diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-22 08:31:38 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-22 08:31:38 +0000 |
commit | 8bcf7fc40266faa09cf8b6cebb2d96c1bb8d51ee (patch) | |
tree | 719fe00c607d84a4339d7cfef7754eec8590d2e3 /vm_method.c | |
parent | 9c46e774c15668b7fbf3df8a9a9ea912b5908738 (diff) | |
download | ruby-8bcf7fc40266faa09cf8b6cebb2d96c1bb8d51ee.tar.gz |
* vm_core.h: add a data type rb_location_t to store iseq location
information.
rb_location_t#filename, filepath, name and line_no was moved from
rb_iseq_t. rb_location_t#basename is a new field which is
similar to `name' field without any decoration.
`name' field contains some decoration such as `block in foo'.
`basename' only contains `foo'.
rb_iseq_t contains memory object of rb_location_t.
* iseq.c: setup rb_location_t for each rb_iseq_t memory objects.
* compile.c, proc.c, vm.c, vm_dump.c, vm_eval.c, vm_insnhelper.c,
vm_method.c: support about it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r-- | vm_method.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vm_method.c b/vm_method.c index 953e509769..f3da623347 100644 --- a/vm_method.c +++ b/vm_method.c @@ -224,9 +224,9 @@ rb_method_entry_make(VALUE klass, ID mid, rb_method_type_t type, default: break; } - if (iseq && !NIL_P(iseq->filename)) { + if (iseq && !NIL_P(iseq->location.filename)) { int line = iseq->line_info_table ? rb_iseq_first_lineno(iseq) : 0; - rb_compile_warning(RSTRING_PTR(iseq->filename), line, + rb_compile_warning(RSTRING_PTR(iseq->location.filename), line, "previous definition of %s was here", rb_id2name(old_def->original_id)); } @@ -307,7 +307,7 @@ rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *opts, rb_method_ th = GET_THREAD(); cfp = rb_vm_get_ruby_level_next_cfp(th, th->cfp); if (cfp && (line = rb_vm_get_sourceline(cfp))) { - VALUE location = rb_ary_new3(2, cfp->iseq->filename, INT2FIX(line)); + VALUE location = rb_ary_new3(2, cfp->iseq->location.filename, INT2FIX(line)); def->body.attr.location = rb_ary_freeze(location); } break; |