src/cpu/sparc/vm/cppInterpreter_sparc.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/cpu/sparc/vm/cppInterpreter_sparc.cpp Mon Mar 3 22:46:20 2014
--- new/src/cpu/sparc/vm/cppInterpreter_sparc.cpp Mon Mar 3 22:46:20 2014
*** 411,430 ****
--- 411,429 ----
__ get_method_counters(G5_method, Rcounters, done);
// Update standard invocation counters
__ increment_invocation_counter(Rcounters, O0, G4_scratch);
if (ProfileInterpreter) {
- Address interpreter_invocation_counter(Rcounters, 0,
in_bytes(MethodCounters::interpreter_invocation_counter_offset()));
__ ld(interpreter_invocation_counter, G4_scratch);
__ inc(G4_scratch);
__ st(G4_scratch, interpreter_invocation_counter);
}
! Address invocation_limit(G3_scratch, (address)&InvocationCounter::InterpreterInvocationLimit);
! __ sethi(invocation_limit);
__ ld(invocation_limit, G3_scratch);
! AddressLiteral invocation_limit((address)&InvocationCounter::InterpreterInvocationLimit);
! __ load_contents(invocation_limit, G3_scratch);
__ cmp(O0, G3_scratch);
__ br(Assembler::greaterEqualUnsigned, false, Assembler::pn, *overflow);
__ delayed()->nop();
__ bind(done);
}
*** 437,447 ****
--- 436,446 ----
Label slow_path;
// do nothing for empty methods (do not even increment invocation counter)
if ( UseFastEmptyMethods) {
// If we need a safepoint check, generate full interpreter entry.
! Address sync_state(G3_scratch, SafepointSynchronize::address_of_state());
! AddressLiteral sync_state(SafepointSynchronize::address_of_state());
__ load_contents(sync_state, G3_scratch);
__ cmp(G3_scratch, SafepointSynchronize::_not_synchronized);
__ br(Assembler::notEqual, false, Assembler::pn, frame_manager_entry);
__ delayed()->nop();
*** 469,479 ****
--- 468,478 ----
Label slow_path;
if ( UseFastAccessorMethods) {
// Check if we need to reach a safepoint and generate full interpreter
// frame if so.
! Address sync_state(G3_scratch, SafepointSynchronize::address_of_state());
! AddressLiteral sync_state(SafepointSynchronize::address_of_state());
__ load_contents(sync_state, G3_scratch);
__ cmp(G3_scratch, SafepointSynchronize::_not_synchronized);
__ br(Assembler::notEqual, false, Assembler::pn, slow_path);
__ delayed()->nop();
*** 484,495 ****
--- 483,494 ----
__ delayed()->nop();
// read first instruction word and extract bytecode @ 1 and index @ 2
// get first 4 bytes of the bytecodes (big endian!)
- __ ld_ptr(Address(G5_method, 0, in_bytes(Method::const_offset())), G1_scratch);
- __ ld(Address(G1_scratch, 0, in_bytes(ConstMethod::codes_offset())), G1_scratch);
// move index @ 2 far left then to the right most two bytes.
__ sll(G1_scratch, 2*BitsPerByte, G1_scratch);
__ srl(G1_scratch, 2*BitsPerByte - exact_log2(in_words(
ConstantPoolCacheEntry::size()) * BytesPerWord), G1_scratch);
*** 588,606 ****
--- 587,605 ----
// the following temporary registers are used during frame creation
const Register Gtmp1 = G3_scratch ;
const Register Gtmp2 = G1_scratch;
const Register RconstMethod = Gtmp1;
- const Address constMethod(G5_method, 0, in_bytes(Method::const_offset()));
- const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset()));
bool inc_counter = UseCompiler || CountCompiledCalls;
// make sure registers are different!
assert_different_registers(G2_thread, G5_method, Gargs, Gtmp1, Gtmp2);
- const Address access_flags (G5_method, 0, in_bytes(Method::access_flags_offset()));
Label Lentry;
__ bind(Lentry);
const Register Glocals_size = G3;
*** 641,651 ****
--- 640,650 ----
generate_compute_interpreter_state(Lstate, G0, true);
// At this point Lstate points to new interpreter state
//
- const Address do_not_unlock_if_synchronized(G2_thread, 0,
in_bytes(JavaThread::do_not_unlock_if_synchronized_offset()));
// Since at this point in the method invocation the exception handler
// would try to exit the monitor of synchronized methods which hasn't
// been entered yet, we set the thread local variable
// _do_not_unlock_if_synchronized to true. If any exception was thrown by
*** 715,735 ****
--- 714,734 ----
Label pending_exception_present;
{ Label L;
__ ld_ptr(STATE(_method), G5_method);
- __ ld_ptr(Address(G5_method, 0, in_bytes(Method::signature_handler_offset())), G3_scratch);
__ tst(G3_scratch);
__ brx(Assembler::notZero, false, Assembler::pt, L);
__ delayed()->nop();
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::prepare_native_call), G5_method, false);
__ ld_ptr(STATE(_method), G5_method);
- Address exception_addr(G2_thread, 0, in_bytes(Thread::pending_exception_offset()));
__ ld_ptr(exception_addr, G3_scratch);
__ br_notnull_short(G3_scratch, Assembler::pn, pending_exception_present);
- __ ld_ptr(Address(G5_method, 0, in_bytes(Method::signature_handler_offset())), G3_scratch);
__ bind(L);
}
// Push a new frame so that the args will really be stored in
// Copy a few locals across so the new frame has the variables
*** 769,785 ****
--- 768,784 ----
__ ld(access_flags, O0);
__ btst(JVM_ACC_STATIC, O0);
__ br( Assembler::zero, false, Assembler::pt, not_static);
__ delayed()->
// get native function entry point(O0 is a good temp until the very end)
- ld_ptr(Address(G5_method, 0, in_bytes(Method::native_function_offset())), O0);
// for static methods insert the mirror argument
const int mirror_offset = in_bytes(Klass::java_mirror_offset());
- __ ld_ptr(Address(G5_method, 0, in_bytes(Method:: const_offset())), O1);
- __ ld_ptr(Address(O1, 0, in_bytes(ConstMethod::constants_offset())), O1);
- __ ld_ptr(Address(O1, 0, ConstantPool::pool_holder_offset_in_bytes()), O1);
__ ld_ptr(O1, mirror_offset, O1);
// where the mirror handle body is allocated:
#ifdef ASSERT
if (!PrintSignatureHandlers) // do not dirty the output with this
{ Label L;
*** 829,850 ****
--- 828,848 ----
// not meaningless information that'll confuse me.
// flush the windows now. We don't care about the current (protection) frame
// only the outer frames
! __ flush_windows();
! __ flushw();
// mark windows as flushed
Address flags(G2_thread,
0,
in_bytes(JavaThread::frame_anchor_offset()) + in_bytes(JavaFrameAnchor::flags_offset()));
__ set(JavaFrameAnchor::flushed, G3_scratch);
__ st(G3_scratch, flags);
// Transition from _thread_in_Java to _thread_in_native. We are already safepoint ready.
- Address thread_state(G2_thread, 0, in_bytes(JavaThread::thread_state_offset()));
#ifdef ASSERT
{ Label L;
__ ld(thread_state, G3_scratch);
__ cmp(G3_scratch, _thread_in_Java);
__ br(Assembler::equal, false, Assembler::pt, L);
*** 865,875 ****
--- 863,873 ----
// must we block?
// Block, if necessary, before resuming in _thread_in_Java state.
// In order for GC to work, don't clear the last_Java_sp until after blocking.
{ Label no_block;
! Address sync_state(G3_scratch, SafepointSynchronize::address_of_state());
! AddressLiteral sync_state(SafepointSynchronize::address_of_state());
// Switch thread to "native transition" state before reading the synchronization state.
// This additional state is necessary because reading and testing the synchronization
// state is not atomic w.r.t. GC, as this scenario demonstrates:
// Java thread A, in _thread_in_native state, loads _not_synchronized and is preempted.
*** 888,898 ****
--- 886,896 ----
__ load_contents(sync_state, G3_scratch);
__ cmp(G3_scratch, SafepointSynchronize::_not_synchronized);
Label L;
- Address suspend_state(G2_thread, 0, in_bytes(JavaThread::suspend_flags_offset()));
__ br(Assembler::notEqual, false, Assembler::pn, L);
__ delayed()->
ld(suspend_state, G3_scratch);
__ cmp(G3_scratch, 0);
__ br(Assembler::equal, false, Assembler::pt, no_block);
*** 963,973 ****
--- 961,971 ----
__ st_ptr(G0, G3_scratch, JNIHandleBlock::top_offset_in_bytes());
// handle exceptions (exception handling will handle unlocking!)
{ Label L;
- Address exception_addr (G2_thread, 0, in_bytes(Thread::pending_exception_offset()));
__ ld_ptr(exception_addr, Gtemp);
__ tst(Gtemp);
__ brx(Assembler::equal, false, Assembler::pt, L);
__ delayed()->nop();
*** 1053,1064 ****
--- 1051,1062 ----
// a new interpretState object and the method expression stack.
assert_different_registers(state, prev_state);
assert_different_registers(prev_state, G3_scratch);
const Register Gtmp = G3_scratch;
- const Address constMethod (G5_method, 0, in_bytes(Method::const_offset()));
- const Address access_flags (G5_method, 0, in_bytes(Method::access_flags_offset()));
// slop factor is two extra slots on the expression stack so that
// we always have room to store a result when returning from a call without parameters
// that returns a result.
*** 1073,1083 ****
--- 1071,1081 ----
// Now compute new frame size
if (native) {
const Register RconstMethod = Gtmp;
- const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset()));
__ ld_ptr(constMethod, RconstMethod);
__ lduh( size_of_parameters, Gtmp );
__ calc_mem_param_words(Gtmp, Gtmp); // space for native call parameters passed on the stack in words
} else {
// Full size expression stack
*** 1244,1255 ****
--- 1242,1253 ----
#endif // ASSERT
}
if (init_value != noreg) {
Label clear_loop;
const Register RconstMethod = O1;
- const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset()));
- const Address size_of_locals (RconstMethod, 0, in_bytes(ConstMethod::size_of_locals_offset()));
// NOTE: If you change the frame layout, this code will need to
// be updated!
__ ld_ptr( constMethod, RconstMethod );
__ lduh( size_of_locals, O2 );
*** 1494,1508 ****
--- 1492,1506 ----
// Destroys args, G3_scratch, G3_scratch
// In/Out O5_savedSP (sender's original SP)
//
// assert_different_registers(state, prev_state);
const Register Gtmp = G3_scratch;
! const Register RconstMethod = G3_scratch;
const Register tmp = O2;
- const Address constMethod(G5_method, 0, in_bytes(Method::const_offset()));
- const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset()));
- const Address size_of_locals (RconstMethod, 0, in_bytes(ConstMethod::size_of_locals_offset()));
__ ld_ptr(constMethod, RconstMethod);
__ lduh(size_of_parameters, tmp);
__ sll(tmp, LogBytesPerWord, Gargs); // parameter size in bytes
__ add(args, Gargs, Gargs); // points to first local + BytesPerWord
*** 1553,1564 ****
--- 1551,1562 ----
// the following temporary registers are used during frame creation
const Register Gtmp1 = G3_scratch;
// const Register Lmirror = L1; // native mirror (native calls only)
- const Address constMethod (G5_method, 0, in_bytes(Method::const_offset()));
- const Address access_flags (G5_method, 0, in_bytes(Method::access_flags_offset()));
address entry_point = __ pc();
__ mov(G0, prevState); // no current activation
*** 1707,1717 ****
--- 1705,1715 ----
// O0: exception
// O7: throwing pc
// We want exception in the thread no matter what we ultimately decide about frame type.
- Address exception_addr (G2_thread, 0, in_bytes(Thread::pending_exception_offset()));
__ verify_thread();
__ st_ptr(O0, exception_addr);
// get the Method*
__ ld_ptr(STATE(_method), G5_method);
src/cpu/sparc/vm/cppInterpreter_sparc.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File