[前][次][番号順一覧][スレッド一覧]

ruby-changes:48340

From: ko1 <ko1@a...>
Date: Thu, 26 Oct 2017 23:44:15 +0900 (JST)
Subject: [ruby-changes:48340] ko1:r60454 (trunk): replace `GET_THREAD()->ec` to `GET_EC()`.

ko1	2017-10-26 23:44:09 +0900 (Thu, 26 Oct 2017)

  New Revision: 60454

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60454

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

  Modified files:
    trunk/eval.c
    trunk/gc.c
    trunk/iseq.c
    trunk/process.c
    trunk/safe.c
    trunk/thread.c
    trunk/vm.c
    trunk/vm_core.h
    trunk/vm_insnhelper.c
    trunk/vm_trace.c
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 60453)
+++ vm_insnhelper.c	(revision 60454)
@@ -1539,8 +1539,8 @@ vm_base_ptr(const rb_control_frame_t *cf https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1539
 #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
Index: process.c
===================================================================
--- process.c	(revision 60453)
+++ process.c	(revision 60454)
@@ -3765,7 +3765,7 @@ rb_f_exit_bang(int argc, VALUE *argv, VA https://github.com/ruby/ruby/blob/trunk/process.c#L3765
 void
 rb_exit(int status)
 {
-    if (GET_THREAD()->ec->tag) {
+    if (GET_EC()->tag) {
 	VALUE args[2];
 
 	args[0] = INT2NUM(status);
Index: vm.c
===================================================================
--- vm.c	(revision 60453)
+++ vm.c	(revision 60454)
@@ -815,7 +815,7 @@ rb_proc_create_from_captured(VALUE klass https://github.com/ruby/ruby/blob/trunk/vm.c#L815
     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 https://github.com/ruby/ruby/blob/trunk/vm.c#L857
     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 s https://github.com/ruby/ruby/blob/trunk/vm.c#L1447
 	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, VAL https://github.com/ruby/ruby/blob/trunk/vm.c#L3293
 	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 https://github.com/ruby/ruby/blob/trunk/vm.c#L3406
     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);
Index: eval.c
===================================================================
--- eval.c	(revision 60453)
+++ eval.c	(revision 60454)
@@ -129,7 +129,7 @@ static void https://github.com/ruby/ruby/blob/trunk/eval.c#L129
 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) https://github.com/ruby/ruby/blob/trunk/eval.c#L1102
 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) https://github.com/ruby/ruby/blob/trunk/eval.c#L1119
 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) https://github.com/ruby/ruby/blob/trunk/eval.c#L1794
     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
Index: thread.c
===================================================================
--- thread.c	(revision 60453)
+++ thread.c	(revision 60454)
@@ -4981,7 +4981,7 @@ rb_check_deadlock(rb_vm_t *vm) https://github.com/ruby/ruby/blob/trunk/thread.c#L4981
 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) {
Index: safe.c
===================================================================
--- safe.c	(revision 60453)
+++ safe.c	(revision 60454)
@@ -34,13 +34,13 @@ ruby_safe_level_2_warning(void) https://github.com/ruby/ruby/blob/trunk/safe.c#L34
 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
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 60453)
+++ vm_core.h	(revision 60454)
@@ -1480,7 +1480,7 @@ extern void rb_vmdebug_stack_dump_raw(rb https://github.com/ruby/ruby/blob/trunk/vm_core.h#L1480
 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, ...));
Index: vm_trace.c
===================================================================
--- vm_trace.c	(revision 60453)
+++ vm_trace.c	(revision 60454)
@@ -706,7 +706,7 @@ tpptr(VALUE tpval) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L706
 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 https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L1310
 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) {
Index: gc.c
===================================================================
--- gc.c	(revision 60453)
+++ gc.c	(revision 60454)
@@ -4008,7 +4008,7 @@ ruby_get_stack_grow_direction(volatile V https://github.com/ruby/ruby/blob/trunk/gc.c#L4008
 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;
Index: iseq.c
===================================================================
--- iseq.c	(revision 60453)
+++ iseq.c	(revision 60454)
@@ -870,7 +870,7 @@ iseqw_s_compile_file(int argc, VALUE *ar https://github.com/ruby/ruby/blob/trunk/iseq.c#L870
     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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]