Print this page


Split Close
Expand all
Collapse all
          --- old/src/cpu/x86/vm/assembler_x86.cpp
          +++ new/src/cpu/x86/vm/assembler_x86.cpp
↓ open down ↓ 3502 lines elided ↑ open up ↑
3503 3503      // are not handled.
3504 3504      if (CodeCache::find_blob(adr._target) == NULL) {
3505 3505        return false;
3506 3506      }
3507 3507    }
3508 3508    // For external_word_type/runtime_call_type if it is reachable from where we
3509 3509    // are now (possibly a temp buffer) and where we might end up
3510 3510    // anywhere in the codeCache then we are always reachable.
3511 3511    // This would have to change if we ever save/restore shared code
3512 3512    // to be more pessimistic.
3513      -
3514 3513    disp = (int64_t)adr._target - ((int64_t)CodeCache::low_bound() + sizeof(int));
3515 3514    if (!is_simm32(disp)) return false;
3516 3515    disp = (int64_t)adr._target - ((int64_t)CodeCache::high_bound() + sizeof(int));
3517 3516    if (!is_simm32(disp)) return false;
3518 3517  
3519 3518    disp = (int64_t)adr._target - ((int64_t)_code_pos + sizeof(int));
3520 3519  
3521 3520    // Because rip relative is a disp + address_of_next_instruction and we
3522 3521    // don't know the value of address_of_next_instruction we apply a fudge factor
3523 3522    // to make sure we will be ok no matter the size of the instruction we get placed into.
↓ open down ↓ 3 lines elided ↑ open up ↑
3527 3526    // + 4 because better safe than sorry.
3528 3527    const int fudge = 12 + 4;
3529 3528    if (disp < 0) {
3530 3529      disp -= fudge;
3531 3530    } else {
3532 3531      disp += fudge;
3533 3532    }
3534 3533    return is_simm32(disp);
3535 3534  }
3536 3535  
     3536 +// Check if the polling page is not reachable from the code cache using rip-relative
     3537 +// addressing.
     3538 +bool Assembler::is_polling_page_far() {
     3539 +  intptr_t addr = (intptr_t)os::get_polling_page();
     3540 +  return !is_simm32(addr - (intptr_t)CodeCache::low_bound()) ||
     3541 +         !is_simm32(addr - (intptr_t)CodeCache::high_bound());
     3542 +}
     3543 +
3537 3544  void Assembler::emit_data64(jlong data,
3538 3545                              relocInfo::relocType rtype,
3539 3546                              int format) {
3540 3547    if (rtype == relocInfo::none) {
3541 3548      emit_long64(data);
3542 3549    } else {
3543 3550      emit_data64(data, Relocation::spec_simple(rtype), format);
3544 3551    }
3545 3552  }
3546 3553  
↓ open down ↓ 3332 lines elided ↑ open up ↑
6879 6886  
6880 6887  void MacroAssembler::sign_extend_short(Register reg) {
6881 6888    if (LP64_ONLY(true ||) VM_Version::is_P6()) {
6882 6889      movswl(reg, reg); // movsxw
6883 6890    } else {
6884 6891      shll(reg, 16);
6885 6892      sarl(reg, 16);
6886 6893    }
6887 6894  }
6888 6895  
     6896 +void MacroAssembler::testl(Register dst, AddressLiteral src) {
     6897 +  assert(reachable(src), "Address should be reachable");
     6898 +  testl(dst, as_Address(src));
     6899 +}
     6900 +
6889 6901  //////////////////////////////////////////////////////////////////////////////////
6890 6902  #ifndef SERIALGC
6891 6903  
6892 6904  void MacroAssembler::g1_write_barrier_pre(Register obj,
6893 6905  #ifndef _LP64
6894 6906                                            Register thread,
6895 6907  #endif
6896 6908                                            Register tmp,
6897 6909                                            Register tmp2,
6898 6910                                            bool tosca_live) {
↓ open down ↓ 215 lines elided ↑ open up ↑
7114 7126  }
7115 7127  
7116 7128  void MacroAssembler::subptr(Register dst, int32_t imm32) {
7117 7129    LP64_ONLY(subq(dst, imm32)) NOT_LP64(subl(dst, imm32));
7118 7130  }
7119 7131  
7120 7132  void MacroAssembler::subptr(Register dst, Register src) {
7121 7133    LP64_ONLY(subq(dst, src)) NOT_LP64(subl(dst, src));
7122 7134  }
7123 7135  
7124      -void MacroAssembler::test32(Register src1, AddressLiteral src2) {
7125      -  // src2 must be rval
7126      -
7127      -  if (reachable(src2)) {
7128      -    testl(src1, as_Address(src2));
7129      -  } else {
7130      -    lea(rscratch1, src2);
7131      -    testl(src1, Address(rscratch1, 0));
7132      -  }
7133      -}
7134      -
7135 7136  // C++ bool manipulation
7136 7137  void MacroAssembler::testbool(Register dst) {
7137 7138    if(sizeof(bool) == 1)
7138 7139      testb(dst, 0xff);
7139 7140    else if(sizeof(bool) == 2) {
7140 7141      // testw implementation needed for two byte bools
7141 7142      ShouldNotReachHere();
7142 7143    } else if(sizeof(bool) == 4)
7143 7144      testl(dst, dst);
7144 7145    else
↓ open down ↓ 2333 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX