You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by va...@apache.org on 2008/02/08 07:14:18 UTC

svn commit: r619775 - in /harmony/enhanced/drlvm/trunk/vm: jitrino/config/em64t/ jitrino/config/ia32/ vmcore/src/jit/ vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/

Author: varlax
Date: Thu Feb  7 22:14:16 2008
New Revision: 619775

URL: http://svn.apache.org/viewvc?rev=619775&view=rev
Log:
Applied HARMONY-5464 [drlvm] vm helper improvement for better performance

Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf
    harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server_static.emconf
    harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf
    harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelperFastPath.java

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?rev=619775&r1=619774&r2=619775&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf Thu Feb  7 22:14:16 2008
@@ -77,7 +77,7 @@
 #enable profiling of all virtual calls
 -XX:jit.SD1_OPT.arg.optimizer.vp_instrument.profile_abstract=true
 
--XX:jit.SD2_OPT.path.optimizer=ssa,simplify,dce,uce,devirt_virtual,edge_annotate,unguard,devirt_intf,hlo_api_magic,inline,purge,simplify,dce,uce,osr_path-,escape_path,dce,uce,hvn,dce,uce,inline_helpers,purge,simplify,uce,dce,uce,abce,lower,dce,uce,memopt,reassoc,dce,uce,hvn,dce,uce,gcm,dessa,statprof
+-XX:jit.SD2_OPT.path.optimizer=ssa,simplify,dce,uce,devirt_virtual,edge_annotate,unguard,devirt_intf,hlo_api_magic,inline,purge,simplify,dce,uce,osr_path,escape_path,dce,uce,hvn,dce,uce,inline_helpers,purge,simplify,uce,dce,uce,abce,lower,dce,uce,memopt,reassoc,dce,uce,hvn,dce,uce,gcm,dessa,statprof
 -XX:jit.SD2_OPT.path.osr_path=gcm,osr,simplify,dce,uce
 -XX:jit.SD2_OPT.path.escape_path=hvn,simplify,dce,uce,escape
 -XX:jit.SD2_OPT.path.abce=classic_abcd,dce,uce,dessa,statprof,peel,ssa,hvn,simplify,dce,uce,memopt,dce,uce,dessa,fastArrayFill,ssa,statprof,dabce,dce,uce

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server_static.emconf
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server_static.emconf?rev=619775&r1=619774&r2=619775&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server_static.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server_static.emconf Thu Feb  7 22:14:16 2008
@@ -32,7 +32,7 @@
 
 -XX:jit.SS_OPT.path=opt_init,translator,optimizer,hir2lir,codegen
 
--XX:jit.SS_OPT.path.optimizer=ssa,simplify,dce,uce,statprof,devirt_virtual,unguard,devirt_intf,hlo_api_magic,inline,purge,simplify,dce,uce,osr_path-,escape_path,dce,uce,hvn,dce,uce,inline_helpers-,purge,simplify,uce,dce,uce,abce,lower,dce,uce,memopt,reassoc,dce,uce,hvn,dce,uce,gcm,dessa,statprof
+-XX:jit.SS_OPT.path.optimizer=ssa,simplify,dce,uce,statprof,devirt_virtual,unguard,devirt_intf,hlo_api_magic,inline,purge,simplify,dce,uce,osr_path,escape_path,dce,uce,hvn,dce,uce,inline_helpers-,purge,simplify,uce,dce,uce,abce,lower,dce,uce,memopt,reassoc,dce,uce,hvn,dce,uce,gcm,dessa,statprof
 -XX:jit.SS_OPT.path.osr_path=gcm,osr,simplify,dce,uce
 -XX:jit.SS_OPT.path.escape_path=hvn,simplify,dce,uce,escape
 -XX:jit.SS_OPT.path.abce=classic_abcd,dce,uce,dessa,statprof,peel,ssa,hvn,simplify,dce,uce,memopt,dce,uce,dessa,fastArrayFill,ssa,statprof,dabce,dce,uce

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?rev=619775&r1=619774&r2=619775&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf Thu Feb  7 22:14:16 2008
@@ -79,7 +79,7 @@
 
 -XX:jit.SD2_OPT.path=opt_init,translator,optimizer,hir2lir,codegen
 
