From cbd8b099200d9cd19df770dbabeb698b08135800 Mon Sep 17 00:00:00 2001 From: tmm1 Date: Wed, 17 Apr 2013 11:20:23 +0000 Subject: iseq: reduce array allocations for simple sequences * compile.c (iseq_add_mark_object): Use new rb_iseq_add_mark_object(). * insns.def (setinlinecache): Ditto. * iseq.c (rb_iseq_add_mark_object): New function to allocate iseq->mark_ary on demand. [Bug #8142] * iseq.h (rb_iseq_add_mark_object): Ditto. * iseq.c (prepare_iseq_build): Avoid allocating mark_ary until needed. * iseq.c (rb_iseq_build_for_ruby2cext): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- insns.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'insns.def') diff --git a/insns.def b/insns.def index d61e99c4d0..fc4db92d4f 100644 --- a/insns.def +++ b/insns.def @@ -1237,7 +1237,7 @@ setinlinecache (VALUE val) { if (ic->ic_value.value == Qundef) { - rb_ary_push(GET_ISEQ()->mark_ary, val); + rb_iseq_add_mark_object(GET_ISEQ(), val); } ic->ic_value.value = val; ic->ic_vmstat = GET_VM_STATE_VERSION() - ruby_vm_const_missing_count; -- cgit v1.2.3