aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--iseq.c27
-rw-r--r--vm_core.h3
2 files changed, 8 insertions, 22 deletions
diff --git a/iseq.c b/iseq.c
index fcf38fcea8..281d5e4224 100644
--- a/iseq.c
+++ b/iseq.c
@@ -966,12 +966,10 @@ rb_iseq_load(VALUE data, VALUE parent, VALUE opt)
}
rb_iseq_t *
-rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE realpath, VALUE line, const struct rb_block *base_block, VALUE opt)
+rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE realpath, VALUE line, VALUE opt)
{
rb_iseq_t *iseq = NULL;
- const rb_iseq_t *const parent = base_block ? vm_block_iseq(base_block) : NULL;
rb_compile_option_t option;
- const enum iseq_type type = parent ? ISEQ_TYPE_EVAL : ISEQ_TYPE_TOP;
#if !defined(__GNUC__) || (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
# define INITIALIZED volatile /* suppress warnings by gcc 4.8 */
#else
@@ -994,11 +992,8 @@ rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE realpath, VALUE line, c
}
{
const VALUE parser = rb_parser_new();
- const rb_iseq_t *outer_scope = parent;
- if (!outer_scope) {
- VALUE name = rb_fstring_lit("<compiled>");
- outer_scope = rb_iseq_new(NULL, name, name, Qnil, 0, ISEQ_TYPE_TOP);
- }
+ VALUE name = rb_fstring_lit("<compiled>");
+ const rb_iseq_t *outer_scope = rb_iseq_new(NULL, name, name, Qnil, 0, ISEQ_TYPE_TOP);
VALUE outer_scope_v = (VALUE)outer_scope;
rb_parser_set_context(parser, outer_scope, FALSE);
RB_GC_GUARD(outer_scope_v);
@@ -1010,11 +1005,9 @@ rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE realpath, VALUE line, c
rb_exc_raise(GET_EC()->errinfo);
}
else {
- INITIALIZED VALUE label = parent ?
- parent->body->location.label :
- rb_fstring_lit("<compiled>");
+ INITIALIZED VALUE label = rb_fstring_lit("<compiled>");
iseq = rb_iseq_new_with_opt(&ast->body, label, file, realpath, line,
- parent, type, &option);
+ 0, ISEQ_TYPE_TOP, &option);
rb_ast_dispose(ast);
}
@@ -1024,13 +1017,7 @@ rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE realpath, VALUE line, c
rb_iseq_t *
rb_iseq_compile(VALUE src, VALUE file, VALUE line)
{
- return rb_iseq_compile_with_option(src, file, Qnil, line, 0, Qnil);
-}
-
-rb_iseq_t *
-rb_iseq_compile_on_base(VALUE src, VALUE file, VALUE line, const struct rb_block *base_block)
-{
- return rb_iseq_compile_with_option(src, file, Qnil, line, base_block, Qnil);
+ return rb_iseq_compile_with_option(src, file, Qnil, line, Qnil);
}
VALUE
@@ -1214,7 +1201,7 @@ iseqw_s_compile(int argc, VALUE *argv, VALUE self)
Check_Type(path, T_STRING);
Check_Type(file, T_STRING);
- return iseqw_new(rb_iseq_compile_with_option(src, file, path, line, 0, opt));
+ return iseqw_new(rb_iseq_compile_with_option(src, file, path, line, opt));
}
/*
diff --git a/vm_core.h b/vm_core.h
index 8eb155585e..7ff943a3e8 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -1021,8 +1021,7 @@ rb_iseq_t *rb_iseq_new_with_callback(const struct rb_iseq_new_with_callback_call
/* src -> iseq */
rb_iseq_t *rb_iseq_compile(VALUE src, VALUE file, VALUE line);
-rb_iseq_t *rb_iseq_compile_on_base(VALUE src, VALUE file, VALUE line, const struct rb_block *base_block);
-rb_iseq_t *rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE realpath, VALUE line, const struct rb_block *base_block, VALUE opt);
+rb_iseq_t *rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE realpath, VALUE line, VALUE opt);
VALUE rb_iseq_disasm(const rb_iseq_t *iseq);
int rb_iseq_disasm_insn(VALUE str, const VALUE *iseqval, size_t pos, const rb_iseq_t *iseq, VALUE child);