replace `GET_THREAD()->ec` to `GET_EC()`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2017-10-26 14:44:09 +00:00
Родитель d77305fc9c
Коммит f56288d7a8
10 изменённых файлов: 20 добавлений и 20 удалений

8
eval.c
Просмотреть файл

@ -129,7 +129,7 @@ static void
ruby_finalize_1(void)
{
ruby_sig_finalize();
GET_THREAD()->ec->errinfo = Qnil;
GET_EC()->errinfo = Qnil;
rb_gc_call_finalizer_at_exit();
}
@ -1102,7 +1102,7 @@ frame_called_id(rb_control_frame_t *cfp)
ID
rb_frame_this_func(void)
{
return frame_func_id(GET_THREAD()->ec->cfp);
return frame_func_id(GET_EC()->cfp);
}
/*!
@ -1119,7 +1119,7 @@ rb_frame_this_func(void)
ID
rb_frame_callee(void)
{
return frame_called_id(GET_THREAD()->ec->cfp);
return frame_called_id(GET_EC()->cfp);
}
static rb_control_frame_t *
@ -1794,7 +1794,7 @@ rb_set_errinfo(VALUE err)
if (!NIL_P(err) && !rb_obj_is_kind_of(err, rb_eException)) {
rb_raise(rb_eTypeError, "assigning non-exception to $!");
}
GET_THREAD()->ec->errinfo = err;
GET_EC()->errinfo = err;
}
static VALUE

2
gc.c
Просмотреть файл

@ -4008,7 +4008,7 @@ ruby_get_stack_grow_direction(volatile VALUE *addr)
size_t
ruby_stack_length(VALUE **p)
{
rb_execution_context_t *ec = GET_THREAD()->ec;
rb_execution_context_t *ec = GET_EC();
SET_STACK_END;
if (p) *p = STACK_UPPER(STACK_END, STACK_START, STACK_END);
return STACK_LENGTH;

2
iseq.c
Просмотреть файл

@ -870,7 +870,7 @@ iseqw_s_compile_file(int argc, VALUE *argv, VALUE self)
parser = rb_parser_new();
rb_parser_set_context(parser, NULL, FALSE);
node = rb_parser_compile_file_path(parser, file, f, NUM2INT(line));
if (!node) exc = GET_THREAD()->ec->errinfo;
if (!node) exc = GET_EC()->errinfo;
rb_io_close(f);
if (!node) rb_exc_raise(exc);

Просмотреть файл

@ -3765,7 +3765,7 @@ rb_f_exit_bang(int argc, VALUE *argv, VALUE obj)
void
rb_exit(int status)
{
if (GET_THREAD()->ec->tag) {
if (GET_EC()->tag) {
VALUE args[2];
args[0] = INT2NUM(status);

4
safe.c
Просмотреть файл

@ -34,13 +34,13 @@ ruby_safe_level_2_warning(void)
int
rb_safe_level(void)
{
return GET_THREAD()->ec->safe_level;
return GET_EC()->safe_level;
}
void
rb_set_safe_level_force(int safe)
{
GET_THREAD()->ec->safe_level = safe;
GET_EC()->safe_level = safe;
}
void

Просмотреть файл

@ -4981,7 +4981,7 @@ rb_check_deadlock(rb_vm_t *vm)
static void
update_coverage(VALUE data, const rb_trace_arg_t *trace_arg)
{
VALUE coverage = rb_iseq_coverage(GET_THREAD()->ec->cfp->iseq);
VALUE coverage = rb_iseq_coverage(GET_EC()->cfp->iseq);
if (RB_TYPE_P(coverage, T_ARRAY) && !RBASIC_CLASS(coverage)) {
long arg = FIX2INT(trace_arg->data);
switch (arg % 16) {

10
vm.c
Просмотреть файл

@ -815,7 +815,7 @@ rb_proc_create_from_captured(VALUE klass,
VALUE procval = rb_proc_alloc(klass);
rb_proc_t *proc = RTYPEDDATA_DATA(procval);
VM_ASSERT(VM_EP_IN_HEAP_P(GET_THREAD()->ec, captured->ep));
VM_ASSERT(VM_EP_IN_HEAP_P(GET_EC(), captured->ep));
/* copy block */
RB_OBJ_WRITE(procval, &proc->block.as.captured.self, captured->self);
@ -857,7 +857,7 @@ rb_proc_create(VALUE klass, const struct rb_block *block,
VALUE procval = rb_proc_alloc(klass);
rb_proc_t *proc = RTYPEDDATA_DATA(procval);
VM_ASSERT(VM_EP_IN_HEAP_P(GET_THREAD()->ec, vm_block_ep(block)));
VM_ASSERT(VM_EP_IN_HEAP_P(GET_EC(), vm_block_ep(block)));
rb_vm_block_copy(procval, &proc->block, block);
vm_block_type_set(&proc->block, block->type);
proc->safe_level = safe_level;
@ -1447,7 +1447,7 @@ rb_vm_make_jump_tag_but_local_jump(int state, VALUE val)
return Qnil;
}
if (val == Qundef) {
val = GET_THREAD()->ec->tag->retval;
val = GET_EC()->tag->retval;
}
return make_localjump_error(mesg, val, state);
}
@ -3293,7 +3293,7 @@ vm_analysis_operand(int insn, int n, VALUE op)
HASH_ASET(ihash, INT2FIX(n), ophash);
}
/* intern */
valstr = rb_insn_operand_intern(GET_THREAD()->ec->cfp->iseq, insn, n, op, 0, 0, 0, 0);
valstr = rb_insn_operand_intern(GET_EC()->cfp->iseq, insn, n, op, 0, 0, 0, 0);
/* set count */
if ((cv = rb_hash_aref(ophash, valstr)) == Qnil) {
@ -3406,7 +3406,7 @@ vm_collect_usage_operand(int insn, int n, VALUE op)
if (RUBY_DTRACE_INSN_OPERAND_ENABLED()) {
VALUE valstr;
valstr = rb_insn_operand_intern(GET_THREAD()->ec->cfp->iseq, insn, n, op, 0, 0, 0, 0);
valstr = rb_insn_operand_intern(GET_EC()->cfp->iseq, insn, n, op, 0, 0, 0, 0);
RUBY_DTRACE_INSN_OPERAND(RSTRING_PTR(valstr), rb_insns_name(insn));
RB_GC_GUARD(valstr);

Просмотреть файл

@ -1480,7 +1480,7 @@ extern void rb_vmdebug_stack_dump_raw(rb_thread_t *, rb_control_frame_t *);
extern void rb_vmdebug_debug_print_pre(rb_thread_t *th, rb_control_frame_t *cfp, const VALUE *_pc);
extern void rb_vmdebug_debug_print_post(rb_thread_t *th, rb_control_frame_t *cfp);
#define SDR() rb_vmdebug_stack_dump_raw(GET_THREAD(), GET_THREAD()->ec->cfp)
#define SDR() rb_vmdebug_stack_dump_raw(GET_THREAD(), GET_EC()->cfp)
#define SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_THREAD(), (cfp))
void rb_vm_bugreport(const void *);
NORETURN(void rb_bug_context(const void *, const char *fmt, ...));

Просмотреть файл

@ -1539,8 +1539,8 @@ vm_base_ptr(const rb_control_frame_t *cfp)
#if VM_DEBUG_BP_CHECK
if (bp != cfp->bp_check) {
fprintf(stderr, "bp_check: %ld, bp: %ld\n",
(long)(cfp->bp_check - GET_THREAD()->ec->vm_stack),
(long)(bp - GET_THREAD()->ec->vm_stack));
(long)(cfp->bp_check - GET_EC()->vm_stack),
(long)(bp - GET_EC()->vm_stack));
rb_bug("vm_base_ptr: unreachable");
}
#endif

Просмотреть файл

@ -706,7 +706,7 @@ tpptr(VALUE tpval)
static rb_trace_arg_t *
get_trace_arg(void)
{
rb_trace_arg_t *trace_arg = GET_THREAD()->ec->trace_arg;
rb_trace_arg_t *trace_arg = GET_EC()->trace_arg;
if (trace_arg == 0) {
rb_raise(rb_eRuntimeError, "access from outside");
}
@ -1310,7 +1310,7 @@ static VALUE
tracepoint_inspect(VALUE self)
{
rb_tp_t *tp = tpptr(self);
rb_trace_arg_t *trace_arg = GET_THREAD()->ec->trace_arg;
rb_trace_arg_t *trace_arg = GET_EC()->trace_arg;
if (trace_arg) {
switch (trace_arg->event) {