diff options
| author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-23 07:49:45 +0000 |
|---|---|---|
| committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-23 07:49:45 +0000 |
| commit | 619d86d0be63a32379200b64a56809745fb7e236 (patch) | |
| tree | 1e92b71304d4cb6f6a37bee6b74d659ea43a5aad /iseq.c | |
| parent | b1a4c1ea5d9b71e9748dc8d920184aae004dcf26 (diff) | |
| download | ruby-619d86d0be63a32379200b64a56809745fb7e236.tar.gz ruby-619d86d0be63a32379200b64a56809745fb7e236.tar.xz ruby-619d86d0be63a32379200b64a56809745fb7e236.zip | |
* include/ruby/node.h, vm_core.h: move definition of
RUBY_VM_METHOD_NODE to node.h.
* class.c, common.mk: remove useless inclusion.
* compile.h, iseq.h, vm_core.h: rename compile.h to iseq.h.
move some definitions from vm_core.h to iseq.h.
* compile.c, iseq.c, vm.c: ditto.
* eval.c, compile.c: move some functions for parser
from eval.c to compile.c.
* eval_intern.h, vm_core.h: move va_init_list() macro to
vm_core.h.
* iseq.c (rb_iseq_new_top, rb_iseq_first_lineno): added.
* load.c, ruby.c: use rb_iseq_new_top() instead of
rb_iseq_new() with ISEQ_TYPE_TOP constant directly.
* proc.c: use rb_iseq_first_lineno() instead of accessing
iseq structure.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
| -rw-r--r-- | iseq.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -15,6 +15,7 @@ /* #define MARK_FREE_DEBUG 1 */ #include "gc.h" #include "vm_core.h" +#include "iseq.h" #include "insns.inc" #include "insns_info.inc" @@ -307,6 +308,13 @@ rb_iseq_new(NODE *node, VALUE name, VALUE filename, &COMPILE_OPTION_DEFAULT); } +VALUE +rb_iseq_new_top(NODE *node, VALUE name, VALUE filename, VALUE parent) +{ + return rb_iseq_new_with_opt(node, name, filename, parent, ISEQ_TYPE_TOP, + &COMPILE_OPTION_DEFAULT); +} + static VALUE rb_iseq_new_with_bopt_and_opt(NODE *node, VALUE name, VALUE filename, VALUE parent, VALUE type, VALUE bopt, @@ -571,6 +579,12 @@ iseq_to_a(VALUE self) return iseq_data_to_ary(iseq); } +int +rb_iseq_first_lineno(rb_iseq_t *iseq) +{ + return iseq->insn_info_table[0].line_no; +} + /* TODO: search algorithm is brute force. this should be binary search or so. */ |
