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

ruby-changes:46902

From: ko1 <ko1@a...>
Date: Mon, 5 Jun 2017 15:57:24 +0900 (JST)
Subject: [ruby-changes:46902] ko1:r59017 (trunk): do not inform ``is_lambda".

ko1	2017-06-05 15:57:20 +0900 (Mon, 05 Jun 2017)

  New Revision: 59017

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

  Log:
    do not inform ``is_lambda".
    
    * vm_eval.c (yield_under): do not inform Proc is lambda or not.
      After that invoke_block_from_c_bh() checks it.

  Modified files:
    trunk/vm.c
    trunk/vm_eval.c
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 59016)
+++ vm_eval.c	(revision 59017)
@@ -16,7 +16,7 @@ struct local_var_list { https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L16
 };
 
 static inline VALUE method_missing(VALUE obj, ID id, int argc, const VALUE *argv, enum method_missing_reason call_status);
-static inline VALUE vm_yield_with_cref(rb_thread_t *th, int argc, const VALUE *argv, const rb_cref_t *cref, int is_lambda);
+static inline VALUE vm_yield_with_cref(rb_thread_t *th, int argc, const VALUE *argv, const rb_cref_t *cref);
 static inline VALUE vm_yield(rb_thread_t *th, int argc, const VALUE *argv);
 static inline VALUE vm_yield_with_block(rb_thread_t *th, int argc, const VALUE *argv, VALUE block_handler);
 static inline VALUE vm_yield_force_blockarg(rb_thread_t *th, VALUE args);
@@ -1573,7 +1573,6 @@ yield_under(VALUE under, VALUE self, int https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1573
     struct rb_captured_block new_captured;
     const VALUE *ep = NULL;
     rb_cref_t *cref;
-    int is_lambda = FALSE;
 
     if (block_handler != VM_BLOCK_HANDLER_NONE) {
       again:
@@ -1589,7 +1588,6 @@ yield_under(VALUE under, VALUE self, int https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1588
 	    new_block_handler = VM_BH_FROM_IFUNC_BLOCK(&new_captured);
 	    break;
 	  case block_handler_type_proc:
-	    is_lambda = rb_proc_lambda_p(block_handler) != Qfalse;
 	    block_handler = vm_proc_to_block_handler(VM_BH_TO_PROC(block_handler));
 	    goto again;
 	  case block_handler_type_symbol:
@@ -1604,7 +1602,7 @@ yield_under(VALUE under, VALUE self, int https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1602
     }
 
     cref = vm_cref_push(th, under, ep, TRUE);
-    return vm_yield_with_cref(th, argc, argv, cref, is_lambda);
+    return vm_yield_with_cref(th, argc, argv, cref);
 }
 
 VALUE
@@ -1625,7 +1623,7 @@ rb_yield_refine_block(VALUE refinement, https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1623
 	CREF_REFINEMENTS_SET(cref, refinements);
 	VM_FORCE_WRITE_SPECIAL_CONST(&VM_CF_LEP(th->ec.cfp)[VM_ENV_DATA_INDEX_SPECVAL], new_block_handler);
 	new_captured.self = refinement;
-	return vm_yield_with_cref(th, 0, NULL, cref, FALSE);
+	return vm_yield_with_cref(th, 0, NULL, cref);
     }
 }
 
Index: vm.c
===================================================================
--- vm.c	(revision 59016)
+++ vm.c	(revision 59017)
@@ -1078,11 +1078,11 @@ check_block_handler(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm.c#L1078
 }
 
 static VALUE
-vm_yield_with_cref(rb_thread_t *th, int argc, const VALUE *argv, const rb_cref_t *cref, int is_lambda)
+vm_yield_with_cref(rb_thread_t *th, int argc, const VALUE *argv, const rb_cref_t *cref)
 {
     return invoke_block_from_c_bh(th, check_block_handler(th),
 				  argc, argv, VM_BLOCK_HANDLER_NONE,
-				  cref, is_lambda, FALSE);
+				  cref, FALSE, FALSE);
 }
 
 static VALUE

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

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