[487] MacRuby/trunk/vm_method.c
Revision: 487 http://trac.macosforge.org/projects/ruby/changeset/487 Author: lsansonetti@apple.com Date: 2008-08-26 13:18:29 -0700 (Tue, 26 Aug 2008) Log Message: ----------- do not call method_added if enable_method_added is false (for better performance during bs parsing) Modified Paths: -------------- MacRuby/trunk/vm_method.c Modified: MacRuby/trunk/vm_method.c =================================================================== --- MacRuby/trunk/vm_method.c 2008-08-26 20:17:59 UTC (rev 486) +++ MacRuby/trunk/vm_method.c 2008-08-26 20:18:29 UTC (rev 487) @@ -25,6 +25,7 @@ static struct cache_entry cache[CACHE_SIZE]; #define ruby_running (GET_VM()->running) /* int ruby_running = 0; */ +VALUE enable_method_added; void rb_clear_cache(void) @@ -186,7 +187,7 @@ st_insert(RCLASS_M_TBL(klass), mid, (st_data_t) body); #endif - if (node && mid != ID_ALLOCATOR && ruby_running) { + if (node && mid != ID_ALLOCATOR && ruby_running && enable_method_added == Qtrue) { if (RCLASS_SINGLETON(klass)) { rb_funcall(rb_iv_get(klass, "__attached__"), singleton_added, 1, ID2SYM(mid)); @@ -1228,6 +1229,8 @@ void Init_eval_method(void) { + enable_method_added = Qtrue; + rb_define_method(rb_mKernel, "respond_to?", obj_respond_to, -1); basic_respond_to = rb_method_node(rb_cObject, idRespond_to); rb_register_mark_object((VALUE)basic_respond_to);
participants (1)
-
source_changes@macosforge.org