You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by py...@apache.org on 2006/10/20 17:22:59 UTC
svn commit: r466148 - in /incubator/harmony/enhanced/drlvm/trunk:
build/make/ build/make/components/vm/ vm/em/src/ vm/interpreter/
vm/jitrino/config/em64t/ vm/jitrino/config/ia32/
Author: pyang
Date: Fri Oct 20 08:22:55 2006
New Revision: 466148
URL: http://svn.apache.org/viewvc?view=rev&rev=466148
Log:
Apply patch for HARMONY-1902 ([drlvm] java.compiler property support)
Added:
incubator/harmony/enhanced/drlvm/trunk/vm/interpreter/interpreter.emconf
Modified:
incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm/interpreter.xml
incubator/harmony/enhanced/drlvm/trunk/build/make/deploy.xml
incubator/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp
incubator/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.h
incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/client.emconf
incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/jet.emconf
incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/opt.emconf
incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf
incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server_static.emconf
incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/ti.emconf
incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/client.emconf
incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/jet.emconf
incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/opt.emconf
incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf
incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf
incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/ti.emconf
Modified: incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm/interpreter.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm/interpreter.xml?view=diff&rev=466148&r1=466147&r2=466148
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm/interpreter.xml (original)
+++ incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm/interpreter.xml Fri Oct 20 08:22:55 2006
@@ -162,5 +162,17 @@
<libset libs="${vm.vmcore.lib}" dir="${vm.vmcore.libdir}" />
<libset libs="${vm.hythr.lib}" dir="${vm.hythr.libdir}" />
</linker>
+
+ <echo message="Copying the configuration interpreter files..."/>
+
+ <mkdir dir="${build.semi.dir}/vm/interpreter/_other"/>
+ <copy todir="${build.semi.dir}/vm/interpreter/_other"
+ flatten="true"
+ includeEmptyDirs="false">
+ <fileset dir="${build.VM.home}/interpreter">
+ <include name="interpreter.emconf" />
+ </fileset>
+ </copy>
+
</target>
</project>
Modified: incubator/harmony/enhanced/drlvm/trunk/build/make/deploy.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/build/make/deploy.xml?view=diff&rev=466148&r1=466147&r2=466148
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/build/make/deploy.xml (original)
+++ incubator/harmony/enhanced/drlvm/trunk/build/make/deploy.xml Fri Oct 20 08:22:55 2006
@@ -39,6 +39,7 @@
<interpreter>
<shared>bin/default:interpreter</shared>
+ <other>bin/default:*</other>
</interpreter>
<jitrino>
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp?view=diff&rev=466148&r1=466147&r2=466148
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp Fri Oct 20 08:22:55 2006
@@ -36,7 +36,6 @@
#include <fstream>
-#define DEFAULT_INTERPRETER_DLL "interpreter"
#define LOG_DOMAIN "em"
#define EDGE_PROFILER_STR "EDGE_PROFILER"
@@ -95,14 +94,15 @@
-RStep::RStep(JIT_Handle _jit, const std::string& _jitName, RChain* _chain)
-: jit(_jit), jitName(_jitName), catName(std::string(LOG_DOMAIN)+"."+_jitName), chain(_chain), loggingEnabled(false), enable_profiling(NULL)
+RStep::RStep(JIT_Handle _jit, const std::string& _jitName, RChain* _chain, apr_dso_handle_t* _libHandle)
+: jit(_jit), jitName(_jitName), catName(std::string(LOG_DOMAIN)+"."+_jitName),
+chain(_chain), loggingEnabled(false), enable_profiling(NULL),
+libHandle(_libHandle)
{}
//todo!! replace inlined strings with defines!!
-DrlEMImpl::DrlEMImpl() : jh(NULL), _execute_method(NULL),
- interpreterMode(false), jitTiMode(false) {
+DrlEMImpl::DrlEMImpl() : jh(NULL), _execute_method(NULL) {
nMethodsCompiled=0;
nMethodsRecompiled=0;
tick=0;
@@ -316,17 +316,18 @@
std::string DrlEMImpl::readConfiguration() {
std::string configFileName = vm_get_property_value("em.properties");
if (configFileName.empty()) {
- configFileName = jitTiMode ? "ti" : "client";
+ bool jitTiMode = vm_get_property_value_boolean("vm.jvmti.enabled", false);
+ bool interpreterMode = vm_get_boolean_property_value_with_default("vm.use_interpreter");
+ configFileName = interpreterMode ? "interpreter" : (jitTiMode ? "ti" : "client");
}
- if (!endsWith(configFileName, EM_CONFIG_EXT)) {
- configFileName = configFileName+EM_CONFIG_EXT;
- }
+ if (!endsWith(configFileName, EM_CONFIG_EXT)) {
+ configFileName = configFileName+EM_CONFIG_EXT;
+ }
- if (configFileName.find('/') == configFileName.npos && configFileName.find('\\') == configFileName.npos ) {
-// $$$ GMJ std::string defaultConfigDir = vm_get_property_value("vm.boot.library.path");
- std::string defaultConfigDir = vm_get_property_value("org.apache.harmony.vm.vmdir");
- configFileName = defaultConfigDir + "/" + configFileName;
- }
+ if (configFileName.find('/') == configFileName.npos && configFileName.find('\\') == configFileName.npos ) {
+ std::string defaultConfigDir = vm_get_property_value("org.apache.harmony.vm.vmdir");
+ configFileName = defaultConfigDir + "/" + configFileName;
+ }
std::string config = readFile(configFileName);
return config;
}
@@ -335,28 +336,6 @@
// EM initialization methods
bool DrlEMImpl::init() {
- interpreterMode = vm_get_boolean_property_value_with_default("vm.use_interpreter");
- jitTiMode = vm_get_property_value_boolean("vm.jvmti.enabled", false);
- if (interpreterMode) {
- apr_dso_handle_t* libHandle;
- std::string interpreterLib = prepareLibPath(DEFAULT_INTERPRETER_DLL);
- jh = vm_load_jit(interpreterLib.c_str(), &libHandle);
-
- if (jh == NULL) {
- ECHO(("EM: Can't load EE library:" + interpreterLib).c_str());
- return false;
- }
- apr_dso_handle_sym_t fn = NULL;
- apr_dso_sym(&fn, libHandle, "JIT_execute_method");
- _execute_method = (void(*)(JIT_Handle,jmethodID, jvalue*, jvalue*)) fn;
- if (_execute_method==NULL) {
- ECHO(("EM: Not a EE shared library: '" + std::string(interpreterLib) + "'").c_str());
- return false;
- }
- RStep step(jh, "interpreter", NULL);
- return initJIT(interpreterLib, libHandle, step);
- }
- //normal mode with recompilation chains..
_execute_method = JIT_execute_method_default;
std::string config = readConfiguration();
if (!config.empty()) {
@@ -440,7 +419,7 @@
failed = true;
break;
}
- RStep* step = new RStep(jh, jitName, chain);
+ RStep* step = new RStep(jh, jitName, chain, libHandle);
step->loggingEnabled = loggingEnabled || is_info_enabled(step->catName.c_str());
chain->steps.push_back(step);
@@ -474,6 +453,24 @@
}
}
}
+
+ //The next lines do the following:
+ //If we have only 1 execution engine in CFG - check if it have JIT_execute_method
+ //This way interpreter mode is supported today.
+ //This code must be refactored when mixed (JIT/interpreter) mode is implemented
+ if (!failed && chains.size()==1) {
+ RChain* chain = *chains.begin();
+ assert(chain->steps.size() > 0);
+ RStep* step = *chain->steps.begin();
+
+ apr_dso_handle_sym_t fn = NULL;
+ apr_dso_sym(&fn, step->libHandle, "JIT_execute_method");
+ if (fn!=NULL) {
+ _execute_method = (void(*)(JIT_Handle,jmethodID, jvalue*, jvalue*)) fn;
+ }
+ }
+
+
if (failed) {
deallocateResources();
}
@@ -767,5 +764,6 @@
int DrlEMImpl::getTbsTimeout() const {
return 100;
}
+
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.h
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.h?view=diff&rev=466148&r1=466147&r2=466148
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.h (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.h Fri Oct 20 08:22:55 2006
@@ -45,13 +45,14 @@
/** Recompilation step. One recompilation chain can have 1 or more recompilation steps */
class RStep {
public:
- RStep(JIT_Handle _jit, const std::string& _jitName, RChain* _chain);
+ RStep(JIT_Handle _jit, const std::string& _jitName, RChain* _chain, apr_dso_handle_t* _libHandle);
virtual ~RStep(){}
JIT_Handle jit;
std::string jitName, catName;
RChain* chain;
bool loggingEnabled;
+ apr_dso_handle_t* libHandle;
bool (*enable_profiling)(JIT_Handle, PC_Handle, EM_JIT_PC_Role);
};
@@ -117,8 +118,6 @@
JIT_Handle jh;
void (*_execute_method) (JIT_Handle jit, jmethodID method, jvalue *return_value, jvalue *args);
- bool interpreterMode;
- bool jitTiMode;
RChains chains;
size_t nMethodsCompiled, nMethodsRecompiled;
Added: incubator/harmony/enhanced/drlvm/trunk/vm/interpreter/interpreter.emconf
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/interpreter/interpreter.emconf?view=auto&rev=466148
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/interpreter/interpreter.emconf (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/interpreter/interpreter.emconf Fri Oct 20 08:22:55 2006
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# EM configuration file for Interpreter-only mode of VM
+
+chains=chain1
+chain1.jits=int
+
+int.file=interpreter
+
+
+#system properties
+-Djava.compiler=interpreter
+-Dvm.use_interpreter=true
\ No newline at end of file
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/client.emconf
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/client.emconf?view=diff&rev=466148&r1=466147&r2=466148
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/client.emconf (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/client.emconf Fri Oct 20 08:22:55 2006
@@ -69,3 +69,7 @@
-Djit.CD_OPT.arg.codegen.dce1.early=yes
-Djit.CD_OPT.arg.codegen.regalloc.bp_regalloc1.regs=ALL_GP
-Djit.CD_OPT.arg.codegen.regalloc.bp_regalloc2.regs=ALL_XMM
+
+
+#system properties
+-Djava.compiler=client
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/jet.emconf
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/jet.emconf?view=diff&rev=466148&r1=466147&r2=466148
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/jet.emconf (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/jet.emconf Fri Oct 20 08:22:55 2006
@@ -21,3 +21,7 @@
#JIT options
-Djit.JET.path=
+
+
+#system properties
+-Djava.compiler=jet
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/opt.emconf
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/opt.emconf?view=diff&rev=466148&r1=466147&r2=466148
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/opt.emconf (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/opt.emconf Fri Oct 20 08:22:55 2006
@@ -41,3 +41,7 @@
-Djit.CS_OPT.arg.codegen.dce1.early=yes
-Djit.CS_OPT.arg.codegen.regalloc.bp_regalloc1.regs=ALL_GP
-Djit.CS_OPT.arg.codegen.regalloc.bp_regalloc2.regs=ALL_XMM
+
+
+#system properties
+-Djava.compiler=client static
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf?view=diff&rev=466148&r1=466147&r2=466148
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf Fri Oct 20 08:22:55 2006
@@ -76,3 +76,7 @@
-Djit.SD2_OPT.arg.codegen.dce1.early=yes
-Djit.SD2_OPT.arg.codegen.regalloc.bp_regalloc1.regs=ALL_GP
-Djit.SD2_OPT.arg.codegen.regalloc.bp_regalloc2.regs=ALL_XMM
+
+
+#system properties
+-Djava.compiler=server
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server_static.emconf
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server_static.emconf?view=diff&rev=466148&r1=466147&r2=466148
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server_static.emconf (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server_static.emconf Fri Oct 20 08:22:55 2006
@@ -40,3 +40,7 @@
-Djit.SS_OPT.arg.codegen.dce1.early=yes
-Djit.SS_OPT.arg.codegen.regalloc.bp_regalloc1.regs=ALL_GP
-Djit.SS_OPT.arg.codegen.regalloc.bp_regalloc2.regs=ALL_XMM
+
+
+#system properties
+-Djava.compiler=server static
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/ti.emconf
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/ti.emconf?view=diff&rev=466148&r1=466147&r2=466148
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/ti.emconf (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/ti.emconf Fri Oct 20 08:22:55 2006
@@ -21,3 +21,6 @@
#JIT options
-Djit.JET_TI.path=
+
+#system properties
+-Djava.compiler=jet ti
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/client.emconf
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/client.emconf?view=diff&rev=466148&r1=466147&r2=466148
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/client.emconf (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/client.emconf Fri Oct 20 08:22:55 2006
@@ -69,3 +69,7 @@
-Djit.CD_OPT.arg.codegen.dce1.early=yes
-Djit.CD_OPT.arg.codegen.regalloc.bp_regalloc1.regs=ALL_GP
-Djit.CD_OPT.arg.codegen.regalloc.bp_regalloc2.regs=ALL_XMM
+
+
+#system properties
+-Djava.compiler=client
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/jet.emconf
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/jet.emconf?view=diff&rev=466148&r1=466147&r2=466148
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/jet.emconf (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/jet.emconf Fri Oct 20 08:22:55 2006
@@ -22,3 +22,6 @@
# Options to be passed to JIT
-Djit.JET.path=
+
+#system properties
+-Djava.compiler=jet
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/opt.emconf
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/opt.emconf?view=diff&rev=466148&r1=466147&r2=466148
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/opt.emconf (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/opt.emconf Fri Oct 20 08:22:55 2006
@@ -44,3 +44,7 @@
#-Djit.CS_OPT.arg.log.irdump.file=log/%jit%/%log%/%seqnb%_%class%.%method%.log
#-Djit.CS_OPT.arg.log=ct,ir,irdump,all
+
+
+#system properties
+-Djava.compiler=client static
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf?view=diff&rev=466148&r1=466147&r2=466148
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf Fri Oct 20 08:22:55 2006
@@ -74,3 +74,7 @@
-Djit.SD2_OPT.arg.codegen.dce1.early=yes
-Djit.SD2_OPT.arg.codegen.regalloc.bp_regalloc1.regs=ALL_GP
-Djit.SD2_OPT.arg.codegen.regalloc.bp_regalloc2.regs=ALL_XMM
+
+
+#system properties
+-Djava.compiler=server
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf?view=diff&rev=466148&r1=466147&r2=466148
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf Fri Oct 20 08:22:55 2006
@@ -40,3 +40,7 @@
-Djit.SS_OPT.arg.codegen.dce1.early=yes
-Djit.SS_OPT.arg.codegen.regalloc.bp_regalloc1.regs=ALL_GP
-Djit.SS_OPT.arg.codegen.regalloc.bp_regalloc2.regs=ALL_XMM
+
+
+#system properties
+-Djava.compiler=server static
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/ti.emconf
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/ti.emconf?view=diff&rev=466148&r1=466147&r2=466148
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/ti.emconf (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/ti.emconf Fri Oct 20 08:22:55 2006
@@ -21,3 +21,7 @@
#JIT options
-Djit.JET_TI.path=
+
+
+#system properties
+-Djava.compiler=jet ti