< prev index next >

src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp

Print this page

1777       // Hmm should this move to the slow path code area???
1778 
1779       // Test if the oopMark is an obvious stack pointer, i.e.,
1780       //  1) (mark & 3) == 0, and
1781       //  2) sp <= mark < mark + os::pagesize()
1782       // These 3 tests can be done by evaluating the following
1783       // expression: ((mark - sp) & (3 - os::vm_page_size())),
1784       // assuming both stack pointer and pagesize have their
1785       // least significant 2 bits clear.
1786       // NOTE: the oopMark is in swap_reg %r0 as the result of cmpxchg
1787 
1788       __ sub(swap_reg, sp, swap_reg);
1789       __ neg(swap_reg, swap_reg);
1790       __ ands(swap_reg, swap_reg, 3 - (int)os::vm_page_size());
1791 
1792       // Save the test result, for recursive case, the result is zero
1793       __ str(swap_reg, Address(lock_reg, mark_word_offset));
1794       __ br(Assembler::NE, slow_path_lock);
1795     } else {
1796       assert(LockingMode == LM_LIGHTWEIGHT, "must be");
1797       __ lightweight_lock(obj_reg, swap_reg, tmp, lock_tmp, slow_path_lock);
1798     }
1799     __ bind(count);
1800     __ increment(Address(rthread, JavaThread::held_monitor_count_offset()));
1801 
1802     // Slow path will re-enter here
1803     __ bind(lock_done);
1804   }
1805 
1806 
1807   // Finally just about ready to make the JNI call
1808 
1809   // get JNIEnv* which is first argument to native
1810   __ lea(c_rarg0, Address(rthread, in_bytes(JavaThread::jni_environment_offset())));
1811 
1812   // Now set thread in native
1813   __ mov(rscratch1, _thread_in_native);
1814   __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
1815   __ stlrw(rscratch1, rscratch2);
1816 
1817   __ rt_call(native_func);

1777       // Hmm should this move to the slow path code area???
1778 
1779       // Test if the oopMark is an obvious stack pointer, i.e.,
1780       //  1) (mark & 3) == 0, and
1781       //  2) sp <= mark < mark + os::pagesize()
1782       // These 3 tests can be done by evaluating the following
1783       // expression: ((mark - sp) & (3 - os::vm_page_size())),
1784       // assuming both stack pointer and pagesize have their
1785       // least significant 2 bits clear.
1786       // NOTE: the oopMark is in swap_reg %r0 as the result of cmpxchg
1787 
1788       __ sub(swap_reg, sp, swap_reg);
1789       __ neg(swap_reg, swap_reg);
1790       __ ands(swap_reg, swap_reg, 3 - (int)os::vm_page_size());
1791 
1792       // Save the test result, for recursive case, the result is zero
1793       __ str(swap_reg, Address(lock_reg, mark_word_offset));
1794       __ br(Assembler::NE, slow_path_lock);
1795     } else {
1796       assert(LockingMode == LM_LIGHTWEIGHT, "must be");
1797       __ lightweight_lock(lock_reg, obj_reg, swap_reg, tmp, lock_tmp, slow_path_lock);
1798     }
1799     __ bind(count);
1800     __ increment(Address(rthread, JavaThread::held_monitor_count_offset()));
1801 
1802     // Slow path will re-enter here
1803     __ bind(lock_done);
1804   }
1805 
1806 
1807   // Finally just about ready to make the JNI call
1808 
1809   // get JNIEnv* which is first argument to native
1810   __ lea(c_rarg0, Address(rthread, in_bytes(JavaThread::jni_environment_offset())));
1811 
1812   // Now set thread in native
1813   __ mov(rscratch1, _thread_in_native);
1814   __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
1815   __ stlrw(rscratch1, rscratch2);
1816 
1817   __ rt_call(native_func);
< prev index next >