harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r518565 [1/3] - in /harmony/enhanced/drlvm/trunk: src/test/microbenchmark/harmony-2874/ vm/jitrino/config/em64t/ vm/jitrino/config/ia32/ vm/jitrino/src/optimizer/
Date Thu, 15 Mar 2007 10:27:24 GMT
Author: varlax
Date: Thu Mar 15 03:27:22 2007
New Revision: 518565

URL: http://svn.apache.org/viewvc?view=rev&rev=518565
Log:
Applied HARMONY-2874 [drlvm][jit] Scalar replacement implementation
Observed 3-4 times boost on the microbenchmarks on both ia32 and x64.
The optimization is ON by default for server mode on both platforms 

Added:
    harmony/enhanced/drlvm/trunk/src/test/microbenchmark/harmony-2874/
    harmony/enhanced/drlvm/trunk/src/test/microbenchmark/harmony-2874/test0.java
    harmony/enhanced/drlvm/trunk/src/test/microbenchmark/harmony-2874/test1.java
    harmony/enhanced/drlvm/trunk/src/test/microbenchmark/harmony-2874/test2.java
Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf
    harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.h

Added: harmony/enhanced/drlvm/trunk/src/test/microbenchmark/harmony-2874/test0.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/microbenchmark/harmony-2874/test0.java?view=auto&rev=518565
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/microbenchmark/harmony-2874/test0.java (added)
+++ harmony/enhanced/drlvm/trunk/src/test/microbenchmark/harmony-2874/test0.java Thu Mar 15
03:27:22 2007
@@ -0,0 +1,35 @@
+/**
+ * Microbenchmark on scalar replacement optimization (final method test).
+ * To see the effect, tests need to be run with the following switches:
+ * -Xem:server -XX:jit.SD2_OPT.arg.optimizer.escape=on
+ * -Xem:server -XX:jit.SD2_OPT.arg.optimizer.escape=off
+ */
+class Cls0 {
+    private long num;
+    public Cls0() { num = 0; }
+    public final void inc(Integer i) { num= i+1; }
+    public long getNum() { return num; }
+    public void reset() { num = 0; }
+}
+
+public class test0 {  
+    static final long limit = 100000000;
+    static Cls0 obj = new Cls0();
+
+    public static void main(String[] args) {
+        long before = 0, after = 0;
+        for (int i = 0; i < 5; i++) {    
+            obj.reset();
+            before = System.currentTimeMillis();
+            for (long k = 0; k < limit; k++ ) {
+                dofc(k);
+            }
+            after = System.currentTimeMillis();
+            System.out.println("Calls per millisecond: " + (obj.getNum() / (after - before)));
+        }
+    }
+    static void dofc(long i) {
+        Integer i1 = new Integer((int)i);
+        obj.inc(i1);
+    }
+}

Added: harmony/enhanced/drlvm/trunk/src/test/microbenchmark/harmony-2874/test1.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/microbenchmark/harmony-2874/test1.java?view=auto&rev=518565
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/microbenchmark/harmony-2874/test1.java (added)
+++ harmony/enhanced/drlvm/trunk/src/test/microbenchmark/harmony-2874/test1.java Thu Mar 15
03:27:22 2007
@@ -0,0 +1,36 @@
+/**
+ * Microbenchmark on scalar replacement optimization (virtual method test).
+ * To see the effect, tests need to be run with the following switches:
+ * -Xem:server -XX:jit.SD2_OPT.arg.optimizer.escape=on
+ * -Xem:server -XX:jit.SD2_OPT.arg.optimizer.escape=off
+ */
+
+class Cls1 { 
+    private long num;
+    public Cls1() { num = 0; }
+    public void inc(Integer i) { num= i+1; }
+    public long getNum() { return num; }
+    public void reset() { num = 0; }
+}
+
+public class test1 {
+    static final long limit = 100000000;
+    static Cls1 obj = new Cls1();
+
+    public static void main(String[] args) {
+        long before = 0, after = 0;
+        for (int i = 0; i < 5; i++) {    
+            obj.reset();
+            before = System.currentTimeMillis();
+            for (long k = 0; k < limit; k++ ) {
+                dovc(k);
+            }
+            after = System.currentTimeMillis();
+            System.out.println("Calls per millisecond: " + (obj.getNum() / (after - before)));
+        }
+    }  
+    static void dovc(long i) {
+        Integer i1 = new Integer((int)i);
+        obj.inc(i1);
+    }
+}

