summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-13 09:30:23 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-13 09:30:23 +0000
commit20d9aefccbc5d9b5f9feacef9ee52dc1731aec55 (patch)
tree4a46ed32d9918e8fdbf3d63cdda79a6526032b5b /iseq.c
parent762f9b28c675b49a4667bfae011857e9e02bcea5 (diff)
* vm_core.h, compile.c: declare struct iseq_inline_cache_entry.
Inline cache (IC) entries are no longer GC managed object. IC entries are freed when ISeq is freed. * iseq.c: fix mark, free, memsize functions for above change. * insns.def: remove rb_gc_write_barrier(). * vm_insnhelper.c (vm_method_search): ditto. * tool/instruction.rb, template/insns_info.inc.tmpl (insn_iclen): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/iseq.c b/iseq.c
index b01874b98f..711712a4db 100644
--- a/iseq.c
+++ b/iseq.c
@@ -74,6 +74,7 @@ iseq_free(void *ptr)
RUBY_FREE_UNLESS_NULL(iseq->iseq);
RUBY_FREE_UNLESS_NULL(iseq->insn_info_table);
RUBY_FREE_UNLESS_NULL(iseq->local_table);
+ RUBY_FREE_UNLESS_NULL(iseq->ic_entries);
RUBY_FREE_UNLESS_NULL(iseq->catch_table);
RUBY_FREE_UNLESS_NULL(iseq->arg_opt_table);
compile_data_free(iseq->compile_data);
@@ -86,11 +87,12 @@ iseq_free(void *ptr)
static void
iseq_mark(void *ptr)
{
- rb_iseq_t *iseq;
RUBY_MARK_ENTER("iseq");
if (ptr) {
- iseq = ptr;
+ int i;
+ rb_iseq_t *iseq = ptr;
+
RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->name), RSTRING_PTR(iseq->filename));
RUBY_MARK_UNLESS_NULL(iseq->mark_ary);
RUBY_MARK_UNLESS_NULL(iseq->name);
@@ -102,6 +104,11 @@ iseq_mark(void *ptr)
/* RUBY_MARK_UNLESS_NULL(iseq->cached_special_block); */
RUBY_MARK_UNLESS_NULL(iseq->orig);
+ for (i=0; i<iseq->ic_size; i++) {
+ RUBY_MARK_UNLESS_NULL(iseq->ic_entries[i].ic_class);
+ RUBY_MARK_UNLESS_NULL(iseq->ic_entries[i].ic_value);
+ }
+
if (iseq->compile_data != 0) {
RUBY_MARK_UNLESS_NULL(iseq->compile_data->mark_ary);
RUBY_MARK_UNLESS_NULL(iseq->compile_data->err_info);
@@ -129,6 +136,7 @@ iseq_memsize(void *ptr)
size += iseq->local_table_size * sizeof(ID);
size += iseq->catch_table_size * sizeof(struct iseq_catch_table_entry);
size += iseq->arg_opts * sizeof(VALUE);
+ size += iseq->ic_size * sizeof(struct iseq_inline_cache_entry);
if (iseq->compile_data) {
struct iseq_compile_data_storage *cur;