summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/iseq.c b/iseq.c
index 057516deed..de8664d5e4 100644
--- a/iseq.c
+++ b/iseq.c
@@ -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. */