Actions
Bug #11203
closedChange method entries into VALUE
Description
Now, rb_method_entry_t
is an allocated data pointed from method tables (class/module
has) and from control frame stacks.
I will change this data structure to make VALUE
(T_IMEMO/ment
).
And I put them onto value frames instead of control frame stacks.
This change has several advantages.
- Solve these issues.
- Simplify sweeping process of method entry
- We can remove
rb_control_frame_t::me
- No need to push CREF for every method invocation. Method entries know required CREF.
- We can share per method CREF only for make them public visibility scope.
- We can introduce other optimization techniques.
- We can remove
rb_control_frame_t::klass
field because method entries can manipulate this information. - We can introduce new method cache mechanism (maybe).
- We can remove
The following pictures show how SVAR/CREF/MENT are located at value stacks.
The following picture shows how alias was implemented.
Files
Updated by nobu (Nobuyoshi Nakada) almost 10 years ago
- Description updated (diff)
Updated by normalperson (Eric Wong) almost 10 years ago
I cannot view images at the moment, but I strongly approve of using
VALUE types more in our internals for the same reasons you describe.
Updated by ko1 (Koichi Sasada) almost 10 years ago
- Status changed from Open to Closed
Applied in changeset r50728.
- method.h: make rb_method_entry_t a VALUE.
Motivation and new data structure are described in [Bug #11203].
This patch also solve the following issues. - test/ruby/test_method.rb: add a test for [Bug #11046].
- vm_core.h: remvoe rb_control_frame_t::me. me is located at value
stack. - vm_core.h, gc.c, vm_method.c: remove unlinked_method... codes
because method entries are simple VALUEs. - method.h: Now, all method entries has own independent method
definititons. Strictly speaking, this change is not essential,
but for future changes.- rb_method_entry_t::flag is move to rb_method_definition_t::flag.
- rb_method_definition_t::alias_count is now
rb_method_definition_t::alias_count_ptr, a pointer to the counter.
- vm_core.h, vm_insnhelper.c (rb_vm_frame_method_entry) added to
search the current method entry from value stack. - vm_insnhelper.c (VM_CHECK_MODE): introduced to enable/disable
assertions.
Updated by usa (Usaku NAKAMURA) almost 10 years ago
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: WONTFIX, 2.1: WONTFIX, 2.2: UNKNOWN
Updated by nagachika (Tomoyuki Chikanaga) almost 10 years ago
- Backport changed from 2.0.0: WONTFIX, 2.1: WONTFIX, 2.2: UNKNOWN to 2.0.0: WONTFIX, 2.1: WONTFIX, 2.2: WONTFIX
Actions
Like0
Like0Like0Like0Like0Like0