79
80 void C2FastUnlockLightweightStub::emit(C2_MacroAssembler& masm) {
81 assert(_t == rax, "must be");
82
83 Label restore_held_monitor_count_and_slow_path;
84
85 { // Restore lock-stack and handle the unlock in runtime.
86
87 __ bind(_push_and_slow_path);
88 #ifdef ASSERT
89 // The obj was only cleared in debug.
90 __ movl(_t, Address(_thread, JavaThread::lock_stack_top_offset()));
91 __ movptr(Address(_thread, _t), _obj);
92 #endif
93 __ addl(Address(_thread, JavaThread::lock_stack_top_offset()), oopSize);
94 }
95
96 { // Restore held monitor count and slow path.
97
98 __ bind(restore_held_monitor_count_and_slow_path);
99 // Restore held monitor count.
100 __ increment(Address(_thread, JavaThread::held_monitor_count_offset()));
101 // increment will always result in ZF = 0 (no overflows).
102 __ jmp(slow_path_continuation());
103 }
104
105 { // Handle monitor medium path.
106
107 __ bind(_check_successor);
108
109 Label fix_zf_and_unlocked;
110 const Register monitor = _mark;
111
112 #ifndef _LP64
113 __ jmpb(restore_held_monitor_count_and_slow_path);
114 #else // _LP64
115 // successor null check.
116 __ cmpptr(Address(monitor, OM_OFFSET_NO_MONITOR_VALUE_TAG(succ)), NULL_WORD);
117 __ jccb(Assembler::equal, restore_held_monitor_count_and_slow_path);
118
|
79
80 void C2FastUnlockLightweightStub::emit(C2_MacroAssembler& masm) {
81 assert(_t == rax, "must be");
82
83 Label restore_held_monitor_count_and_slow_path;
84
85 { // Restore lock-stack and handle the unlock in runtime.
86
87 __ bind(_push_and_slow_path);
88 #ifdef ASSERT
89 // The obj was only cleared in debug.
90 __ movl(_t, Address(_thread, JavaThread::lock_stack_top_offset()));
91 __ movptr(Address(_thread, _t), _obj);
92 #endif
93 __ addl(Address(_thread, JavaThread::lock_stack_top_offset()), oopSize);
94 }
95
96 { // Restore held monitor count and slow path.
97
98 __ bind(restore_held_monitor_count_and_slow_path);
99 __ bind(_slow_path);
100 // Restore held monitor count.
101 __ increment(Address(_thread, JavaThread::held_monitor_count_offset()));
102 // increment will always result in ZF = 0 (no overflows).
103 __ jmp(slow_path_continuation());
104 }
105
106 { // Handle monitor medium path.
107
108 __ bind(_check_successor);
109
110 Label fix_zf_and_unlocked;
111 const Register monitor = _mark;
112
113 #ifndef _LP64
114 __ jmpb(restore_held_monitor_count_and_slow_path);
115 #else // _LP64
116 // successor null check.
117 __ cmpptr(Address(monitor, OM_OFFSET_NO_MONITOR_VALUE_TAG(succ)), NULL_WORD);
118 __ jccb(Assembler::equal, restore_held_monitor_count_and_slow_path);
119
|