Project

General

Profile

Bug #11203

Updated by nobu (Nobuyoshi Nakada) almost 9 years ago

Now, `rb_method_entry_t` rb_method_entry_t is an allocated data pointed from method tables (`class/module` (class/module has) and from control frame stacks. 

 I will change this data structure to make `VALUE` (`T_IMEMO/ment`). VALUE (T_IMEMO/ment). 
 And I put them onto value frames instead of control frame stacks. 

 This change has several advantages. 

 * Solve these issues. 
   * [Bug #11200] Memory leak of method entries 
   * [Bug #11046] `__callee__` __callee__ returns incorrect method name in orphan proc 
 * Simplify sweeping process of method entry 
 * We can remove `rb_control_frame_t::me` 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` rb_control_frame_t::klass field because method entries can manipulate this information. 
   * We can introduce new method cache mechanism (maybe). 

 The following pictures show how SVAR/CREF/MENT are located at value stacks. 

 ![before-value-stack](1.PNG) 
 ![after-value-stack](2.PNG) 

 The following picture shows how alias was implemented. 

 ![alias-relation](3.PNG) 

Back