Lines Matching defs:__
40 #define __ _masm->
136 __ movl(rdx, obj.base());
139 __ leal(rdx, obj);
141 __ get_thread(rcx);
142 __ save_bcp();
143 __ g1_write_barrier_pre(rdx /* obj */,
153 __ movptr(Address(rdx, 0), NULL_WORD);
156 __ movl(Address(rdx, 0), val);
157 __ g1_write_barrier_post(rdx /* store_adr */,
163 __ restore_bcp();
172 __ movptr(obj, NULL_WORD);
174 __ movl(obj, val);
177 __ store_check(obj.base());
179 __ leal(rdx, obj);
180 __ store_check(rdx);
188 __ movptr(obj, NULL_WORD);
190 __ movl(obj, val);
228 __ get_cache_and_index_and_bytecode_at_bcp(bc_reg, temp_reg, temp_reg, byte_no, 1);
229 __ movl(bc_reg, bc);
230 __ cmpl(temp_reg, (int) 0);
231 __ jcc(Assembler::zero, L_patch_done); // don't patch
238 __ movl(bc_reg, bc);
245 __ movzbl(temp_reg, at_bcp(0));
246 __ cmpl(temp_reg, Bytecodes::_breakpoint);
247 __ jcc(Assembler::notEqual, L_fast_patch);
248 __ get_method(temp_reg);
250 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::set_original_bytecode_at), temp_reg, rsi, bc_reg);
252 __ jmpb(L_patch_done);
254 __ jmp(L_patch_done);
256 __ bind(L_fast_patch);
261 __ load_unsigned_byte(temp_reg, at_bcp(0));
262 __ cmpl(temp_reg, (int)Bytecodes::java_code(bc));
263 __ jccb(Assembler::equal, L_okay);
264 __ cmpl(temp_reg, bc_reg);
265 __ jcc(Assembler::equal, L_okay);
266 __ stop("patching the wrong bytecode");
267 __ bind(L_okay);
271 __ movb(at_bcp(0), bc_reg);
272 __ bind(L_patch_done);
285 __ stop("shouldnotreachhere bytecode");
292 __ xorptr(rax, rax);
299 __ xorptr(rax, rax);
301 __ movptr(rax, value);
309 __ xorptr(rax, rax);
311 __ movptr(rax, value);
314 __ xorptr(rdx, rdx);
320 if (value == 0) { __ fldz();
321 } else if (value == 1) { __ fld1();
322 } else if (value == 2) { __ fld1(); __ fld1(); __ faddp(); // should do a better solution here
330 if (value == 0) { __ fldz();
331 } else if (value == 1) { __ fld1();
339 __ load_signed_byte(rax, at_bcp(1));
345 __ load_unsigned_short(rax, at_bcp(1));
346 __ bswapl(rax);
347 __ sarl(rax, 16);
355 __ get_unsigned_2_byte_index_at_bcp(rbx, 1);
357 __ load_unsigned_byte(rbx, at_bcp(1));
359 __ get_cpool_and_tags(rcx, rax);
364 __ xorptr(rdx, rdx);
365 __ movb(rdx, Address(rax, rbx, Address::times_1, tags_offset));
368 __ cmpl(rdx, JVM_CONSTANT_UnresolvedString);
369 __ jccb(Assembler::equal, call_ldc);
372 __ cmpl(rdx, JVM_CONSTANT_UnresolvedClass);
373 __ jccb(Assembler::equal, call_ldc);
377 __ cmpl(rdx, JVM_CONSTANT_UnresolvedClassInError);
378 __ jccb(Assembler::equal, call_ldc);
381 __ cmpl(rdx, JVM_CONSTANT_Class);
382 __ jcc(Assembler::notEqual, notClass);
384 __ bind(call_ldc);
385 __ movl(rcx, wide);
387 __ push(atos);
388 __ jmp(Done);
390 __ bind(notClass);
391 __ cmpl(rdx, JVM_CONSTANT_Float);
392 __ jccb(Assembler::notEqual, notFloat);
394 __ fld_s( Address(rcx, rbx, Address::times_ptr, base_offset));
395 __ push(ftos);
396 __ jmp(Done);
398 __ bind(notFloat);
401 __ cmpl(rdx, JVM_CONSTANT_Integer);
402 __ jcc(Assembler::equal, L);
403 __ cmpl(rdx, JVM_CONSTANT_String);
404 __ jcc(Assembler::equal, L);
405 __ cmpl(rdx, JVM_CONSTANT_Object);
406 __ jcc(Assembler::equal, L);
407 __ stop("unexpected tag type in ldc");
408 __ bind(L);
414 __ cmpl(rdx, JVM_CONSTANT_Integer);
415 __ jccb(Assembler::notEqual, isOop);
416 __ movl(rax, Address(rcx, rbx, Address::times_ptr, base_offset));
417 __ push(itos);
418 __ jmp(Done);
419 __ bind(isOop);
420 __ movptr(rax, Address(rcx, rbx, Address::times_ptr, base_offset));
421 __ push(atos);
424 __ verify_oop(rax);
426 __ bind(Done);
439 __ call_VM(noreg, CAST_FROM_FN_PTR(address,
442 __ should_not_reach_here();
451 __ verify_oop(rax);
456 __ load_klass(con_klass_temp, rax);
457 __ cmpptr(con_klass_temp, ExternalAddress((address)Universe::systemObjArrayKlassObj_addr()));
458 __ jcc(Assembler::notEqual, L_done);
459 __ cmpl(Address(rax, arrayOopDesc::length_offset_in_bytes()), 0);
460 __ jcc(Assembler::notEqual, L_throw_exception);
461 __ xorptr(rax, rax);
462 __ jmp(L_done);
465 __ bind(L_throw_exception);
466 __ load_heap_oop(rax, Address(rax, arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
467 __ jump(ExternalAddress(Interpreter::throw_exception_entry()));
469 __ bind(L_done);
475 __ get_unsigned_2_byte_index_at_bcp(rbx, 1);
477 __ get_cpool_and_tags(rcx, rax);
482 __ cmpb(Address(rax, rbx, Address::times_1, tags_offset), JVM_CONSTANT_Double);
483 __ jccb(Assembler::notEqual, Long);
485 __ fld_d( Address(rcx, rbx, Address::times_ptr, base_offset));
486 __ push(dtos);
487 __ jmpb(Done);
489 __ bind(Long);
491 __ movptr(rax, Address(rcx, rbx, Address::times_ptr, base_offset + 0 * wordSize));
492 NOT_LP64(__ movptr(rdx, Address(rcx, rbx, Address::times_ptr, base_offset + 1 * wordSize)));
494 __ push(ltos);
496 __ bind(Done);
501 __ load_unsigned_byte(reg, at_bcp(offset));
502 __ negptr(reg);
512 __ load_unsigned_byte(rbx, at_bcp(Bytecodes::length_for(Bytecodes::_iload)));
517 __ cmpl(rbx, Bytecodes::_iload);
518 __ jcc(Assembler::equal, done);
520 __ cmpl(rbx, Bytecodes::_fast_iload);
521 __ movl(rcx, Bytecodes::_fast_iload2);
522 __ jccb(Assembler::equal, rewrite);
525 __ cmpl(rbx, Bytecodes::_caload);
526 __ movl(rcx, Bytecodes::_fast_icaload);
527 __ jccb(Assembler::equal, rewrite);
530 __ movl(rcx, Bytecodes::_fast_iload);
534 __ bind(rewrite);
536 __ bind(done);
541 __ movl(rax, iaddress(rbx));
548 __ movl(rax, iaddress(rbx));
549 __ push(itos);
551 __ movl(rax, iaddress(rbx));
557 __ movl(rax, iaddress(rbx));
564 __ movptr(rax, laddress(rbx));
565 NOT_LP64(__ movl(rdx, haddress(rbx)));
572 __ fld_s(faddress(rbx));
579 __ fld_d(daddress(rbx));
586 __ movptr(rax, aaddress(rbx));
591 __ movl(reg, at_bcp(2));
592 __ bswapl(reg);
593 __ shrl(reg, 16);
594 __ negptr(reg);
601 __ movl(rax, iaddress(rbx));
608 __ movptr(rax, laddress(rbx));
609 NOT_LP64(__ movl(rdx, haddress(rbx)));
616 __ fld_s(faddress(rbx));
623 __ fld_d(daddress(rbx));
630 __ movptr(rax, aaddress(rbx));
635 __ pop_ptr(array);
642 __ null_check(array, arrayOopDesc::length_offset_in_bytes());
643 LP64_ONLY(__ movslq(index, index));
645 __ cmpl(index, Address(array, arrayOopDesc::length_offset_in_bytes()));
649 __ mov(rbx, index);
651 __ jump_cc(Assembler::aboveEqual,
661 __ movl(rax, Address(rdx, rax, Address::times_4, arrayOopDesc::base_offset_in_bytes(T_INT)));
670 __ mov(rbx, rax);
672 __ movptr(rax, Address(rdx, rbx, Address::times_8, arrayOopDesc::base_offset_in_bytes(T_LONG) + 0 * wordSize));
673 NOT_LP64(__ movl(rdx, Address(rdx, rbx, Address::times_8, arrayOopDesc::base_offset_in_bytes(T_LONG) + 1 * wordSize)));
682 __ fld_s(Address(rdx, rax, Address::times_4, arrayOopDesc::base_offset_in_bytes(T_FLOAT)));
691 __ fld_d(Address(rdx, rax, Address::times_8, arrayOopDesc::base_offset_in_bytes(T_DOUBLE)));
700 __ movptr(rax, Address(rdx, rax, Address::times_ptr, arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
710 __ load_signed_byte(rbx, Address(rdx, rax, Address::times_1, arrayOopDesc::base_offset_in_bytes(T_BYTE)));
711 __ mov(rax, rbx);
721 __ load_unsigned_short(rbx, Address(rdx, rax, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
722 __ mov(rax, rbx);
730 __ movl(rax, iaddress(rbx));
735 __ load_unsigned_short(rbx, Address(rdx, rax, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
736 __ mov(rax, rbx);
745 __ load_signed_short(rbx, Address(rdx, rax, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_SHORT)));
746 __ mov(rax, rbx);
752 __ movl(rax, iaddress(n));
758 __ movptr(rax, laddress(n));
759 NOT_LP64(__ movptr(rdx, haddress(n)));
765 __ fld_s(faddress(n));
771 __ fld_d(daddress(n));
777 __ movptr(rax, aaddress(n));
805 __ load_unsigned_byte(rbx, at_bcp(Bytecodes::length_for(Bytecodes::_aload_0)));
811 __ cmpl(rbx, Bytecodes::_getfield);
812 __ jcc(Assembler::equal, done);
816 __ cmpl(rbx, Bytecodes::_fast_igetfield);
817 __ movl(rcx, Bytecodes::_fast_iaccess_0);
818 __ jccb(Assembler::equal, rewrite);
822 __ cmpl(rbx, Bytecodes::_fast_agetfield);
823 __ movl(rcx, Bytecodes::_fast_aaccess_0);
824 __ jccb(Assembler::equal, rewrite);
828 __ cmpl(rbx, Bytecodes::_fast_fgetfield);
829 __ movl(rcx, Bytecodes::_fast_faccess_0);
830 __ jccb(Assembler::equal, rewrite);
834 __ movl(rcx, Bytecodes::_fast_aload_0);
838 __ bind(rewrite);
841 __ bind(done);
850 __ movl(iaddress(rbx), rax);
857 __ movptr(laddress(rbx), rax);
858 NOT_LP64(__ movptr(haddress(rbx), rdx));
865 __ fstp_s(faddress(rbx));
872 __ fstp_d(daddress(rbx));
878 __ pop_ptr(rax);
880 __ movptr(aaddress(rbx), rax);
886 __ pop_i(rax);
888 __ movl(iaddress(rbx), rax);
894 __ pop_l(rax, rdx);
896 __ movptr(laddress(rbx), rax);
897 NOT_LP64(__ movl(haddress(rbx), rdx));
913 __ pop_ptr(rax);
915 __ movptr(aaddress(rbx), rax);
921 __ pop_i(rbx);
926 __ movl(Address(rdx, rbx, Address::times_4, arrayOopDesc::base_offset_in_bytes(T_INT)), rax);
932 __ pop_i(rbx);
938 __ movptr(Address(rcx, rbx, Address::times_8, arrayOopDesc::base_offset_in_bytes(T_LONG) + 0 * wordSize), rax);
939 NOT_LP64(__ movl(Address(rcx, rbx, Address::times_8, arrayOopDesc::base_offset_in_bytes(T_LONG) + 1 * wordSize), rdx));
945 __ pop_i(rbx);
950 __ fstp_s(Address(rdx, rbx, Address::times_4, arrayOopDesc::base_offset_in_bytes(T_FLOAT)));
956 __ pop_i(rbx);
961 __ fstp_d(Address(rdx, rbx, Address::times_8, arrayOopDesc::base_offset_in_bytes(T_DOUBLE)));
969 __ movptr(rax, at_tos()); // Value
970 __ movl(rcx, at_tos_p1()); // Index
971 __ movptr(rdx, at_tos_p2()); // Array
976 __ testptr(rax, rax);
977 __ jcc(Assembler::zero, is_null);
980 __ load_klass(rbx, rax);
982 __ load_klass(rax, rdx);
983 __ movptr(rax, Address(rax, objArrayKlass::element_klass_offset()));
985 __ lea(rdx, element_address);
989 __ gen_subtype_check( rbx, ok_is_subtype );
993 __ jump(ExternalAddress(Interpreter::_throw_ArrayStoreException_entry));
996 __ bind(ok_is_subtype);
999 __ movptr(rax, at_rsp());
1003 __ jmp(done);
1006 __ bind(is_null);
1007 __ profile_null_seen(rbx);
1013 __ bind(done);
1014 __ addptr(rsp, 3 * Interpreter::stackElementSize);
1020 __ pop_i(rbx);
1025 __ movb(Address(rdx, rbx, Address::times_1, arrayOopDesc::base_offset_in_bytes(T_BYTE)), rax);
1031 __ pop_i(rbx);
1036 __ movw(Address(rdx, rbx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)), rax);
1047 __ movl(iaddress(n), rax);
1053 __ movptr(laddress(n), rax);
1054 NOT_LP64(__ movptr(haddress(n), rdx));
1060 __ fstp_s(faddress(n));
1066 __ fstp_d(daddress(n));
1072 __ pop_ptr(rax);
1073 __ movptr(aaddress(n), rax);
1079 __ addptr(rsp, Interpreter::stackElementSize);
1085 __ addptr(rsp, 2*Interpreter::stackElementSize);
1092 __ load_ptr(0, rax);
1093 __ push_ptr(rax);
1101 __ load_ptr( 0, rax); // load b
1102 __ load_ptr( 1, rcx); // load a
1103 __ store_ptr(1, rax); // store b
1104 __ store_ptr(0, rcx); // store a
1105 __ push_ptr(rax); // push b
1113 __ load_ptr( 0, rax); // load c
1114 __ load_ptr( 2, rcx); // load a
1115 __ store_ptr(2, rax); // store c in a
1116 __ push_ptr(rax); // push c
1118 __ load_ptr( 2, rax); // load b
1119 __ store_ptr(2, rcx); // store a in b
1121 __ store_ptr(1, rax); // store b in c
1129 __ load_ptr(1, rax); // load a
1130 __ push_ptr(rax); // push a
1131 __ load_ptr(1, rax); // load b
1132 __ push_ptr(rax); // push b
1140 __ load_ptr( 0, rcx); // load c
1141 __ load_ptr( 1, rax); // load b
1142 __ push_ptr(rax); // push b
1143 __ push_ptr(rcx); // push c
1145 __ store_ptr(3, rcx); // store c in b
1147 __ load_ptr( 4, rcx); // load a
1148 __ store_ptr(2, rcx); // store a in 2nd c
1150 __ store_ptr(4, rax); // store b in a
1159 __ load_ptr( 0, rcx); // load d
1160 __ load_ptr( 1, rax); // load c
1161 __ push_ptr(rax); // push c
1162 __ push_ptr(rcx); // push d
1164 __ load_ptr( 4, rax); // load b
1165 __ store_ptr(2, rax); // store b in d
1166 __ store_ptr(4, rcx); // store d in b
1168 __ load_ptr( 5, rcx); // load a
1169 __ load_ptr( 3, rax); // load c
1170 __ store_ptr(3, rcx); // store a in c
1171 __ store_ptr(5, rax); // store c in a
1180 __ load_ptr( 1, rcx); // load a
1181 __ load_ptr( 0, rax); // load b
1182 __ store_ptr(0, rcx); // store a in b
1183 __ store_ptr(1, rax); // store b in a
1191 case add : __ pop_i(rdx); __ addl (rax, rdx); break;
1192 case sub : __ mov(rdx, rax); __ pop_i(rax); __ subl (rax, rdx); break;
1193 case mul : __ pop_i(rdx); __ imull(rax, rdx); break;
1194 case _and : __ pop_i(rdx); __ andl (rax, rdx); break;
1195 case _or : __ pop_i(rdx); __ orl (rax, rdx); break;
1196 case _xor : __ pop_i(rdx); __ xorl (rax, rdx); break;
1197 case shl : __ mov(rcx, rax); __ pop_i(rax); __ shll (rax); break; // implicit masking of lower 5 bits by Intel shift instr.
1198 case shr : __ mov(rcx, rax); __ pop_i(rax); __ sarl (rax); break; // implicit masking of lower 5 bits by Intel shift instr.
1199 case ushr : __ mov(rcx, rax); __ pop_i(rax); __ shrl (rax); break; // implicit masking of lower 5 bits by Intel shift instr.
1207 __ pop_l(rbx, rcx);
1209 case add : __ addl(rax, rbx); __ adcl(rdx, rcx); break;
1210 case sub : __ subl(rbx, rax); __ sbbl(rcx, rdx);
1211 __ mov (rax, rbx); __ mov (rdx, rcx); break;
1212 case _and : __ andl(rax, rbx); __ andl(rdx, rcx); break;
1213 case _or : __ orl (rax, rbx); __ orl (rdx, rcx); break;
1214 case _xor : __ xorl(rax, rbx); __ xorl(rdx, rcx); break;
1222 __ mov(rcx, rax);
1223 __ pop_i(rax);
1228 __ corrected_idivl(rcx);
1234 __ mov(rcx, rax);
1235 __ pop_i(rax);
1240 __ corrected_idivl(rcx);
1241 __ mov(rax, rdx);
1247 __ pop_l(rbx, rcx);
1248 __ push(rcx); __ push(rbx);
1249 __ push(rdx); __ push(rax);
1250 __ lmul(2 * wordSize, 0);
1251 __ addptr(rsp, 4 * wordSize); // take off temporaries
1257 __ pop_l(rbx, rcx);
1258 __ push(rcx); __ push(rbx);
1259 __ push(rdx); __ push(rax);
1261 __ orl(rax, rdx);
1262 __ jump_cc(Assembler::zero,
1264 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::ldiv));
1265 __ addptr(rsp, 4 * wordSize); // take off temporaries
1271 __ pop_l(rbx, rcx);
1272 __ push(rcx); __ push(rbx);
1273 __ push(rdx); __ push(rax);
1275 __ orl(rax, rdx);
1276 __ jump_cc(Assembler::zero,
1278 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::lrem));
1279 __ addptr(rsp, 4 * wordSize);
1285 __ movl(rcx, rax); // get shift count
1286 __ pop_l(rax, rdx); // get shift value
1287 __ lshl(rdx, rax);
1293 __ mov(rcx, rax); // get shift count
1294 __ pop_l(rax, rdx); // get shift value
1295 __ lshr(rdx, rax, true);
1301 __ mov(rcx, rax); // get shift count
1302 __ pop_l(rax, rdx); // get shift value
1303 __ lshr(rdx, rax);
1310 case add: __ fadd_s (at_rsp()); break;
1311 case sub: __ fsubr_s(at_rsp()); break;
1312 case mul: __ fmul_s (at_rsp()); break;
1313 case div: __ fdivr_s(at_rsp()); break;
1314 case rem: __ fld_s (at_rsp()); __ fremr(rax); break;
1317 __ f2ieee();
1318 __ pop(rax); // pop float thing off
1326 case add: __ fadd_d (at_rsp()); break;
1327 case sub: __ fsubr_d(at_rsp()); break;
1332 __ get_method(rcx);
1333 __ movl(rcx, access_flags);
1334 __ testl(rcx, JVM_ACC_STRICT);
1335 __ jccb(Assembler::notZero, L_strict);
1336 __ fmul_d (at_rsp());
1337 __ jmpb(L_join);
1338 __ bind(L_strict);
1339 __ fld_x(ExternalAddress(StubRoutines::addr_fpu_subnormal_bias1()));
1340 __ fmulp();
1341 __ fmul_d (at_rsp());
1342 __ fld_x(ExternalAddress(StubRoutines::addr_fpu_subnormal_bias2()));
1343 __ fmulp();
1344 __ bind(L_join);
1351 __ get_method(rcx);
1352 __ movl(rcx, access_flags);
1353 __ testl(rcx, JVM_ACC_STRICT);
1354 __ jccb(Assembler::notZero, L_strict);
1355 __ fdivr_d(at_rsp());
1356 __ jmp(L_join);
1357 __ bind(L_strict);
1358 __ fld_x(ExternalAddress(StubRoutines::addr_fpu_subnormal_bias1()));
1359 __ fmul_d (at_rsp());
1360 __ fdivrp();
1361 __ fld_x(ExternalAddress(StubRoutines::addr_fpu_subnormal_bias2()));
1362 __ fmulp();
1363 __ bind(L_join);
1366 case rem: __ fld_d (at_rsp()); __ fremr(rax); break;
1369 __ d2ieee();
1371 __ pop(rax);
1372 __ pop(rdx);
1378 __ negl(rax);
1384 __ lneg(rdx, rax);
1390 __ fchs();
1396 __ fchs();
1402 __ load_signed_byte(rdx, at_bcp(2)); // get constant
1404 __ addl(iaddress(rbx), rdx);
1410 __ movl(rdx, at_bcp(4)); // get constant
1412 __ bswapl(rdx); // swap bytes & sign-extend constant
1413 __ sarl(rdx, 16);
1414 __ addl(iaddress(rbx), rdx);
1469 __ extend_sign(rdx, rax);
1472 __ push(rax); // store int on tos
1473 __ fild_s(at_rsp()); // load int to ST0
1474 __ f2ieee(); // truncate to float size
1475 __ pop(rcx); // adjust rsp
1478 __ push(rax); // add one slot for d2ieee()
1479 __ push(rax); // store int on tos
1480 __ fild_s(at_rsp()); // load int to ST0
1481 __ d2ieee(); // truncate to double size
1482 __ pop(rcx); // adjust rsp
1483 __ pop(rcx);
1486 __ shll(rax, 24); // truncate upper 24 bits
1487 __ sarl(rax, 24); // and sign-extend byte
1488 LP64_ONLY(__ movsbl(rax, rax));
1491 __ andl(rax, 0xFFFF); // truncate upper 16 bits
1492 LP64_ONLY(__ movzwl(rax, rax));
1495 __ shll(rax, 16); // truncate upper 16 bits
1496 __ sarl(rax, 16); // and sign-extend short
1497 LP64_ONLY(__ movswl(rax, rax));
1503 __ push(rdx); // store long on tos
1504 __ push(rax);
1505 __ fild_d(at_rsp()); // load long to ST0
1506 __ f2ieee(); // truncate to float size
1507 __ pop(rcx); // adjust rsp
1508 __ pop(rcx);
1511 __ push(rdx); // store long on tos
1512 __ push(rax);
1513 __ fild_d(at_rsp()); // load long to ST0
1514 __ d2ieee(); // truncate to double size
1515 __ pop(rcx); // adjust rsp
1516 __ pop(rcx);
1519 __ push(rcx); // reserve space for argument
1520 __ fstp_s(at_rsp()); // pass float argument on stack
1521 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::f2i), 1);
1524 __ push(rcx); // reserve space for argument
1525 __ fstp_s(at_rsp()); // pass float argument on stack
1526 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::f2l), 1);
1532 __ push(rcx); // reserve space for argument
1533 __ push(rcx);
1534 __ fstp_d(at_rsp()); // pass double argument on stack
1535 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::d2i), 2);
1538 __ push(rcx); // reserve space for argument
1539 __ push(rcx);
1540 __ fstp_d(at_rsp()); // pass double argument on stack
1541 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::d2l), 2);
1544 __ push(rcx); // reserve space for f2ieee()
1545 __ f2ieee(); // truncate to float size
1546 __ pop(rcx); // adjust rsp
1557 __ pop_l(rbx, rcx); // get x = rcx:rbx
1558 __ lcmp2int(rcx, rbx, rdx, rax);// rcx := cmp(x, y)
1559 __ mov(rax, rcx);
1565 __ fld_s(at_rsp());
1567 __ fld_d(at_rsp());
1568 __ pop(rdx);
1570 __ pop(rcx);
1571 __ fcmp2int(rax, unordered_result < 0);
1576 __ get_method(rcx); // ECX holds method
1577 __ profile_taken_branch(rax,rbx); // EAX holds updated MDP, EBX holds bumped taken count
1584 __ movl(rdx, at_bcp(1));
1585 __ bswapl(rdx);
1586 if (!is_wide) __ sarl(rdx, 16);
1587 LP64_ONLY(__ movslq(rdx, rdx));
1595 __ load_unsigned_byte(rbx, Address(rsi, rdx, Address::times_1, 0));
1598 __ lea(rax, at_bcp((is_wide ? 5 : 3) - in_bytes(constMethodOopDesc::codes_offset())));
1599 __ subptr(rax, Address(rcx, methodOopDesc::const_offset()));
1601 __ addptr(rsi, rdx);
1603 __ push_i(rax);
1605 __ dispatch_only_noverify(vtos);
1612 __ addptr(rsi, rdx);
1626 __ testl(rdx, rdx); // check if forward or backward branch
1627 __ jcc(Assembler::positive, dispatch); // count only if backward branch
1635 __ movptr(rbx, Address(rcx, in_bytes(methodOopDesc::method_data_offset())));
1636 __ testptr(rbx, rbx);
1637 __ jccb(Assembler::zero, no_mdo);
1641 __ increment_mask_and_jump(mdo_backedge_counter, increment, mask,
1643 __ jmp(dispatch);
1645 __ bind(no_mdo);
1647 __ increment_mask_and_jump(Address(rcx, be_offset), increment, mask,
1651 __ movl(rax, Address(rcx, be_offset)); // load backedge counter
1652 __ incrementl(rax, InvocationCounter::count_increment); // increment counter
1653 __ movl(Address(rcx, be_offset), rax); // store counter
1655 __ movl(rax, Address(rcx, inv_offset)); // load invocation counter
1656 __ andl(rax, InvocationCounter::count_mask_value); // and the status bits
1657 __ addl(rax, Address(rcx, be_offset)); // add both counters
1661 __ cmp32(rax,
1663 __ jcc(Assembler::less, dispatch);
1666 __ test_method_data_pointer(rax, profile_method);
1670 __ cmp32(rbx,
1672 __ jcc(Assembler::below, dispatch);
1680 __ andptr(rbx, overflow_frequency-1);
1681 __ jcc(Assembler::zero, backedge_counter_overflow);
1686 __ cmp32(rax,
1688 __ jcc(Assembler::aboveEqual, backedge_counter_overflow);
1693 __ bind(dispatch);
1697 __ load_unsigned_byte(rbx, Address(rsi, 0));
1703 __ dispatch_only(vtos);
1708 __ bind(profile_method);
1709 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method));
1710 __ load_unsigned_byte(rbx, Address(rsi, 0)); // restore target bytecode
1711 __ set_method_data_pointer_for_bcp();
1712 __ jmp(dispatch);
1718 __ bind(backedge_counter_overflow);
1719 __ negptr(rdx);
1720 __ addptr(rdx, rsi); // branch bcp
1722 __ load_unsigned_byte(rbx, Address(rsi, 0)); // restore target bytecode
1729 __ testptr(rax, rax); // test result
1730 __ jcc(Assembler::zero, dispatch); // no osr if null
1732 __ movl(rcx, Address(rax, nmethod::entry_bci_offset()));
1733 __ cmpl(rcx, InvalidOSREntryBci);
1734 __ jcc(Assembler::equal, dispatch);
1740 __ mov(rbx, rax); // save the nmethod
1743 __ get_thread(thread);
1746 __ mov(rcx, rax);
1749 __ movptr(rdx, Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize)); // get sender sp
1750 __ leave(); // remove frame anchor
1751 __ pop(rdi); // get return address
1752 __ mov(rsp, rdx); // set sp to sender sp
1757 __ andptr(rsp, -(StackAlignmentInBytes));
1760 __ push(rdi);
1763 __ jmp(Address(rbx, nmethod::osr_entry_point_offset()));
1773 __ testl(rax, rax);
1774 __ jcc(j_not(cc), not_taken);
1776 __ bind(not_taken);
1777 __ profile_not_taken_branch(rax);
1785 __ pop_i(rdx);
1786 __ cmpl(rdx, rax);
1787 __ jcc(j_not(cc), not_taken);
1789 __ bind(not_taken);
1790 __ profile_not_taken_branch(rax);
1798 __ testptr(rax, rax);
1799 __ jcc(j_not(cc), not_taken);
1801 __ bind(not_taken);
1802 __ profile_not_taken_branch(rax);
1810 __ pop_ptr(rdx);
1811 __ cmpptr(rdx, rax);
1812 __ jcc(j_not(cc), not_taken);
1814 __ bind(not_taken);
1815 __ profile_not_taken_branch(rax);
1822 __ movptr(rbx, iaddress(rbx)); // get return bci, compute return bcp
1823 __ profile_ret(rbx, rcx);
1824 __ get_method(rax);
1825 __ movptr(rsi, Address(rax, methodOopDesc::const_offset()));
1826 __ lea(rsi, Address(rsi, rbx, Address::times_1,
1828 __ dispatch_next(vtos);
1835 __ movptr(rbx, iaddress(rbx)); // get return bci, compute return bcp
1836 __ profile_ret(rbx, rcx);
1837 __ get_method(rax);
1838 __ movptr(rsi, Address(rax, methodOopDesc::const_offset()));
1839 __ lea(rsi, Address(rsi, rbx, Address::times_1, constMethodOopDesc::codes_offset()));
1840 __ dispatch_next(vtos);
1848 __ lea(rbx, at_bcp(wordSize));
1849 __ andptr(rbx, -wordSize);
1851 __ movl(rcx, Address(rbx, 1 * wordSize));
1852 __ movl(rdx, Address(rbx, 2 * wordSize));
1853 __ bswapl(rcx);
1854 __ bswapl(rdx);
1856 __ cmpl(rax, rcx);
1857 __ jccb(Assembler::less, default_case);
1858 __ cmpl(rax, rdx);
1859 __ jccb(Assembler::greater, default_case);
1861 __ subl(rax, rcx);
1862 __ movl(rdx, Address(rbx, rax, Address::times_4, 3 * BytesPerInt));
1863 __ profile_switch_case(rax, rbx, rcx);
1865 __ bind(continue_execution);
1866 __ bswapl(rdx);
1867 __ load_unsigned_byte(rbx, Address(rsi, rdx, Address::times_1));
1868 __ addptr(rsi, rdx);
1869 __ dispatch_only(vtos);
1871 __ bind(default_case);
1872 __ profile_switch_default(rax);
1873 __ movl(rdx, Address(rbx, 0));
1874 __ jmp(continue_execution);
1880 __ stop("lookupswitch bytecode should have been rewritten");
1888 __ bswapl(rax);
1890 __ lea(rbx, at_bcp(wordSize)); // btw: should be able to get rid of this instruction (change offsets below)
1891 __ andptr(rbx, -wordSize);
1893 __ movl(rcx, Address(rbx, wordSize));
1894 __ bswapl(rcx);
1895 __ jmpb(loop_entry);
1897 __ bind(loop);
1898 __ cmpl(rax, Address(rbx, rcx, Address::times_8, 2 * wordSize));
1899 __ jccb(Assembler::equal, found);
1900 __ bind(loop_entry);
1901 __ decrementl(rcx);
1902 __ jcc(Assembler::greaterEqual, loop);
1904 __ profile_switch_default(rax);
1905 __ movl(rdx, Address(rbx, 0));
1906 __ jmpb(continue_execution);
1908 __ bind(found);
1909 __ movl(rdx, Address(rbx, rcx, Address::times_8, 3 * wordSize));
1910 __ profile_switch_case(rcx, rax, rbx);
1912 __ bind(continue_execution);
1913 __ bswapl(rdx);
1914 __ load_unsigned_byte(rbx, Address(rsi, rdx, Address::times_1));
1915 __ addptr(rsi, rdx);
1916 __ dispatch_only(vtos);
1955 __ save_bcp();
1957 __ lea(array, at_bcp(3*wordSize)); // btw: should be able to get rid of this instruction (change offsets below)
1958 __ andptr(array, -wordSize);
1960 __ xorl(i, i); // i = 0;
1961 __ movl(j, Address(array, -wordSize)); // j = length(array);
1963 __ bswapl(j);
1966 __ jmp(entry);
1970 __ bind(loop);
1972 __ leal(h, Address(i, j, Address::times_1)); // h = i + j;
1973 __ sarl(h, 1); // h = (i + j) >> 1;
1980 __ movl(temp, Address(array, h, Address::times_8, 0*wordSize));
1981 __ bswapl(temp);
1982 __ cmpl(key, temp);
1984 __ cmov32(Assembler::less , j, h);
1986 __ cmov32(Assembler::greaterEqual, i, h);
1988 __ bind(entry);
1989 __ leal(h, Address(i, 1)); // i+1
1990 __ cmpl(h, j); // i+1 < j
1991 __ jcc(Assembler::less, loop);
1997 __ movl(temp, Address(array, i, Address::times_8, 0*wordSize));
1998 __ bswapl(temp);
1999 __ cmpl(key, temp);
2000 __ jcc(Assembler::notEqual, default_case);
2003 __ movl(j , Address(array, i, Address::times_8, 1*wordSize));
2004 __ profile_switch_case(i, key, array);
2005 __ bswapl(j);
2006 LP64_ONLY(__ movslq(j, j));
2007 __ restore_bcp();
2008 __ restore_locals(); // restore rdi
2009 __ load_unsigned_byte(rbx, Address(rsi, j, Address::times_1));
2011 __ addptr(rsi, j);
2012 __ dispatch_only(vtos);
2015 __ bind(default_case);
2016 __ profile_switch_default(i);
2017 __ movl(j, Address(array, -2*wordSize));
2018 __ bswapl(j);
2019 LP64_ONLY(__ movslq(j, j));
2020 __ restore_bcp();
2021 __ restore_locals(); // restore rdi
2022 __ load_unsigned_byte(rbx, Address(rsi, j, Address::times_1));
2023 __ addptr(rsi, j);
2024 __ dispatch_only(vtos);
2034 __ movptr(rax, aaddress(0));
2035 __ load_klass(rdi, rax);
2036 __ movl(rdi, Address(rdi, Klass::access_flags_offset()));
2037 __ testl(rdi, JVM_ACC_HAS_FINALIZER);
2039 __ jcc(Assembler::zero, skip_register_finalizer);
2041 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), rax);
2043 __ bind(skip_register_finalizer);
2046 __ remove_activation(state, rsi);
2047 __ jmp(rsi);
2079 __ membar(order_constraint);
2097 __ get_cache_and_index_at_bcp(Rcache, index, 1, index_size);
2098 __ movptr(result, Address(Rcache, index, Address::times_ptr, constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::f1_offset()));
2099 __ testptr(result, result);
2100 __ jcc(Assembler::notEqual, resolved);
2104 __ get_cache_and_index_and_bytecode_at_bcp(Rcache, index, temp, byte_no, 1, index_size);
2105 __ cmpl(temp, (int) bytecode()); // have we resolved this bytecode?
2106 __ jcc(Assembler::equal, resolved);
2128 __ movl(temp, (int)bytecode());
2129 __ call_VM(noreg, entry, temp);
2131 __ get_cache_and_index_at_bcp(Rcache, index, 1, index_size);
2133 __ movptr(result, Address(Rcache, index, Address::times_ptr, constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::f1_offset()));
2134 __ bind(resolved);
2149 __ movptr(off, Address(cache, index, Address::times_ptr,
2152 __ movl(flags, Address(cache, index, Address::times_ptr,
2157 __ movptr(obj, Address(cache, index, Address::times_ptr,
2195 __ movptr(method, Address(cache, index, Address::times_ptr, index_offset));
2199 __ movptr(method, Address(cache, index, Address::times_ptr, method_offset));
2204 __ movptr(itable_index, Address(cache, index, Address::times_ptr, index_offset));
2206 __ movl(flags, Address(cache, index, Address::times_ptr, flags_offset));
2221 __ mov32(rax, ExternalAddress((address) JvmtiExport::get_field_access_count_addr()));
2222 __ testl(rax,rax);
2223 __ jcc(Assembler::zero, L1);
2226 __ addptr(cache, in_bytes(constantPoolCacheOopDesc::base_offset()));
2227 __ shll(index, LogBytesPerWord);
2228 __ addptr(cache, index);
2230 __ xorptr(rax, rax); // NULL object reference
2232 __ pop(atos); // Get the object
2233 __ verify_oop(rax);
2234 __ push(atos); // Restore stack state
2238 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_access),
2240 __ get_cache_and_index_at_bcp(cache, index, 1);
2241 __ bind(L1);
2246 __ pop_ptr(r);
2247 __ null_check(r); // for field access must check obj.
2248 __ verify_oop(r);
2271 __ shrl(flags, ConstantPoolCacheEntry::tos_state_shift);
2274 __ andptr(flags, ConstantPoolCacheEntry::tos_state_mask);
2275 __ jcc(Assembler::notZero, notByte);
2277 __ load_signed_byte(rax, lo );
2278 __ push(btos);
2283 __ jmp(Done);
2285 __ bind(notByte);
2287 __ cmpl(flags, itos );
2288 __ jcc(Assembler::notEqual, notInt);
2290 __ movl(rax, lo );
2291 __ push(itos);
2296 __ jmp(Done);
2298 __ bind(notInt);
2300 __ cmpl(flags, atos );
2301 __ jcc(Assembler::notEqual, notObj);
2303 __ movl(rax, lo );
2304 __ push(atos);
2308 __ jmp(Done);
2310 __ bind(notObj);
2312 __ cmpl(flags, ctos );
2313 __ jcc(Assembler::notEqual, notChar);
2315 __ load_unsigned_short(rax, lo );
2316 __ push(ctos);
2320 __ jmp(Done);
2322 __ bind(notChar);
2324 __ cmpl(flags, stos );
2325 __ jcc(Assembler::notEqual, notShort);
2327 __ load_signed_short(rax, lo );
2328 __ push(stos);
2332 __ jmp(Done);
2334 __ bind(notShort);
2336 __ cmpl(flags, ltos );
2337 __ jcc(Assembler::notEqual, notLong);
2341 __ fild_d(lo); // Must load atomically
2342 __ subptr(rsp,2*wordSize); // Make space for store
2343 __ fistp_d(Address(rsp,0));
2344 __ pop(rax);
2345 __ pop(rdx);
2347 __ push(ltos);
2349 __ jmp(Done);
2351 __ bind(notLong);
2353 __ cmpl(flags, ftos );
2354 __ jcc(Assembler::notEqual, notFloat);
2356 __ fld_s(lo);
2357 __ push(ftos);
2361 __ jmp(Done);
2363 __ bind(notFloat);
2365 __ cmpl(flags, dtos );
2366 __ jcc(Assembler::notEqual, notDouble);
2368 __ fld_d(lo);
2369 __ push(dtos);
2373 __ jmpb(Done);
2375 __ bind(notDouble);
2377 __ stop("Bad state");
2379 __ bind(Done);
2405 __ mov32(rax, ExternalAddress((address)JvmtiExport::get_field_modification_count_addr()));
2406 __ testl(rax, rax);
2407 __ jcc(Assembler::zero, L1);
2412 __ get_cache_and_index_at_bcp(rax, rdx, 1);
2416 __ xorptr(rbx, rbx);
2423 __ movl(rcx, Address(rax, rdx, Address::times_ptr, in_bytes(cp_base_offset +
2425 __ mov(rbx, rsp);
2426 __ shrl(rcx, ConstantPoolCacheEntry::tos_state_shift);
2429 __ cmpl(rcx, ltos);
2430 __ jccb(Assembler::equal, two_word);
2431 __ cmpl(rcx, dtos);
2432 __ jccb(Assembler::equal, two_word);
2433 __ addptr(rbx, Interpreter::expr_offset_in_bytes(1)); // one word jvalue (not ltos, dtos)
2434 __ jmpb(valsize_known);
2436 __ bind(two_word);
2437 __ addptr(rbx, Interpreter::expr_offset_in_bytes(2)); // two words jvalue
2439 __ bind(valsize_known);
2441 __ movptr(rbx, Address(rbx, 0));
2444 __ addptr(rax, in_bytes(cp_base_offset));
2445 __ shll(rdx, LogBytesPerWord);
2446 __ addptr(rax, rdx);
2448 __ mov(rcx, rsp);
2452 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_modification),
2454 __ get_cache_and_index_at_bcp(cache, index, 1);
2455 __ bind(L1);
2477 __ movl(rdx, flags);
2478 __ shrl(rdx, ConstantPoolCacheEntry::is_volatile_shift);
2479 __ andl(rdx, 0x1);
2487 __ shrl(flags, ConstantPoolCacheEntry::tos_state_shift);
2489 __ andl(flags, ConstantPoolCacheEntry::tos_state_mask);
2490 __ jcc(Assembler::notZero, notByte);
2494 __ pop(btos);
2496 __ movb(lo, rax);
2500 __ jmp(Done);
2503 __ bind(notByte);
2504 __ cmpl(flags, itos);
2505 __ jcc(Assembler::notEqual, notInt);
2509 __ pop(itos);
2511 __ movl(lo, rax);
2515 __ jmp(Done);
2518 __ bind(notInt);
2519 __ cmpl(flags, atos);
2520 __ jcc(Assembler::notEqual, notObj);
2524 __ pop(atos);
2530 __ jmp(Done);
2533 __ bind(notObj);
2534 __ cmpl(flags, ctos);
2535 __ jcc(Assembler::notEqual, notChar);
2539 __ pop(ctos);
2541 __ movw(lo, rax);
2545 __ jmp(Done);
2548 __ bind(notChar);
2549 __ cmpl(flags, stos);
2550 __ jcc(Assembler::notEqual, notShort);
2554 __ pop(stos);
2556 __ movw(lo, rax);
2560 __ jmp(Done);
2563 __ bind(notShort);
2564 __ cmpl(flags, ltos);
2565 __ jcc(Assembler::notEqual, notLong);
2570 __ testl(rdx, rdx);
2571 __ jcc(Assembler::zero, notVolatileLong);
2573 __ pop(ltos); // overwrites rdx, do this after testing volatile.
2577 __ push(rdx);
2578 __ push(rax); // Must update atomically with FIST
2579 __ fild_d(Address(rsp,0)); // So load into FPU register
2580 __ fistp_d(lo); // and put into memory atomically
2581 __ addptr(rsp, 2*wordSize);
2586 __ jmp(notVolatile);
2588 __ bind(notVolatileLong);
2590 __ pop(ltos); // overwrites rdx
2592 NOT_LP64(__ movptr(hi, rdx));
2593 __ movptr(lo, rax);
2597 __ jmp(notVolatile);
2600 __ bind(notLong);
2601 __ cmpl(flags, ftos);
2602 __ jcc(Assembler::notEqual, notFloat);
2606 __ pop(ftos);
2608 __ fstp_s(lo);
2612 __ jmp(Done);
2615 __ bind(notFloat);
2617 __ cmpl(flags, dtos);
2618 __ jcc(Assembler::notEqual, notDouble);
2623 __ pop(dtos);
2625 __ fstp_d(lo);
2629 __ jmp(Done);
2633 __ bind(notDouble);
2634 __ stop("Bad state");
2637 __ bind(Done);
2640 __ testl(rdx, rdx);
2641 __ jcc(Assembler::zero, notVolatile);
2644 __ bind(notVolatile);
2662 __ mov32(rcx, ExternalAddress((address)JvmtiExport::get_field_modification_count_addr()));
2663 __ testl(rcx,rcx);
2664 __ jcc(Assembler::zero, L2);
2665 __ pop_ptr(rbx); // copy the object pointer from tos
2666 __ verify_oop(rbx);
2667 __ push_ptr(rbx); // put the object pointer back on tos
2673 case Bytecodes::_fast_aputfield: __ push_ptr(rax); break;
2677 case Bytecodes::_fast_iputfield: __ push_i(rax); break;
2678 case Bytecodes::_fast_dputfield: __ push_d(); break;
2679 case Bytecodes::_fast_fputfield: __ push_f(); break;
2680 case Bytecodes::_fast_lputfield: __ push_l(rax); break;
2685 __ mov(rcx, rsp); // points to jvalue on the stack
2687 __ get_cache_entry_pointer_at_bcp(rax, rdx, 1);
2688 __ verify_oop(rbx);
2692 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_modification), rbx, rax, rcx);
2695 case Bytecodes::_fast_aputfield: __ pop_ptr(rax); break;
2699 case Bytecodes::_fast_iputfield: __ pop_i(rax); break;
2700 case Bytecodes::_fast_dputfield: __ pop_d(); break;
2701 case Bytecodes::_fast_fputfield: __ pop_f(); break;
2702 case Bytecodes::_fast_lputfield: __ pop_l(rax); break;
2704 __ bind(L2);
2716 __ get_cache_and_index_at_bcp(rcx, rbx, 1);
2719 if (bytecode() == Bytecodes::_fast_lputfield) __ push(rdx);
2720 __ movl(rdx, Address(rcx, rbx, Address::times_ptr, in_bytes(base +
2724 __ movptr(rbx, Address(rcx, rbx, Address::times_ptr, in_bytes(base + ConstantPoolCacheEntry::f2_offset())));
2730 __ shrl(rdx, ConstantPoolCacheEntry::is_volatile_shift);
2731 __ andl(rdx, 0x1);
2733 __ testl(rdx, rdx);
2734 __ jcc(Assembler::zero, notVolatile);
2736 if (bytecode() == Bytecodes::_fast_lputfield) __ pop(rdx);
2747 case Bytecodes::_fast_bputfield: __ movb(lo, rax); break;
2749 case Bytecodes::_fast_cputfield: __ movw(lo, rax); break;
2750 case Bytecodes::_fast_iputfield: __ movl(lo, rax); break;
2752 NOT_LP64(__ movptr(hi, rdx));
2753 __ movptr(lo, rax);
2755 case Bytecodes::_fast_fputfield: __ fstp_s(lo); break;
2756 case Bytecodes::_fast_dputfield: __ fstp_d(lo); break;
2769 __ jmp(done);
2772 __ bind(notVolatile);
2774 if (bytecode() == Bytecodes::_fast_lputfield) __ pop(rdx);
2781 case Bytecodes::_fast_bputfield: __ movb(lo, rax); break;
2783 case Bytecodes::_fast_cputfield: __ movw(lo, rax); break;
2784 case Bytecodes::_fast_iputfield: __ movl(lo, rax); break;
2786 NOT_LP64(__ movptr(hi, rdx));
2787 __ movptr(lo, rax);
2789 case Bytecodes::_fast_fputfield: __ fstp_s(lo); break;
2790 case Bytecodes::_fast_dputfield: __ fstp_d(lo); break;
2798 __ bind(done);
2810 __ mov32(rcx, ExternalAddress((address) JvmtiExport::get_field_access_count_addr()));
2811 __ testl(rcx,rcx);
2812 __ jcc(Assembler::zero, L1);
2814 __ get_cache_entry_pointer_at_bcp(rcx, rdx, 1);
2815 __ push_ptr(rax); // save object pointer before call_VM() clobbers it
2816 __ verify_oop(rax);
2819 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_access), rax, rcx);
2820 __ pop_ptr(rax); // restore object pointer
2821 __ bind(L1);
2825 __ get_cache_and_index_at_bcp(rcx, rbx, 1);
2827 __ movptr(rbx, Address(rcx,
2834 __ verify_oop(rax);
2835 __ null_check(rax);
2842 case Bytecodes::_fast_bgetfield: __ movsbl(rax, lo ); break;
2843 case Bytecodes::_fast_sgetfield: __ load_signed_short(rax, lo ); break;
2844 case Bytecodes::_fast_cgetfield: __ load_unsigned_short(rax, lo ); break;
2845 case Bytecodes::_fast_igetfield: __ movl(rax, lo); break;
2846 case Bytecodes::_fast_lgetfield: __ stop("should not be rewritten"); break;
2847 case Bytecodes::_fast_fgetfield: __ fld_s(lo); break;
2848 case Bytecodes::_fast_dgetfield: __ fld_d(lo); break;
2849 case Bytecodes::_fast_agetfield: __ movptr(rax, lo); __ verify_oop(rax); break;
2861 __ movptr(rax, aaddress(0));
2863 __ get_cache_and_index_at_bcp(rcx, rdx, 2);
2864 __ movptr(rbx, Address(rcx,
2869 __ increment(rsi);
2870 __ null_check(rax);
2873 __ movl(rax, lo);
2875 __ movptr(rax, lo);
2876 __ verify_oop(rax);
2878 __ fld_s(lo);
2882 __ decrement(rsi);
2922 __ save_bcp();
2929 __ verify_oop(index);
2930 __ testl(flags, (1 << ConstantPoolCacheEntry::has_appendix_shift));
2931 __ jccb(Assembler::zero, L_no_push);
2935 __ push(index); // push appendix (MethodType, CallSite, etc.)
2936 __ bind(L_no_push);
2941 __ movl(recv, flags);
2942 __ andl(recv, ConstantPoolCacheEntry::parameter_size_mask);
2945 Address recv_addr = __ argument_address(recv, no_return_pc_pushed_yet + receiver_is_at_end);
2946 __ movptr(recv, recv_addr);
2947 __ verify_oop(recv);
2951 __ mov(rsi, flags);
2955 __ shrl(flags, ConstantPoolCacheEntry::tos_state_shift);
2964 __ movptr(flags, ArrayAddress(table, Address(noreg, flags, Address::times_ptr)));
2968 __ push(flags);
2973 __ mov(flags, rsi);
2974 __ restore_bcp();
2989 __ movl(rax, flags);
2990 __ andl(rax, (1 << ConstantPoolCacheEntry::is_vfinal_shift));
2991 __ jcc(Assembler::zero, notFinal);
2999 __ verify_oop(method);
3002 __ null_check(recv);
3005 __ profile_final_call(rax);
3007 __ jump_from_interpreted(method, rax);
3009 __ bind(notFinal);
3012 __ null_check(recv, oopDesc::klass_offset_in_bytes());
3013 __ load_klass(rax, recv);
3014 __ verify_oop(rax);
3017 __ profile_virtual_call(rax, rdi, rdx);
3020 __ lookup_virtual_method(rax, index, method);
3021 __ jump_from_interpreted(method, rdx);
3046 __ verify_oop(rcx);
3047 __ null_check(rcx);
3049 __ verify_oop(rbx);
3050 __ profile_call(rax);
3051 __ jump_from_interpreted(rbx, rax);
3060 __ verify_oop(rbx);
3061 __ profile_call(rax);
3062 __ jump_from_interpreted(rbx, rax);
3069 __ stop("fast_invokevfinal not used on x86");
3089 __ movl(rdi, rdx);
3090 __ andl(rdi, (1 << ConstantPoolCacheEntry::is_forced_virtual_shift));
3091 __ jcc(Assembler::zero, notMethod);
3094 __ bind(notMethod);
3097 __ restore_locals(); // restore rdi
3098 __ null_check(rcx, oopDesc::klass_offset_in_bytes());
3099 __ load_klass(rdx, rcx);
3100 __ verify_oop(rdx);
3103 __ profile_virtual_call(rdx, rsi, rdi);
3107 __ lookup_interface_method(// inputs: rec. class, interface, itable index
3119 __ testptr(rbx, rbx);
3120 __ jcc(Assembler::zero, no_such_method);
3125 __ jump_from_interpreted(rbx, rdx);
3126 __ should_not_reach_here();
3132 __ bind(no_such_method);
3134 __ pop(rbx); // pop return address (pushed by prepare_invoke)
3135 __ restore_bcp(); // rsi must be correct for exception handler (was destroyed)
3136 __ restore_locals(); // make sure locals pointer is correct as well (was destroyed)
3137 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError));
3139 __ should_not_reach_here();
3141 __ bind(no_such_interface);
3143 __ pop(rbx); // pop return address (pushed by prepare_invoke)
3144 __ restore_bcp(); // rsi must be correct for exception handler (was destroyed)
3145 __ restore_locals(); // make sure locals pointer is correct as well (was destroyed)
3146 __ call_VM(noreg, CAST_FROM_FN_PTR(address,
3149 __ should_not_reach_here();
3162 __ should_not_reach_here();
3169 __ verify_oop(rbx_method);
3170 __ verify_oop(rcx_recv);
3171 __ null_check(rcx_recv);
3176 __ profile_final_call(rax);
3178 __ jump_from_interpreted(rbx_method, rdx);
3190 __ call_VM(noreg, CAST_FROM_FN_PTR(address,
3193 __ should_not_reach_here();
3209 __ profile_call(rsi);
3211 __ verify_oop(rax_callsite);
3213 __ jump_from_interpreted(rbx_method, rdx);
3221 __ get_unsigned_2_byte_index_at_bcp(rdx, 1);
3229 __ get_cpool_and_tags(rcx, rax);
3235 __ cmpb(Address(rax, rdx, Address::times_1, tags_offset), JVM_CONSTANT_Class);
3236 __ jcc(Assembler::notEqual, slow_case_no_pop);
3239 __ movptr(rcx, Address(rcx, rdx, Address::times_ptr, sizeof(constantPoolOopDesc)));
3240 __ push(rcx); // save the contexts of klass for initializing the header
3244 __ cmpb(Address(rcx, instanceKlass::init_state_offset()), instanceKlass::fully_initialized);
3245 __ jcc(Assembler::notEqual, slow_case);
3248 __ movl(rdx, Address(rcx, Klass::layout_helper_offset()));
3250 __ testl(rdx, Klass::_lh_instance_slow_path_bit);
3251 __ jcc(Assembler::notZero, slow_case);
3265 __ get_thread(thread);
3269 __ movptr(rax, Address(thread, in_bytes(JavaThread::tlab_top_offset())));
3270 __ lea(rbx, Address(rax, rdx, Address::times_1));
3271 __ cmpptr(rbx, Address(thread, in_bytes(JavaThread::tlab_end_offset())));
3272 __ jcc(Assembler::above, allow_shared_alloc ? allocate_shared : slow_case);
3273 __ movptr(Address(thread, in_bytes(JavaThread::tlab_top_offset())), rbx);
3276 __ jmp(initialize_header);
3279 __ jmp(initialize_object);
3287 __ bind(allocate_shared);
3292 __ bind(retry);
3293 __ movptr(rax, heap_top);
3294 __ lea(rbx, Address(rax, rdx, Address::times_1));
3295 __ cmpptr(rbx, ExternalAddress((address)Universe::heap()->end_addr()));
3296 __ jcc(Assembler::above, slow_case);
3305 __ locked_cmpxchgptr(rbx, heap_top);
3308 __ jcc(Assembler::notEqual, retry);
3310 __ incr_allocated_bytes(thread, rdx, 0);
3316 __ bind(initialize_object);
3317 __ decrement(rdx, sizeof(oopDesc));
3318 __ jcc(Assembler::zero, initialize_header);
3322 __ xorl(rcx, rcx); // use zero reg to clear memory (shorter code)
3323 __ shrl(rdx, LogBytesPerLong); // divide by 2*oopSize and set carry flag if odd
3330 __ jccb(Assembler::carryClear, L);
3331 __ stop("object size is not multiple of 2 - adjust this code");
3332 __ bind(L);
3338 __ bind(loop);
3339 __ movptr(Address(rax, rdx, Address::times_8, sizeof(oopDesc) - 1*oopSize), rcx);
3340 NOT_LP64(__ movptr(Address(rax, rdx, Address::times_8, sizeof(oopDesc) - 2*oopSize), rcx));
3341 __ decrement(rdx);
3342 __ jcc(Assembler::notZero, loop);
3346 __ bind(initialize_header);
3348 __ pop(rcx); // get saved klass back in the register.
3349 __ movptr(rbx, Address(rcx, Klass::prototype_header_offset()));
3350 __ movptr(Address(rax, oopDesc::mark_offset_in_bytes ()), rbx);
3352 __ movptr(Address(rax, oopDesc::mark_offset_in_bytes ()),
3354 __ pop(rcx); // get saved klass back in the register.
3356 __ store_klass(rax, rcx); // klass
3361 __ push(atos);
3362 __ call_VM_leaf(
3364 __ pop(atos);
3367 __ jmp(done);
3371 __ bind(slow_case);
3372 __ pop(rcx); // restore stack pointer to what it was when we came in.
3373 __ bind(slow_case_no_pop);
3374 __ get_constant_pool(rax);
3375 __ get_unsigned_2_byte_index_at_bcp(rdx, 1);
3379 __ bind(done);
3385 __ push_i(rax); // make sure everything is on the stack
3386 __ load_unsigned_byte(rdx, at_bcp(1));
3388 __ pop_i(rdx); // discard size
3394 __ get_unsigned_2_byte_index_at_bcp(rdx, 1);
3395 __ get_constant_pool(rcx);
3402 __ null_check(rax, arrayOopDesc::length_offset_in_bytes());
3403 __ movl(rax, Address(rax, arrayOopDesc::length_offset_in_bytes()));
3410 __ testptr(rax, rax); // Object is in EAX
3411 __ jcc(Assembler::zero, is_null);
3414 __ get_cpool_and_tags(rcx, rdx); // ECX=cpool, EDX=tags array
3415 __ get_unsigned_2_byte_index_at_bcp(rbx, 1); // EBX=index
3417 __ cmpb(Address(rdx, rbx, Address::times_1, typeArrayOopDesc::header_size(T_BYTE) * wordSize), JVM_CONSTANT_Class);
3418 __ jcc(Assembler::equal, quicked);
3420 __ push(atos);
3422 __ pop_ptr(rdx);
3423 __ jmpb(resolved);
3426 __ bind(quicked);
3427 __ mov(rdx, rax); // Save object in EDX; EAX needed for subtype check
3428 __ movptr(rax, Address(rcx, rbx, Address::times_ptr, sizeof(constantPoolOopDesc)));
3430 __ bind(resolved);
3431 __ load_klass(rbx, rdx);
3435 __ gen_subtype_check( rbx, ok_is_subtype );
3438 __ push(rdx);
3440 __ jump(ExternalAddress(Interpreter::_throw_ClassCastException_entry));
3443 __ bind(ok_is_subtype);
3444 __ mov(rax,rdx); // Restore object in EDX
3448 __ jmp(done);
3449 __ bind(is_null);
3450 __ profile_null_seen(rcx);
3452 __ bind(is_null); // same as 'done'
3454 __ bind(done);
3461 __ testptr(rax, rax);
3462 __ jcc(Assembler::zero, is_null);
3465 __ get_cpool_and_tags(rcx, rdx); // ECX=cpool, EDX=tags array
3466 __ get_unsigned_2_byte_index_at_bcp(rbx, 1); // EBX=index
3468 __ cmpb(Address(rdx, rbx, Address::times_1, typeArrayOopDesc::header_size(T_BYTE) * wordSize), JVM_CONSTANT_Class);
3469 __ jcc(Assembler::equal, quicked);
3471 __ push(atos);
3473 __ pop_ptr(rdx);
3474 __ load_klass(rdx, rdx);
3475 __ jmp(resolved);
3478 __ bind(quicked);
3479 __ load_klass(rdx, rax);
3480 __ movptr(rax, Address(rcx, rbx, Address::times_ptr, sizeof(constantPoolOopDesc)));
3482 __ bind(resolved);
3486 __ gen_subtype_check( rdx, ok_is_subtype );
3489 __ xorl(rax,rax);
3490 __ jmpb(done);
3492 __ bind(ok_is_subtype);
3493 __ movl(rax, 1);
3497 __ jmp(done);
3498 __ bind(is_null);
3499 __ profile_null_seen(rcx);
3501 __ bind(is_null); // same as 'done'
3503 __ bind(done);
3520 __ get_method(rcx);
3521 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::get_original_bytecode_at), rcx, rsi);
3522 __ mov(rbx, rax);
3525 __ get_method(rcx);
3526 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::_breakpoint), rcx, rsi);
3529 __ dispatch_only_normal(vtos);
3538 __ null_check(rax);
3539 __ jump(ExternalAddress(Interpreter::throw_exception_entry()));
3566 __ null_check(rax);
3574 __ xorl(rdx, rdx); // points to free slot or NULL
3578 __ movptr(rcx, monitor_block_top); // points to current entry, starting with top-most entry
3580 __ lea(rbx, monitor_block_bot); // points to word before bottom of monitor block
3581 __ jmpb(entry);
3583 __ bind(loop);
3584 __ cmpptr(Address(rcx, BasicObjectLock::obj_offset_in_bytes()), (int32_t)NULL_WORD); // check if current entry is used
3585 __ cmovptr(Assembler::equal, rdx, rcx); // if not used then remember entry in rdx
3586 __ cmpptr(rax, Address(rcx, BasicObjectLock::obj_offset_in_bytes())); // check if current entry is for same object
3587 __ jccb(Assembler::equal, exit); // if same object then stop searching
3588 __ addptr(rcx, entry_size); // otherwise advance to next entry
3589 __ bind(entry);
3590 __ cmpptr(rcx, rbx); // check if bottom reached
3591 __ jcc(Assembler::notEqual, loop); // if not at bottom then check this entry
3592 __ bind(exit);
3595 __ testptr(rdx, rdx); // check if a slot has been found
3596 __ jccb(Assembler::notZero, allocated); // if found, continue with that one
3601 __ movptr(rdx, monitor_block_bot); // rdx: old expression stack bottom
3602 __ subptr(rsp, entry_size); // move expression stack top
3603 __ subptr(rdx, entry_size); // move expression stack bottom
3604 __ mov(rcx, rsp); // set start value for copy loop
3605 __ movptr(monitor_block_bot, rdx); // set new monitor block top
3606 __ jmp(entry);
3608 __ bind(loop);
3609 __ movptr(rbx, Address(rcx, entry_size)); // load expression stack word from old location
3610 __ movptr(Address(rcx, 0), rbx); // and store it at new location
3611 __ addptr(rcx, wordSize); // advance to next word
3612 __ bind(entry);
3613 __ cmpptr(rcx, rdx); // check if bottom reached
3614 __ jcc(Assembler::notEqual, loop); // if not at bottom then copy next word
3619 __ bind(allocated);
3623 __ increment(rsi);
3625 __ movptr(Address(rdx, BasicObjectLock::obj_offset_in_bytes()), rax); // store object
3626 __ lock_object(rdx);
3629 __ save_bcp(); // in case of exception
3630 __ generate_stack_overflow_check(0);
3633 __ dispatch_next(vtos);
3641 __ null_check(rax);
3650 __ movptr(rdx, monitor_block_top); // points to current entry, starting with top-most entry
3651 __ lea(rbx, monitor_block_bot); // points to word before bottom of monitor block
3652 __ jmpb(entry);
3654 __ bind(loop);
3655 __ cmpptr(rax, Address(rdx, BasicObjectLock::obj_offset_in_bytes())); // check if current entry is for same object
3656 __ jcc(Assembler::equal, found); // if same object then stop searching
3657 __ addptr(rdx, entry_size); // otherwise advance to next entry
3658 __ bind(entry);
3659 __ cmpptr(rdx, rbx); // check if bottom reached
3660 __ jcc(Assembler::notEqual, loop); // if not at bottom then check this entry
3665 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_illegal_monitor_state_exception));
3666 __ should_not_reach_here();
3670 __ bind(found);
3671 __ push_ptr(rax); // make sure object is on stack (contract with oopMaps)
3672 __ unlock_object(rdx);
3673 __ pop_ptr(rax); // discard object
3674 __ bind(end);
3683 __ load_unsigned_byte(rbx, at_bcp(1));
3685 __ jump(ArrayAddress(wtable, Address(noreg, rbx, Address::times_ptr)));
3695 __ load_unsigned_byte(rax, at_bcp(3)); // get number of dimensions
3699 __ lea( rax, Address(rsp, rax, Interpreter::stackElementScale(), -wordSize));
3701 __ load_unsigned_byte(rbx, at_bcp(3));
3702 __ lea(rsp, Address(rsp, rbx, Interpreter::stackElementScale())); // get rid of counts