diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-28 21:39:24 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-28 21:39:24 +0000 |
commit | d7935475fc46adc50def2f89bfe3a5b99d7707ac (patch) | |
tree | 94055a58e49eab1b1c6682d8502b435791ef7384 /compile.c | |
parent | 0a41425ad424dbf52e30bce1e649204e9a7553c3 (diff) | |
download | ruby-d7935475fc46adc50def2f89bfe3a5b99d7707ac.tar.gz |
remove rb_thread_t::parse_in_eval
* parse.y (struct parser_params): move parse_in_eval flag from
rb_thread_t.
* parse.y (rb_parser_set_context): set parsing context, not only
mild error flag.
* iseq.c (rb_iseq_compile_with_option): the parser now refers no
thread local states to be restored.
* vm_eval.c (eval_string_with_cref): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 24 |
1 files changed, 5 insertions, 19 deletions
@@ -6764,12 +6764,11 @@ rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc, VALUE locals, VALUE params, /* for parser */ int -rb_dvar_defined(ID id) +rb_dvar_defined(ID id, const rb_block_t *base_block) { - rb_thread_t *th = GET_THREAD(); const rb_iseq_t *iseq; - if (th->base_block && (iseq = th->base_block->iseq)) { + if (base_block && (iseq = base_block->iseq)) { while (iseq->body->type == ISEQ_TYPE_BLOCK || iseq->body->type == ISEQ_TYPE_RESCUE || iseq->body->type == ISEQ_TYPE_ENSURE || @@ -6790,14 +6789,13 @@ rb_dvar_defined(ID id) } int -rb_local_defined(ID id) +rb_local_defined(ID id, const rb_block_t *base_block) { - rb_thread_t *th = GET_THREAD(); const rb_iseq_t *iseq; - if (th->base_block && th->base_block->iseq) { + if (base_block && base_block->iseq) { unsigned int i; - iseq = th->base_block->iseq->body->local_iseq; + iseq = base_block->iseq->body->local_iseq; for (i=0; i<iseq->body->local_table_size; i++) { if (iseq->body->local_table[i] == id) { @@ -6808,18 +6806,6 @@ rb_local_defined(ID id) return 0; } -int -rb_parse_in_eval(void) -{ - return GET_THREAD()->parse_in_eval > 0; -} - -int -rb_parse_in_main(void) -{ - return GET_THREAD()->parse_in_eval < 0; -} - static int caller_location(VALUE *path, VALUE *absolute_path) { |