From 7215c9af95eb2375eebef478502a7a824ddd16d5 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sun, 12 Oct 2008 03:28:49 +0000 Subject: * vm.c, vm_insnhelper.h (ruby_vm_redefined_flag): apply optimization patch proposed by Paul Brannan. [ruby-core:19171] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vm.c') diff --git a/vm.c b/vm.c index a805c80526..5bf684237e 100644 --- a/vm.c +++ b/vm.c @@ -34,7 +34,7 @@ VALUE rb_cEnv; VALUE rb_mRubyVMFrozenCore; VALUE ruby_vm_global_state_version = 1; -VALUE ruby_vm_redefined_flag = 0; +char ruby_vm_redefined_flag[BOP_LAST_]; rb_thread_t *ruby_current_thread = 0; rb_vm_t *ruby_current_vm = 0; @@ -877,7 +877,7 @@ rb_vm_check_redefinition_opt_method(const NODE *node) VALUE bop; if (st_lookup(vm_opt_method_table, (st_data_t)node, &bop)) { - ruby_vm_redefined_flag |= bop; + ruby_vm_redefined_flag[bop] = 1; } } @@ -902,7 +902,7 @@ vm_init_redefined_flag(void) vm_opt_method_table = st_init_numtable(); -#define OP(mid_, bop_) (mid = id##mid_, bop = BOP_##bop_) +#define OP(mid_, bop_) (mid = id##mid_, bop = BOP_##bop_, ruby_vm_redefined_flag[bop] = 0) #define C(k) add_opt_method(rb_c##k, mid, bop) OP(PLUS, PLUS), (C(Fixnum), C(Float), C(String), C(Array)); OP(MINUS, MINUS), (C(Fixnum)); -- cgit v1.2.1