1817 // Hmm should this move to the slow path code area???
1818
1819 // Test if the oopMark is an obvious stack pointer, i.e.,
1820 // 1) (mark & 3) == 0, and
1821 // 2) sp <= mark < mark + os::pagesize()
1822 // These 3 tests can be done by evaluating the following
1823 // expression: ((mark - sp) & (3 - os::vm_page_size())),
1824 // assuming both stack pointer and pagesize have their
1825 // least significant 2 bits clear.
1826 // NOTE: the oopMark is in swap_reg %r0 as the result of cmpxchg
1827
1828 __ sub(swap_reg, sp, swap_reg);
1829 __ neg(swap_reg, swap_reg);
1830 __ ands(swap_reg, swap_reg, 3 - (int)os::vm_page_size());
1831
1832 // Save the test result, for recursive case, the result is zero
1833 __ str(swap_reg, Address(lock_reg, mark_word_offset));
1834 __ br(Assembler::NE, slow_path_lock);
1835 } else {
1836 assert(LockingMode == LM_LIGHTWEIGHT, "must be");
1837 __ lightweight_lock(obj_reg, swap_reg, tmp, lock_tmp, slow_path_lock);
1838 }
1839 __ bind(count);
1840 __ increment(Address(rthread, JavaThread::held_monitor_count_offset()));
1841
1842 // Slow path will re-enter here
1843 __ bind(lock_done);
1844 }
1845
1846
1847 // Finally just about ready to make the JNI call
1848
1849 // get JNIEnv* which is first argument to native
1850 __ lea(c_rarg0, Address(rthread, in_bytes(JavaThread::jni_environment_offset())));
1851
1852 // Now set thread in native
1853 __ mov(rscratch1, _thread_in_native);
1854 __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
1855 __ stlrw(rscratch1, rscratch2);
1856
1857 __ rt_call(native_func);
|
1817 // Hmm should this move to the slow path code area???
1818
1819 // Test if the oopMark is an obvious stack pointer, i.e.,
1820 // 1) (mark & 3) == 0, and
1821 // 2) sp <= mark < mark + os::pagesize()
1822 // These 3 tests can be done by evaluating the following
1823 // expression: ((mark - sp) & (3 - os::vm_page_size())),
1824 // assuming both stack pointer and pagesize have their
1825 // least significant 2 bits clear.
1826 // NOTE: the oopMark is in swap_reg %r0 as the result of cmpxchg
1827
1828 __ sub(swap_reg, sp, swap_reg);
1829 __ neg(swap_reg, swap_reg);
1830 __ ands(swap_reg, swap_reg, 3 - (int)os::vm_page_size());
1831
1832 // Save the test result, for recursive case, the result is zero
1833 __ str(swap_reg, Address(lock_reg, mark_word_offset));
1834 __ br(Assembler::NE, slow_path_lock);
1835 } else {
1836 assert(LockingMode == LM_LIGHTWEIGHT, "must be");
1837 __ lightweight_lock(lock_reg, obj_reg, swap_reg, tmp, lock_tmp, slow_path_lock);
1838 }
1839 __ bind(count);
1840 __ increment(Address(rthread, JavaThread::held_monitor_count_offset()));
1841
1842 // Slow path will re-enter here
1843 __ bind(lock_done);
1844 }
1845
1846
1847 // Finally just about ready to make the JNI call
1848
1849 // get JNIEnv* which is first argument to native
1850 __ lea(c_rarg0, Address(rthread, in_bytes(JavaThread::jni_environment_offset())));
1851
1852 // Now set thread in native
1853 __ mov(rscratch1, _thread_in_native);
1854 __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
1855 __ stlrw(rscratch1, rscratch2);
1856
1857 __ rt_call(native_func);
|