# HG changeset patch # User Gary Benson # Date 1236260696 0 # Node ID 6cb81042d68ceb15354e5a41326c85205bdaca1e # Parent 017b63ad6962fe6467c5e7adcf00b23f2c7d02e0 2009-03-05 Gary Benson * 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. (transplanted from c5a65faa56e25214fb227cdf2eeaf5b195426052) diff -r 017b63ad6962 -r 6cb81042d68c ChangeLog --- a/ChangeLog Thu Mar 19 10:20:51 2009 +0000 +++ b/ChangeLog Thu Mar 05 13:44:56 2009 +0000 @@ -492,6 +492,16 @@ 2009-03-05 Gary Benson + * 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 + * ports/hotspot/src/share/vm/shark/sharkInliner.cpp (SharkInliner::may_be_inlinable): Bail out early on constructors. diff -r 017b63ad6962 -r 6cb81042d68c patches/hotspot/default/icedtea-shark.patch --- a/patches/hotspot/default/icedtea-shark.patch Thu Mar 19 10:20:51 2009 +0000 +++ b/patches/hotspot/default/icedtea-shark.patch Thu Mar 05 13:44:56 2009 +0000 @@ -364,3 +364,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 diff -r 017b63ad6962 -r 6cb81042d68c ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp --- a/ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp Thu Mar 19 10:20:51 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: diff -r 017b63ad6962 -r 6cb81042d68c ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp --- a/ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp Thu Mar 19 10:20:51 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();