Author: mfursov
Date: Tue Sep 11 07:39:52 2007
New Revision: 574617
URL: http://svn.apache.org/viewvc?rev=574617&view=rev
Log:
Fix for HARMONY-4773 : [drlvm][jit][opt] Enabling of per-method locks in Jitrino.OPT compiler
Modified:
harmony/enhanced/drlvm/trunk/vm/include/open/vm.h
harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/client.emconf
harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/opt.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/jitrino/src/jet/compiler.cpp
harmony/enhanced/drlvm/trunk/vm/jitrino/src/main/Jitrino.cpp
harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.cpp
harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp
Modified: harmony/enhanced/drlvm/trunk/vm/include/open/vm.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/vm.h?rev=574617&r1=574616&r2=574617&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm.h Tue Sep 11 07:39:52 2007
@@ -561,6 +561,16 @@
*/
VMEXPORT Class_Handle method_get_class(Method_Handle mh);
+/*
+* Acquires lock associated with method
+*/
+VMEXPORT void method_lock(Method_Handle mh);
+
+/*
+* Releases lock associated with method
+*/
+VMEXPORT void method_unlock(Method_Handle mh);
+
/**
* @return <code>TRUE</code> if the method is private.
*/
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/client.emconf
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/client.emconf?rev=574617&r1=574616&r2=574617&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/client.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/client.emconf Tue Sep 11 07:39:52
2007
@@ -51,10 +51,10 @@
-XX:jit.JET_CLINIT.path=
-XX:jit.JET_DPGO.path=
--XX:jit.CD_OPT.path=opt_init,translator,optimizer,hir2lir,codegen
+-XX:jit.CD_OPT.path=opt_init,lock_method,translator,optimizer,hir2lir,codegen,unlock_method
-XX:jit.CD_OPT.path.optimizer=ssa,devirt,inline,purge,simplify,dce,uce,lazyexc,throwopt,memopt,simplify,dce,uce,lower,statprof,unroll,ssa,simplify,dce,uce,dessa,statprof
--XX:jit.CD_OPT.path.codegen=lock_method,bbp,btr,gcpoints,cafl,dce1,i8l,api_magic,early_prop,peephole,itrace-,native,constraints,dce2,regalloc,spillgen,copy,i586,layout,rce+,stack,break-,iprof-,peephole,emitter!,si_insts,gcmap,info,unlock_method
+-XX:jit.CD_OPT.path.codegen=bbp,btr,gcpoints,cafl,dce1,i8l,api_magic,early_prop,peephole,itrace-,native,constraints,dce2,regalloc,spillgen,copy,i586,layout,rce+,stack,break-,iprof-,peephole,emitter!,si_insts,gcmap,info
-XX:jit.CD_OPT.path.dce1=cg_dce
-XX:jit.CD_OPT.path.dce2=cg_dce
-XX:jit.CD_OPT.path.regalloc=bp_regalloc1,bp_regalloc2
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/opt.emconf
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/opt.emconf?rev=574617&r1=574616&r2=574617&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/opt.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/opt.emconf Tue Sep 11 07:39:52 2007
@@ -22,12 +22,10 @@
# Options to be passed to JIT
--XX:jit.arg.lazyResolution=on
-
--XX:jit.CS_OPT.path=opt_init,translator,optimizer,hir2lir,codegen
+-XX:jit.CS_OPT.path=opt_init,lock_method,translator,optimizer,hir2lir,codegen,unlock_method
-XX:jit.CS_OPT.path.optimizer=ssa,devirt,inline,purge,simplify,dce,uce,lazyexc,throwopt,escape,dce,uce,memopt,simplify,dce,uce,lower,statprof,unroll,ssa,simplify,dce,uce,dessa,statprof
--XX:jit.CS_OPT.path.codegen=lock_method,bbp,btr,gcpoints,cafl,dce1,i8l,api_magic,early_prop,peephole,itrace-,native,constraints,dce2,regalloc,spillgen,copy,i586,layout,rce+,stack,break-,iprof-,peephole,emitter!,si_insts,gcmap,info,unlock_method
+-XX:jit.CS_OPT.path.codegen=bbp,btr,gcpoints,cafl,dce1,i8l,api_magic,early_prop,peephole,itrace-,native,constraints,dce2,regalloc,spillgen,copy,i586,layout,rce+,stack,break-,iprof-,peephole,emitter!,si_insts,gcmap,info
-XX:jit.CS_OPT.path.dce1=cg_dce
-XX:jit.CS_OPT.path.dce2=cg_dce
-XX:jit.CS_OPT.path.regalloc=bp_regalloc1,bp_regalloc2
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=574617&r1=574616&r2=574617&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf Tue Sep 11 07:39:52
2007
@@ -53,11 +53,11 @@
-XDjit.RA3.path=webmaker,cg_regalloc
-XDjit.RA3.arg.webmaker.calc=true
--XX:jit.SD1_OPT.path=opt_init,translator,optimizer,hir2lir,codegen
+-XX:jit.SD1_OPT.path=opt_init,lock_method,translator,optimizer,hir2lir,codegen,unlock_method
-XX:jit.SD1_OPT.path.optimizer=ssa,simplify,dce,uce,vp_instrument,devirt_virtual,edge_instrument,dessa,statprof
-XX:jit.SD1_OPT.path.devirt_virtual=devirt
--XX:jit.SD1_OPT.path.codegen=lock_method,bbp,btr,gcpoints,cafl,dce1,i8l,api_magic,early_prop,peephole,itrace-,native,constraints,dce2,regalloc,spillgen,copy,i586,layout,rce+,stack,break-,iprof-,peephole,emitter!,si_insts,gcmap,info,unlock_method
+-XX:jit.SD1_OPT.path.codegen=bbp,btr,gcpoints,cafl,dce1,i8l,api_magic,early_prop,peephole,itrace-,native,constraints,dce2,regalloc,spillgen,copy,i586,layout,rce+,stack,break-,iprof-,peephole,emitter!,si_insts,gcmap,info
-XX:jit.SD1_OPT.path.dce1=cg_dce
-XX:jit.SD1_OPT.path.dce2=cg_dce
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=574617&r1=574616&r2=574617&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 Tue Sep 11 07:39:52
2007
@@ -22,10 +22,10 @@
# Options to be passed to JIT
--XX:jit.SS_OPT.path=opt_init,translator,optimizer,hir2lir,codegen
+-XX:jit.SS_OPT.path=opt_init,lock_method,translator,optimizer,hir2lir,codegen,unlock_method
-XX:jit.SS_OPT.path.optimizer=ssa,simplify,dce,uce,statprof,devirt,inline,purge,simplify,dce,uce,lazyexc,throwopt,statprof,hvn,dce,uce,dessa,statprof,peel,ssa,hvn,simplify,dce,uce,lower,dce,uce,unroll,ssa,simplify,dce,uce,memopt,reassoc,dce,uce,hvn,dce,uce,classic_abcd,dce,uce,gcm,dessa,statprof
--XX:jit.SS_OPT.path.codegen=lock_method,bbp,btr,gcpoints,cafl,dce1,i8l,api_magic,early_prop,peephole,itrace-,native,constraints,dce2,regalloc,spillgen,copy,i586,layout,rce+,stack,break-,iprof-,peephole,emitter!,si_insts,gcmap,info,unlock_method
+-XX:jit.SS_OPT.path.codegen=bbp,btr,gcpoints,cafl,dce1,i8l,api_magic,early_prop,peephole,itrace-,native,constraints,dce2,regalloc,spillgen,copy,i586,layout,rce+,stack,break-,iprof-,peephole,emitter!,si_insts,gcmap,info
-XX:jit.SS_OPT.path.dce1=cg_dce
-XX:jit.SS_OPT.path.dce2=cg_dce
-XX:jit.SS_OPT.path.regalloc=bp_regalloc1,bp_regalloc2
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp?rev=574617&r1=574616&r2=574617&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp Tue Sep 11 07:39:52 2007
@@ -50,15 +50,14 @@
#include "Jitrino.h"
#include "EMInterface.h"
#include "JITInstanceContext.h"
- /**
- * A lock used to protect method's data in multi-threaded compilation.
- * See VMInterface.h
- * CompilationInterface::lockMethodData/unlockMethodData for details.
- */
- extern Jitrino::Mutex g_compileLock;
-#else
- static Jitrino::Mutex g_compileLock;
#endif
+/**
+* A lock used to protect method's data in multi-threaded compilation.
+* See VMInterface.h
+* CompilationInterface::lockMethodData/unlockMethodData for details.
+*/
+static Jitrino::Mutex g_compileLock;
+
#include "../main/Log.h"
using Jitrino::Log;
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/main/Jitrino.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/main/Jitrino.cpp?rev=574617&r1=574616&r2=574617&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/main/Jitrino.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/main/Jitrino.cpp Tue Sep 11 07:39:52 2007
@@ -251,9 +251,6 @@
bool Jitrino::CompileMethod(CompilationContext* cc) {
CompilationInterface* compilationInterface = cc->getVMCompilationInterface();
-//#ifdef _IPF_ //IPF CG params are not safe -> add them to CompilationContext and remove
this lock
-// compilationInterface->lockMethodData();
-//#endif
bool success = false;
MethodDesc& methodDesc = *compilationInterface->getMethodToCompile();
initialize_parameters(cc, methodDesc);
@@ -264,9 +261,6 @@
} else {
success = compileMethod(cc);
}
-//#ifdef _IPF_
-// compilationInterface->unlockMethodData();
-//#endif
return success;
}
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.cpp?rev=574617&r1=574616&r2=574617&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.cpp Tue Sep 11
07:39:52 2007
@@ -131,8 +131,13 @@
flags.genMinMaxAbs = getBoolArg("genMinMaxAbs", false);
flags.genFMinMaxAbs = getBoolArg("genFMinMaxAbs", false);
-
- flags.lazyResolution = getBoolArg("lazyResolution", false);
+
+#ifdef _IA32_
+ bool defaultIsLazy = true;
+#else
+ bool defaultIsLazy = false;
+#endif
+ flags.lazyResolution = getBoolArg("lazyResolution", defaultIsLazy);
flags.assertOnRecursion = getBoolArg("assertOnRecursion", flags.lazyResolution);
}
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp?rev=574617&r1=574616&r2=574617&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp Tue Sep 11 07:39:52
2007
@@ -36,11 +36,6 @@
#include "mkernel.h"
#include "VMMagic.h"
-/**
-* @brief A lock used to protect method's data in multi-threaded compilation.
-*/
-Jitrino::Mutex g_compileLock;
-
namespace Jitrino {
@@ -793,9 +788,17 @@
flushToZeroAllowed = false;
}
-void CompilationInterface::lockMethodData(void) { g_compileLock.lock(); }
+void CompilationInterface::lockMethodData(void) {
+ assert(methodToCompile);
+ Method_Handle mh = methodToCompile->getMethodHandle();
+ method_lock(mh);
+}
-void CompilationInterface::unlockMethodData(void) { g_compileLock.unlock(); }
+void CompilationInterface::unlockMethodData(void) {
+ assert(methodToCompile);
+ Method_Handle mh = methodToCompile->getMethodHandle();
+ method_unlock(mh);
+}
Byte* CompilationInterface::allocateCodeBlock(size_t size, size_t alignment, CodeBlockHeat
heat, int32 id,
bool simulate) {
Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp?rev=574617&r1=574616&r2=574617&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp Tue Sep 11 07:39:52
2007
@@ -467,6 +467,17 @@
return ((Method *)m)->get_class();
}
+void method_lock(Method_Handle m)
+{
+ assert(m);
+ return ((Method *)m)->lock();
+}
+
+void method_unlock(Method_Handle m)
+{
+ assert(m);
+ return ((Method *)m)->unlock();
+}
Java_Type method_get_return_type(Method_Handle m)
|