1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00
guile/module
Andy Wingo 4898959901 Implement class redefinition on top of fixed structs
* libguile/struct.h: Steal another flag for GOOPS.
* libguile/goops.h (SCM_VTABLE_FLAG_GOOPS_INDIRECT)
  (SCM_VTABLE_FLAG_GOOPS_NEEDS_MIGRATION): New flags.
  (SCM_CLASSF_GOOPS_VALID, SCM_CLASSF_GOOPS_OR_VALID): Remove obsolete
  definitions.
  (SCM_IS_A_P): Use the scm_class_of function.
* libguile/goops.c (var_class_of_obsolete_indirect_instance): Rename
  from var_migrate_instance.
  (scm_is_generic, scm_is_method, scm_sys_init_layout_x): Use
  scm_class_of instead of the SCM_CLASS_OF macro.
  (get_indirect_slots): New helper.
  (scm_class_of): This patch moves us in a direction where we won't be
  able to separately address a struct's data and its identity.
  Therefore to check whether a class needs migration, we check an
  embedded pointer from a slot instead of the vtable data.
  (scm_sys_struct_data): Remove this temporary function.
  (scm_sys_modify_instance): Update to swap slot values instead of the
  data pointers themselves.
  (scm_sys_modify_class): Use scm_sys_modify_instance.
  (scm_sys_goops_loaded): Capture class-of-obsolete-indirect-instance
  instead of migrate-instance.
  (scm_init_goops_builtins): Don't export the "valid" flag any more;
  export instead the "indirect" and "needs-migration" flags.
* libguile/foreign-object.c (scm_assert_foreign_object_type): Add a
  FIXME.
* libguile/vm-engine.c (class-of): Take away fast path for the time
  being.
* module/oop/goops.scm (class-has-indirect-instances?)
  (indirect-slots-need-migration?): New helpers.
  (<class>, <slot>, %class-slot-definition, initialize): Remove use of
  vtable-flag-goops-valid.
  (define-class): Always push redefined values through
  `class-redefinition'.
  (<redefinable-class>): New public definition.  Use it as a metaclass
  for redefinable classes.  Provide a compute-slots function that
  declares the indirect slots mechanism.  Add the "indirect" flag to
  instances of <redefinable-class>.  Create indirect-slots objects for
  instances of those classes as part of their allocate-instance.
  (change-object-class, class-of-obsolete-indirect-instance): Update for
  new representation change.
* test-suite/tests/goops.test ("object update"): Add #:metaclass
  <redefinable-class> to all redefinable classes.  For the "hell" test,
  make the new classes with class-direct-slots, not class-slots; this
  was an error in the test.
2017-09-14 09:44:30 +02:00
..
ice-9 Remove support for legacy syntax objects. 2017-05-22 15:37:43 +02:00
language Add disjoint syntax object type 2017-03-28 19:23:13 +02:00
oop Implement class redefinition on top of fixed structs 2017-09-14 09:44:30 +02:00
rnrs Flush when getting string from r6rs string output port 2017-03-01 14:26:11 +01:00
scripts Wire up `guild compile -O0 foo.scm' 2015-10-22 17:44:17 +00:00
srfi SRFI-19: Swap seconds and nanoseconds in 'current-time-monotonic'. 2017-04-22 01:01:32 +02:00
sxml Remove duplicate definitions of call/ec' and let/ec'. 2013-04-06 15:40:19 +02:00
system Update effective version to 3.0 2017-05-22 14:15:40 +02:00
texinfo Remove all deprecated code 2017-05-22 13:36:42 +02:00
web Remove all deprecated code 2017-05-22 13:36:42 +02:00
Makefile.am Remove all deprecated code 2017-05-22 13:36:42 +02:00
rnrs.scm Add R6RS bytevector->string, string->bytevector 2016-06-21 11:29:14 +02:00
statprof.scm Remove all deprecated code 2017-05-22 13:36:42 +02:00
texinfo.scm texinfo: fix @url{@@} parsing 2014-11-09 15:56:33 +00:00