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

ruby-changes:48678

From: ko1 <ko1@a...>
Date: Thu, 16 Nov 2017 15:10:36 +0900 (JST)
Subject: [ruby-changes:48678] ko1:r60794 (trunk): accepts `ec` as first parameter.

ko1	2017-11-16 15:10:31 +0900 (Thu, 16 Nov 2017)

  New Revision: 60794

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

  Log:
    accepts `ec` as first parameter.
    
    * vm_insnhelper.c (vm_check_match): accepts `ec` as first parameter.

  Modified files:
    trunk/insns.def
    trunk/vm_insnhelper.c
Index: insns.def
===================================================================
--- insns.def	(revision 60793)
+++ insns.def	(revision 60794)
@@ -759,7 +759,7 @@ checkmatch https://github.com/ruby/ruby/blob/trunk/insns.def#L759
 (VALUE target, VALUE pattern)
 (VALUE result)
 {
-    result = vm_check_match(target, pattern, flag);
+    result = vm_check_match(ec, target, pattern, flag);
 }
 
 /**
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 60793)
+++ vm_insnhelper.c	(revision 60794)
@@ -1464,7 +1464,7 @@ rb_eql_opt(VALUE obj1, VALUE obj2) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1464
 static VALUE vm_call0(rb_execution_context_t *ec, VALUE, ID, int, const VALUE*, const rb_callable_method_entry_t *);
 
 static VALUE
-check_match(VALUE pattern, VALUE target, enum vm_check_match_type type)
+check_match(rb_execution_context_t *ec, VALUE pattern, VALUE target, enum vm_check_match_type type)
 {
     switch (type) {
       case VM_CHECKMATCH_TYPE_WHEN:
@@ -1478,7 +1478,7 @@ check_match(VALUE pattern, VALUE target, https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1478
 	const rb_callable_method_entry_t *me =
 	    rb_callable_method_entry_with_refinements(CLASS_OF(pattern), idEqq, NULL);
 	if (me) {
-	    return vm_call0(GET_EC(), pattern, idEqq, 1, &target, me);
+	    return vm_call0(ec, pattern, idEqq, 1, &target, me);
 	}
 	else {
 	    /* fallback to funcall (e.g. method_missing) */
@@ -2979,7 +2979,7 @@ vm_splat_array(VALUE flag, VALUE ary) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2979
 }
 
 static VALUE
-vm_check_match(VALUE target, VALUE pattern, rb_num_t flag)
+vm_check_match(rb_execution_context_t *ec, VALUE target, VALUE pattern, rb_num_t flag)
 {
     enum vm_check_match_type type = ((int)flag) & VM_CHECKMATCH_TYPE_MASK;
 
@@ -2989,7 +2989,7 @@ vm_check_match(VALUE target, VALUE patte https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2989
 
 	for (i = 0; i < n; i++) {
 	    VALUE v = RARRAY_AREF(pattern, i);
-	    VALUE c = check_match(v, target, type);
+	    VALUE c = check_match(ec, v, target, type);
 
 	    if (RTEST(c)) {
 		return c;
@@ -2998,7 +2998,7 @@ vm_check_match(VALUE target, VALUE patte https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2998
 	return Qfalse;
     }
     else {
-	return check_match(pattern, target, type);
+	return check_match(ec, pattern, target, type);
     }
 }
 

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

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