src/cpu/x86/vm/macroAssembler_x86.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 8004537 Sdiff src/cpu/x86/vm

src/cpu/x86/vm/macroAssembler_x86.cpp

Print this page




2523     lea(rscratch1, dst);
2524     jmp(rscratch1);
2525   }
2526 }
2527 
2528 void MacroAssembler::jump_cc(Condition cc, AddressLiteral dst) {
2529   if (reachable(dst)) {
2530     InstructionMark im(this);
2531     relocate(dst.reloc());
2532     const int short_size = 2;
2533     const int long_size = 6;
2534     int offs = (intptr_t)dst.target() - ((intptr_t)pc());
2535     if (dst.reloc() == relocInfo::none && is8bit(offs - short_size)) {
2536       // 0111 tttn #8-bit disp
2537       emit_int8(0x70 | cc);
2538       emit_int8((offs - short_size) & 0xFF);
2539     } else {
2540       // 0000 1111 1000 tttn #32-bit disp
2541       emit_int8(0x0F);
2542       emit_int8((unsigned char)(0x80 | cc));
2543       emit_long(offs - long_size);
2544     }
2545   } else {
2546 #ifdef ASSERT
2547     warning("reversing conditional branch");
2548 #endif /* ASSERT */
2549     Label skip;
2550     jccb(reverse[cc], skip);
2551     lea(rscratch1, dst);
2552     Assembler::jmp(rscratch1);
2553     bind(skip);
2554   }
2555 }
2556 
2557 void MacroAssembler::ldmxcsr(AddressLiteral src) {
2558   if (reachable(src)) {
2559     Assembler::ldmxcsr(as_Address(src));
2560   } else {
2561     lea(rscratch1, src);
2562     Assembler::ldmxcsr(Address(rscratch1, 0));
2563   }




2523     lea(rscratch1, dst);
2524     jmp(rscratch1);
2525   }
2526 }
2527 
2528 void MacroAssembler::jump_cc(Condition cc, AddressLiteral dst) {
2529   if (reachable(dst)) {
2530     InstructionMark im(this);
2531     relocate(dst.reloc());
2532     const int short_size = 2;
2533     const int long_size = 6;
2534     int offs = (intptr_t)dst.target() - ((intptr_t)pc());
2535     if (dst.reloc() == relocInfo::none && is8bit(offs - short_size)) {
2536       // 0111 tttn #8-bit disp
2537       emit_int8(0x70 | cc);
2538       emit_int8((offs - short_size) & 0xFF);
2539     } else {
2540       // 0000 1111 1000 tttn #32-bit disp
2541       emit_int8(0x0F);
2542       emit_int8((unsigned char)(0x80 | cc));
2543       emit_int32(offs - long_size);
2544     }
2545   } else {
2546 #ifdef ASSERT
2547     warning("reversing conditional branch");
2548 #endif /* ASSERT */
2549     Label skip;
2550     jccb(reverse[cc], skip);
2551     lea(rscratch1, dst);
2552     Assembler::jmp(rscratch1);
2553     bind(skip);
2554   }
2555 }
2556 
2557 void MacroAssembler::ldmxcsr(AddressLiteral src) {
2558   if (reachable(src)) {
2559     Assembler::ldmxcsr(as_Address(src));
2560   } else {
2561     lea(rscratch1, src);
2562     Assembler::ldmxcsr(Address(rscratch1, 0));
2563   }


src/cpu/x86/vm/macroAssembler_x86.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File