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

ruby-changes:32057

From: tmm1 <ko1@a...>
Date: Wed, 11 Dec 2013 15:38:49 +0900 (JST)
Subject: [ruby-changes:32057] tmm1:r44136 (trunk): compile.c: add opt_aset instruction for faster Hash#[]= and Array#[]=

tmm1	2013-12-11 15:38:42 +0900 (Wed, 11 Dec 2013)

  New Revision: 44136

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44136

  Log:
    compile.c: add opt_aset instruction for faster Hash#[]= and Array#[]=
    
    * compile.c (iseq_specialized_instruction): emit opt_aset instruction
      to optimize Hash#[]= and Array#[]= when called with Fixnum argument.
      [Bug #9227] [ruby-core:58956]

  Modified files:
    trunk/ChangeLog
    trunk/compile.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 44135)
+++ ChangeLog	(revision 44136)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Dec 11 15:36:15 2013  Aman Gupta <ruby@t...>
+
+	* compile.c (iseq_specialized_instruction): emit opt_aset instruction
+	  to optimize Hash#[]= and Array#[]= when called with Fixnum argument.
+	  [Bug #9227] [ruby-core:58956]
+
 Wed Dec 11 12:38:17 2013  Koichi Sasada  <ko1@a...>
 
 	* eval.c (rb_raise_jump): pop frame after setup exception.
Index: compile.c
===================================================================
--- compile.c	(revision 44135)
+++ compile.c	(revision 44136)
@@ -1955,6 +1955,11 @@ iseq_specialized_instruction(rb_iseq_t * https://github.com/ruby/ruby/blob/trunk/compile.c#L1955
 		  case idAREF:	 SP_INSN(aref);	  return COMPILE_OK;
 		}
 		break;
+	      case 2:
+		switch (ci->mid) {
+		  case idASET:	 SP_INSN(aset);	  return COMPILE_OK;
+		}
+		break;
 	    }
 	}
 	if (ci->flag & VM_CALL_ARGS_SKIP_SETUP) {

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

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