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

ruby-changes:48405

From: ko1 <ko1@a...>
Date: Sat, 28 Oct 2017 20:46:37 +0900 (JST)
Subject: [ruby-changes:48405] ko1:r60519 (trunk): * proc.c (rb_block_arity): use `ec` directly.

ko1	2017-10-28 20:46:32 +0900 (Sat, 28 Oct 2017)

  New Revision: 60519

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

  Log:
    * proc.c (rb_block_arity): use `ec` directly.
    
    * proc.c (rb_mod_define_method): ditto.

  Modified files:
    trunk/proc.c
Index: proc.c
===================================================================
--- proc.c	(revision 60518)
+++ proc.c	(revision 60519)
@@ -1046,8 +1046,8 @@ int https://github.com/ruby/ruby/blob/trunk/proc.c#L1046
 rb_block_arity(void)
 {
     int min, max;
-    rb_thread_t *th = GET_THREAD();
-    rb_control_frame_t *cfp = th->ec->cfp;
+    const rb_execution_context_t *ec = GET_EC();
+    rb_control_frame_t *cfp = ec->cfp;
     VALUE block_handler = rb_vm_frame_block_handler(cfp);
     struct rb_block block;
 
@@ -1079,8 +1079,8 @@ rb_block_arity(void) https://github.com/ruby/ruby/blob/trunk/proc.c#L1079
 int
 rb_block_min_max_arity(int *max)
 {
-    rb_thread_t *th = GET_THREAD();
-    rb_control_frame_t *cfp = th->ec->cfp;
+    const rb_execution_context_t *ec = GET_EC();
+    rb_control_frame_t *cfp = ec->cfp;
     VALUE block_handler = rb_vm_frame_block_handler(cfp);
     struct rb_block block;
 
@@ -1908,8 +1908,8 @@ rb_mod_define_method(int argc, VALUE *ar https://github.com/ruby/ruby/blob/trunk/proc.c#L1908
 #if PROC_NEW_REQUIRES_BLOCK
 	body = rb_block_lambda();
 #else
-	rb_thread_t *th = GET_THREAD();
-	VALUE block_handler = rb_vm_frame_block_handler(th->ec->cfp);
+	const rb_execution_context_t *ec = GET_EC();
+	VALUE block_handler = rb_vm_frame_block_handler(ec->cfp);
 	if (block_handler == VM_BLOCK_HANDLER_NONE) rb_raise(rb_eArgError, proc_without_block);
 
 	switch (vm_block_handler_type(block_handler)) {
@@ -1921,7 +1921,7 @@ rb_mod_define_method(int argc, VALUE *ar https://github.com/ruby/ruby/blob/trunk/proc.c#L1921
 	    break;
 	  case block_handler_type_iseq:
 	  case block_handler_type_ifunc:
-	    body = rb_vm_make_proc_lambda(th->ec, VM_BH_TO_CAPT_BLOCK(block_handler), rb_cProc, TRUE);
+	    body = rb_vm_make_proc_lambda(ec, VM_BH_TO_CAPT_BLOCK(block_handler), rb_cProc, TRUE);
 	}
 #endif
     }

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

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