Mercurial > hg > release > icedtea6-1.3
changeset 1063:f4981f8a1720
2008-10-01 Gary Benson <gbenson@redhat.com>
* ports/hotspot/src/share/vm/shark/sharkState.cpp: Remove a
section of old code that had been #ifdef'd out.
author | Gary Benson <gbenson@redhat.com> |
---|---|
date | Wed, 01 Oct 2008 05:52:01 -0400 |
parents | d03dd528c2ed |
children | 09dcedbe63a8 358cb21c4730 |
files | ChangeLog ports/hotspot/src/share/vm/shark/sharkState.cpp |
diffstat | 2 files changed, 5 insertions(+), 261 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Tue Sep 30 13:22:52 2008 -0400 +++ b/ChangeLog Wed Oct 01 05:52:01 2008 -0400 @@ -1,3 +1,8 @@ +2008-10-01 Gary Benson <gbenson@redhat.com> + + * ports/hotspot/src/share/vm/shark/sharkState.cpp: Remove a + section of old code that had been #ifdef'd out. + 2008-09-30 Lillian Angel <langel@redhat.com> * Makefile.am
--- a/ports/hotspot/src/share/vm/shark/sharkState.cpp Tue Sep 30 13:22:52 2008 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkState.cpp Wed Oct 01 05:52:01 2008 -0400 @@ -205,267 +205,6 @@ } } -#if 0 -void SharkTrackingState::decache_for(CDReason reason, ciMethod *callee) -{ - // Start recording the debug information - OopMap *oopmap = new OopMap( - oopmap_slot_munge(function()->oopmap_frame_size()), - oopmap_slot_munge(function()->arg_size())); - int offset = function()->code_offset(); - debug_info()->add_safepoint(offset, oopmap); - - // Decache expression stack slots as necessary - GrowableArray<ScopeValue*> *exparray = - new GrowableArray<ScopeValue*>(stack_depth()); - - for (int i = stack_depth() - 1; i >= 0; i--) { - SharkValue *value = stack(i); - - Location::Type type = Location::normal; - if (value && value->is_jobject()) - type = Location::oop; - - int dst = i + max_stack() - stack_depth(); - int oiwfusp = function()->stack_slots_offset() + dst; - VMReg dst_as_vmreg = slot2reg(oiwfusp); - LocationValue* dst_as_lv = slot2lv(oiwfusp, type); - - bool write = false; - bool record = false; - - if (reason == TRAP) { - write = value != NULL; - record = true; - } - else if (value) { - if (reason == JAVA_CALL && i < callee->arg_size()) { - write = true; - record = false; - } - else { - write = value->is_jobject(); - record = true; - } - } - - if (write) { - if (value->is_two_word()) { - assert(i > 0, "should be"); - assert(stack(i - 1) == NULL, "should be"); - dst--; - } - - builder()->CreateStore( - value->generic_value(), - builder()->CreateBitCast( - builder()->CreateStructGEP(function()->stack_slots(), dst), - PointerType::getUnqual(SharkType::to_stackType( - value->basic_type())))); - - if (record) - oopmap->set_oop(dst_as_vmreg); - } - - if (record) - exparray->append(dst_as_lv); - } - - // If we're decaching for a call then pop the arguments - int trim_slots = max_stack() - stack_depth(); - if (reason == JAVA_CALL) - pop(callee->arg_size()); - - // Record any monitors - GrowableArray<MonitorValue*> *monarray = - new GrowableArray<MonitorValue*>(function()->monitor_count()); - - for (int i = 0; i < function()->monitor_count(); i++) { - int box_oiwfusp = - function()->monitors_slots_offset() + - i * frame::interpreter_frame_monitor_size(); - - int obj_oiwfusp = - box_oiwfusp + - (BasicObjectLock::obj_offset_in_bytes() >> LogBytesPerWord); - - oopmap->set_oop(slot2reg(obj_oiwfusp)); - - monarray->append(new MonitorValue( - slot2lv (obj_oiwfusp, Location::oop), - slot2loc(box_oiwfusp, Location::normal))); - } - - // Record the exception slot - oopmap->set_oop(slot2reg(function()->exception_slot_offset())); - - // Decache the method pointer - builder()->CreateStore(method(), function()->method_slot()); - oopmap->set_oop(slot2reg(function()->method_slot_offset())); - - // Decache the PC - builder()->CreateStore( - builder()->CreateAdd( - function()->base_pc(), LLVMValue::intptr_constant(offset)), - function()->pc_slot()); - - // Decache local variables as necesary - GrowableArray<ScopeValue*> *locarray = - new GrowableArray<ScopeValue*>(max_locals()); - - for (int i = 0; i < max_locals(); i++) { - SharkValue *value = local(i); - - Location::Type type = Location::invalid; - if (value) { - if (value->is_jobject()) - type = Location::oop; - else - type = Location::normal; - } - else if (i > 0) { - SharkValue *prev = local(i - 1); - if (prev && prev->is_two_word()) - type = Location::normal; - } - - int dst = max_locals() - 1 - i; - int oiwfusp = function()->locals_slots_offset() + dst; - VMReg dst_as_vmreg = slot2reg(oiwfusp); - LocationValue* dst_as_lv = slot2lv(oiwfusp, type); - - if (value) { - if (value->is_two_word()) { - assert(i + 1 < max_locals(), "should be"); - assert(local(i + 1) == NULL, "should be"); - dst--; - } - - if (reason == TRAP || value->is_jobject()) { - builder()->CreateStore( - value->generic_value(), - builder()->CreateBitCast( - builder()->CreateStructGEP(function()->locals_slots(), dst), - PointerType::getUnqual( - SharkType::to_stackType(value->basic_type())))); - } - - if (value->is_jobject()) - oopmap->set_oop(dst_as_vmreg); - } - locarray->append(dst_as_lv); - } - - // Trim back the stack if necessary - if (trim_slots) { - function()->CreateStoreZeroStackPointer( - builder()->CreatePtrToInt( - builder()->CreateStructGEP( - function()->stack_slots(), trim_slots), - SharkType::intptr_type())); - } - - // Record the scope and end the block of debug information - DebugToken *locvals = debug_info()->create_scope_values(locarray); - DebugToken *expvals = debug_info()->create_scope_values(exparray); - DebugToken *monvals = debug_info()->create_monitor_values(monarray); - debug_info()->describe_scope( - offset, block()->target(), block()->bci(), locvals, expvals, monvals); - debug_info()->end_safepoint(offset); -} - -void SharkTrackingState::cache_after(CDReason reason, ciMethod *callee) -{ - assert(reason != TRAP, "shouldn't be"); - - // If we're caching after a call then push a dummy result to set up the stack - int result_size = reason == JAVA_CALL ? callee->return_type()->size() : 0; - if (result_size) { - ciType *result_type; - switch (callee->return_type()->basic_type()) { - case T_BOOLEAN: - case T_BYTE: - case T_CHAR: - case T_SHORT: - result_type = ciType::make(T_INT); - break; - - default: - result_type = callee->return_type(); - } - - push(SharkValue::create_generic(result_type, NULL)); - if (result_size == 2) - push(NULL); - } - - // Cache expression stack slots as necessary - for (int i = 0; i < stack_depth(); i++) { - SharkValue *value = stack(i); - if (value == NULL) { - set_stack(i, NULL); - continue; - } - - bool read; - - if (i < result_size) { - read = true; - } - else { - read = value->is_jobject(); - } - - if (read) { - int src = i + max_stack() - stack_depth(); - if (value->is_two_word()) { - assert(i > 0, "should be"); - assert(stack(i - 1) == NULL, "should be"); - src--; - } - - set_stack( - i, - SharkValue::create_generic( - value->type(), - builder()->CreateLoad( - builder()->CreateBitCast( - builder()->CreateStructGEP(function()->stack_slots(), src), - PointerType::getUnqual( - SharkType::to_stackType(value->basic_type())))))); - } - } - - // Cache the method pointer - set_method(builder()->CreateLoad(function()->method_slot())); - - // Cache local variables as necesary - for (int i = max_locals() - 1; i >= 0; i--) { - SharkValue *value = local(i); - if (value && value->is_jobject()) { - int src = max_locals() - 1 - i; - set_local( - i, - SharkValue::create_generic( - value->type(), - builder()->CreateLoad( - builder()->CreateBitCast( - builder()->CreateStructGEP(function()->locals_slots(), src), - PointerType::getUnqual( - SharkType::to_stackType(value->type())))))); - } - } - - // Restore the stack pointer if necessary - if (stack_depth() != max_stack()) { - function()->CreateStoreZeroStackPointer( - builder()->CreatePtrToInt( - builder()->CreateStructGEP(function()->stack_slots(), 0), - SharkType::intptr_type())); - } -} -#endif // 0 - void SharkTrackingState::merge(SharkState* other, BasicBlock* other_block, BasicBlock* this_block)