[前][次][番号順一覧][スレッド一覧][生データ]

yarv-diff:24

From: ko1 atdot.net
Date: 28 Jun 2005 12:17:01 -0000
Subject: [yarv-diff:24] r179 - in trunk: . benchmark

Author: ko1
Date: 2005-06-28 21:17:01 +0900 (Tue, 28 Jun 2005)
New Revision: 179

Modified:
   trunk/ChangeLog
   trunk/benchmark/run.rb
   trunk/compile.c
   trunk/test.rb
Log:
	* compile.c : fix opt_case_dispatch instruction

	* benchmark/run.rb : output all usertimes when exit benchmark



Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2005-06-28 11:37:34 UTC (rev 178)
+++ trunk/ChangeLog	2005-06-28 12:17:01 UTC (rev 179)
@@ -4,6 +4,13 @@
 #  from Mon, 03 May 2004 01:24:19 +0900
 #
 
+2005-06-28(Tue) 21:15:54 +0900  Koichi Sasada  <ko1 atdot.net>
+
+	* compile.c : fix opt_case_dispatch instruction
+
+	* benchmark/run.rb : output all usertimes when exit benchmark
+
+
 2005-06-28(Tue) 20:35:55 +0900  Koichi Sasada  <ko1 atdot.net>
 
 	* extconf.rb, compile.c, tmpl/optinsn.inc.tmpl, vm.c :

Modified: trunk/benchmark/run.rb
===================================================================
--- trunk/benchmark/run.rb	2005-06-28 11:37:34 UTC (rev 178)
+++ trunk/benchmark/run.rb	2005-06-28 12:17:01 UTC (rev 179)
@@ -7,8 +7,8 @@
 require 'rbconfig'
 
 $yarvonly = false
+$results  = []
 
-
 puts "ruby #{RUBY_VERSION} #{RUBY_PLATFORM}(#{RUBY_RELEASE_DATE})"
 puts YARVCore::VERSION + " rev: #{YARVCore::REV} (#{YARVCore::DATE})"
 puts YARVCore::OPTS
@@ -74,8 +74,10 @@
   tmpfile.write(prog)
   tmpfile.close
   cmd = "#{rubybin} #{tmpfile.path}"
-  puts `#{cmd}`
+  result = `#{cmd}`
+  puts result
   tmpfile.close(true)
+  $results << result
 end
 
 def ruby_exec file
@@ -108,6 +110,12 @@
       bm file
     }
   end
+
+  $results.each{|result|
+    if /([\d\.]+)/ =~ result
+      puts $1
+    end
+  }
 end
 
 

Modified: trunk/compile.c
===================================================================
--- trunk/compile.c	2005-06-28 11:37:34 UTC (rev 178)
+++ trunk/compile.c	2005-06-28 12:17:01 UTC (rev 179)
@@ -1882,6 +1882,7 @@
     
     if(special_literals){
       special_literals = (VALUE)NEW_WHILE(special_literals, 0, 0);
+      ADD_INSN (ret, nd_line(tempnode), dup);
       ADD_INSN2(ret, nd_line(tempnode), opt_case_dispatch,
                 special_literals, elselabel);
       rb_ary_push(iseqobj->compile_data->mark_ary, special_literals);

Modified: trunk/test.rb
===================================================================
--- trunk/test.rb	2005-06-28 11:37:34 UTC (rev 178)
+++ trunk/test.rb	2005-06-28 12:17:01 UTC (rev 179)
@@ -9,8 +9,21 @@
 ###########################################################
 $prog =<<'__EOP__'
 
-a = b = c = d = 1
+def test(arg)
+a =  case arg
+  when 1
+    2
+  else
+    3
+  end
+  return a
+end
 
+p :miss
+test(0)
+p :hit
+test(1)
+
 __EOP__
 ###########################################################
 


--
ML: yarv-diff quickml.atdot.net
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧][生データ]