# HG changeset patch # User Andrew John Hughes # Date 1237464174 0 # Node ID 9fef463be3011015f6035130dffe7a4eb96f4f17 # Parent ae9230c3f0c54223a79895eb613be72de99274c5 Cleanup Shark merge duplication. 2009-03-19 Andrew John Hughes * ChangeLog, * ports/hotspot/src/share/vm/includeDB_shark, * ports/hotspot/src/share/vm/shark/sharkFunction.cpp, * ports/hotspot/src/share/vm/shark/sharkState.cpp, * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp, * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp, * ports/hotspot/src/share/vm/shark/shark_globals.hpp: Cleanup Shark merge duplication. diff -r ae9230c3f0c5 -r 9fef463be301 ChangeLog --- a/ChangeLog Fri Mar 13 09:55:22 2009 -0400 +++ b/ChangeLog Thu Mar 19 12:02:54 2009 +0000 @@ -1,3 +1,14 @@ +2009-03-19 Andrew John Hughes + + * ChangeLog, + * ports/hotspot/src/share/vm/includeDB_shark, + * ports/hotspot/src/share/vm/shark/sharkFunction.cpp, + * ports/hotspot/src/share/vm/shark/sharkState.cpp, + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp, + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp, + * ports/hotspot/src/share/vm/shark/shark_globals.hpp: + Cleanup Shark merge duplication. + 2009-03-13 Gary Benson * ports/hotspot/src/share/vm/shark/sharkValue.hpp @@ -256,13 +267,6 @@ (SharkRuntime::resolve_get_put_C): Likewise. (SharkRuntime::resolve_invoke_C): Likewise. (SharkRuntime::uncommon_trap_C): s/index/trap_request/. - * ports/hotspot/src/share/vm/shark/sharkRuntime.cpp - (SharkRuntime::_resolve_get_put): Removed. - (SharkRuntime::_resolve_invoke): Likewise. - (SharkRuntime::initialize): Removed initialization for the above. - (SharkRuntime::resolve_get_put_C): Removed. - (SharkRuntime::resolve_invoke_C): Likewise. - (SharkRuntime::uncommon_trap_C): s/index/trap_request/. * ports/hotspot/src/share/vm/shark/sharkBlock.cpp (SharkBlock::do_field_access): Mismatch case now handled by trap. diff -r ae9230c3f0c5 -r 9fef463be301 ports/hotspot/src/share/vm/includeDB_shark --- a/ports/hotspot/src/share/vm/includeDB_shark Fri Mar 13 09:55:22 2009 -0400 +++ b/ports/hotspot/src/share/vm/includeDB_shark Thu Mar 19 12:02:54 2009 +0000 @@ -25,25 +25,6 @@ // NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps! -sharkBlock.cpp debug.hpp -sharkBlock.cpp bytecodes.hpp -sharkBlock.cpp llvmHeaders.hpp -sharkBlock.cpp shark_globals.hpp -sharkBlock.cpp sharkBlock.hpp -sharkBlock.cpp sharkBuilder.hpp -sharkBlock.cpp sharkRuntime.hpp -sharkBlock.cpp sharkState.inline.hpp -sharkBlock.cpp sharkValue.inline.hpp - -sharkBlock.hpp allocation.hpp -sharkBlock.hpp ciMethod.hpp -sharkBlock.hpp ciStreams.hpp -sharkBlock.hpp debug.hpp -sharkBlock.hpp llvmHeaders.hpp -sharkBlock.hpp sharkBuilder.hpp -sharkBlock.hpp sharkState.hpp -sharkBlock.hpp sharkValue.hpp - ciMethod.cpp ciTypeFlow.hpp ciMethod.cpp methodOop.hpp diff -r ae9230c3f0c5 -r 9fef463be301 ports/hotspot/src/share/vm/shark/sharkFunction.cpp --- a/ports/hotspot/src/share/vm/shark/sharkFunction.cpp Fri Mar 13 09:55:22 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkFunction.cpp Thu Mar 19 12:02:54 2009 +0000 @@ -30,65 +30,6 @@ using namespace llvm; -class SharkEntryState : public SharkState { - public: - SharkEntryState(SharkTopLevelBlock* block, llvm::Value* method) - : SharkState(block, block->function(), method) - { - char name[18]; - - // Local variables - for (int i = 0; i < max_locals(); i++) { - ciType *type = block->local_type_at_entry(i); - - SharkValue *value = NULL; - switch (type->basic_type()) { - case T_INT: - case T_LONG: - case T_FLOAT: - case T_DOUBLE: - case T_OBJECT: - case T_ARRAY: - if (i < function()->arg_size()) { - snprintf(name, sizeof(name), "local_%d_", i); - value = SharkValue::create_generic( - type, - builder()->CreateLoad( - function()->CreateAddressOfFrameEntry( - function()->locals_slots_offset() - + max_locals() - type->size() - i, - SharkType::to_stackType(type)), - name)); - } - else { - Unimplemented(); - } - break; - - case ciTypeFlow::StateVector::T_BOTTOM: - break; - - case ciTypeFlow::StateVector::T_LONG2: - case ciTypeFlow::StateVector::T_DOUBLE2: - break; - - default: - ShouldNotReachHere(); - } - set_local(i, value); - } - - // Non-static methods have a guaranteed non-null receiver - if (!function()->target()->is_static()) { - assert(local(0)->is_jobject(), "should be"); - local(0)->set_zero_checked(true); - } - - // Expression stack - assert(!block->stack_depth_at_entry(), "entry block shouldn't have stack"); - } -}; - void SharkFunction::initialize() { // Emit the entry point diff -r ae9230c3f0c5 -r 9fef463be301 ports/hotspot/src/share/vm/shark/sharkState.cpp --- a/ports/hotspot/src/share/vm/shark/sharkState.cpp Fri Mar 13 09:55:22 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkState.cpp Thu Mar 19 12:02:54 2009 +0000 @@ -46,24 +46,6 @@ initialize(state); } -SharkState::SharkState(SharkBlock* block, - SharkFunction* function, - llvm::Value* method) - : _block(block), - _function(function), - _method(method) -{ - initialize(NULL); -} - -SharkState::SharkState(const SharkState* state) - : _block(state->block()), - _function(state->function()), - _method(state->method()) -{ - initialize(state); -} - void SharkState::initialize(const SharkState *state) { _locals = NEW_RESOURCE_ARRAY(SharkValue*, max_locals()); diff -r ae9230c3f0c5 -r 9fef463be301 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Mar 13 09:55:22 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Thu Mar 19 12:02:54 2009 +0000 @@ -121,99 +121,6 @@ return TRAP_NO_TRAPS; } -int SharkTopLevelBlock::scan_for_traps() -{ - // If typeflow got one then we're already done - if (ciblock()->has_trap()) { - return Deoptimization::make_trap_request( - Deoptimization::Reason_unloaded, - Deoptimization::Action_reinterpret, - ciblock()->trap_index()); - } - - // Scan the bytecode - iter()->reset_to_bci(start()); - while (iter()->next_bci() < limit()) { - iter()->next(); - - ciField *field; - ciMethod *method; - bool will_link; - bool is_field; - - int index = -1; - - switch (bc()) { - case Bytecodes::_getfield: - case Bytecodes::_getstatic: - case Bytecodes::_putfield: - case Bytecodes::_putstatic: - field = iter()->get_field(will_link); - assert(will_link, "typeflow responsibility"); - is_field = (bc() == Bytecodes::_getfield || bc() == Bytecodes::_putfield); - - // If the bytecode does not match the field then bail out to - // the interpreter to throw an IncompatibleClassChangeError - if (is_field == field->is_static()) { - return Deoptimization::make_trap_request( - Deoptimization::Reason_unhandled, - Deoptimization::Action_none); - } - - // If this is a getfield or putfield then there won't be a - // pool access and we're done - if (is_field) - break; - - // There won't be a pool access if this is a getstatic that - // resolves to a handled constant either - if (bc() == Bytecodes::_getstatic && field->is_constant()) { - if (SharkValue::from_ciConstant(field->constant_value())) - break; - } - - // Continue to the check - index = iter()->get_field_index(); - break; - - case Bytecodes::_invokespecial: - case Bytecodes::_invokestatic: - case Bytecodes::_invokevirtual: - case Bytecodes::_invokeinterface: - method = iter()->get_method(will_link); - assert(will_link, "typeflow responsibility"); - - // If this is a non-final invokevirtual then there won't - // be a pool access. We do need to check that its holder - // is linked, however, because its vtable won't have been - // set up otherwise. - if (bc() == Bytecodes::_invokevirtual && !method->is_final_method()) { - if (!method->holder()->is_linked()) { - return Deoptimization::make_trap_request( - Deoptimization::Reason_uninitialized, - Deoptimization::Action_reinterpret); - } - break; - } - - // Continue to the check - index = iter()->get_method_index(); - 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())) { - return Deoptimization::make_trap_request( - Deoptimization::Reason_uninitialized, - Deoptimization::Action_reinterpret); - } - } - } - return TRAP_NO_TRAPS; -} - SharkState* SharkTopLevelBlock::entry_state() { if (_entry_state == NULL) { diff -r ae9230c3f0c5 -r 9fef463be301 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri Mar 13 09:55:22 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Thu Mar 19 12:02:54 2009 +0000 @@ -127,29 +127,6 @@ private: int scan_for_traps(); - // Traps - private: - enum { - TRAP_UNCHECKED = 232323, // > any constant pool index - TRAP_NO_TRAPS - }; - int _trap_request; - - public: - int trap_request() - { - if (_trap_request == TRAP_UNCHECKED) - _trap_request = scan_for_traps(); - return _trap_request; - } - bool has_trap() - { - return trap_request() != TRAP_NO_TRAPS; - } - - private: - int scan_for_traps(); - // Entry state private: bool _entered; diff -r ae9230c3f0c5 -r 9fef463be301 ports/hotspot/src/share/vm/shark/shark_globals.hpp --- a/ports/hotspot/src/share/vm/shark/shark_globals.hpp Fri Mar 13 09:55:22 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/shark_globals.hpp Thu Mar 19 12:02:54 2009 +0000 @@ -36,10 +36,6 @@ product(intx, SharkMaxInlineSize, 32, \ "Maximum bytecode size of methods to inline when using Shark") \ \ - /* inlining */ \ - product(intx, SharkMaxInlineSize, 32, \ - "Maximum bytecode size of methods to inline when using Shark") \ - \ /* compiler debugging */ \ develop(uintx, SharkStartAt, 0, \ "First method to consider when using Shark") \