changeset 1217:16d57d401734

Merge with upstream
author Deepak Bhole <dbhole@redhat.com>
date Fri, 21 Nov 2008 15:23:16 -0500
parents 85921aeaed32 (current diff) 8af2ec380258 (diff)
children b8307e2d80a5
files ChangeLog
diffstat 7 files changed, 42 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Nov 21 11:39:51 2008 -0500
+++ b/ChangeLog	Fri Nov 21 15:23:16 2008 -0500
@@ -12,6 +12,27 @@
 	* rt/net/sourceforge/jnlp/NetxPanel.java: Provide function to return the
 	applet classloader.
 
+2008-11-21 Andrew Haley <aph@redhat.com>
+
+	* ports/hotspot/src/share/vm/shark/sharkValue.hpp
+	(class SharkComputableValue): Use IRBuilder<>, not IRBuilder.
+	(class SharkValue): Use IRBuilder<>, not IRBuilder.
+	* ports/hotspot/src/share/vm/shark/sharkFunction.cpp
+	(SharkFunction::CreatePopFrame): Change a few jint_types to
+	intptr_types.
+	* ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp
+	(SharkConstantPool::cache_entry_at): Byte-swap the cache index.
+	* ports/hotspot/src/share/vm/shark/sharkBuilder.cpp
+	(SharkBuilder::SharkBuilder) Inherit from template class
+	IRBuilder<>.
+	* ports/hotspot/src/share/vm/shark/sharkBuilder.hpp:
+	(SharkBuilder::SharkBuilder) Inherit from template class
+	IRBuilder<>.
+	Change a few jint_types to intptr_types.
+	* ports/hotspot/src/share/vm/shark/sharkBlock.cpp
+	(SharkBlock::get_interface_callee): Change a few jint_types to
+	intptr_types.
+
 2008-11-18  Deepak Bhole  <dbhole@redhat.com>
 	* IcedTeaPlugin.cc: Encode newline characters instead of stripping them.
 	* plugin/icedtea/sun/applet/PluginAppletSecurityContext.java: Minor debug
--- a/ports/hotspot/src/share/vm/shark/sharkBlock.cpp	Fri Nov 21 11:39:51 2008 -0500
+++ b/ports/hotspot/src/share/vm/shark/sharkBlock.cpp	Fri Nov 21 15:23:16 2008 -0500
@@ -1814,6 +1814,8 @@
     in_ByteSize(instanceKlass::vtable_length_offset() * HeapWordSize),
     SharkType::jint_type(),
     "vtable_length");
+  vtable_length =
+    builder()->CreateIntCast(vtable_length, SharkType::intptr_type(), false);
 
   bool needs_aligning = HeapWordsPerLong > 1;
   const char *itable_start_name = "itable_start";
@@ -1821,7 +1823,7 @@
     vtable_start,
     builder()->CreateShl(
       vtable_length,
-      LLVMValue::jint_constant(exact_log2(vtableEntry::size() * wordSize))),
+      LLVMValue::intptr_constant(exact_log2(vtableEntry::size() * wordSize))),
     needs_aligning ? "" : itable_start_name);
   if (needs_aligning)
     itable_start = builder()->CreateAlign(
@@ -1878,6 +1880,8 @@
     in_ByteSize(itableOffsetEntry::offset_offset_in_bytes()),
     SharkType::jint_type(),
     "offset");
+  offset =
+    builder()->CreateIntCast(offset, SharkType::intptr_type(), false);
 
   Value *index = builder()->CreateValueOfStructEntry(
     cache, ConstantPoolCacheEntry::f2_offset(),
@@ -1894,7 +1898,7 @@
             offset),
           builder()->CreateShl(
             index,
-            LLVMValue::jint_constant(
+            LLVMValue::intptr_constant(
               exact_log2(itableMethodEntry::size() * wordSize)))),
         LLVMValue::intptr_constant(
           itableMethodEntry::method_offset_in_bytes())),
--- a/ports/hotspot/src/share/vm/shark/sharkBuilder.cpp	Fri Nov 21 11:39:51 2008 -0500
+++ b/ports/hotspot/src/share/vm/shark/sharkBuilder.cpp	Fri Nov 21 15:23:16 2008 -0500
@@ -29,7 +29,7 @@
 using namespace llvm;
 
 SharkBuilder::SharkBuilder()
