From 7049d9c80d1ba859beb5d68c7a9de37d5c11b8e8 Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 24 Aug 2011 06:31:15 +0000 Subject: * iseq.h, iseq.c, compile.c: Change the line number data structure to solve an issue reported at [ruby-dev:44413] [Ruby 1.9 - Bug #5217]. Before this fix, each instruction has an information including line number (iseq::iseq_insn_info_table). Instead of this data structure, recording only line number changing places (iseq::iseq_line_info_table). The order of entries in iseq_line_info_table is ascending order of iseq_line_info_table_entry::position. You can get a line number by an iseq and a program counter with this data structure. This fix reduces memory consumption of iseq (bytecode). On my measurement, a rails application consumes 21.8MB for iseq with this fix on the 32bit CPU. Without this fix, it consumes 24.7MB for iseq [ruby-dev:44415]. * proc.c: ditto. * vm_insnhelper.c: ditto. * vm_method.c: ditto. * vm.c (rb_vm_get_sourceline): change to use rb_iseq_line_no(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_method.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vm_method.c') diff --git a/vm_method.c b/vm_method.c index 3ef93314c8..608760f2ad 100644 --- a/vm_method.c +++ b/vm_method.c @@ -216,7 +216,7 @@ rb_method_entry_make(VALUE klass, ID mid, rb_method_type_t type, break; } if (iseq && !NIL_P(iseq->filename)) { - int line = iseq->insn_info_table ? rb_iseq_first_lineno(iseq) : 0; + int line = iseq->line_info_table ? rb_iseq_first_lineno(iseq) : 0; rb_compile_warning(RSTRING_PTR(iseq->filename), line, "previous definition of %s was here", rb_id2name(old_def->original_id)); -- cgit v1.2.3