changeset in /hg/icedtea6: PR icedtea/353
Xerxes R?nby
xerxes at zafena.se
Tue Jun 23 03:37:20 PDT 2009
changeset fbfa0d5fa7d3 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=fbfa0d5fa7d3
description:
PR icedtea/353
* ports/hotspot/src/share/vm/shark/llvmHeaders.hpp
Include llvm/Support/Threading.h and llvm/Target/TargetSelect.h
used by llvm_start_multithreaded() and InitializeNativeTarget()
when llvm version are 2.6 or later.
* ports/hotspot/src/share/vm/shark/llvmValue.hpp
(jfloat_constant): Return llvm::Constant* when llvm
version are 2.6 or later to handle llvm r73431 API change.
(jdouble_constant): Likewise.
* ports/hotspot/src/share/vm/shark/sharkBlock.cpp
(SharkBlock::parse_bytecode): Updated to use CreateFAdd
CreateFSub, CreateFMul and CreateFNeg for jfloat and jdouble
when llvm version are 2.6 or later.
* ports/hotspot/src/share/vm/shark/sharkCompiler.cpp
(SharkCompiler::SharkCompiler): Call InitializeNativeTarget() to
link in native target when llvm version are 2.6 or later.
* ports/hotspot/src/share/vm/shark/sharkFunction.cpp
(SharkFunction::initialize): Call llvm_start_multithreaded() to
initialize llvm mutex guards when llvm version are 2.6 or later.
diffstat:
6 files changed, 78 insertions(+)
ChangeLog | 22 +++++++++++++
ports/hotspot/src/share/vm/shark/llvmHeaders.hpp | 4 ++
ports/hotspot/src/share/vm/shark/llvmValue.hpp | 8 +++++
ports/hotspot/src/share/vm/shark/sharkBlock.cpp | 32 ++++++++++++++++++++
ports/hotspot/src/share/vm/shark/sharkCompiler.cpp | 6 +++
ports/hotspot/src/share/vm/shark/sharkFunction.cpp | 6 +++
diffs (188 lines):
diff -r 0d70559fe534 -r fbfa0d5fa7d3 ChangeLog
--- a/ChangeLog Fri Jun 19 11:59:37 2009 -0400
+++ b/ChangeLog Tue Jun 23 12:40:50 2009 +0200
@@ -1,3 +1,25 @@ 2009-06-19 Lillian Angel <langel at redha
+2009-06-23 Xerxes RÃ¥nby <xerxes at zafena.se>
+
+ PR icedtea/353
+ * ports/hotspot/src/share/vm/shark/llvmHeaders.hpp
+ Include llvm/Support/Threading.h and llvm/Target/TargetSelect.h
+ used by llvm_start_multithreaded() and InitializeNativeTarget()
+ when llvm version are 2.6 or later.
+ * ports/hotspot/src/share/vm/shark/llvmValue.hpp
+ (jfloat_constant): Return llvm::Constant* when llvm
+ version are 2.6 or later to handle llvm r73431 API change.
+ (jdouble_constant): Likewise.
+ * ports/hotspot/src/share/vm/shark/sharkBlock.cpp
+ (SharkBlock::parse_bytecode): Updated to use CreateFAdd
+ CreateFSub, CreateFMul and CreateFNeg for jfloat and jdouble
+ when llvm version are 2.6 or later.
+ * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp
+ (SharkCompiler::SharkCompiler): Call InitializeNativeTarget() to
+ link in native target when llvm version are 2.6 or later.
+ * ports/hotspot/src/share/vm/shark/sharkFunction.cpp
+ (SharkFunction::initialize): Call llvm_start_multithreaded() to
+ initialize llvm mutex guards when llvm version are 2.6 or later.
+
2009-06-19 Lillian Angel <langel at redhat.com>
* patches/icedtea-toolkit.patch: Updated, as per Anthony Petrov's
diff -r 0d70559fe534 -r fbfa0d5fa7d3 ports/hotspot/src/share/vm/shark/llvmHeaders.hpp
--- a/ports/hotspot/src/share/vm/shark/llvmHeaders.hpp Fri Jun 19 11:59:37 2009 -0400
+++ b/ports/hotspot/src/share/vm/shark/llvmHeaders.hpp Tue Jun 23 12:40:50 2009 +0200
@@ -35,6 +35,10 @@
#include <llvm/Module.h>
#include <llvm/ModuleProvider.h>
#include <llvm/Support/IRBuilder.h>
+#if SHARK_LLVM_VERSION >= 26
+#include <llvm/Support/Threading.h>
+#include <llvm/Target/TargetSelect.h>
+#endif
#include <llvm/Type.h>
#include <llvm/ExecutionEngine/JITMemoryManager.h>
#include <llvm/Support/CommandLine.h>
diff -r 0d70559fe534 -r fbfa0d5fa7d3 ports/hotspot/src/share/vm/shark/llvmValue.hpp
--- a/ports/hotspot/src/share/vm/shark/llvmValue.hpp Fri Jun 19 11:59:37 2009 -0400
+++ b/ports/hotspot/src/share/vm/shark/llvmValue.hpp Tue Jun 23 12:40:50 2009 +0200
@@ -37,11 +37,19 @@ class LLVMValue : public AllStatic {
{
return llvm::ConstantInt::get(SharkType::jlong_type(), value, true);
}
+#if SHARK_LLVM_VERSION >= 26
+ static llvm::Constant* jfloat_constant(jfloat value)
+#else
static llvm::ConstantFP* jfloat_constant(jfloat value)
+#endif
{
return llvm::ConstantFP::get(SharkType::jfloat_type(), value);
}
+#if SHARK_LLVM_VERSION >= 26
+ static llvm::Constant* jdouble_constant(jdouble value)
+#else
static llvm::ConstantFP* jdouble_constant(jdouble value)
+#endif
{
return llvm::ConstantFP::get(SharkType::jdouble_type(), value);
}
diff -r 0d70559fe534 -r fbfa0d5fa7d3 ports/hotspot/src/share/vm/shark/sharkBlock.cpp
--- a/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Fri Jun 19 11:59:37 2009 -0400
+++ b/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Tue Jun 23 12:40:50 2009 +0200
@@ -532,19 +532,31 @@ void SharkBlock::parse_bytecode(int star
b = pop();
a = pop();
push(SharkValue::create_jfloat(
+#if SHARK_LLVM_VERSION >= 26
+ builder()->CreateFAdd(a->jfloat_value(), b->jfloat_value())));
+#else
builder()->CreateAdd(a->jfloat_value(), b->jfloat_value())));
+#endif
break;
case Bytecodes::_fsub:
b = pop();
a = pop();
push(SharkValue::create_jfloat(
+#if SHARK_LLVM_VERSION >= 26
+ builder()->CreateFSub(a->jfloat_value(), b->jfloat_value())));
+#else
builder()->CreateSub(a->jfloat_value(), b->jfloat_value())));
+#endif
break;
case Bytecodes::_fmul:
b = pop();
a = pop();
push(SharkValue::create_jfloat(
+#if SHARK_LLVM_VERSION >= 26
+ builder()->CreateFMul(a->jfloat_value(), b->jfloat_value())));
+#else
builder()->CreateMul(a->jfloat_value(), b->jfloat_value())));
+#endif
break;
case Bytecodes::_fdiv:
b = pop();
@@ -561,26 +573,42 @@ void SharkBlock::parse_bytecode(int star
case Bytecodes::_fneg:
a = pop();
push(SharkValue::create_jfloat(
+#if SHARK_LLVM_VERSION >= 26
+ builder()->CreateFNeg(a->jfloat_value())));
+#else
builder()->CreateNeg(a->jfloat_value())));
+#endif
break;
case Bytecodes::_dadd:
b = pop();
a = pop();
push(SharkValue::create_jdouble(
+#if SHARK_LLVM_VERSION >= 26
+ builder()->CreateFAdd(a->jdouble_value(), b->jdouble_value())));
+#else
builder()->CreateAdd(a->jdouble_value(), b->jdouble_value())));
+#endif
break;
case Bytecodes::_dsub:
b = pop();
a = pop();
push(SharkValue::create_jdouble(
+#if SHARK_LLVM_VERSION >= 26
+ builder()->CreateFSub(a->jdouble_value(), b->jdouble_value())));
+#else
builder()->CreateSub(a->jdouble_value(), b->jdouble_value())));
+#endif
break;
case Bytecodes::_dmul:
b = pop();
a = pop();
push(SharkValue::create_jdouble(
+#if SHARK_LLVM_VERSION >= 26
+ builder()->CreateFMul(a->jdouble_value(), b->jdouble_value())));
+#else
builder()->CreateMul(a->jdouble_value(), b->jdouble_value())));
+#endif
break;
case Bytecodes::_ddiv:
b = pop();
@@ -597,7 +625,11 @@ void SharkBlock::parse_bytecode(int star
case Bytecodes::_dneg:
a = pop();
push(SharkValue::create_jdouble(
+#if SHARK_LLVM_VERSION >= 26
+ builder()->CreateFNeg(a->jdouble_value())));
+#else
builder()->CreateNeg(a->jdouble_value())));
+#endif
break;
case Bytecodes::_iinc:
diff -r 0d70559fe534 -r fbfa0d5fa7d3 ports/hotspot/src/share/vm/shark/sharkCompiler.cpp
--- a/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp Fri Jun 19 11:59:37 2009 -0400
+++ b/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp Tue Jun 23 12:40:50 2009 +0200
@@ -38,6 +38,12 @@ SharkCompiler::SharkCompiler()
// Create the builder to build our functions
_builder = new SharkBuilder(this);
+
+#if SHARK_LLVM_VERSION >= 26
+ // If we have a native target, initialize it to ensure it is linked in and
+ // usable by the JIT.
+ InitializeNativeTarget();
+#endif
// Create the JIT
ModuleProvider *module_provider = new ExistingModuleProvider(module());
diff -r 0d70559fe534 -r fbfa0d5fa7d3 ports/hotspot/src/share/vm/shark/sharkFunction.cpp
--- a/ports/hotspot/src/share/vm/shark/sharkFunction.cpp Fri Jun 19 11:59:37 2009 -0400
+++ b/ports/hotspot/src/share/vm/shark/sharkFunction.cpp Tue Jun 23 12:40:50 2009 +0200
@@ -30,6 +30,12 @@ using namespace llvm;
void SharkFunction::initialize(const char *name)
{
+
+#if SHARK_LLVM_VERSION >= 26
+ // Initialize llvm mutex guards
+ llvm_start_multithreaded();
+#endif
+
// Create the function
_function = Function::Create(
SharkType::entry_point_type(),
More information about the distro-pkg-dev
mailing list