Lines Matching defs:__
40 #define __ _masm->
145 __ movq(rdx, obj.base());
148 __ leaq(rdx, obj);
150 __ g1_write_barrier_pre(rdx /* obj */,
157 __ store_heap_oop_null(Address(rdx, 0));
163 __ movptr(new_val, val);
165 __ store_heap_oop(Address(rdx, 0), val);
166 __ g1_write_barrier_post(rdx /* store_adr */,
179 __ store_heap_oop_null(obj);
181 __ store_heap_oop(obj, val);
184 __ store_check(obj.base());
186 __ leaq(rdx, obj);
187 __ store_check(rdx);
195 __ store_heap_oop_null(obj);
197 __ store_heap_oop(obj, val);
234 __ get_cache_and_index_and_bytecode_at_bcp(temp_reg, bc_reg, temp_reg, byte_no, 1);
235 __ movl(bc_reg, bc);
236 __ cmpl(temp_reg, (int) 0);
237 __ jcc(Assembler::zero, L_patch_done); // don't patch
244 __ movl(bc_reg, bc);
251 __ movzbl(temp_reg, at_bcp(0));
252 __ cmpl(temp_reg, Bytecodes::_breakpoint);
253 __ jcc(Assembler::notEqual, L_fast_patch);
254 __ get_method(temp_reg);
256 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::set_original_bytecode_at), temp_reg, r13, bc_reg);
258 __ jmpb(L_patch_done);
260 __ jmp(L_patch_done);
262 __ bind(L_fast_patch);
267 __ load_unsigned_byte(temp_reg, at_bcp(0));
268 __ cmpl(temp_reg, (int) Bytecodes::java_code(bc));
269 __ jcc(Assembler::equal, L_okay);
270 __ cmpl(temp_reg, bc_reg);
271 __ jcc(Assembler::equal, L_okay);
272 __ stop("patching the wrong bytecode");
273 __ bind(L_okay);
277 __ movb(at_bcp(0), bc_reg);
278 __ bind(L_patch_done);
291 __ stop("shouldnotreachhere bytecode");
296 __ xorl(rax, rax);
302 __ xorl(rax, rax);
304 __ movl(rax, value);
311 __ xorl(rax, rax);
313 __ movl(rax, value);
322 __ xorps(xmm0, xmm0);
325 __ movflt(xmm0, ExternalAddress((address) &one));
328 __ movflt(xmm0, ExternalAddress((address) &two));
341 __ xorpd(xmm0, xmm0);
344 __ movdbl(xmm0, ExternalAddress((address) &one));
354 __ load_signed_byte(rax, at_bcp(1));
359 __ load_unsigned_short(rax, at_bcp(1));
360 __ bswapl(rax);
361 __ sarl(rax, 16);
369 __ get_unsigned_2_byte_index_at_bcp(rbx, 1);
371 __ load_unsigned_byte(rbx, at_bcp(1));
374 __ get_cpool_and_tags(rcx, rax);
379 __ movzbl(rdx, Address(rax, rbx, Address::times_1, tags_offset));
382 __ cmpl(rdx, JVM_CONSTANT_UnresolvedString);
383 __ jccb(Assembler::equal, call_ldc);
386 __ cmpl(rdx, JVM_CONSTANT_UnresolvedClass);
387 __ jccb(Assembler::equal, call_ldc);
391 __ cmpl(rdx, JVM_CONSTANT_UnresolvedClassInError);
392 __ jccb(Assembler::equal, call_ldc);
395 __ cmpl(rdx, JVM_CONSTANT_Class);
396 __ jcc(Assembler::notEqual, notClass);
398 __ bind(call_ldc);
399 __ movl(c_rarg1, wide);
401 __ push_ptr(rax);
402 __ verify_oop(rax);
403 __ jmp(Done);
405 __ bind(notClass);
406 __ cmpl(rdx, JVM_CONSTANT_Float);
407 __ jccb(Assembler::notEqual, notFloat);
409 __ movflt(xmm0, Address(rcx, rbx, Address::times_8, base_offset));
410 __ push_f();
411 __ jmp(Done);
413 __ bind(notFloat);
417 __ cmpl(rdx, JVM_CONSTANT_Integer);
418 __ jcc(Assembler::equal, L);
419 __ cmpl(rdx, JVM_CONSTANT_String);
420 __ jcc(Assembler::equal, L);
421 __ cmpl(rdx, JVM_CONSTANT_Object);
422 __ jcc(Assembler::equal, L);
423 __ stop("unexpected tag type in ldc");
424 __ bind(L);
429 __ cmpl(rdx, JVM_CONSTANT_Integer);
430 __ jcc(Assembler::notEqual, isOop);
431 __ movl(rax, Address(rcx, rbx, Address::times_8, base_offset));
432 __ push_i(rax);
433 __ jmp(Done);
435 __ bind(isOop);
436 __ movptr(rax, Address(rcx, rbx, Address::times_8, base_offset));
437 __ push_ptr(rax);
440 __ verify_oop(rax);
443 __ bind(Done);
456 __ call_VM(noreg, CAST_FROM_FN_PTR(address,
459 __ should_not_reach_here();
468 __ verify_oop(rax);
474 __ load_klass(con_klass_temp, rax);
475 __ lea(array_klass_temp, ExternalAddress((address)Universe::systemObjArrayKlassObj_addr()));
476 __ cmpptr(con_klass_temp, Address(array_klass_temp, 0));
477 __ jcc(Assembler::notEqual, L_done);
478 __ cmpl(Address(rax, arrayOopDesc::length_offset_in_bytes()), 0);
479 __ jcc(Assembler::notEqual, L_throw_exception);
480 __ xorptr(rax, rax);
481 __ jmp(L_done);
484 __ bind(L_throw_exception);
485 __ load_heap_oop(rax, Address(rax, arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
486 __ jump(ExternalAddress(Interpreter::throw_exception_entry()));
488 __ bind(L_done);
494 __ get_unsigned_2_byte_index_at_bcp(rbx, 1);
496 __ get_cpool_and_tags(rcx, rax);
501 __ cmpb(Address(rax, rbx, Address::times_1, tags_offset),
503 __ jccb(Assembler::notEqual, Long);
505 __ movdbl(xmm0, Address(rcx, rbx, Address::times_8, base_offset));
506 __ push_d();
507 __ jmpb(Done);
509 __ bind(Long);
511 __ movq(rax, Address(rcx, rbx, Address::times_8, base_offset));
512 __ push_l();
514 __ bind(Done);
518 __ load_unsigned_byte(reg, at_bcp(offset));
519 __ negptr(reg);
530 __ load_unsigned_byte(rbx,
536 __ cmpl(rbx, Bytecodes::_iload);
537 __ jcc(Assembler::equal, done);
539 __ cmpl(rbx, Bytecodes::_fast_iload);
540 __ movl(bc, Bytecodes::_fast_iload2);
541 __ jccb(Assembler::equal, rewrite);
544 __ cmpl(rbx, Bytecodes::_caload);
545 __ movl(bc, Bytecodes::_fast_icaload);
546 __ jccb(Assembler::equal, rewrite);
549 __ movl(bc, Bytecodes::_fast_iload);
553 __ bind(rewrite);
555 __ bind(done);
560 __ movl(rax, iaddress(rbx));
566 __ movl(rax, iaddress(rbx));
567 __ push(itos);
569 __ movl(rax, iaddress(rbx));
575 __ movl(rax, iaddress(rbx));
581 __ movq(rax, laddress(rbx));
587 __ movflt(xmm0, faddress(rbx));
593 __ movdbl(xmm0, daddress(rbx));
599 __ movptr(rax, aaddress(rbx));
603 __ movl(reg, at_bcp(2));
604 __ bswapl(reg);
605 __ shrl(reg, 16);
606 __ negptr(reg);
612 __ movl(rax, iaddress(rbx));
618 __ movq(rax, laddress(rbx));
624 __ movflt(xmm0, faddress(rbx));
630 __ movdbl(xmm0, daddress(rbx));
636 __ movptr(rax, aaddress(rbx));
642 __ null_check(array, arrayOopDesc::length_offset_in_bytes());
644 __ movl2ptr(index, index);
646 __ cmpl(index, Address(array, arrayOopDesc::length_offset_in_bytes()));
650 __ movl(rbx, index);
652 __ jump_cc(Assembler::aboveEqual,
658 __ pop_ptr(rdx);
662 __ movl(rax, Address(rdx, rax,
669 __ pop_ptr(rdx);
673 __ movq(rax, Address(rdx, rbx,
680 __ pop_ptr(rdx);
684 __ movflt(xmm0, Address(rdx, rax,
691 __ pop_ptr(rdx);
695 __ movdbl(xmm0, Address(rdx, rax,
702 __ pop_ptr(rdx);
706 __ load_heap_oop(rax, Address(rdx, rax,
713 __ pop_ptr(rdx);
717 __ load_signed_byte(rax,
725 __ pop_ptr(rdx);
729 __ load_unsigned_short(rax,
740 __ movl(rax, iaddress(rbx));
744 __ pop_ptr(rdx);
746 __ load_unsigned_short(rax,
754 __ pop_ptr(rdx);
758 __ load_signed_short(rax,
766 __ movl(rax, iaddress(n));
771 __ movq(rax, laddress(n));
776 __ movflt(xmm0, faddress(n));
781 __ movdbl(xmm0, daddress(n));
786 __ movptr(rax, aaddress(n));
817 __ load_unsigned_byte(rbx,
824 __ cmpl(rbx, Bytecodes::_getfield);
825 __ jcc(Assembler::equal, done);
831 __ cmpl(rbx, Bytecodes::_fast_igetfield);
832 __ movl(bc, Bytecodes::_fast_iaccess_0);
833 __ jccb(Assembler::equal, rewrite);
839 __ cmpl(rbx, Bytecodes::_fast_agetfield);
840 __ movl(bc, Bytecodes::_fast_aaccess_0);
841 __ jccb(Assembler::equal, rewrite);
847 __ cmpl(rbx, Bytecodes::_fast_fgetfield);
848 __ movl(bc, Bytecodes::_fast_faccess_0);
849 __ jccb(Assembler::equal, rewrite);
855 __ movl(bc, Bytecodes::_fast_aload_0);
859 __ bind(rewrite);
862 __ bind(done);
871 __ movl(iaddress(rbx), rax);
877 __ movq(laddress(rbx), rax);
883 __ movflt(faddress(rbx), xmm0);
889 __ movdbl(daddress(rbx), xmm0);
894 __ pop_ptr(rax);
896 __ movptr(aaddress(rbx), rax);
901 __ pop_i();
903 __ movl(iaddress(rbx), rax);
908 __ pop_l();
910 __ movq(laddress(rbx), rax);
915 __ pop_f();
917 __ movflt(faddress(rbx), xmm0);
922 __ pop_d();
924 __ movdbl(daddress(rbx), xmm0);
929 __ pop_ptr(rax);
931 __ movptr(aaddress(rbx), rax);
936 __ pop_i(rbx);
937 __ pop_ptr(rdx);
942 __ movl(Address(rdx, rbx,
950 __ pop_i(rbx);
951 __ pop_ptr(rdx);
956 __ movq(Address(rdx, rbx,
964 __ pop_i(rbx);
965 __ pop_ptr(rdx);
970 __ movflt(Address(rdx, rbx,
978 __ pop_i(rbx);
979 __ pop_ptr(rdx);
984 __ movdbl(Address(rdx, rbx,
994 __ movptr(rax, at_tos()); // value
995 __ movl(rcx, at_tos_p1()); // index
996 __ movptr(rdx, at_tos_p2()); // array
1004 __ testptr(rax, rax);
1005 __ jcc(Assembler::zero, is_null);
1008 __ load_klass(rbx, rax);
1010 __ load_klass(rax, rdx);
1011 __ movptr(rax, Address(rax,
1014 __ lea(rdx, element_address);
1018 __ gen_subtype_check(rbx, ok_is_subtype);
1022 __ jump(ExternalAddress(Interpreter::_throw_ArrayStoreException_entry));
1025 __ bind(ok_is_subtype);
1028 __ movptr(rax, at_tos());
1031 __ jmp(done);
1034 __ bind(is_null);
1035 __ profile_null_seen(rbx);
1041 __ bind(done);
1042 __ addptr(rsp, 3 * Interpreter::stackElementSize);
1047 __ pop_i(rbx);
1048 __ pop_ptr(rdx);
1053 __ movb(Address(rdx, rbx,
1061 __ pop_i(rbx);
1062 __ pop_ptr(rdx);
1067 __ movw(Address(rdx, rbx,
1079 __ movl(iaddress(n), rax);
1084 __ movq(laddress(n), rax);
1089 __ movflt(faddress(n), xmm0);
1094 __ movdbl(daddress(n), xmm0);
1099 __ pop_ptr(rax);
1100 __ movptr(aaddress(n), rax);
1105 __ addptr(rsp, Interpreter::stackElementSize);
1110 __ addptr(rsp, 2 * Interpreter::stackElementSize);
1115 __ load_ptr(0, rax);
1116 __ push_ptr(rax);
1123 __ load_ptr( 0, rax); // load b
1124 __ load_ptr( 1, rcx); // load a
1125 __ store_ptr(1, rax); // store b
1126 __ store_ptr(0, rcx); // store a
1127 __ push_ptr(rax); // push b
1134 __ load_ptr( 0, rax); // load c
1135 __ load_ptr( 2, rcx); // load a
1136 __ store_ptr(2, rax); // store c in a
1137 __ push_ptr(rax); // push c
1139 __ load_ptr( 2, rax); // load b
1140 __ store_ptr(2, rcx); // store a in b
1142 __ store_ptr(1, rax); // store b in c
1149 __ load_ptr(1, rax); // load a
1150 __ push_ptr(rax); // push a
1151 __ load_ptr(1, rax); // load b
1152 __ push_ptr(rax); // push b
1159 __ load_ptr( 0, rcx); // load c
1160 __ load_ptr( 1, rax); // load b
1161 __ push_ptr(rax); // push b
1162 __ push_ptr(rcx); // push c
1164 __ store_ptr(3, rcx); // store c in b
1166 __ load_ptr( 4, rcx); // load a
1167 __ store_ptr(2, rcx); // store a in 2nd c
1169 __ store_ptr(4, rax); // store b in a
1176 __ load_ptr( 0, rcx); // load d
1177 __ load_ptr( 1, rax); // load c
1178 __ push_ptr(rax); // push c
1179 __ push_ptr(rcx); // push d
1181 __ load_ptr( 4, rax); // load b
1182 __ store_ptr(2, rax); // store b in d
1183 __ store_ptr(4, rcx); // store d in b
1185 __ load_ptr( 5, rcx); // load a
1186 __ load_ptr( 3, rax); // load c
1187 __ store_ptr(3, rcx); // store a in c
1188 __ store_ptr(5, rax); // store c in a
1195 __ load_ptr( 1, rcx); // load a
1196 __ load_ptr( 0, rax); // load b
1197 __ store_ptr(0, rcx); // store a in b
1198 __ store_ptr(1, rax); // store b in a
1205 case add : __ pop_i(rdx); __ addl (rax, rdx); break;
1206 case sub : __ movl(rdx, rax); __ pop_i(rax); __ subl (rax, rdx); break;
1207 case mul : __ pop_i(rdx); __ imull(rax, rdx); break;
1208 case _and : __ pop_i(rdx); __ andl (rax, rdx); break;
1209 case _or : __ pop_i(rdx); __ orl (rax, rdx); break;
1210 case _xor : __ pop_i(rdx); __ xorl (rax, rdx); break;
1211 case shl : __ movl(rcx, rax); __ pop_i(rax); __ shll (rax); break;
1212 case shr : __ movl(rcx, rax); __ pop_i(rax); __ sarl (rax); break;
1213 case ushr : __ movl(rcx, rax); __ pop_i(rax); __ shrl (rax); break;
1221 case add : __ pop_l(rdx); __ addptr(rax, rdx); break;
1222 case sub : __ mov(rdx, rax); __ pop_l(rax); __ subptr(rax, rdx); break;
1223 case _and : __ pop_l(rdx); __ andptr(rax, rdx); break;
1224 case _or : __ pop_l(rdx); __ orptr (rax, rdx); break;
1225 case _xor : __ pop_l(rdx); __ xorptr(rax, rdx); break;
1232 __ movl(rcx, rax);
1233 __ pop_i(rax);
1238 __ corrected_idivl(rcx);
1243 __ movl(rcx, rax);
1244 __ pop_i(rax);
1249 __ corrected_idivl(rcx);
1250 __ movl(rax, rdx);
1255 __ pop_l(rdx);
1256 __ imulq(rax, rdx);
1261 __ mov(rcx, rax);
1262 __ pop_l(rax);
1264 __ testq(rcx, rcx);
1265 __ jump_cc(Assembler::zero,
1271 __ corrected_idivq(rcx); // kills rbx
1276 __ mov(rcx, rax);
1277 __ pop_l(rax);
1278 __ testq(rcx, rcx);
1279 __ jump_cc(Assembler::zero,
1285 __ corrected_idivq(rcx); // kills rbx
1286 __ mov(rax, rdx);
1291 __ movl(rcx, rax); // get shift count
1292 __ pop_l(rax); // get shift value
1293 __ shlq(rax);
1298 __ movl(rcx, rax); // get shift count
1299 __ pop_l(rax); // get shift value
1300 __ sarq(rax);
1305 __ movl(rcx, rax); // get shift count
1306 __ pop_l(rax); // get shift value
1307 __ shrq(rax);
1314 __ addss(xmm0, at_rsp());
1315 __ addptr(rsp, Interpreter::stackElementSize);
1318 __ movflt(xmm1, xmm0);
1319 __ pop_f(xmm0);
1320 __ subss(xmm0, xmm1);
1323 __ mulss(xmm0, at_rsp());
1324 __ addptr(rsp, Interpreter::stackElementSize);
1327 __ movflt(xmm1, xmm0);
1328 __ pop_f(xmm0);
1329 __ divss(xmm0, xmm1);
1332 __ movflt(xmm1, xmm0);
1333 __ pop_f(xmm0);
1334 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::frem), 2);
1346 __ addsd(xmm0, at_rsp());
1347 __ addptr(rsp, 2 * Interpreter::stackElementSize);
1350 __ movdbl(xmm1, xmm0);
1351 __ pop_d(xmm0);
1352 __ subsd(xmm0, xmm1);
1355 __ mulsd(xmm0, at_rsp());
1356 __ addptr(rsp, 2 * Interpreter::stackElementSize);
1359 __ movdbl(xmm1, xmm0);
1360 __ pop_d(xmm0);
1361 __ divsd(xmm0, xmm1);
1364 __ movdbl(xmm1, xmm0);
1365 __ pop_d(xmm0);
1366 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::drem), 2);
1376 __ negl(rax);
1381 __ negq(rax);
1402 __ xorps(xmm0, ExternalAddress((address) float_signflip));
1408 __ xorpd(xmm0, ExternalAddress((address) double_signflip));
1413 __ load_signed_byte(rdx, at_bcp(2)); // get constant
1415 __ addl(iaddress(rbx), rdx);
1420 __ movl(rdx, at_bcp(4)); // get constant
1422 __ bswapl(rdx); // swap bytes & sign-extend constant
1423 __ sarl(rdx, 16);
1424 __ addl(iaddress(rbx), rdx);
1480 __ movslq(rax, rax);
1483 __ cvtsi2ssl(xmm0, rax);
1486 __ cvtsi2sdl(xmm0, rax);
1489 __ movsbl(rax, rax);
1492 __ movzwl(rax, rax);
1495 __ movswl(rax, rax);
1498 __ movl(rax, rax);
1501 __ cvtsi2ssq(xmm0, rax);
1504 __ cvtsi2sdq(xmm0, rax);
1509 __ cvttss2sil(rax, xmm0);
1510 __ cmpl(rax, 0x80000000); // NaN or overflow/underflow?
1511 __ jcc(Assembler::notEqual, L);
1512 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::f2i), 1);
1513 __ bind(L);
1519 __ cvttss2siq(rax, xmm0);
1521 __ cmp64(rax, ExternalAddress((address) &is_nan));
1522 __ jcc(Assembler::notEqual, L);
1523 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::f2l), 1);
1524 __ bind(L);
1528 __ cvtss2sd(xmm0, xmm0);
1533 __ cvttsd2sil(rax, xmm0);
1534 __ cmpl(rax, 0x80000000); // NaN or overflow/underflow?
1535 __ jcc(Assembler::notEqual, L);
1536 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::d2i), 1);
1537 __ bind(L);
1543 __ cvttsd2siq(rax, xmm0);
1545 __ cmp64(rax, ExternalAddress((address) &is_nan));
1546 __ jcc(Assembler::notEqual, L);
1547 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::d2l), 1);
1548 __ bind(L);
1552 __ cvtsd2ss(xmm0, xmm0);
1562 __ pop_l(rdx);
1563 __ cmpq(rdx, rax);
1564 __ movl(rax, -1);
1565 __ jccb(Assembler::less, done);
1566 __ setb(Assembler::notEqual, rax);
1567 __ movzbl(rax, rax);
1568 __ bind(done);
1575 __ pop_f(xmm1);
1576 __ ucomiss(xmm1, xmm0);
1579 __ pop_d(xmm1);
1580 __ ucomisd(xmm1, xmm0);
1583 __ movl(rax, -1);
1584 __ jccb(Assembler::parity, done);
1585 __ jccb(Assembler::below, done);
1586 __ setb(Assembler::notEqual, rdx);
1587 __ movzbl(rax, rdx);
1589 __ movl(rax, 1);
1590 __ jccb(Assembler::parity, done);
1591 __ jccb(Assembler::above, done);
1592 __ movl(rax, 0);
1593 __ jccb(Assembler::equal, done);
1594 __ decrementl(rax);
1596 __ bind(done);
1600 __ get_method(rcx); // rcx holds method
1601 __ profile_taken_branch(rax, rbx); // rax holds updated MDP, rbx
1611 __ movl(rdx, at_bcp(1));
1612 __ bswapl(rdx);
1615 __ sarl(rdx, 16);
1617 __ movl2ptr(rdx, rdx);
1624 __ load_unsigned_byte(rbx, Address(r13, rdx, Address::times_1, 0));
1627 __ lea(rax, at_bcp((is_wide ? 5 : 3) -
1629 __ subptr(rax, Address(rcx, methodOopDesc::const_offset()));
1631 __ addptr(r13, rdx);
1633 __ push_i(rax);
1634 __ dispatch_only(vtos);
1641 __ addptr(r13, rdx);
1656 __ testl(rdx, rdx); // check if forward or backward branch
1657 __ jcc(Assembler::positive, dispatch); // count only if backward branch
1664 __ movptr(rbx, Address(rcx, in_bytes(methodOopDesc::method_data_offset())));
1665 __ testptr(rbx, rbx);
1666 __ jccb(Assembler::zero, no_mdo);
1670 __ increment_mask_and_jump(mdo_backedge_counter, increment, mask,
1672 __ jmp(dispatch);
1674 __ bind(no_mdo);
1676 __ increment_mask_and_jump(Address(rcx, be_offset), increment, mask,
1680 __ movl(rax, Address(rcx, be_offset)); // load backedge counter
1681 __ incrementl(rax, InvocationCounter::count_increment); // increment counter
1682 __ movl(Address(rcx, be_offset), rax); // store counter
1684 __ movl(rax, Address(rcx, inv_offset)); // load invocation counter
1685 __ andl(rax, InvocationCounter::count_mask_value); // and the status bits
1686 __ addl(rax, Address(rcx, be_offset)); // add both counters
1690 __ cmp32(rax,
1692 __ jcc(Assembler::less, dispatch);
1695 __ test_method_data_pointer(rax, profile_method);
1699 __ cmp32(rbx,
1701 __ jcc(Assembler::below, dispatch);
1710 __ andl(rbx, overflow_frequency - 1);
1711 __ jcc(Assembler::zero, backedge_counter_overflow);
1718 __ cmp32(rax,
1720 __ jcc(Assembler::aboveEqual, backedge_counter_overflow);
1725 __ bind(dispatch);
1729 __ load_unsigned_byte(rbx, Address(r13, 0));
1735 __ dispatch_only(vtos);
1740 __ bind(profile_method);
1741 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method));
1742 __ load_unsigned_byte(rbx, Address(r13, 0)); // restore target bytecode
1743 __ set_method_data_pointer_for_bcp();
1744 __ jmp(dispatch);
1749 __ bind(backedge_counter_overflow);
1750 __ negptr(rdx);
1751 __ addptr(rdx, r13); // branch bcp
1753 __ call_VM(noreg,
1757 __ load_unsigned_byte(rbx, Address(r13, 0)); // restore target bytecode
1764 __ testptr(rax, rax); // test result
1765 __ jcc(Assembler::zero, dispatch); // no osr if null
1767 __ movl(rcx, Address(rax, nmethod::entry_bci_offset()));
1768 __ cmpl(rcx, InvalidOSREntryBci);
1769 __ jcc(Assembler::equal, dispatch);
1775 __ mov(r13, rax); // save the nmethod
1780 __ mov(j_rarg0, rax);
1790 __ movptr(sender_sp, Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize)); // get sender sp
1791 __ leave(); // remove frame anchor
1792 __ pop(retaddr); // get return address
1793 __ mov(rsp, sender_sp); // set sp to sender sp
1795 __ andptr(rsp, -(StackAlignmentInBytes));
1801 __ push(retaddr);
1804 __ jmp(Address(r13, nmethod::osr_entry_point_offset()));
1814 __ testl(rax, rax);
1815 __ jcc(j_not(cc), not_taken);
1817 __ bind(not_taken);
1818 __ profile_not_taken_branch(rax);
1825 __ pop_i(rdx);
1826 __ cmpl(rdx, rax);
1827 __ jcc(j_not(cc), not_taken);
1829 __ bind(not_taken);
1830 __ profile_not_taken_branch(rax);
1837 __ testptr(rax, rax);
1838 __ jcc(j_not(cc), not_taken);
1840 __ bind(not_taken);
1841 __ profile_not_taken_branch(rax);
1848 __ pop_ptr(rdx);
1849 __ cmpptr(rdx, rax);
1850 __ jcc(j_not(cc), not_taken);
1852 __ bind(not_taken);
1853 __ profile_not_taken_branch(rax);
1859 __ movslq(rbx, iaddress(rbx)); // get return bci, compute return bcp
1860 __ profile_ret(rbx, rcx);
1861 __ get_method(rax);
1862 __ movptr(r13, Address(rax, methodOopDesc::const_offset()));
1863 __ lea(r13, Address(r13, rbx, Address::times_1,
1865 __ dispatch_next(vtos);
1871 __ movptr(rbx, aaddress(rbx)); // get return bci, compute return bcp
1872 __ profile_ret(rbx, rcx);
1873 __ get_method(rax);
1874 __ movptr(r13, Address(rax, methodOopDesc::const_offset()));
1875 __ lea(r13, Address(r13, rbx, Address::times_1, constMethodOopDesc::codes_offset()));
1876 __ dispatch_next(vtos);
1883 __ lea(rbx, at_bcp(BytesPerInt));
1884 __ andptr(rbx, -BytesPerInt);
1886 __ movl(rcx, Address(rbx, BytesPerInt));
1887 __ movl(rdx, Address(rbx, 2 * BytesPerInt));
1888 __ bswapl(rcx);
1889 __ bswapl(rdx);
1891 __ cmpl(rax, rcx);
1892 __ jcc(Assembler::less, default_case);
1893 __ cmpl(rax, rdx);
1894 __ jcc(Assembler::greater, default_case);
1896 __ subl(rax, rcx);
1897 __ movl(rdx, Address(rbx, rax, Address::times_4, 3 * BytesPerInt));
1898 __ profile_switch_case(rax, rbx, rcx);
1900 __ bind(continue_execution);
1901 __ bswapl(rdx);
1902 __ movl2ptr(rdx, rdx);
1903 __ load_unsigned_byte(rbx, Address(r13, rdx, Address::times_1));
1904 __ addptr(r13, rdx);
1905 __ dispatch_only(vtos);
1907 __ bind(default_case);
1908 __ profile_switch_default(rax);
1909 __ movl(rdx, Address(rbx, 0));
1910 __ jmp(continue_execution);
1915 __ stop("lookupswitch bytecode should have been rewritten");
1922 __ bswapl(rax);
1924 __ lea(rbx, at_bcp(BytesPerInt)); // btw: should be able to get rid of
1927 __ andptr(rbx, -BytesPerInt);
1929 __ movl(rcx, Address(rbx, BytesPerInt));
1930 __ bswapl(rcx);
1931 __ jmpb(loop_entry);
1933 __ bind(loop);
1934 __ cmpl(rax, Address(rbx, rcx, Address::times_8, 2 * BytesPerInt));
1935 __ jcc(Assembler::equal, found);
1936 __ bind(loop_entry);
1937 __ decrementl(rcx);
1938 __ jcc(Assembler::greaterEqual, loop);
1940 __ profile_switch_default(rax);
1941 __ movl(rdx, Address(rbx, 0));
1942 __ jmp(continue_execution);
1944 __ bind(found);
1945 __ movl(rdx, Address(rbx, rcx, Address::times_8, 3 * BytesPerInt));
1946 __ profile_switch_case(rcx, rax, rbx);
1948 __ bind(continue_execution);
1949 __ bswapl(rdx);
1950 __ movl2ptr(rdx, rdx);
1951 __ load_unsigned_byte(rbx, Address(r13, rdx, Address::times_1));
1952 __ addptr(r13, rdx);
1953 __ dispatch_only(vtos);
1992 __ lea(array, at_bcp(3 * BytesPerInt)); // btw: should be able to
1996 __ andptr(array, -BytesPerInt);
1999 __ xorl(i, i); // i = 0;
2000 __ movl(j, Address(array, -BytesPerInt)); // j = length(array);
2003 __ bswapl(j);
2007 __ jmp(entry);
2012 __ bind(loop);
2014 __ leal(h, Address(i, j, Address::times_1)); // h = i + j;
2015 __ sarl(h, 1); // h = (i + j) >> 1;
2022 __ movl(temp, Address(array, h, Address::times_8));
2023 __ bswapl(temp);
2024 __ cmpl(key, temp);
2026 __ cmovl(Assembler::less, j, h);
2028 __ cmovl(Assembler::greaterEqual, i, h);
2030 __ bind(entry);
2031 __ leal(h, Address(i, 1)); // i+1
2032 __ cmpl(h, j); // i+1 < j
2033 __ jcc(Assembler::less, loop);
2039 __ movl(temp, Address(array, i, Address::times_8));
2040 __ bswapl(temp);
2041 __ cmpl(key, temp);
2042 __ jcc(Assembler::notEqual, default_case);
2045 __ movl(j , Address(array, i, Address::times_8, BytesPerInt));
2046 __ profile_switch_case(i, key, array);
2047 __ bswapl(j);
2048 __ movl2ptr(j, j);
2049 __ load_unsigned_byte(rbx, Address(r13, j, Address::times_1));
2050 __ addptr(r13, j);
2051 __ dispatch_only(vtos);
2054 __ bind(default_case);
2055 __ profile_switch_default(i);
2056 __ movl(j, Address(array, -2 * BytesPerInt));
2057 __ bswapl(j);
2058 __ movl2ptr(j, j);
2059 __ load_unsigned_byte(rbx, Address(r13, j, Address::times_1));
2060 __ addptr(r13, j);
2061 __ dispatch_only(vtos);
2072 __ movptr(c_rarg1, aaddress(0));
2073 __ load_klass(rdi, c_rarg1);
2074 __ movl(rdi, Address(rdi, Klass::access_flags_offset()));
2075 __ testl(rdi, JVM_ACC_HAS_FINALIZER);
2077 __ jcc(Assembler::zero, skip_register_finalizer);
2079 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), c_rarg1);
2081 __ bind(skip_register_finalizer);
2084 __ remove_activation(state, r13);
2085 __ jmp(r13);
2120 __ membar(order_constraint);
2139 __ get_cache_and_index_at_bcp(Rcache, index, 1, index_size);
2140 __ movptr(result, Address(Rcache, index, Address::times_ptr, constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::f1_offset()));
2141 __ testptr(result, result);
2142 __ jcc(Assembler::notEqual, resolved);
2146 __ get_cache_and_index_and_bytecode_at_bcp(Rcache, index, temp, byte_no, 1, index_size);
2147 __ cmpl(temp, (int) bytecode()); // have we resolved this bytecode?
2148 __ jcc(Assembler::equal, resolved);
2182 __ movl(temp, (int) bytecode());
2183 __ call_VM(noreg, entry, temp);
2186 __ get_cache_and_index_at_bcp(Rcache, index, 1, index_size);
2188 __ movptr(result, Address(Rcache, index, Address::times_ptr, constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::f1_offset()));
2189 __ bind(resolved);
2203 __ movptr(off, Address(cache, index, Address::times_ptr,
2207 __ movl(flags, Address(cache, index, Address::times_ptr,
2213 __ movptr(obj, Address(cache, index, Address::times_ptr,
2252 __ movptr(method, Address(cache, index, Address::times_ptr, index_offset));
2256 __ movptr(method, Address(cache, index, Address::times_ptr, method_offset));
2261 __ movptr(itable_index, Address(cache, index, Address::times_ptr, index_offset));
2263 __ movl(flags, Address(cache, index, Address::times_ptr, flags_offset));
2279 __ mov32(rax, ExternalAddress((address) JvmtiExport::get_field_access_count_addr()));
2280 __ testl(rax, rax);
2281 __ jcc(Assembler::zero, L1);
2283 __ get_cache_and_index_at_bcp(c_rarg2, c_rarg3, 1);
2286 __ addptr(c_rarg2, in_bytes(constantPoolCacheOopDesc::base_offset()));
2287 __ shll(c_rarg3, LogBytesPerWord);
2288 __ addptr(c_rarg2, c_rarg3);
2290 __ xorl(c_rarg1, c_rarg1); // NULL object reference
2292 __ movptr(c_rarg1, at_tos()); // get object pointer without popping it
2293 __ verify_oop(c_rarg1);
2298 __ call_VM(noreg, CAST_FROM_FN_PTR(address,
2301 __ get_cache_and_index_at_bcp(cache, index, 1);
2302 __ bind(L1);
2307 __ pop_ptr(r);
2308 __ null_check(r); // for field access must check obj.
2309 __ verify_oop(r);
2336 __ shrl(flags, ConstantPoolCacheEntry::tos_state_shift);
2340 __ andl(flags, ConstantPoolCacheEntry::tos_state_mask);
2341 __ jcc(Assembler::notZero, notByte);
2343 __ load_signed_byte(rax, field);
2344 __ push(btos);
2349 __ jmp(Done);
2351 __ bind(notByte);
2352 __ cmpl(flags, atos);
2353 __ jcc(Assembler::notEqual, notObj);
2355 __ load_heap_oop(rax, field);
2356 __ push(atos);
2360 __ jmp(Done);
2362 __ bind(notObj);
2363 __ cmpl(flags, itos);
2364 __ jcc(Assembler::notEqual, notInt);
2366 __ movl(rax, field);
2367 __ push(itos);
2372 __ jmp(Done);
2374 __ bind(notInt);
2375 __ cmpl(flags, ctos);
2376 __ jcc(Assembler::notEqual, notChar);
2378 __ load_unsigned_short(rax, field);
2379 __ push(ctos);
2384 __ jmp(Done);
2386 __ bind(notChar);
2387 __ cmpl(flags, stos);
2388 __ jcc(Assembler::notEqual, notShort);
2390 __ load_signed_short(rax, field);
2391 __ push(stos);
2396 __ jmp(Done);
2398 __ bind(notShort);
2399 __ cmpl(flags, ltos);
2400 __ jcc(Assembler::notEqual, notLong);
2402 __ movq(rax, field);
2403 __ push(ltos);
2408 __ jmp(Done);
2410 __ bind(notLong);
2411 __ cmpl(flags, ftos);
2412 __ jcc(Assembler::notEqual, notFloat);
2414 __ movflt(xmm0, field);
2415 __ push(ftos);
2420 __ jmp(Done);
2422 __ bind(notFloat);
2424 __ cmpl(flags, dtos);
2425 __ jcc(Assembler::notEqual, notDouble);
2428 __ movdbl(xmm0, field);
2429 __ push(dtos);
2435 __ jmp(Done);
2437 __ bind(notDouble);
2438 __ stop("Bad state");
2441 __ bind(Done);
2468 __ mov32(rax, ExternalAddress((address)JvmtiExport::get_field_modification_count_addr()));
2469 __ testl(rax, rax);
2470 __ jcc(Assembler::zero, L1);
2472 __ get_cache_and_index_at_bcp(c_rarg2, rscratch1, 1);
2476 __ xorl(c_rarg1, c_rarg1);
2482 __ movl(c_rarg3, Address(c_rarg2, rscratch1,
2486 __ shrl(c_rarg3, ConstantPoolCacheEntry::tos_state_shift);
2489 __ movptr(c_rarg1, at_tos_p1()); // initially assume a one word jvalue
2490 __ cmpl(c_rarg3, ltos);
2491 __ cmovptr(Assembler::equal,
2493 __ cmpl(c_rarg3, dtos);
2494 __ cmovptr(Assembler::equal,
2498 __ addptr(c_rarg2, in_bytes(cp_base_offset));
2499 __ shll(rscratch1, LogBytesPerWord);
2500 __ addptr(c_rarg2, rscratch1);
2502 __ mov(c_rarg3, rsp);
2506 __ call_VM(noreg,
2510 __ get_cache_and_index_at_bcp(cache, index, 1);
2511 __ bind(L1);
2534 __ movl(rdx, flags);
2535 __ shrl(rdx, ConstantPoolCacheEntry::is_volatile_shift);
2536 __ andl(rdx, 0x1);
2544 __ shrl(flags, ConstantPoolCacheEntry::tos_state_shift);
2547 __ andl(flags, ConstantPoolCacheEntry::tos_state_mask);
2548 __ jcc(Assembler::notZero, notByte);
2552 __ pop(btos);
2554 __ movb(field, rax);
2558 __ jmp(Done);
2561 __ bind(notByte);
2562 __ cmpl(flags, atos);
2563 __ jcc(Assembler::notEqual, notObj);
2567 __ pop(atos);
2574 __ jmp(Done);
2577 __ bind(notObj);
2578 __ cmpl(flags, itos);
2579 __ jcc(Assembler::notEqual, notInt);
2583 __ pop(itos);
2585 __ movl(field, rax);
2589 __ jmp(Done);
2592 __ bind(notInt);
2593 __ cmpl(flags, ctos);
2594 __ jcc(Assembler::notEqual, notChar);
2598 __ pop(ctos);
2600 __ movw(field, rax);
2604 __ jmp(Done);
2607 __ bind(notChar);
2608 __ cmpl(flags, stos);
2609 __ jcc(Assembler::notEqual, notShort);
2613 __ pop(stos);
2615 __ movw(field, rax);
2619 __ jmp(Done);
2622 __ bind(notShort);
2623 __ cmpl(flags, ltos);
2624 __ jcc(Assembler::notEqual, notLong);
2628 __ pop(ltos);
2630 __ movq(field, rax);
2634 __ jmp(Done);
2637 __ bind(notLong);
2638 __ cmpl(flags, ftos);
2639 __ jcc(Assembler::notEqual, notFloat);
2643 __ pop(ftos);
2645 __ movflt(field, xmm0);
2649 __ jmp(Done);
2652 __ bind(notFloat);
2654 __ cmpl(flags, dtos);
2655 __ jcc(Assembler::notEqual, notDouble);
2660 __ pop(dtos);
2662 __ movdbl(field, xmm0);
2669 __ jmp(Done);
2671 __ bind(notDouble);
2672 __ stop("Bad state");
2675 __ bind(Done);
2678 __ testl(rdx, rdx);
2679 __ jcc(Assembler::zero, notVolatile);
2682 __ bind(notVolatile);
2698 __ mov32(c_rarg3, ExternalAddress((address)JvmtiExport::get_field_modification_count_addr()));
2699 __ testl(c_rarg3, c_rarg3);
2700 __ jcc(Assembler::zero, L2);
2701 __ pop_ptr(rbx); // copy the object pointer from tos
2702 __ verify_oop(rbx);
2703 __ push_ptr(rbx); // put the object pointer back on tos
2708 case Bytecodes::_fast_aputfield: __ push_ptr(rax); break;
2712 case Bytecodes::_fast_iputfield: __ push_i(rax); break;
2713 case Bytecodes::_fast_dputfield: __ push_d(); break;
2714 case Bytecodes::_fast_fputfield: __ push_f(); break;
2715 case Bytecodes::_fast_lputfield: __ push_l(rax); break;
2720 __ mov(c_rarg3, rsp); // points to jvalue on the stack
2722 __ get_cache_entry_pointer_at_bcp(c_rarg2, rax, 1);
2723 __ verify_oop(rbx);
2727 __ call_VM(noreg,
2733 case Bytecodes::_fast_aputfield: __ pop_ptr(rax); break;
2737 case Bytecodes::_fast_iputfield: __ pop_i(rax); break;
2738 case Bytecodes::_fast_dputfield: __ pop_d(); break;
2739 case Bytecodes::_fast_fputfield: __ pop_f(); break;
2740 case Bytecodes::_fast_lputfield: __ pop_l(rax); break;
2742 __ bind(L2);
2754 __ get_cache_and_index_at_bcp(rcx, rbx, 1);
2757 __ movl(rdx, Address(rcx, rbx, Address::times_8,
2762 __ movptr(rbx, Address(rcx, rbx, Address::times_8,
2770 __ shrl(rdx, ConstantPoolCacheEntry::is_volatile_shift);
2771 __ andl(rdx, 0x1);
2785 __ movq(field, rax);
2788 __ movl(field, rax);
2791 __ movb(field, rax);
2796 __ movw(field, rax);
2799 __ movflt(field, xmm0);
2802 __ movdbl(field, xmm0);
2809 __ testl(rdx, rdx);
2810 __ jcc(Assembler::zero, notVolatile);
2813 __ bind(notVolatile);
2825 __ mov32(rcx, ExternalAddress((address) JvmtiExport::get_field_access_count_addr()));
2826 __ testl(rcx, rcx);
2827 __ jcc(Assembler::zero, L1);
2829 __ get_cache_entry_pointer_at_bcp(c_rarg2, rcx, 1);
2830 __ verify_oop(rax);
2831 __ push_ptr(rax); // save object pointer before call_VM() clobbers it
2832 __ mov(c_rarg1, rax);
2835 __ call_VM(noreg,
2839 __ pop_ptr(rax); // restore object pointer
2840 __ bind(L1);
2844 __ get_cache_and_index_at_bcp(rcx, rbx, 1);
2848 // __ movl(rdx, Address(rcx, rbx, Address::times_8,
2851 // __ shrl(rdx, ConstantPoolCacheEntry::is_volatile_shift);
2852 // __ andl(rdx, 0x1);
2854 __ movptr(rbx, Address(rcx, rbx, Address::times_8,
2859 __ verify_oop(rax);
2860 __ null_check(rax);
2866 __ load_heap_oop(rax, field);
2867 __ verify_oop(rax);
2870 __ movq(rax, field);
2873 __ movl(rax, field);
2876 __ movsbl(rax, field);
2879 __ load_signed_short(rax, field);
2882 __ load_unsigned_short(rax, field);
2885 __ movflt(xmm0, field);
2888 __ movdbl(xmm0, field);
2896 // __ testl(rdx, rdx);
2897 // __ jcc(Assembler::zero, notVolatile);
2898 // __ membar(Assembler::LoadLoad);
2899 // __ bind(notVolatile);
2907 __ movptr(rax, aaddress(0));
2909 __ get_cache_and_index_at_bcp(rcx, rdx, 2);
2910 __ movptr(rbx,
2916 __ increment(r13);
2917 __ null_check(rax);
2920 __ movl(rax, Address(rax, rbx, Address::times_1));
2923 __ load_heap_oop(rax, Address(rax, rbx, Address::times_1));
2924 __ verify_oop(rax);
2927 __ movflt(xmm0, Address(rax, rbx, Address::times_1));
2936 // __ movl(rdx, Address(rcx, rdx, Address::times_8,
2939 // __ shrl(rdx, ConstantPoolCacheEntry::is_volatile_shift);
2940 // __ testl(rdx, 0x1);
2941 // __ jcc(Assembler::zero, notVolatile);
2942 // __ membar(Assembler::LoadLoad);
2943 // __ bind(notVolatile);
2946 __ decrement(r13);
2985 __ save_bcp();
2992 __ verify_oop(index);
2993 __ testl(flags, (1 << ConstantPoolCacheEntry::has_appendix_shift));
2994 __ jccb(Assembler::zero, L_no_push);
2998 __ push(index); // push appendix (MethodType, CallSite, etc.)
2999 __ bind(L_no_push);
3005 __ movl(recv, flags);
3006 __ andl(recv, ConstantPoolCacheEntry::parameter_size_mask);
3009 Address recv_addr = __ argument_address(recv, no_return_pc_pushed_yet + receiver_is_at_end);
3010 __ movptr(recv, recv_addr);
3011 __ verify_oop(recv);
3015 __ movl(r13, flags);
3019 __ shrl(flags, ConstantPoolCacheEntry::tos_state_shift);
3028 __ lea(rscratch1, table);
3029 __ movptr(flags, Address(rscratch1, flags, Address::times_ptr));
3033 __ push(flags);
3038 __ movl(flags, r13);
3039 __ restore_bcp();
3054 __ movl(rax, flags);
3055 __ andl(rax, (1 << ConstantPoolCacheEntry::is_vfinal_shift));
3056 __ jcc(Assembler::zero, notFinal);
3064 __ verify_oop(method);
3067 __ null_check(recv);
3070 __ profile_final_call(rax);
3072 __ jump_from_interpreted(method, rax);
3074 __ bind(notFinal);
3077 __ null_check(recv, oopDesc::klass_offset_in_bytes());
3078 __ load_klass(rax, recv);
3079 __ verify_oop(rax);
3082 __ profile_virtual_call(rax, r14, rdx);
3085 __ lookup_virtual_method(rax, index, method);
3086 __ jump_from_interpreted(method, rdx);
3111 __ verify_oop(rcx);
3112 __ null_check(rcx);
3114 __ verify_oop(rbx);
3115 __ profile_call(rax);
3116 __ jump_from_interpreted(rbx, rax);
3125 __ verify_oop(rbx);
3126 __ profile_call(rax);
3127 __ jump_from_interpreted(rbx, rax);
3133 __ stop("fast_invokevfinal not used on amd64");
3152 __ movl(r14, rdx);
3153 __ andl(r14, (1 << ConstantPoolCacheEntry::is_forced_virtual_shift));
3154 __ jcc(Assembler::zero, notMethod);
3157 __ bind(notMethod);
3160 __ restore_locals(); // restore r14
3161 __ null_check(rcx, oopDesc::klass_offset_in_bytes());
3162 __ load_klass(rdx, rcx);
3163 __ verify_oop(rdx);
3166 __ profile_virtual_call(rdx, r13, r14);
3170 __ lookup_interface_method(// inputs: rec. class, interface, itable index
3182 __ testptr(rbx, rbx);
3183 __ jcc(Assembler::zero, no_such_method);
3188 __ jump_from_interpreted(rbx, rdx);
3189 __ should_not_reach_here();
3195 __ bind(no_such_method);
3197 __ pop(rbx); // pop return address (pushed by prepare_invoke)
3198 __ restore_bcp(); // r13 must be correct for exception handler (was destroyed)
3199 __ restore_locals(); // make sure locals pointer is correct as well (was destroyed)
3200 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError));
3202 __ should_not_reach_here();
3204 __ bind(no_such_interface);
3206 __ pop(rbx); // pop return address (pushed by prepare_invoke)
3207 __ restore_bcp(); // r13 must be correct for exception handler (was destroyed)
3208 __ restore_locals(); // make sure locals pointer is correct as well (was destroyed)
3209 __ call_VM(noreg, CAST_FROM_FN_PTR(address,
3212 __ should_not_reach_here();
3226 __ should_not_reach_here();
3233 __ verify_oop(rbx_method);
3234 __ verify_oop(rcx_recv);
3235 __ null_check(rcx_recv);
3240 __ profile_final_call(rax);
3242 __ jump_from_interpreted(rbx_method, rdx);
3254 __ call_VM(noreg, CAST_FROM_FN_PTR(address,
3257 __ should_not_reach_here();
3273 __ profile_call(r13);
3275 __ verify_oop(rax_callsite);
3277 __ jump_from_interpreted(rbx_method, rdx);
3286 __ get_unsigned_2_byte_index_at_bcp(rdx, 1);
3293 __ get_cpool_and_tags(rsi, rax);
3298 __ cmpb(Address(rax, rdx, Address::times_1, tags_offset),
3300 __ jcc(Assembler::notEqual, slow_case);
3303 __ movptr(rsi, Address(rsi, rdx,
3308 __ cmpb(Address(rsi,
3311 __ jcc(Assembler::notEqual, slow_case);
3314 __ movl(rdx,
3318 __ testl(rdx, Klass::_lh_instance_slow_path_bit);
3319 __ jcc(Assembler::notZero, slow_case);
3331 __ movptr(rax, Address(r15_thread, in_bytes(JavaThread::tlab_top_offset())));
3332 __ lea(rbx, Address(rax, rdx, Address::times_1));
3333 __ cmpptr(rbx, Address(r15_thread, in_bytes(JavaThread::tlab_end_offset())));
3334 __ jcc(Assembler::above, allow_shared_alloc ? allocate_shared : slow_case);
3335 __ movptr(Address(r15_thread, in_bytes(JavaThread::tlab_top_offset())), rbx);
3338 __ jmp(initialize_header);
3341 __ jmp(initialize_object);
3349 __ bind(allocate_shared);
3357 __ lea(RtopAddr, top);
3358 __ lea(RendAddr, end);
3359 __ movptr(rax, Address(RtopAddr, 0));
3363 __ bind(retry);
3364 __ lea(rbx, Address(rax, rdx, Address::times_1));
3365 __ cmpptr(rbx, Address(RendAddr, 0));
3366 __ jcc(Assembler::above, slow_case);
3376 __ lock();
3378 __ cmpxchgptr(rbx, Address(RtopAddr, 0));
3381 __ jcc(Assembler::notEqual, retry);
3383 __ incr_allocated_bytes(r15_thread, rdx, 0);
3389 __ bind(initialize_object);
3390 __ decrementl(rdx, sizeof(oopDesc));
3391 __ jcc(Assembler::zero, initialize_header);
3394 __ xorl(rcx, rcx); // use zero reg to clear memory (shorter code)
3395 __ shrl(rdx, LogBytesPerLong); // divide by oopSize to simplify the loop
3398 __ bind(loop);
3399 __ movq(Address(rax, rdx, Address::times_8,
3402 __ decrementl(rdx);
3403 __ jcc(Assembler::notZero, loop);
3407 __ bind(initialize_header);
3409 __ movptr(rscratch1, Address(rsi, Klass::prototype_header_offset()));
3410 __ movptr(Address(rax, oopDesc::mark_offset_in_bytes()), rscratch1);
3412 __ movptr(Address(rax, oopDesc::mark_offset_in_bytes()),
3415 __ xorl(rcx, rcx); // use zero reg to clear memory (shorter code)
3416 __ store_klass_gap(rax, rcx); // zero klass gap for compressed oops
3417 __ store_klass(rax, rsi); // store klass last
3422 __ push(atos); // save the return value
3423 __ call_VM_leaf(
3425 __ pop(atos); // restore the return value
3428 __ jmp(done);
3433 __ bind(slow_case);
3434 __ get_constant_pool(c_rarg1);
3435 __ get_unsigned_2_byte_index_at_bcp(c_rarg2, 1);
3437 __ verify_oop(rax);
3440 __ bind(done);
3445 __ load_unsigned_byte(c_rarg1, at_bcp(1));
3446 __ movl(c_rarg2, rax);
3453 __ get_unsigned_2_byte_index_at_bcp(c_rarg2, 1);
3454 __ get_constant_pool(c_rarg1);
3455 __ movl(c_rarg3, rax);
3462 __ null_check(rax, arrayOopDesc::length_offset_in_bytes());
3463 __ movl(rax, Address(rax, arrayOopDesc::length_offset_in_bytes()));
3469 __ testptr(rax, rax); // object is in rax
3470 __ jcc(Assembler::zero, is_null);
3473 __ get_cpool_and_tags(rcx, rdx); // rcx=cpool, rdx=tags array
3474 __ get_unsigned_2_byte_index_at_bcp(rbx, 1); // rbx=index
3476 __ cmpb(Address(rdx, rbx,
3480 __ jcc(Assembler::equal, quicked);
3481 __ push(atos); // save receiver for result, and for GC
3483 __ pop_ptr(rdx); // restore receiver
3484 __ jmpb(resolved);
3487 __ bind(quicked);
3488 __ mov(rdx, rax); // Save object in rdx; rax needed for subtype check
3489 __ movptr(rax, Address(rcx, rbx,
3492 __ bind(resolved);
3493 __ load_klass(rbx, rdx);
3497 __ gen_subtype_check(rbx, ok_is_subtype);
3500 __ push_ptr(rdx);
3502 __ jump(ExternalAddress(Interpreter::_throw_ClassCastException_entry));
3505 __ bind(ok_is_subtype);
3506 __ mov(rax, rdx); // Restore object in rdx
3510 __ jmp(done);
3511 __ bind(is_null);
3512 __ profile_null_seen(rcx);
3514 __ bind(is_null); // same as 'done'
3516 __ bind(done);
3522 __ testptr(rax, rax);
3523 __ jcc(Assembler::zero, is_null);
3526 __ get_cpool_and_tags(rcx, rdx); // rcx=cpool, rdx=tags array
3527 __ get_unsigned_2_byte_index_at_bcp(rbx, 1); // rbx=index
3529 __ cmpb(Address(rdx, rbx,
3533 __ jcc(Assembler::equal, quicked);
3535 __ push(atos); // save receiver for result, and for GC
3537 __ pop_ptr(rdx); // restore receiver
3538 __ verify_oop(rdx);
3539 __ load_klass(rdx, rdx);
3540 __ jmpb(resolved);
3543 __ bind(quicked);
3544 __ load_klass(rdx, rax);
3545 __ movptr(rax, Address(rcx, rbx,
3548 __ bind(resolved);
3552 __ gen_subtype_check(rdx, ok_is_subtype);
3555 __ xorl(rax, rax);
3556 __ jmpb(done);
3558 __ bind(ok_is_subtype);
3559 __ movl(rax, 1);
3563 __ jmp(done);
3564 __ bind(is_null);
3565 __ profile_null_seen(rcx);
3567 __ bind(is_null); // same as 'done'
3569 __ bind(done);
3584 __ get_method(c_rarg1);
3585 __ call_VM(noreg,
3589 __ mov(rbx, rax);
3592 __ get_method(c_rarg1);
3593 __ call_VM(noreg,
3598 __ dispatch_only_normal(vtos);
3606 __ null_check(rax);
3607 __ jump(ExternalAddress(Interpreter::throw_exception_entry()));
3631 __ null_check(rax);
3642 __ xorl(c_rarg1, c_rarg1); // points to free slot or NULL
3647 __ movptr(c_rarg3, monitor_block_top); // points to current entry,
3649 __ lea(c_rarg2, monitor_block_bot); // points to word before bottom
3651 __ jmpb(entry);
3653 __ bind(loop);
3655 __ cmpptr(Address(c_rarg3, BasicObjectLock::obj_offset_in_bytes()), (int32_t) NULL_WORD);
3657 __ cmov(Assembler::equal, c_rarg1, c_rarg3);
3659 __ cmpptr(rax, Address(c_rarg3, BasicObjectLock::obj_offset_in_bytes()));
3661 __ jccb(Assembler::equal, exit);
3663 __ addptr(c_rarg3, entry_size);
3664 __ bind(entry);
3666 __ cmpptr(c_rarg3, c_rarg2);
3668 __ jcc(Assembler::notEqual, loop);
3669 __ bind(exit);
3672 __ testptr(c_rarg1, c_rarg1); // check if a slot has been found
3673 __ jcc(Assembler::notZero, allocated); // if found, continue with that one
3679 __ movptr(c_rarg1, monitor_block_bot); // c_rarg1: old expression stack bottom
3680 __ subptr(rsp, entry_size); // move expression stack top
3681 __ subptr(c_rarg1, entry_size); // move expression stack bottom
3682 __ mov(c_rarg3, rsp); // set start value for copy loop
3683 __ movptr(monitor_block_bot, c_rarg1); // set new monitor block bottom
3684 __ jmp(entry);
3686 __ bind(loop);
3687 __ movptr(c_rarg2, Address(c_rarg3, entry_size)); // load expression stack
3689 __ movptr(Address(c_rarg3, 0), c_rarg2); // and store it at new location
3690 __ addptr(c_rarg3, wordSize); // advance to next word
3691 __ bind(entry);
3692 __ cmpptr(c_rarg3, c_rarg1); // check if bottom reached
3693 __ jcc(Assembler::notEqual, loop); // if not at bottom then
3699 __ bind(allocated);
3705 __ increment(r13);
3708 __ movptr(Address(c_rarg1, BasicObjectLock::obj_offset_in_bytes()), rax);
3709 __ lock_object(c_rarg1);
3712 __ save_bcp(); // in case of exception
3713 __ generate_stack_overflow_check(0);
3717 __ dispatch_next(vtos);
3725 __ null_check(rax);
3738 __ movptr(c_rarg1, monitor_block_top); // points to current entry,
3740 __ lea(c_rarg2, monitor_block_bot); // points to word before bottom
3742 __ jmpb(entry);
3744 __ bind(loop);
3746 __ cmpptr(rax, Address(c_rarg1, BasicObjectLock::obj_offset_in_bytes()));
3748 __ jcc(Assembler::equal, found);
3750 __ addptr(c_rarg1, entry_size);
3751 __ bind(entry);
3753 __ cmpptr(c_rarg1, c_rarg2);
3755 __ jcc(Assembler::notEqual, loop);
3759 __ call_VM(noreg, CAST_FROM_FN_PTR(address,
3761 __ should_not_reach_here();
3765 __ bind(found);
3766 __ push_ptr(rax); // make sure object is on stack (contract with oopMaps)
3767 __ unlock_object(c_rarg1);
3768 __ pop_ptr(rax); // discard object
3775 __ load_unsigned_byte(rbx, at_bcp(1));
3776 __ lea(rscratch1, ExternalAddress((address)Interpreter::_wentry_point));
3777 __ jmp(Address(rscratch1, rbx, Address::times_8));
3786 __ load_unsigned_byte(rax, at_bcp(3)); // get number of dimensions
3789 __ lea(c_rarg1, Address(rsp, rax, Address::times_8, -wordSize));
3793 __ load_unsigned_byte(rbx, at_bcp(3));
3794 __ lea(rsp, Address(rsp, rbx, Address::times_8));