summaryrefslogtreecommitdiffstats
path: root/checkman.txr
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-09-04 07:15:34 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-09-04 07:15:34 -0700
commitf81e83b591e18fae2efc27252a6e1717b35ecead (patch)
tree5b0271072ade488fa8267908256b044f5d1bc22e /checkman.txr
parent51e5d6643fa63478a4ddc1a0ec5570879675ae11 (diff)
downloadtxr-f81e83b591e18fae2efc27252a6e1717b35ecead.tar.gz
txr-f81e83b591e18fae2efc27252a6e1717b35ecead.tar.bz2
txr-f81e83b591e18fae2efc27252a6e1717b35ecead.zip
structs: special slot generalization.
This lays the groundwork for optimizing access to more special slots. Currently the equal method is handled specially; if a type has an equal method, then this is cached for fast access, so we are not doing a slot lookup each time the method needs to be called. We would like a small array of such methods, with minimal code duplication. * struct.c (enum special_slot): New enum. (struct struct_type): Scalar member eqmslot replaced by spslot array. (make_struct_type): Initialize elements of new array to null; don't initialize removed eqmslot member. (invalidate_special_slot_nonexistence): New static function. (static_slot_set, static_slot_ens_rec): Use invalidate_special_slot_nonexistence instead of open code. (get_static_special_slot): General function for obtaining and caching a special slot. Based on implementation of get_equal_method. (get_equal_method): Rewritten as a simple call to get_special-static_slot.
Diffstat (limited to 'checkman.txr')
0 files changed, 0 insertions, 0 deletions