* vm_core.h: remove rb_iseq_t::orig because rb_iseq_clone()

no longer exists.
* iseq.c: don't use rb_iseq_t::orig.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2015-07-07 02:41:52 +00:00
parent 16a68369d2
commit f395c5be87
3 changed files with 61 additions and 68 deletions

View File

@ -1,3 +1,10 @@
Tue Jul 7 11:37:25 2015 Koichi Sasada <ko1@atdot.net>
* vm_core.h: remove rb_iseq_t::orig because rb_iseq_clone()
no longer exists.
* iseq.c: don't use rb_iseq_t::orig.
Tue Jul 07 11:25:57 2015 Koichi Sasada <ko1@atdot.net> Tue Jul 07 11:25:57 2015 Koichi Sasada <ko1@atdot.net>
* iseq.c, internal.h (rb_iseq_clone): removed because we don't need to * iseq.c, internal.h (rb_iseq_clone): removed because we don't need to

45
iseq.c
View File

@ -66,40 +66,34 @@ compile_data_free(struct iseq_compile_data *compile_data)
static void static void
iseq_free(void *ptr) iseq_free(void *ptr)
{ {
rb_iseq_t *iseq;
RUBY_FREE_ENTER("iseq"); RUBY_FREE_ENTER("iseq");
if (ptr) { if (ptr) {
int i; int i;
iseq = ptr; rb_iseq_t *iseq = ptr;
if (!iseq->orig) {
/* It's possible that strings are freed */ ruby_xfree(iseq->iseq_encoded);
if (0) { ruby_xfree(iseq->line_info_table);
RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->location.label), ruby_xfree(iseq->local_table);
RSTRING_PTR(iseq->location.path)); ruby_xfree(iseq->is_entries);
}
RUBY_FREE_UNLESS_NULL(iseq->iseq_encoded);
RUBY_FREE_UNLESS_NULL(iseq->line_info_table);
RUBY_FREE_UNLESS_NULL(iseq->local_table);
RUBY_FREE_UNLESS_NULL(iseq->is_entries);
if (iseq->callinfo_entries) { if (iseq->callinfo_entries) {
for (i=0; i<iseq->callinfo_size; i++) { for (i=0; i<iseq->callinfo_size; i++) {
/* TODO: revisit callinfo data structure */ /* TODO: revisit callinfo data structure */
rb_call_info_kw_arg_t *kw_arg = iseq->callinfo_entries[i].kw_arg; rb_call_info_kw_arg_t *kw_arg = iseq->callinfo_entries[i].kw_arg;
RUBY_FREE_UNLESS_NULL(kw_arg); ruby_xfree(kw_arg);
} }
RUBY_FREE_UNLESS_NULL(iseq->callinfo_entries); ruby_xfree(iseq->callinfo_entries);
} }
RUBY_FREE_UNLESS_NULL(iseq->catch_table); ruby_xfree(iseq->catch_table);
RUBY_FREE_UNLESS_NULL(iseq->param.opt_table); ruby_xfree(iseq->param.opt_table);
if (iseq->param.keyword != NULL) { if (iseq->param.keyword != NULL) {
RUBY_FREE_UNLESS_NULL(iseq->param.keyword->default_values); ruby_xfree(iseq->param.keyword->default_values);
RUBY_FREE_UNLESS_NULL(iseq->param.keyword); ruby_xfree(iseq->param.keyword);
} }
compile_data_free(iseq->compile_data); compile_data_free(iseq->compile_data);
RUBY_FREE_UNLESS_NULL(iseq->iseq); ruby_xfree(iseq->iseq);
}
ruby_xfree(ptr); ruby_xfree(ptr);
} }
RUBY_FREE_LEAVE("iseq"); RUBY_FREE_LEAVE("iseq");
@ -115,17 +109,12 @@ iseq_mark(void *ptr)
RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->location.label), RSTRING_PTR(iseq->location.path)); RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->location.label), RSTRING_PTR(iseq->location.path));
if (!iseq->orig) {
RUBY_MARK_UNLESS_NULL(iseq->mark_ary); RUBY_MARK_UNLESS_NULL(iseq->mark_ary);
RUBY_MARK_UNLESS_NULL(iseq->location.label); RUBY_MARK_UNLESS_NULL(iseq->location.label);
RUBY_MARK_UNLESS_NULL(iseq->location.base_label); RUBY_MARK_UNLESS_NULL(iseq->location.base_label);
RUBY_MARK_UNLESS_NULL(iseq->location.path); RUBY_MARK_UNLESS_NULL(iseq->location.path);
RUBY_MARK_UNLESS_NULL(iseq->location.absolute_path); RUBY_MARK_UNLESS_NULL(iseq->location.absolute_path);
RUBY_MARK_UNLESS_NULL(iseq->coverage); RUBY_MARK_UNLESS_NULL(iseq->coverage);
}
else {
RUBY_MARK_UNLESS_NULL(iseq->orig);
}
if (iseq->compile_data != 0) { if (iseq->compile_data != 0) {
struct iseq_compile_data *const compile_data = iseq->compile_data; struct iseq_compile_data *const compile_data = iseq->compile_data;
@ -141,11 +130,10 @@ static size_t
iseq_memsize(const void *ptr) iseq_memsize(const void *ptr)
{ {
size_t size = sizeof(rb_iseq_t); size_t size = sizeof(rb_iseq_t);
const rb_iseq_t *iseq;
if (ptr) { if (ptr) {
iseq = ptr; const rb_iseq_t *iseq = ptr;
if (!iseq->orig) {
size += iseq->iseq_size * sizeof(VALUE); size += iseq->iseq_size * sizeof(VALUE);
size += iseq->line_info_size * sizeof(struct iseq_line_info_entry); size += iseq->line_info_size * sizeof(struct iseq_line_info_entry);
size += iseq->local_table_size * sizeof(ID); size += iseq->local_table_size * sizeof(ID);
@ -174,7 +162,6 @@ iseq_memsize(const void *ptr)
size += iseq->iseq_size * sizeof(VALUE); size += iseq->iseq_size * sizeof(VALUE);
} }
} }
}
return size; return size;
} }

View File

@ -345,7 +345,6 @@ struct rb_iseq_struct {
/****************/ /****************/
VALUE self; VALUE self;
const VALUE orig; /* non-NULL if its data have origin */
/* misc */ /* misc */
rb_num_t flip_cnt; rb_num_t flip_cnt;