Mercurial > hg > icedtea7
changeset 1884:600e54c4e646
Forwardport Shark.
2009-06-09 Gary Benson <gbenson@redhat.com>
* ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
(SharkTopLevelBlock::scan_for_traps): Removed unused code.
* ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp: Removed.
* ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp: Likewise.
* ports/hotspot/src/share/vm/includeDB_shark: Updated.
author | Andrew John Hughes <ahughes@redhat.com> |
---|---|
date | Wed, 10 Jun 2009 17:20:46 +0100 |
parents | e5e58bda8299 |
children | 19e7ed3a153a |
files | ChangeLog ports/hotspot/src/share/vm/includeDB_shark ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp |
diffstat | 5 files changed, 10 insertions(+), 233 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Tue Jun 09 06:22:07 2009 -0400 +++ b/ChangeLog Wed Jun 10 17:20:46 2009 +0100 @@ -1,3 +1,13 @@ +2009-06-09 Gary Benson <gbenson@redhat.com> + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::scan_for_traps): Removed unused code. + + * ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp: Removed. + * ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp: Likewise. + + * ports/hotspot/src/share/vm/includeDB_shark: Updated. + 2009-06-09 Gary Benson <gbenson@redhat.com> * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp
--- a/ports/hotspot/src/share/vm/includeDB_shark Tue Jun 09 06:22:07 2009 -0400 +++ b/ports/hotspot/src/share/vm/includeDB_shark Wed Jun 10 17:20:46 2009 +0100 @@ -170,24 +170,6 @@ sharkConstant.hpp sharkBuilder.hpp sharkConstant.hpp sharkValue.hpp -sharkConstantPool.cpp allocation.hpp -sharkConstantPool.cpp constantPoolOop.hpp -sharkConstantPool.cpp cpCacheOop.hpp -sharkConstantPool.cpp debug.hpp -sharkConstantPool.cpp llvmHeaders.hpp -sharkConstantPool.cpp llvmValue.hpp -sharkConstantPool.cpp methodOop.hpp -sharkConstantPool.cpp sharkBuilder.hpp -sharkConstantPool.cpp sharkConstantPool.hpp -sharkConstantPool.cpp sharkState.inline.hpp -sharkConstantPool.cpp sharkType.hpp -sharkConstantPool.cpp sharkValue.hpp - -sharkConstantPool.hpp allocation.hpp -sharkConstantPool.hpp llvmHeaders.hpp -sharkConstantPool.hpp sharkBuilder.hpp -sharkConstantPool.hpp sharkTopLevelBlock.hpp - sharkEntry.cpp sharkEntry.hpp sharkEntry.hpp llvmHeaders.hpp @@ -316,7 +298,6 @@ sharkTopLevelBlock.cpp sharkTopLevelBlock.hpp sharkTopLevelBlock.cpp sharkBuilder.hpp sharkTopLevelBlock.cpp sharkConstant.hpp -sharkTopLevelBlock.cpp sharkConstantPool.hpp sharkTopLevelBlock.cpp sharkInliner.hpp sharkTopLevelBlock.cpp sharkRuntime.hpp sharkTopLevelBlock.cpp sharkState.inline.hpp
--- a/ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp Tue Jun 09 06:22:07 2009 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ -/* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. - * 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - */ - -#include "incls/_precompiled.incl" -#include "incls/_sharkConstantPool.cpp.incl" - -using namespace llvm; - -Value *SharkConstantPool::constants() -{ - Value *m = method(); - if (m != _constants_method) { - _constants = builder()->CreateValueOfStructEntry( - m, methodOopDesc::constants_offset(), - SharkType::oop_type(), "constants"); - _constants_method = m; - } - return _constants; -} - -Value *SharkConstantPool::tags() -{ - Value *cp = constants(); - if (cp != _tags_constants) { - _tags = builder()->CreateValueOfStructEntry( - cp, in_ByteSize(constantPoolOopDesc::tags_offset_in_bytes()), - SharkType::oop_type(), "tags"); - _tags_constants = cp; - } - return _tags; -} - -Value *SharkConstantPool::cache() -{ - Value *cp = constants(); - if (cp != _cache_constants) { - _cache = builder()->CreateValueOfStructEntry( - cp, in_ByteSize(constantPoolOopDesc::cache_offset_in_bytes()), - SharkType::oop_type(), "cache"); - _cache_constants = cp; - } - return _cache; -} - -Value *SharkConstantPool::object_at(int which) -{ - return builder()->CreateLoad( - builder()->CreateArrayAddress( - constants(), - T_OBJECT, in_ByteSize(sizeof(constantPoolOopDesc)), - LLVMValue::jint_constant(which))); -} - -Value *SharkConstantPool::tag_at(int which) -{ - return builder()->CreateLoad( - builder()->CreateArrayAddress( - tags(), T_BYTE, LLVMValue::jint_constant(which))); -} - -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); - assert(target()->holder()->is_cache_entry_resolved(which, block()->bc()), - "should be"); - - return builder()->CreateIntToPtr( - builder()->CreateAdd( - builder()->CreatePtrToInt( - cache(), SharkType::intptr_type()), - LLVMValue::intptr_constant( - in_bytes(constantPoolCacheOopDesc::base_offset()) + - which * sizeof(ConstantPoolCacheEntry))), - SharkType::cpCacheEntry_type()); -} - -Value *SharkConstantPool::java_mirror() -{ - Value *cp = constants(); - - Value *pool_holder = builder()->CreateValueOfStructEntry( - cp, - in_ByteSize(constantPoolOopDesc::pool_holder_offset_in_bytes()), - SharkType::oop_type(), - "pool_holder"); - - Value *klass_part = builder()->CreateAddressOfStructEntry( - pool_holder, - in_ByteSize(klassOopDesc::klass_part_offset_in_bytes()), - SharkType::klass_type(), - "klass_part"); - - // XXX should there be a memory barrier before this load? - return builder()->CreateValueOfStructEntry( - klass_part, - in_ByteSize(Klass::java_mirror_offset_in_bytes()), - SharkType::oop_type(), - "java_mirror"); -}
--- a/ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp Tue Jun 09 06:22:07 2009 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. - * 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - */ - -class SharkConstantPool : public StackObj { - public: - SharkConstantPool(SharkTopLevelBlock* block) - : _block(block), - _constants_method(NULL), - _tags_constants(NULL), - _cache_constants(NULL) {} - - private: - SharkTopLevelBlock* _block; - - private: - SharkTopLevelBlock* block() const - { - return _block; - } - SharkBuilder* builder() const - { - return block()->builder(); - } - ciMethod* target() const - { - return block()->target(); - } - llvm::Value* method() const - { - return block()->method(); - } - - private: - llvm::Value* _constants; // The constant pool, a constantPoolOop - llvm::Value* _constants_method; // The method _constants was loaded from - - llvm::Value* _tags; // The tags array, a typeArrayOop - llvm::Value* _tags_constants; // The constantPoolOop _tags is in - - llvm::Value* _cache; // The cache, a constantPoolCacheOop - llvm::Value* _cache_constants; // The constantPoolCacheOop _cache is in - - private: - llvm::Value* constants(); - llvm::Value* tags(); - llvm::Value* cache(); - - public: - llvm::Value* object_at(int which); - llvm::Value* tag_at(int which); - llvm::Value* cache_entry_at(int which); - llvm::Value* java_mirror(); -};
--- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Tue Jun 09 06:22:07 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Wed Jun 10 17:20:46 2009 +0100 @@ -44,8 +44,6 @@ bool will_link; bool is_field; - int index = -1; - switch (bc()) { case Bytecodes::_ldc: case Bytecodes::_ldc_w: @@ -141,18 +139,6 @@ } break; } - - // If we found a constant pool access on this bytecode then check it - if (index != -1) { - if (!target()->holder()->is_cache_entry_resolved( - Bytes::swap_u2(index), bc())) { - set_trap( - Deoptimization::make_trap_request( - Deoptimization::Reason_uninitialized, - Deoptimization::Action_reinterpret), bci()); - return; - } - } } // Trap if typeflow trapped (and we didn't before)