changeset 1739:c5a65faa56e2

2009-03-05 Gary Benson <gbenson@redhat.com> * patches/hotspot/default/icedtea-shark.patch (ciInstanceKlass::is_cache_entry_resolved): New method. * ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp (SharkConstantPool::target): Likewise. * ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp (SharkConstantPool::cache_entry_at): Don't emit code to resolve entry if the entry is resolved at compile time.
author Gary Benson <gbenson@redhat.com>
date Thu, 05 Mar 2009 13:44:56 +0000
parents a737ec21e449
children f51dcb5de1a9
files ChangeLog patches/hotspot/default/icedtea-shark.patch ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp
diffstat 4 files changed, 50 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Mar 05 09:41:58 2009 +0000
+++ b/ChangeLog	Thu Mar 05 13:44:56 2009 +0000
@@ -1,3 +1,13 @@
+2009-03-05  Gary Benson  <gbenson@redhat.com>
+
+	* patches/hotspot/default/icedtea-shark.patch
+	(ciInstanceKlass::is_cache_entry_resolved): New method.
+	* ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp
+	(SharkConstantPool::target): Likewise.
+	* ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp
+	(SharkConstantPool::cache_entry_at): Don't emit code to
+	resolve entry if the entry is resolved at compile time.
+
 2009-03-05  Gary Benson  <gbenson@redhat.com>
 
 	* ports/hotspot/src/share/vm/shark/sharkInliner.cpp
--- a/patches/hotspot/default/icedtea-shark.patch	Thu Mar 05 09:41:58 2009 +0000
+++ b/patches/hotspot/default/icedtea-shark.patch	Thu Mar 05 13:44:56 2009 +0000
@@ -363,3 +363,34 @@
  }
  
  // ------------------------------------------------------------------
+diff -r 5297ff20101d openjdk-ecj/hotspot/src/share/vm/ci/ciInstanceKlass.hpp
+--- openjdk/hotspot/src/share/vm/ci/ciInstanceKlass.hpp	Mon Dec 15 15:32:37 2008 +0000
++++ openjdk/hotspot/src/share/vm/ci/ciInstanceKlass.hpp	Thu Mar 05 11:48:56 2009 +0000
+@@ -198,4 +198,9 @@
+   // What kind of ciObject is this?
+   bool is_instance_klass() { return true; }
+   bool is_java_klass()     { return true; }
++
++#ifdef SHARK
++  // Is this entry in the constant pool cache resolved?
++  bool is_cache_entry_resolved(int index, Bytecodes::Code opcode);
++#endif // SHARK
+ };
+diff -r 5297ff20101d openjdk-ecj/hotspot/src/share/vm/ci/ciInstanceKlass.cpp
+--- openjdk/hotspot/src/share/vm/ci/ciInstanceKlass.cpp	Mon Dec 15 15:32:37 2008 +0000
++++ openjdk/hotspot/src/share/vm/ci/ciInstanceKlass.cpp	Thu Mar 05 11:48:56 2009 +0000
+@@ -548,3 +548,14 @@
+   }
+   return impl;
+ }
++
++#ifdef SHARK
++// ------------------------------------------------------------------
++// ciInstanceKlass::is_cache_entry_resolved
++//
++// Is this entry in the constant pool cache resolved?
++bool ciInstanceKlass::is_cache_entry_resolved(int index, Bytecodes::Code opcode) {
++  VM_ENTRY_MARK;
++  return get_instanceKlass()->constants()->cache()->entry_at(index)->is_resolved(opcode);
++}
++#endif // SHARK
--- a/ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp	Thu Mar 05 09:41:58 2009 +0000
+++ b/ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp	Thu Mar 05 13:44:56 2009 +0000
@@ -1,6 +1,6 @@
 /*
  * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008 Red Hat, Inc.
+ * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -98,6 +98,9 @@
     SharkType::cpCacheEntry_type());
 
   // Resolve the entry if necessary
+  if (target()->holder()->is_cache_entry_resolved(which, block()->bc()))
+    return entry;
+
   int shift;
   switch (ConstantPoolCacheEntry::bytecode_number(block()->bc())) {
   case 1:
--- a/ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp	Thu Mar 05 09:41:58 2009 +0000
+++ b/ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp	Thu Mar 05 13:44:56 2009 +0000
@@ -1,6 +1,6 @@
 /*
  * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008 Red Hat, Inc.
+ * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,10 @@
   {
     return block()->builder();
   }
+  ciMethod* target() const
+  {
+    return block()->target();
+  }
   llvm::Value* method() const
   {
     return block()->method();