--XX:jit.SD2_OPT.path.optimizer=ssa,simplify,dce,uce,devirt_virtual,edge_annotate,unguard,devirt_intf,hlo_api_magic,inline,purge,simplify,dce,uce,osr_path-,lazyexc,throwopt,escape_path,inline_helpers,purge,simplify,uce,dce,uce,abce,lower,dce,uce,statprof,unroll,ssa,simplify,dce,uce,memopt,reassoc,dce,uce,hvn,dce,uce,gcm,dessa,statprof
+-XX:jit.SD2_OPT.path.optimizer=ssa,simplify,dce,uce,devirt_virtual,edge_annotate,unguard,devirt_intf,hlo_api_magic,inline,purge,simplify,dce,uce,osr_path,lazyexc,throwopt,escape_path,inline_helpers,purge,simplify,uce,dce,uce,abce,lower,dce,uce,statprof,unroll,ssa,simplify,dce,uce,memopt,reassoc,dce,uce,hvn,dce,uce,gcm,dessa,statprof
 -XX:jit.SD2_OPT.path.osr_path=gcm,osr,simplify,dce,uce
 -XX:jit.SD2_OPT.path.escape_path=hvn,simplify,dce,uce,escape
 -XX:jit.SD2_OPT.path.abce=classic_abcd,dce,uce,dessa,statprof,peel,ssa,hvn,simplify,dce,uce,memopt,dce,uce,dessa,fastArrayFill,ssa,statprof,dabce,dce,uce

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf?rev=619775&r1=619774&r2=619775&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf Thu Feb  7 22:14:16 2008
@@ -32,7 +32,7 @@
 
 -XX:jit.SS_OPT.path=opt_init,translator,optimizer,hir2lir,codegen
 
--XX:jit.SS_OPT.path.optimizer=ssa,simplify,dce,uce,devirt_virtual,statprof,unguard,devirt_intf,hlo_api_magic,inline,purge,simplify,dce,uce,osr_path-,lazyexc,throwopt,escape_path,inline_helpers-,purge,simplify,uce,dce,uce,abce,lower,dce,uce,statprof,unroll,ssa,simplify,dce,uce,memopt,reassoc,dce,uce,hvn,dce,uce,gcm,dessa,statprof
+-XX:jit.SS_OPT.path.optimizer=ssa,simplify,dce,uce,devirt_virtual,statprof,unguard,devirt_intf,hlo_api_magic,inline,purge,simplify,dce,uce,osr_path,lazyexc,throwopt,escape_path,inline_helpers-,purge,simplify,uce,dce,uce,abce,lower,dce,uce,statprof,unroll,ssa,simplify,dce,uce,memopt,reassoc,dce,uce,hvn,dce,uce,gcm,dessa,statprof
 -XX:jit.SS_OPT.path.osr_path=gcm,osr,simplify,dce,uce
 -XX:jit.SS_OPT.path.escape_path=hvn,simplify,dce,uce,escape
 -XX:jit.SS_OPT.path.abce=classic_abcd,dce,uce,dessa,statprof,peel,ssa,hvn,simplify,dce,uce,memopt,dce,uce,dessa,fastArrayFill,ssa,statprof,dabce,dce,uce

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp?rev=619775&r1=619774&r2=619775&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp Thu Feb  7 22:14:16 2008
@@ -2223,7 +2223,15 @@
 
     Global_Env* env = VM_Global_State::loader_env;
     if (obj == NULL) {
-        exn_throw_by_class(env->java_lang_NullPointerException_Class);
+
+    //Returning zero address and not generating NPE if the object is null 
+    //is safe in terms of preserving program semantics(the exception will be generated 
+    //on the first method invocation) and
+    //allows profitable code transformations such as hoisting vm helper outside the loop body 
+    //This is our current convention which touches all variants of this helper, 
+    //If it changes, all variants must be fixed. 
+            
+        //exn_throw_by_class(env->java_lang_NullPointerException_Class);
         return NULL;
     }
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelperFastPath.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelperFastPath.java?rev=619775&r1=619774&r2=619775&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelperFastPath.java (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelperFastPath.java Thu Feb  7 22:14:16 2008
@@ -42,6 +42,17 @@
 
     @Inline
     public static Address getInterfaceVTable3(Address intfType, Object obj)  {
+        
+        //Returning zero address if the object is null 
+        //is safe in terms of preserving program semantics(the exception will be generated on the first method invocation) and
+        //allows profitable code transformations such as hoisting vm helper outside the loop body.
+        //This is our current convention which touches all variants of this helper, 
+        //If it changes, all variants must be fixed. 
+            
+        if(obj==null){
+                return Address.zero();
+        }
+            
         Address vtableAddr = VMHelper.getVTable(obj);
 
         Address inf0Type = vtableAddr.loadAddress(Offset.fromIntZeroExtend(CLASS_INF_TYPE_0_OFFSET));