changeset in /hg/icedtea: 2009-06-09 Gary Benson <gbenson at redh...

Gary Benson gbenson at redhat.com
Wed Jun 10 13:45:39 PDT 2009


changeset e5e58bda8299 in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=e5e58bda8299
description:
	2009-06-09  Gary Benson  <gbenson at redhat.com>

		* ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp
		(SharkTopLevelBlock::get_interface_callee): New argument.
		* ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
		(SharkTopLevelBlock::scan_for_traps): Update traps for
		invokeinterface.
		(SharkTopLevelBlock::get_callee): Pass method to
		get_interface_callee.
		(SharkTopLevelBlock::get_interface_callee): Removed constant
		pool lookup.

		* patches/hotspot/default/icedtea-shark.patch
		(ciMethod::itable_index): New method.

diffstat:

3 files changed, 31 insertions(+), 23 deletions(-)
ChangeLog                                               |   15 ++++++
ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp |   37 ++++++---------
ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp |    2 

diffs (116 lines):

diff -r 12b58111793f -r e5e58bda8299 ChangeLog
--- a/ChangeLog	Mon Jun 08 05:59:35 2009 -0400
+++ b/ChangeLog	Tue Jun 09 06:22:07 2009 -0400
@@ -1,3 +1,18 @@ 2009-06-08  Gary Benson  <gbenson at redhat
+2009-06-09  Gary Benson  <gbenson at redhat.com>
+
+	* ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp
+	(SharkTopLevelBlock::get_interface_callee): New argument.
+	* ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
+	(SharkTopLevelBlock::scan_for_traps): Update traps for
+	invokeinterface.
+	(SharkTopLevelBlock::get_callee): Pass method to
+	get_interface_callee. 
+	(SharkTopLevelBlock::get_interface_callee): Removed constant
+	pool lookup.
+
+	* patches/hotspot/default/icedtea-shark.patch
+	(ciMethod::itable_index): New method.
+
 2009-06-08  Gary Benson  <gbenson at redhat.com>
 
 	* ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp
diff -r 12b58111793f -r e5e58bda8299 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
--- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp	Mon Jun 08 05:59:35 2009 -0400
+++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp	Tue Jun 09 06:22:07 2009 -0400
@@ -107,8 +107,14 @@ void SharkTopLevelBlock::scan_for_traps(
       if (method->holder() == function()->env()->Object_klass())
         Unimplemented();
 
-      // Continue to the check
-      index = iter()->get_method_index();
+      // Bail out if the holder is unloaded
+      if (!method->holder()->is_linked()) {
+        set_trap(
+          Deoptimization::make_trap_request(
+            Deoptimization::Reason_uninitialized,
+            Deoptimization::Action_reinterpret), bci());
+          return;
+      }
       break;
 
     case Bytecodes::_new:
@@ -873,7 +879,7 @@ Value *SharkTopLevelBlock::get_callee(Ca
   case CALL_VIRTUAL:
     return get_virtual_callee(receiver, method);
   case CALL_INTERFACE:
-    return get_interface_callee(receiver);
+    return get_interface_callee(receiver, method);
   default:
     ShouldNotReachHere();
   } 
@@ -911,11 +917,9 @@ Value *SharkTopLevelBlock::get_virtual_c
 }
 
 // Interface calls are handled here
-Value* SharkTopLevelBlock::get_interface_callee(SharkValue *receiver)
-{
-  SharkConstantPool constants(this);
-  Value *cache = constants.cache_entry_at(iter()->get_method_index());
-
+Value* SharkTopLevelBlock::get_interface_callee(SharkValue *receiver,
+                                                ciMethod*   method)
+{
   BasicBlock *loop       = function()->CreateBlock("loop");
   BasicBlock *got_null   = function()->CreateBlock("got_null");
   BasicBlock *not_null   = function()->CreateBlock("not_null");
@@ -955,11 +959,7 @@ Value* SharkTopLevelBlock::get_interface
       itable_start, BytesPerLong, itable_start_name);
 
   // Locate this interface's entry in the table
-  Value *iklass = builder()->CreateValueOfStructEntry(
-    cache, ConstantPoolCacheEntry::f1_offset(),
-    SharkType::jobject_type(),
-    "iklass");
-
+  Value *iklass = builder()->CreateInlineOop(method->holder());
   BasicBlock *loop_entry = builder()->GetInsertBlock();
   builder()->CreateBr(loop);
   builder()->SetInsertPoint(loop);
@@ -1009,11 +1009,6 @@ Value* SharkTopLevelBlock::get_interface
   offset =
     builder()->CreateIntCast(offset, SharkType::intptr_type(), false);
 
-  Value *index = builder()->CreateValueOfStructEntry(
-    cache, ConstantPoolCacheEntry::f2_offset(),
-    SharkType::intptr_type(),
-    "index");
-
   return builder()->CreateLoad(
     builder()->CreateIntToPtr(
       builder()->CreateAdd(
@@ -1022,10 +1017,8 @@ Value* SharkTopLevelBlock::get_interface
             builder()->CreatePtrToInt(
               object_klass, SharkType::intptr_type()),
             offset),
-          builder()->CreateShl(
-            index,
-            LLVMValue::intptr_constant(
-              exact_log2(itableMethodEntry::size() * wordSize)))),
+          LLVMValue::intptr_constant(
+            method->itable_index() * itableMethodEntry::size() * wordSize)),
         LLVMValue::intptr_constant(
           itableMethodEntry::method_offset_in_bytes())),
       PointerType::getUnqual(SharkType::methodOop_type())),
diff -r 12b58111793f -r e5e58bda8299 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp
--- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp	Mon Jun 08 05:59:35 2009 -0400
+++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp	Tue Jun 09 06:22:07 2009 -0400
@@ -383,7 +383,7 @@ class SharkTopLevelBlock : public SharkB
 
   llvm::Value* get_direct_callee(ciMethod* method);
   llvm::Value* get_virtual_callee(SharkValue* receiver, ciMethod* method);
-  llvm::Value* get_interface_callee(SharkValue* receiver);
+  llvm::Value* get_interface_callee(SharkValue* receiver, ciMethod* method);
 
   void do_call();
 



More information about the distro-pkg-dev mailing list