299 // copied into place by code emitted in the IR. |
299 // copied into place by code emitted in the IR. |
300 |
300 |
301 Register OSR_buf = osrBufferPointer()->as_pointer_register(); |
301 Register OSR_buf = osrBufferPointer()->as_pointer_register(); |
302 { assert(frame::interpreter_frame_monitor_size() == BasicObjectLock::size(), "adjust code below"); |
302 { assert(frame::interpreter_frame_monitor_size() == BasicObjectLock::size(), "adjust code below"); |
303 int monitor_offset = BytesPerWord * method()->max_locals() + |
303 int monitor_offset = BytesPerWord * method()->max_locals() + |
304 (BasicObjectLock::size() * BytesPerWord) * (number_of_locks - 1); |
304 (2 * BytesPerWord) * (number_of_locks - 1); |
|
305 // SharedRuntime::OSR_migration_begin() packs BasicObjectLocks in |
|
306 // the OSR buffer using 2 word entries: first the lock and then |
|
307 // the oop. |
305 for (int i = 0; i < number_of_locks; i++) { |
308 for (int i = 0; i < number_of_locks; i++) { |
306 int slot_offset = monitor_offset - ((i * BasicObjectLock::size()) * BytesPerWord); |
309 int slot_offset = monitor_offset - ((i * 2) * BytesPerWord); |
307 #ifdef ASSERT |
310 #ifdef ASSERT |
308 // verify the interpreter's monitor has a non-null object |
311 // verify the interpreter's monitor has a non-null object |
309 { |
312 { |
310 Label L; |
313 Label L; |
311 __ cmpptr(Address(OSR_buf, slot_offset + BasicObjectLock::obj_offset_in_bytes()), (int32_t)NULL_WORD); |
314 __ cmpptr(Address(OSR_buf, slot_offset + 1*BytesPerWord), (int32_t)NULL_WORD); |
312 __ jcc(Assembler::notZero, L); |
315 __ jcc(Assembler::notZero, L); |
313 __ stop("locked object is NULL"); |
316 __ stop("locked object is NULL"); |
314 __ bind(L); |
317 __ bind(L); |
315 } |
318 } |
316 #endif |
319 #endif |
317 __ movptr(rbx, Address(OSR_buf, slot_offset + BasicObjectLock::lock_offset_in_bytes())); |
320 __ movptr(rbx, Address(OSR_buf, slot_offset + 0)); |
318 __ movptr(frame_map()->address_for_monitor_lock(i), rbx); |
321 __ movptr(frame_map()->address_for_monitor_lock(i), rbx); |
319 __ movptr(rbx, Address(OSR_buf, slot_offset + BasicObjectLock::obj_offset_in_bytes())); |
322 __ movptr(rbx, Address(OSR_buf, slot_offset + 1*BytesPerWord)); |
320 __ movptr(frame_map()->address_for_monitor_object(i), rbx); |
323 __ movptr(frame_map()->address_for_monitor_object(i), rbx); |
321 } |
324 } |
322 } |
325 } |
323 } |
326 } |
324 |
327 |
783 } else { |
786 } else { |
784 if (is_literal_address(addr)) { |
787 if (is_literal_address(addr)) { |
785 ShouldNotReachHere(); |
788 ShouldNotReachHere(); |
786 __ movoop(as_Address(addr, noreg), c->as_jobject()); |
789 __ movoop(as_Address(addr, noreg), c->as_jobject()); |
787 } else { |
790 } else { |
|
791 #ifdef _LP64 |
|
792 __ movoop(rscratch1, c->as_jobject()); |
|
793 null_check_here = code_offset(); |
|
794 __ movptr(as_Address_lo(addr), rscratch1); |
|
795 #else |
788 __ movoop(as_Address(addr), c->as_jobject()); |
796 __ movoop(as_Address(addr), c->as_jobject()); |
|
797 #endif |
789 } |
798 } |
790 } |
799 } |
791 break; |
800 break; |
792 |
801 |
793 case T_LONG: // fall through |
802 case T_LONG: // fall through |
1116 if (src->is_single_stack()) { |
1125 if (src->is_single_stack()) { |
1117 if (type == T_OBJECT || type == T_ARRAY) { |
1126 if (type == T_OBJECT || type == T_ARRAY) { |
1118 __ pushptr(frame_map()->address_for_slot(src ->single_stack_ix())); |
1127 __ pushptr(frame_map()->address_for_slot(src ->single_stack_ix())); |
1119 __ popptr (frame_map()->address_for_slot(dest->single_stack_ix())); |
1128 __ popptr (frame_map()->address_for_slot(dest->single_stack_ix())); |
1120 } else { |
1129 } else { |
|
1130 #ifndef _LP64 |
1121 __ pushl(frame_map()->address_for_slot(src ->single_stack_ix())); |
1131 __ pushl(frame_map()->address_for_slot(src ->single_stack_ix())); |
1122 __ popl (frame_map()->address_for_slot(dest->single_stack_ix())); |
1132 __ popl (frame_map()->address_for_slot(dest->single_stack_ix())); |
|
1133 #else |
|
1134 //no pushl on 64bits |
|
1135 __ movl(rscratch1, frame_map()->address_for_slot(src ->single_stack_ix())); |
|
1136 __ movl(frame_map()->address_for_slot(dest->single_stack_ix()), rscratch1); |
|
1137 #endif |
1123 } |
1138 } |
1124 |
1139 |
1125 } else if (src->is_double_stack()) { |
1140 } else if (src->is_double_stack()) { |
1126 #ifdef _LP64 |
1141 #ifdef _LP64 |
1127 __ pushptr(frame_map()->address_for_slot(src ->double_stack_ix())); |
1142 __ pushptr(frame_map()->address_for_slot(src ->double_stack_ix())); |
3134 __ shlptr(length, shift_amount); |
3149 __ shlptr(length, shift_amount); |
3135 } |
3150 } |
3136 |
3151 |
3137 #ifdef _LP64 |
3152 #ifdef _LP64 |
3138 assert_different_registers(c_rarg0, dst, dst_pos, length); |
3153 assert_different_registers(c_rarg0, dst, dst_pos, length); |
|
3154 __ movl2ptr(src_pos, src_pos); //higher 32bits must be null |
3139 __ lea(c_rarg0, Address(src, src_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type))); |
3155 __ lea(c_rarg0, Address(src, src_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type))); |
3140 assert_different_registers(c_rarg1, length); |
3156 assert_different_registers(c_rarg1, length); |
|
3157 __ movl2ptr(dst_pos, dst_pos); //higher 32bits must be null |
3141 __ lea(c_rarg1, Address(dst, dst_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type))); |
3158 __ lea(c_rarg1, Address(dst, dst_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type))); |
3142 __ mov(c_rarg2, length); |
3159 __ mov(c_rarg2, length); |
3143 |
3160 |
3144 #else |
3161 #else |
3145 __ lea(tmp, Address(src, src_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type))); |
3162 __ lea(tmp, Address(src, src_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type))); |