Added: harmony/enhanced/drlvm/trunk/src/test/microbenchmark/harmony-2874/test2.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/microbenchmark/harmony-2874/test2.java?view=auto&rev=518565
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/microbenchmark/harmony-2874/test2.java (added)
+++ harmony/enhanced/drlvm/trunk/src/test/microbenchmark/harmony-2874/test2.java Thu Mar 15
03:27:22 2007
@@ -0,0 +1,42 @@
+/**
+ * Microbenchmark on scalar replacement optimization (interface method test).
+ * To see the effect, tests need to be run with the following switches:
+ * -Xem:server -XX:jit.SD2_OPT.arg.optimizer.escape=on
+ * -Xem:server -XX:jit.SD2_OPT.arg.optimizer.escape=off
+ */
+
+interface Intf2 {
+    public void inc(Integer i) ;
+    public long getNum();
+    public void reset();
+}
+
+class Cls2 implements Intf2 {
+    private long num;
+    public Cls2() { num = 0; }
+    public void inc(Integer i) { num= i+1; }
+    public long getNum() { return num; }
+    public void reset() { num = 0; }
+}
+
+public class test2 {  
+    static final long limit = 100000000;
+    static Intf2 obj = new Cls2();
+
+    public static void main(String[] args) {
+        long before = 0, after = 0;
+        for (int i = 0; i < 5; i++) {    
+            obj.reset();
+            before = System.currentTimeMillis();
+            for (long k = 0; k < limit; k++ ) {
+                doic(k);
+            }
+            after = System.currentTimeMillis();
+            System.out.println("Calls per millisecond: " + (obj.getNum() / (after - before)));
+        }
+    }
+    static void doic(long i) {
+        Integer i1 = new Integer((int)i);
+        obj.inc(i1);
+    }
+}

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf?view=diff&rev=518565&r1=518564&r2=518565
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf Thu Mar 15 03:27:22
2007
@@ -62,7 +62,7 @@
 
 -XDjit.SD2_OPT.path=opt_init,translator,optimizer,hir2lir,codegen
 
--XDjit.SD2_OPT.path.optimizer=ssa,simplify,dce,uce,devirt_virtual,edge_annotate,unguard,devirt_intf,inline,uce,purge,simplify,dce,uce,so2-,simplify,dce,uce,hvn,dce,uce,dessa,statprof,peel,ssa,hvn,simplify,dce,uce,lower,dce,uce,memopt,reassoc,dce,uce,hvn,dce,uce,abcd,dce,uce,gcm,dessa,statprof,markglobals
+-XDjit.SD2_OPT.path.optimizer=ssa,simplify,dce,uce,devirt_virtual,edge_annotate,unguard,devirt_intf,inline,uce,purge,simplify,dce,uce,so2-,simplify,dce,uce,escape,hvn,dce,uce,dessa,statprof,peel,ssa,hvn,simplify,dce,uce,lower,dce,uce,memopt,reassoc,dce,uce,hvn,dce,uce,abcd,dce,uce,gcm,dessa,statprof,markglobals
 -XDjit.SD2_OPT.path.codegen=lock_method,bbp,gcpoints,cafl,dce1,i8l-,early_prop-,itrace-,native,constraints,dce2,regalloc,spillgen,layout,copy,rce-,stack,break-,iprof-,emitter!,si_insts,gcmap,info,unlock_method
 -XDjit.SD2_OPT.path.dce1=cg_dce
 -XDjit.SD2_OPT.path.dce2=cg_dce

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf?view=diff&rev=518565&r1=518564&r2=518565
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf Thu Mar 15 03:27:22
2007
@@ -63,7 +63,7 @@
 
 -XDjit.SD2_OPT.path=opt_init,translator,optimizer,hir2lir,codegen
 
--XDjit.SD2_OPT.path.optimizer=ssa,simplify,dce,uce,devirt_virtual,edge_annotate,unguard,devirt_intf,inline,uce,purge,simplify,dce,uce,lazyexc,so2-,simplify,dce,uce,inline_helpers,purge,simplify,uce,dce,dessa,statprof,peel,ssa,hvn,simplify,dce,uce,lower,dce,uce,memopt,reassoc,dce,uce,hvn,dce,uce,abcd,dce,uce,gcm,dessa,statprof,markglobals
+-XDjit.SD2_OPT.path.optimizer=ssa,simplify,dce,uce,devirt_virtual,edge_annotate,unguard,devirt_intf,inline,uce,purge,simplify,dce,uce,lazyexc,so2-,simplify,dce,uce,escape,inline_helpers,purge,simplify,uce,dce,dessa,statprof,peel,ssa,hvn,simplify,dce,uce,lower,dce,uce,memopt,reassoc,dce,uce,hvn,dce,uce,abcd,dce,uce,gcm,dessa,statprof,markglobals
 -XDjit.SD2_OPT.path.codegen=lock_method,bbp,btr,gcpoints,cafl,dce1,i8l,api_magic,early_prop,peephole,itrace-,native,constraints,dce2,regalloc,spillgen,layout,copy,rce+,stack,break-,iprof-,peephole,emitter!,si_insts,gcmap,info,unlock_method
 -XDjit.SD2_OPT.path.dce1=cg_dce
 -XDjit.SD2_OPT.path.dce2=cg_dce



Mime
View raw message