< prev index next >

src/hotspot/cpu/x86/templateTable_x86.cpp

Print this page




2494   __ jcc(j_not(cc), not_taken);
2495   branch(false, false);
2496   __ bind(not_taken);
2497   __ profile_not_taken_branch(rax);
2498 }
2499 
2500 void TemplateTable::if_nullcmp(Condition cc) {
2501   transition(atos, vtos);
2502   // assume branch is more often taken than not (loops use backward branches)
2503   Label not_taken;
2504   __ testptr(rax, rax);
2505   __ jcc(j_not(cc), not_taken);
2506   branch(false, false);
2507   __ bind(not_taken);
2508   __ profile_not_taken_branch(rax);
2509 }
2510 
2511 void TemplateTable::if_acmp(Condition cc) {
2512   transition(atos, vtos);
2513   // assume branch is more often taken than not (loops use backward branches)
2514   Label not_taken, is_null;
2515   __ pop_ptr(rdx);
2516 
2517   if (EnableValhalla) {
2518     // Handle value types
2519     const int mask = Universe::oop_metadata_valuetype_mask();
2520     __ testptr(rdx, rdx);
2521     __ jcc(Assembler::zero, is_null);
2522     __ movl(rbx, Address(rdx, oopDesc::klass_offset_in_bytes()));
2523     __ andptr(rbx, mask);
2524     // Check if a shift is required for perturbation to affect aligned bits
2525     if (mask == KlassPtrValueTypeMask && ObjectAlignmentInBytes <= KlassAlignmentInBytes) {
2526       assert((mask >> LogKlassAlignmentInBytes) == 1, "invalid shift");
2527       __ shrptr(rbx, LogKlassAlignmentInBytes);
2528     } else {
2529       assert(mask < ObjectAlignmentInBytes, "invalid mask");
2530     }
2531     __ orptr(rdx, rbx);
2532     __ bind(is_null);
2533   }
2534 
2535   __ cmpoop(rdx, rax);











2536   __ jcc(j_not(cc), not_taken);

2537   branch(false, false);
2538   __ bind(not_taken);
2539   __ profile_not_taken_branch(rax);
2540 }
2541 
2542 void TemplateTable::ret() {
2543   transition(vtos, vtos);
2544   locals_index(rbx);
2545   LP64_ONLY(__ movslq(rbx, iaddress(rbx))); // get return bci, compute return bcp
2546   NOT_LP64(__ movptr(rbx, iaddress(rbx)));
2547   __ profile_ret(rbx, rcx);
2548   __ get_method(rax);
2549   __ movptr(rbcp, Address(rax, Method::const_offset()));
2550   __ lea(rbcp, Address(rbcp, rbx, Address::times_1,
2551                       ConstMethod::codes_offset()));
2552   __ dispatch_next(vtos, 0, true);
2553 }
2554 
2555 void TemplateTable::wide_ret() {
2556   transition(vtos, vtos);




2494   __ jcc(j_not(cc), not_taken);
2495   branch(false, false);
2496   __ bind(not_taken);
2497   __ profile_not_taken_branch(rax);
2498 }
2499 
2500 void TemplateTable::if_nullcmp(Condition cc) {
2501   transition(atos, vtos);
2502   // assume branch is more often taken than not (loops use backward branches)
2503   Label not_taken;
2504   __ testptr(rax, rax);
2505   __ jcc(j_not(cc), not_taken);
2506   branch(false, false);
2507   __ bind(not_taken);
2508   __ profile_not_taken_branch(rax);
2509 }
2510 
2511 void TemplateTable::if_acmp(Condition cc) {
2512   transition(atos, vtos);
2513   // assume branch is more often taken than not (loops use backward branches)
2514   Label taken, not_taken;
2515   __ pop_ptr(rdx);
2516 
2517   const int is_value_mask = markOopDesc::always_locked_pattern;
2518   if (EnableValhalla && UsePointerPerturbation) {
2519     Label is_null;
2520     __ testptr(rdx, rdx);
2521     __ jcc(Assembler::zero, is_null);
2522     __ movptr(rbx, Address(rdx, oopDesc::mark_offset_in_bytes()));
2523     __ andptr(rbx, is_value_mask);
2524     __ cmpl(rbx, is_value_mask);
2525     __ setb(Assembler::equal, rbx);
2526     __ movzbl(rbx, rbx);




2527     __ orptr(rdx, rbx);
2528     __ bind(is_null);
2529   }
2530 
2531   __ cmpoop(rdx, rax);
2532 
2533   if (EnableValhalla && !UsePointerPerturbation) {
2534     __ jcc(Assembler::notEqual, (cc == not_equal) ? taken : not_taken);
2535     __ testptr(rdx, rdx);
2536     __ jcc(Assembler::zero, (cc == equal) ? taken : not_taken);
2537     __ movptr(rbx, Address(rdx, oopDesc::mark_offset_in_bytes()));
2538     __ andptr(rbx, is_value_mask);
2539     __ cmpl(rbx, is_value_mask);
2540     cc = (cc == equal) ? not_equal : equal;
2541   }
2542 
2543   __ jcc(j_not(cc), not_taken);
2544   __ bind(taken);
2545   branch(false, false);
2546   __ bind(not_taken);
2547   __ profile_not_taken_branch(rax);
2548 }
2549 
2550 void TemplateTable::ret() {
2551   transition(vtos, vtos);
2552   locals_index(rbx);
2553   LP64_ONLY(__ movslq(rbx, iaddress(rbx))); // get return bci, compute return bcp
2554   NOT_LP64(__ movptr(rbx, iaddress(rbx)));
2555   __ profile_ret(rbx, rcx);
2556   __ get_method(rax);
2557   __ movptr(rbcp, Address(rax, Method::const_offset()));
2558   __ lea(rbcp, Address(rbcp, rbx, Address::times_1,
2559                       ConstMethod::codes_offset()));
2560   __ dispatch_next(vtos, 0, true);
2561 }
2562 
2563 void TemplateTable::wide_ret() {
2564   transition(vtos, vtos);


< prev index next >