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 /proc.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 'proc.c')
-rw-r--r-- | proc.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -322,7 +322,7 @@ rb_binding_new(void) GetBindingPtr(bindval, bind); bind->env = rb_vm_make_env_object(th, cfp); - bind->filename = cfp->iseq->filename; + bind->filename = cfp->iseq->location.filename; bind->line_no = rb_vm_get_sourceline(cfp); return bindval; } @@ -699,7 +699,7 @@ iseq_location(rb_iseq_t *iseq) VALUE loc[2]; if (!iseq) return Qnil; - loc[0] = iseq->filename; + loc[0] = iseq->location.filename; if (iseq->line_info_table) { loc[1] = INT2FIX(rb_iseq_first_lineno(iseq)); } @@ -849,7 +849,7 @@ proc_to_s(VALUE self) line_no = rb_iseq_first_lineno(iseq); } str = rb_sprintf("#<%s:%p@%s:%d%s>", cname, (void *)self, - RSTRING_PTR(iseq->filename), + RSTRING_PTR(iseq->location.filename), line_no, is_lambda); } else { @@ -1980,7 +1980,7 @@ proc_binding(VALUE self) GetBindingPtr(bindval, bind); bind->env = proc->envval; if (RUBY_VM_NORMAL_ISEQ_P(proc->block.iseq)) { - bind->filename = proc->block.iseq->filename; + bind->filename = proc->block.iseq->location.filename; bind->line_no = rb_iseq_first_lineno(proc->block.iseq); } else { |