From 8bcf7fc40266faa09cf8b6cebb2d96c1bb8d51ee Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 22 May 2012 08:31:38 +0000 Subject: * 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 --- proc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'proc.c') diff --git a/proc.c b/proc.c index d44e8d8ab9..f9548a3c82 100644 --- a/proc.c +++ b/proc.c @@ -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 { -- cgit v1.2.3