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

yarv-diff:50

From: ko1 atdot.net
Date: 7 Jul 2005 14:49:46 -0000
Subject: [yarv-diff:50] r205 - in trunk: . benchmark rb

Author: ko1
Date: 2005-07-07 23:49:45 +0900 (Thu, 07 Jul 2005)
New Revision: 205

Modified:
   trunk/ChangeLog
   trunk/benchmark/bmx_temp.rb
   trunk/extconf.rb
   trunk/rb/insns2vm.rb
   trunk/test.rb
   trunk/vm.h
Log:
	* rb/insns2vm.rb, extconf.rb : add --[enable|disable]-opt-unify-all-combination
	and --disable-opts

	* vm.h : DISPATCH_ARCH_DEPEND_WAY is only enabled on GCC 3.x



Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2005-07-06 04:24:15 UTC (rev 204)
+++ trunk/ChangeLog	2005-07-07 14:49:45 UTC (rev 205)
@@ -4,6 +4,14 @@
 #  from Mon, 03 May 2004 01:24:19 +0900
 #
 
+2005-07-07(Thu) 23:47:55 +0900  Koichi Sasada  <ko1 atdot.net>
+
+	* rb/insns2vm.rb, extconf.rb : add --[enable|disable]-opt-unify-all-combination
+	and --disable-opts
+
+	* vm.h : DISPATCH_ARCH_DEPEND_WAY is only enabled on GCC 3.x
+
+
 2005-07-06(Wed) 13:20:27 +0900  Koichi Sasada  <ko1 atdot.net>
 
 	* depend, rb/eval.rb : add ITEMS option to benchmark rule

Modified: trunk/benchmark/bmx_temp.rb
===================================================================
--- trunk/benchmark/bmx_temp.rb	2005-07-06 04:24:15 UTC (rev 204)
+++ trunk/benchmark/bmx_temp.rb	2005-07-07 14:49:45 UTC (rev 205)
@@ -1,13 +1,10 @@
-def fact(n)
-  if n < 2
-    1
-  else
-    n * fact(n-1)
+1.times{|i|
+  1.times{|j|
+    1.times{|k|
+  i=0
+  while i<30_000_000
+    
+    i+=1
+    # fact(100)
   end
-end
-
-i=0
-while i<10000
-  i+=1
-  fact(100)
-end
+}}}

Modified: trunk/extconf.rb
===================================================================
--- trunk/extconf.rb	2005-07-06 04:24:15 UTC (rev 204)
+++ trunk/extconf.rb	2005-07-07 14:49:45 UTC (rev 205)
@@ -5,7 +5,8 @@
   --help             print this messages
   --enable-OPTION    enable yarv option
   --disable-OPTION   disable yarv option
-
+  --disable-opts     disable all optimization
+  
 OPTION:
   
   optimization option (default enable):
@@ -15,6 +16,7 @@
   * opt-instructions-unification
   * opt-stack-caching
   * opt-inline-method-cache
+  * opt-unify-all-combination
 
   others (default disable):
   * opt-indirect-threaded-code
@@ -39,11 +41,14 @@
 
 require 'mkmf.rb'
 
+# it's for debug
+CONFIG['LDSHARED'].sub!(/-s\b/, '')
+$opt_defs = []
 
 ##
 def check_arg arg, default=nil
   if enable_config(arg, default)
-    $defs.push "-D#{arg.upcase.tr_s("^A-Z0-9_", "_")}"
+    $opt_defs.push "-D#{arg.upcase.tr_s("^A-Z0-9_", "_")}"
   end
 end
 
@@ -53,20 +58,39 @@
 check_arg('opt-basic-operations', true)
 check_arg('opt-operands-unification', true)
 check_arg('opt-instructions-unification', true)
+check_arg('opt-inline-method-cache', true)
 check_arg('opt-stack-caching'   , true)
-check_arg('opt-inline-method-cache', true)
+check_arg('opt-unify-all-combination', true)
 
-# danger
 check_arg('opt-jit-compile', false)
+
+if arg_config('--disable-opts')
+  $opt_defs.clear
+end
+
 check_arg('collect-usage-analysis', false)
+
+# danger
 check_arg('test-aot-compile', false)
 check_arg('fake-inline-method-cache', false)
 check_arg('support-goto', false)
 
+if arg_config('--disable-opt-unifs')
+  $opt_defs.delete_if{|e|
+    /UNIFICATION/ =~ e
+  }
+end
+
 have_type("ulong", "sys/types.h")
 
 $cleanfiles += %w( *.inc ) - %w(vm_evalbody.inc call_cfunc.inc)
 
+$defs.concat $opt_defs
+
+puts
+puts "YARV options:"
+puts $opt_defs.map{|e| "\t" + e}
+puts
 create_makefile('yarvcore')
 
 if macro_defined?("__GNUC__", "") && try_compile(<<-EOS, '-fno-crossjumping')

Modified: trunk/rb/insns2vm.rb
===================================================================
--- trunk/rb/insns2vm.rb	2005-07-06 04:24:15 UTC (rev 204)
+++ trunk/rb/insns2vm.rb	2005-07-07 14:49:45 UTC (rev 205)
@@ -280,7 +280,7 @@
 
   def make_unified_insns insns
 
-    if false  || true # all optimized insn
+    if $opts['OPT_UNIFY_ALL_COMBINATION']
       insn_sets = insns.map{|insn|
         [insn] + insn.optimized
       }

Modified: trunk/test.rb
===================================================================
--- trunk/test.rb	2005-07-06 04:24:15 UTC (rev 204)
+++ trunk/test.rb	2005-07-07 14:49:45 UTC (rev 205)
@@ -9,46 +9,8 @@
 ###########################################################
 $prog =<<'__EOP__'
 
-a = 'abc'
 
 
-__END__
-class C
-  def length
-    30
-  end
-end
-
-a = C.new
-a.length + a.length
-__END__
-10000000.times{
-  a.length + a.length
-}
-
-
-__END__
-require 'stringio'
-input = StringIO.new
-
-data = 'hogehuga'
-
-5000.times{|i|
-  input.write data
-}
-input.seek 0
-
-nl = nw = nc = 0
-while true
-  data = (input.read(4096) or break) << (input.gets || "")
-
-  nc += data.length
-  nl += data.count("\n")
-  ((data.strip! || data).tr!("\n", " ") || data).squeeze!
-  nw += data.count(" ") + 1
-end
-
-
 __EOP__
 ###########################################################
 

Modified: trunk/vm.h
===================================================================
--- trunk/vm.h	2005-07-06 04:24:15 UTC (rev 204)
+++ trunk/vm.h	2005-07-07 14:49:45 UTC (rev 205)
@@ -103,9 +103,9 @@
   INSN_ENTRY_SIG(insn); \
 
 /* dispather */
-#if __GNUC__ && __i386__
+#if __GNUC__ && __i386__ && __GNUC__ == 3
 #define DISPATCH_ARCH_DEPEND_WAY(addr) \
-  asm volatile("jmp *%0;" : : "r" (addr))
+  asm volatile("jmp *%0;\t# -- inseted by vm.h\t[length = 2]" : : "r" (addr))
 
 #else
 #define DISPATCH_ARCH_DEPEND_WAY(addr) \


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

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