[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, goops-cleanup, created. release_1-9-4-
From: |
Andy Wingo |
Subject: |
[Guile-commits] GNU Guile branch, goops-cleanup, created. release_1-9-4-141-gefd0dc9 |
Date: |
Sun, 15 Nov 2009 20:03:11 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=efd0dc902eef0163a69b2ec621415ec0fee6985f
The branch, goops-cleanup has been created
at efd0dc902eef0163a69b2ec621415ec0fee6985f (commit)
- Log -----------------------------------------------------------------
commit efd0dc902eef0163a69b2ec621415ec0fee6985f
Author: Andy Wingo <address@hidden>
Date: Sun Nov 8 11:49:06 2009 +0100
make sure that when equal? is extended, that the generic has a method
* libguile/goops.h:
* libguile/goops.c (scm_set_primitive_generic_x): New function, for now
local to the goops module.
* module/oop/goops.scm (equal?): Make sure that when equal? is extended,
that the generic already has a default method.
commit 0fb541a42a8f1c37441e44122317da7b0245f84c
Author: Andy Wingo <address@hidden>
Date: Sun Nov 8 11:34:30 2009 +0100
remove cache-mutex slot from generics
* libguile/goops.c:
* libguile/goops.h: Remove cache-mutex slot from generics, and renumber
other slots.
commit 10ed1c68331e83a46333be0fa144cf7280464d12
Author: Andy Wingo <address@hidden>
Date: Sun Nov 8 11:29:48 2009 +0100
remove locking in method memoization
* libguile/goops.c (scm_memoize_method): Don't lock around method
memoization, as the new protocol will be reeentrant and lock-free.
commit 43ee16dd48d34a9c6f0296c6a34e50b3c9e57e3a
Author: Andy Wingo <address@hidden>
Date: Sun Nov 8 11:24:23 2009 +0100
limn goops flags, remove foreign objs, rename entity to applicable-struct
* libguile/goops.c (scm_class_applicable_struct)
(scm_class_applicable_struct_with_setter)
(scm_class_applicable_struct_class): Rename from
scm_class_entity, scm_class_entity_with_setter, and
scm_class_entity_class.
(scm_class_simple_method): Removed; this abstraction is not used.
(scm_class_foreign_class, scm_class_foreign_object): Remove these,
they are undocumented and unused. They might come back later.
(scm_sys_inherit_magic_x): Simply inherit the vtable flags from the
class's class. Flags are about layout, and it is the class that
determines the layout of the instance.
(scm_basic_basic_make_class): Don't bother setting GOOPS_OR_VALID,
inherit-magic will do that.
(scm_basic_make_class): Inherit magic after setting the layout. Allows
the struct magic checker to do its job.
(scm_accessor_method_slot_definition): Move implementation to Scheme.
Removes the need for the accessor flag.
(scm_sys_allocate_instance): Adapt to scm_i_alloc_struct name change,
and that alloc-struct will handle finalization.
(scm_compute_applicable_methods): Remove accessor check, as it's
unnecessary.
(scm_make): Adapt to new generic slot order, and no more
simple-method.
(create_standard_classes): What was the GF slot "dispatch-procedure"
is now the applicable-struct slot "procedure". No more foreign class,
foreign object, or simple method. Rename <entity> and friends to
<applicable-struct> and friends. No more entity-with-setter -- though
perhaps it will come back too. Instead generic-with-setter is its own
thing.
* libguile/goops.h (SCM_CLASSF_METACLASS): "A goops class that is a
vtable" -- no need for a separate flag.
(SCM_CLASSF_FOREIGN, SCM_CLASSF_SIMPLE_METHOD)
(SCM_CLASSF_ACCESSOR_METHOD): Removed these unused flags.
(SCM_ACCESSORP): Removed.
Renumber generic slots, rename entity classes, and remove the foreign
class, foreign object, and simple method classes.
* libguile/struct.c (scm_i_struct_inherit_vtable_magic): New function,
called when making new vtables.applicable structs
(scm_i_alloc_struct): Remove 8-bit alignment check, as libGC
guarantees this for us. Handle finalizer registration here.
(scm_make_struct): Factor some things to scm_i_alloc_struct and
scm_i_struct_inherit_vtable_magic.
(scm_make_vtable_vtable): Adapt to scm_i_alloc_struct name change.
* libguile/struct.h (scm_i_alloc_struct): Change name from
scm_alloc_struct, and make internal.
* module/oop/goops.scm (oop): Don't declare #:replace <class> et al,
because <class> isn't defined in the core any more.
(accessor-method-slot-definition): Defined in Scheme now.
Remove <foreign-object> methods.
(initialize on <class>): Prep layout before inheriting magic, as in
scm_basic_make_class.
* module/oop/goops/dispatch.scm (delayed-compile)
(memoize-effective-method!): Adapt to 'procedure slot name change.
commit da410c811d0207070e8b3bcb098a262d7d94cc69
Author: Andy Wingo <address@hidden>
Date: Fri Nov 6 17:17:33 2009 +0100
%invalidate-method-cache invalidates the dispatch procedure too
* libguile/goops.c (make_dispatch_procedure, clear_method_cache):
Properly reset the dispatch procedure.
commit 23e6a1c0b917f12bfab4676a916512fc92d48746
Author: Andy Wingo <address@hidden>
Date: Fri Nov 6 11:25:50 2009 +0100
generic dispatch protocol in scheme, not yet wired up
* module/oop/goops/dispatch.scm: Add a dispatch protocol in Scheme. The
idea is that instead of using a hardcoded C protocol, we compile
dispatch procedures at runtime. To avoid too much thrashing at bootup,
there is a simple JIT mechanism -- dispatch will be data-driven,
through the cache, for the first 5 invocations, then a dispatch
procedure will be compiled from the cache.
My initial timings indicate that interpreted dispatch takes about
100us, and that compiled dispatch takes about 60us. Compilation itself
takes about 16000us (16 ms). The compiled procedure dispatch times
will improve soon, hopefully.
commit 3f620851699b0d4489c8369a3509469a6d162eb1
Author: Andy Wingo <address@hidden>
Date: Fri Nov 6 10:27:19 2009 +0100
eqv? not a generic, equal? dispatches to generic only for objects
* libguile/eq.c (scm_eqv_p): Not a generic any more. Since eqv? is used
by e.g. `case', which should be able to compile into dispatch tables,
it really doesn't make sense to dispatch out to a generic.
(scm_equal_p): So it was always the case that (equal? 'foo "foo") =>
#f. But (equal? 'foo 'bar) could actually be extended by a generic.
This was a bug, if you follow the other logic of the code. Changed so
that generic functions can only extend the domain of equal? when
operating on goops objects.
* oop/goops.scm: No more eqv? generic.
* test-suite/tests/goops.test: Remove eqv? tests.
commit 65f0ddae570c43efaf7efa0ed4e5c5038ed05834
Author: Andy Wingo <address@hidden>
Date: Thu Nov 5 17:35:44 2009 +0100
generic tweaks; realizing what the setter slot actually is
* libguile/goops.h (scm_si_dispatch_procedure)
(scm_si_effective_methods): Rename the new generics slots to
"effective-methods" and "dispatch-procedure".
(scm_si_generic_setter): Rename this one from "%setter" to "setter",
and it's not a cache -- it's a pointer to the setter, which is also a
generic. I didn't realize that before. It's better this way (like it
always was.)
(SCM_SET_GENERIC_DISPATCH_PROCEDURE)
(SCM_CLEAR_GENERIC_EFFECTIVE_METHODS): New helper macros.
* libguile/goops.c (clear_method_cache): Clear the new dispatch
procedure and the effective methods as well.
(create_standard_classes): Rename slots, and fix the setter slots.
commit d843e01710af3f9676837326dcfdbd21a79e1cf7
Author: Andy Wingo <address@hidden>
Date: Thu Nov 5 13:16:40 2009 +0100
more clarity in (oop goops dispatch)
* module/oop/goops/dispatch.scm (memoize-method!): If we don't have a
no-applicable-method, just call no-applicable-method directly.
* test-suite/tests/goops.test ("no-applicable-method"): Add some tests.
commit 0140022cd2e30037b41d3526e89f812c379f731c
Author: Andy Wingo <address@hidden>
Date: Thu Nov 5 12:54:41 2009 +0100
remove code-table slot from methods
* libguile/goops.c (scm_sys_invalidate_method_cache_x, scm_make)
(create_standard_classes): Remove code-table slot from methods. The
generic cache completely does its job, afaict.
* libguile/goops.h (scm_si_formals, scm_si_body, scm_si_make_procedure):
Renumber slots.
* module/oop/goops.scm (initialize on <method>): No more code-table
slot.
* module/oop/goops/compile.scm: Always "compile" a method, instead of
looking for a hit in an always-empty cache.
commit 28cefc061271f9930bcc0bb3986e3435150b9f78
Author: Andy Wingo <address@hidden>
Date: Thu Nov 5 12:41:54 2009 +0100
remove used-by slot from generics
* libguile/goops.c (clear_method_cache)
(scm_sys_invalidate_method_cache_x, scm_make)
(create_standard_classes): Remove the used-by method from generics, as
it is not used at all.
* libguile/goops.h: Renumber generic slots.
* module/oop/goops/dispatch.scm (memoize-method!): No more used-by slot.
commit 5df445f1e3dbf6a340f878a9ebe02fafcb093e4e
Author: Andy Wingo <address@hidden>
Date: Thu Nov 5 11:32:16 2009 +0100
first step towards effective methods
* libguile/goops.c (create_standard_classes):
* libguile/goops.h *scm_si_applicable_methods, scm_si_effective_method)
(scm_si_applicable_setter_methods, scm_si_effective_setter_method):
Add space for the new form of the generic cache and effective method.
commit 0badf0f53e17b4a3a2d6ed5426cc23e467862da0
Author: Andy Wingo <address@hidden>
Date: Tue Nov 3 23:59:51 2009 +0100
a very big commit cleaning up structs & goops. also applicable structs.
I tried to split this one, and I know it's a bit disruptive, but this
stuff really is one big cobweb. So instead we'll pretend like these are
separate commits, by separating the changelog.
Applicable struct runtime support.
* libguile/debug.c (scm_procedure_source):
* libguile/eval.c (scm_trampoline_0, scm_trampoline_1)
(scm_trampoline_2):
* libguile/eval.i.c (CEVAL):
* libguile/goops.c (scm_class_of):
* libguile/procprop.c (scm_i_procedure_arity):
* libguile/procs.c (scm_procedure_p, scm_procedure, scm_setter): Allow
for applicable structs. Whee!
* libguile/deprecated.h (scm_vtable_index_vtable): Define as a synonym
for scm_vtable_index_self.
(scm_vtable_index_printer): Alias scm_vtable_index_instance_printer.
(scm_struct_i_free): Alias scm_vtable_index_instance_finalize.
(scm_struct_i_flags): Alias scm_vtable_index_flags.
(SCM_STRUCTF_FLAGS): Be a -1 mask, we have a whole word now.
(SCM_SET_VTABLE_DESTRUCTOR): Implement by hand.
Hidden slots.
* libguile/struct.c (scm_make_struct_layout): Add support for "hidden"
fields, writable fields that are not visible to make-struct. This
allows us to add fields to vtables and not break existing make-struct
invocations.
(scm_struct_ref, scm_struct_set_x): Always get struct length from the
vtable. Support hidden fields.
* libguile/goops.c (scm_class_hidden, scm_class_protected_hidden): New
slot classes, to correspond to the new vtable slots.
(scm_sys_prep_layout_x): Turn hidden slots into 'h'.
(build_class_class_slots): Reorder the class slots to account for
vtable fields coming out of negative-land, for name as a vtable slot,
and for hidden fields.
(create_standard_classes): Define <hidden-slot> and
<protected-hidden-slot>.
Clean up struct.h.
* libguile/struct.h: Lay things out cleaner. There are no more hidden
(negative) words. Names are nicer. The exposition is nicer. But the
basics are the same. The incompatibilities are that <vtable> has more
slots now, and that scm_alloc_struct's signature has changed. The
former is ameliorated by the "hidden" slots mentioned before, and the
latter, well, it was always a very internal thing...
* libguile/struct.c: (scm_vtable_p): Now we keep flags on
vtable-vtables, so this check is cheaper.
(scm_alloc_struct): No hidden words. Yippee.
(struct_finalizer_trampoline): Entersify.
(scm_make_struct): No need to babysit extra words, though now we have
to babysit flags. Propagate the vtable, applicable, and setter flags
appropriately.
(scm_make_vtable_vtable): Update for new simplicity.
(scm_print_struct): A better printer.
(scm_init_struct): Define <applicable-struct-vtable>, a magical vtable
like CL's funcallable-standard-class. Also define
<applicable-struct-with-setter-vtable>.
Remove foreign object implementation.
* libguile/goops.h:
* libguile/goops.c (scm_make_foreign_object, scm_make_class)
(scm_add_slot, scm_wrap_object, scm_wrap_component): Remove, these
were undocumented and unworking.
Clean up goops.h, a little.
* libguile/goops.h:
* libguile/goops.c: Also clean up.
* module/oop/goops/dispatch.scm (hashset-index): Adapt for new hashset
index.
commit b10d93309b4c96caa5d399716c9b09a862c8ce0e
Author: Andy Wingo <address@hidden>
Date: Fri Nov 6 13:13:39 2009 +0100
opcodes for bit twiddling (ash, logand, logior, logxor)
* module/language/tree-il/compile-glil.scm:
* module/language/tree-il/primitives.scm:
* libguile/vm-i-scheme.c (ash, logand, logior, logxor): New opcodes.
commit aec4a84ac8bb3270e6f68f8299e76c49857e24d4
Author: Andy Wingo <address@hidden>
Date: Fri Nov 6 12:40:20 2009 +0100
class-of has an opcode
* libguile/vm-i-scheme.c (class-of): New opcode.
* module/language/tree-il/compile-glil.scm:
* module/oop/goops.scm: Compile class-of into an opcode.
commit b4a595a5d6447ef41d57690e841c545aa45d3a08
Author: Andy Wingo <address@hidden>
Date: Fri Nov 6 12:13:33 2009 +0100
faster conditionals
* module/language/tree-il/compile-glil.scm (flatten): Compile `if'
statements with `eq?' and `null?', and their `not?' variants, into
more specific bytecode.
commit 0e249fd35912fabb7678a395753f315e0302515a
Author: Andy Wingo <address@hidden>
Date: Fri Nov 6 11:16:54 2009 +0100
fix (apply f) -- without the args list
* module/language/tree-il/primitives.scm (apply): Only inline if we
actually have an argument to apply.
commit 1e2a8edb8b0cd0818e1ea3ffdf05b8fc7c7f507d
Author: Andy Wingo <address@hidden>
Date: Thu Nov 5 10:22:01 2009 +0100
Revert "implement #:predicate" and remove predicate from <lambda-case>
Turns out this was not a very useful idea, and semantically tricky to
boot.
This reverts commit 24bf130fd15afbc8b3a2ccdc50a027f9b6c9e623, and makes
the following additional changes:
* module/ice-9/optargs.scm (parse-lambda-case, let-optional)
(let-optional*, let-keywords, let-keywords*):
* module/language/tree-il.scm: (<lambda-case>, parse-tree-il)
(unparse-tree-il, tree-il->scheme, tree-il-fold,
make-tree-il-folder)
(post-order!, pre-order!):
* module/language/tree-il/analyze.scm (analyze-lexicals):
* module/language/tree-il/compile-glil.scm (compile-glil):
* module/language/tree-il/inline.scm (inline!): Remove all traces of
#:predicate from tree-il.
* module/ice-9/psyntax.scm (build-simple-lambda, build-lambda-case)
(chi-lambda-case): Adapt to tree-il change.
* module/ice-9/psyntax-pp.scm: Regenerated.
* module/language/brainfuck/compile-tree-il.scm (compile-body):
* module/language/ecmascript/compile-tree-il.scm (comp, comp-body):
* test-suite/tests/tree-il.test: Adapt to tree-il change.
* doc/ref/api-procedures.texi (Case-lambda): Remove mention of
#:predicate.
commit e161c9f85cfac9aead3728b4d1239bd973600a7a
Author: Andy Wingo <address@hidden>
Date: Tue Nov 3 22:43:29 2009 +0100
actually set all 8 hashsets in classes
* libguile/goops.c (prep_hashsets): Actually set all 8 hashsets. Doh...
commit 4d34fbe1815be52cd669b53e03158ab931d9e80b
Author: Andy Wingo <address@hidden>
Date: Tue Nov 3 22:41:59 2009 +0100
remove goops-local %tag-body
* libguile/goops.c (scm_sys_tag_body): Remove goops-local hack that is
no longer necessary.
commit 092d7704bef29a999a6f861fae461e9662b6fb98
Author: Andy Wingo <address@hidden>
Date: Tue Nov 3 22:33:22 2009 +0100
SCM_VALIDATE_VTABLE tweak
* libguile/validate.h (SCM_VALIDATE_VTABLE): Simply call
scm_struct_vtable_p.
commit b8187a71cb2cdb103aad10e75dc2947b06617ca9
Author: Andy Wingo <address@hidden>
Date: Tue Nov 3 22:32:39 2009 +0100
fix printing-programs bug
* module/system/vm/program.scm (write-program): Fix a bug if we couldn't
get a procedure's arity.
commit b7bff2ba9bc7b1b131b8e08059dd2870f76500be
Author: Andy Wingo <address@hidden>
Date: Tue Nov 3 22:28:26 2009 +0100
values.c defines a vtable, not a vtable-vtable
* libguile/values.c (scm_init_values): Define a vtable, not a
"metaclass".
commit ceedcfaa0c273b466a371b9bef7c84ce27ec27fb
Author: Andy Wingo <address@hidden>
Date: Tue Nov 3 22:27:34 2009 +0100
srfi-35 properly uses vtable-offset-user
* module/srfi/srfi-35.scm (condition-type-id):
(condition-type-parent, condition-type-all-fields): Don't ref fixed
struct indices, use vtable-offset-user instead.
commit fb0f1a40e72217861bb420cb20707618028b7a10
Author: Andy Wingo <address@hidden>
Date: Tue Nov 3 22:26:46 2009 +0100
fix a structs.test test
* test-suite/tests/structs.test ("equal?"): Instantiate vtables, not
vtable-vtables. "hello" is not a valid vtable layout.
commit 26fe6af140fd7e3042bfc628e5fb60b382d6a126
Author: Andy Wingo <address@hidden>
Date: Sun Nov 1 21:09:42 2009 +0100
remove redundant, unnecessary instance size from struct vtables
* libguile/struct.h (scm_struct_i_size): Remove this shared field -- I
mean, the slot is still there, but it's only used for flags.
* libguile/goops.h (SCM_SET_CLASS_INSTANCE_SIZE):
* libguile/goops.c (scm_sys_inherit_magic_x, scm_make_class): Remove
uses and definition of SCM_SET_CLASS_INSTANCE_SIZE. Light structs used
it, but you have that info in the layout; and foreign classes used it,
but that is going away soon anyway :)
commit efcebb5b56a315f42c32e8bbc682d218a38c9428
Author: Andy Wingo <address@hidden>
Date: Sun Nov 1 20:45:02 2009 +0100
fold objects.[ch] into goops.[ch]
Remove objects.h #includes as appropriate.
commit 11561496bad94481cc2b3d8acba1a154e3c052fc
Author: Andy Wingo <address@hidden>
Date: Sun Nov 1 19:46:27 2009 +0100
remove support for "entities" -- a form of applicable struct
Entities were meant to be a form of applicable struct. Unfortunately,
the implementation is intertwingled with generics. Removing them, for
now, will make it possible to cleanly re-add applicable struct support.
* libguile/struct.h (SCM_STRUCTF_ENTITY): Remove.
(SCM_STRUCTF_GOOPS_HACK): New flag; sigh.
* libguile/struct.c (scm_make_struct): We make "entity" structs if the
GOOPS_HACK flag is set. This will be fixed when we rework flags and
remove hidden words.
* libguile/goops.c (scm_class_of): Structs are not applicable, for now
at least.
(scm_sys_inherit_magic_x, scm_basic_basic_make_class)
(scm_sys_allocate_instance, scm_sys_set_object_setter_x):
(make_struct_class): Adapt for no more entities (and thus no entity
flag).
(create_standard_classes): For some reason, generic functions were
getting the LIGHT flag set, after the ENTITY flag was removed; so for
now explicitly clear that flag.
* libguile/goops.h (SCM_GENERIC_SETTER, SCM_SET_GENERIC_SETTER): New
macros.
* libguile/objects.h:
* libguile/objects.c: Remove code for entities.
* libguile/debug.c: (scm_procedure_source): Only work with generics.
* libguile/eval.c (scm_trampoline_0, scm_trampoline_1)
(scm_trampoline_2): Only handle generics.
* libguile/eval.i.c (CEVAL): #ifdef out the pieces about entities.
* libguile/procprop.c (scm_i_procedure_arity): Remove support for
entities.
* libguile/procs.c (scm_procedure_p, scm_procedure, scm_setter): Remove
entity support.
commit 521ac49bdea053227c973a92e37fcc0879fa20d0
Author: Andy Wingo <address@hidden>
Date: Sat Oct 31 12:04:53 2009 +0100
SCM_GENERIC_METHOD_CACHE macro splits from SCM_ENTITY_PROCEDURE
* libguile/goops.h (SCM_GENERIC_METHOD_CACHE)
(SCM_SET_GENERIC_METHOD_CACHE): Two new macros; the same as
SCM_[SET_]ENTITY_PROCEDURE, but more reflecting the reality of the
generic hack.
* libguile/eval.i.c:
* libguile/goops.c:
* libguile/objects.c:
* libguile/vm-i-system.c: Use the new macros when it is appropriate to
do so.
commit 48c7c44e70e6ba80fe16bfb179320cffb6a03996
Author: Andy Wingo <address@hidden>
Date: Sat Oct 31 11:17:12 2009 +0100
remove unused things from object.[ch]
* libguile/objects.h:
* libguile/objects.c (scm_object_procedure): Remove, it was only
compiled with SCM_DEBUG.
* libguile/objects.h:
* libguile/objects.c (scm_make_class_object, scm_make_subclass_object,
(scm_i_make_class_object, scm_metaclass_standard): Remove also. These
implemented an undocumented object system, and are totally replaced by
GOOPS.
commit 730d8ad9e64c3d4b31871a50a4c790b7548bc478
Author: Andy Wingo <address@hidden>
Date: Sat Oct 31 00:28:43 2009 +0100
remove operators
commit 352c87d7e4c8845b935f8439432d28d80bf06879
Author: Andy Wingo <address@hidden>
Date: Sat Oct 31 00:08:42 2009 +0100
generic dispatch in the vm (sorta)
* libguile/vm-i-system.c (call, goto/args, mv-call): Add a case for
generics, so we can avoid the evaluator in that case. Still have to
cons up a list -- the real solution comes later.
commit 9e759da10b8ec9334239d6ce40e19bf45c2d00e7
Author: Andy Wingo <address@hidden>
Date: Thu Oct 29 09:47:00 2009 +0100
remove unused struct gc chain macros
* libguile/struct.h (SCM_STRUCT_GC_CHAIN, SCM_SET_STRUCT_GC_CHAIN):
Remove, no longer necessary given topological finalization, provided
by libGC.
commit ee7ef600b99465387fafff05adb99cab25d3685e
Author: Andy Wingo <address@hidden>
Date: Fri Oct 30 22:21:29 2009 +0100
de-inline goops dispatch from the evaluator
* libguile/eval.i.c: De-inline goops dispatch from the evaluator. Part
of a refactor.
-----------------------------------------------------------------------
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, goops-cleanup, created. release_1-9-4-141-gefd0dc9,
Andy Wingo <=