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

ruby-changes:50018

From: usa <ko1@a...>
Date: Wed, 31 Jan 2018 22:24:49 +0900 (JST)
Subject: [ruby-changes:50018] usa:r62136 (ruby_2_3): merge revision(s) 60024: [Backport #13945]

usa	2018-01-31 22:24:42 +0900 (Wed, 31 Jan 2018)

  New Revision: 62136

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

  Log:
    merge revision(s) 60024: [Backport #13945]
    
    vm.c: fetch retval iff necessary
    
    * vm.c (rb_vm_make_jump_tag_but_local_jump): get rid of fetching
      retval when it is not used.  it is necessary for local jump
      state only.

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/load.c
    branches/ruby_2_3/version.h
    branches/ruby_2_3/vm.c
Index: ruby_2_3/load.c
===================================================================
--- ruby_2_3/load.c	(revision 62135)
+++ ruby_2_3/load.c	(revision 62136)
@@ -629,6 +629,8 @@ rb_load_internal0(rb_thread_t *th, VALUE https://github.com/ruby/ruby/blob/trunk/ruby_2_3/load.c#L629
     th->top_wrapper = wrapper;
 
     if (state) {
+	/* usually state == TAG_RAISE only, except for
+	 * rb_iseq_load_iseq case */
 	VALUE exc = rb_vm_make_jump_tag_but_local_jump(state, Qundef);
 	if (NIL_P(exc)) return state;
 	th->errinfo = exc;
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 62135)
+++ ruby_2_3/version.h	(revision 62136)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.7"
 #define RUBY_RELEASE_DATE "2018-01-31"
-#define RUBY_PATCHLEVEL 397
+#define RUBY_PATCHLEVEL 398
 
 #define RUBY_RELEASE_YEAR 2018
 #define RUBY_RELEASE_MONTH 1
Index: ruby_2_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 62135)
+++ ruby_2_3/ChangeLog	(revision 62136)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Wed Jan 31 22:24:05 2018  Nobuyoshi Nakada  <nobu@r...>
+
+	vm.c: fetch retval iff necessary
+
+	* vm.c (rb_vm_make_jump_tag_but_local_jump): get rid of fetching
+	  retval when it is not used.  it is necessary for local jump
+	  state only.
+
 Wed Jan 31 22:16:00 2018  Nobuyoshi Nakada  <nobu@r...>
 
 	compile.c: fix stack consitency error
Index: ruby_2_3/vm.c
===================================================================
--- ruby_2_3/vm.c	(revision 62135)
+++ ruby_2_3/vm.c	(revision 62136)
@@ -1310,33 +1310,31 @@ rb_vm_localjump_error(const char *mesg, https://github.com/ruby/ruby/blob/trunk/ruby_2_3/vm.c#L1310
 VALUE
 rb_vm_make_jump_tag_but_local_jump(int state, VALUE val)
 {
-    VALUE result = Qnil;
+    const char *mesg;
 
-    if (val == Qundef) {
-	val = GET_THREAD()->tag->retval;
-    }
     switch (state) {
-      case 0:
-	break;
       case TAG_RETURN:
-	result = make_localjump_error("unexpected return", val, state);
+	mesg = "unexpected return";
 	break;
       case TAG_BREAK:
-	result = make_localjump_error("unexpected break", val, state);
+	mesg = "unexpected break";
 	break;
       case TAG_NEXT:
-	result = make_localjump_error("unexpected next", val, state);
+	mesg = "unexpected next";
 	break;
       case TAG_REDO:
-	result = make_localjump_error("unexpected redo", Qnil, state);
+	mesg = "unexpected redo";
 	break;
       case TAG_RETRY:
-	result = make_localjump_error("retry outside of rescue clause", Qnil, state);
+	mesg = "retry outside of rescue clause";
 	break;
       default:
-	break;
+	return Qnil;
+    }
+    if (val == Qundef) {
+	val = GET_THREAD()->tag->retval;
     }
-    return result;
+    return make_localjump_error(mesg, val, state);
 }
 
 void
Index: ruby_2_3
===================================================================
--- ruby_2_3	(revision 62135)
+++ ruby_2_3	(revision 62136)

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r60024

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

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