-  : IRBuilder(),
+  : IRBuilder<>(),
       _module("shark"),
       _module_provider(module()),
       _execution_engine(ExecutionEngine::create(&_module_provider))
--- a/ports/hotspot/src/share/vm/shark/sharkBuilder.hpp	Fri Nov 21 11:39:51 2008 -0500
+++ b/ports/hotspot/src/share/vm/shark/sharkBuilder.hpp	Fri Nov 21 15:23:16 2008 -0500
@@ -23,7 +23,7 @@
  *
  */
 
-class SharkBuilder : public llvm::IRBuilder {
+class SharkBuilder : public llvm::IRBuilder<> {
  public:
   SharkBuilder();
 
@@ -81,13 +81,13 @@
                                   llvm::Value*      index,
                                   const char*       name = "")
   {
-    llvm::Value* offset = index;
+    llvm::Value* offset = CreateIntCast(index, SharkType::intptr_type(), false);
     if (element_bytes != 1)
       offset = CreateShl(
         offset,
-        LLVMValue::jint_constant(exact_log2(element_bytes)));
+        LLVMValue::intptr_constant(exact_log2(element_bytes)));
     offset = CreateAdd(
-      LLVMValue::jint_constant(in_bytes(base_offset)), offset);
+      LLVMValue::intptr_constant(in_bytes(base_offset)), offset);
 
     return CreateIntToPtr(
       CreateAdd(CreatePtrToInt(arrayoop, SharkType::intptr_type()), offset),
--- a/ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp	Fri Nov 21 11:39:51 2008 -0500
+++ b/ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp	Fri Nov 21 15:23:16 2008 -0500
@@ -82,6 +82,12 @@
 
 Value *SharkConstantPool::cache_entry_at(int which)
 {
+  // Takes a constant pool cache index in byte-swapped byte order
+  // (which comes from the bytecodes after rewriting).  This is a
+  // bizarre hack but it's the same as
+  // constantPoolOopDesc::field_or_method_at().
+  which = Bytes::swap_u2(which);
+
   Value *entry = builder()->CreateIntToPtr(
     builder()->CreateAdd(
       builder()->CreatePtrToInt(
@@ -109,7 +115,7 @@
       builder()->CreateValueOfStructEntry(
         entry, ConstantPoolCacheEntry::indices_offset(),
         SharkType::intptr_type()),
-      LLVMValue::jint_constant(shift)),
+      LLVMValue::intptr_constant(shift)),
     LLVMValue::intptr_constant(0xff));
 
   BasicBlock *orig_block = builder()->GetInsertBlock();
--- a/ports/hotspot/src/share/vm/shark/sharkFunction.cpp	Fri Nov 21 11:39:51 2008 -0500
+++ b/ports/hotspot/src/share/vm/shark/sharkFunction.cpp	Fri Nov 21 15:23:16 2008 -0500
@@ -182,7 +182,7 @@
   Value *fp = CreateLoadZeroFramePointer();
   Value *sp = builder()->CreateAdd(
     fp,
-    LLVMValue::jint_constant((1 + locals_to_pop) * wordSize));
+    LLVMValue::intptr_constant((1 + locals_to_pop) * wordSize));
 
   CreateStoreZeroStackPointer(sp);
   CreateStoreZeroFramePointer(
--- a/ports/hotspot/src/share/vm/shark/sharkValue.hpp	Fri Nov 21 11:39:51 2008 -0500
+++ b/ports/hotspot/src/share/vm/shark/sharkValue.hpp	Fri Nov 21 15:23:16 2008 -0500
@@ -246,7 +246,7 @@
   {
     ShouldNotCallThis();
   }
-  virtual llvm::Value* intptr_value(llvm::IRBuilder* builder) const
+  virtual llvm::Value* intptr_value(llvm::IRBuilder<>* builder) const
   {
     ShouldNotCallThis();
   }
@@ -370,7 +370,7 @@
   {
     return llvm_value();
   }
-  llvm::Value* intptr_value(llvm::IRBuilder* builder) const
+  llvm::Value* intptr_value(llvm::IRBuilder<>* builder) const
   {
     assert(is_jobject(), "should be");
     return builder->CreatePtrToInt(llvm_value(), SharkType::intptr_type());