src/cpu/x86/vm/assembler_x86_64.cpp

changeset 559
b130b98db9cf
parent 553
fb75a7673531
child 599
c436414a719e
child 613
6d172e3548cb
child 777
37f87013dfd8
     1.1 --- a/src/cpu/x86/vm/assembler_x86_64.cpp	Thu Apr 17 07:16:03 2008 -0700
     1.2 +++ b/src/cpu/x86/vm/assembler_x86_64.cpp	Wed Apr 23 11:20:36 2008 -0700
     1.3 @@ -4150,7 +4150,7 @@
     1.4    if (oop_result->is_valid()) {
     1.5      movq(oop_result, Address(r15_thread, JavaThread::vm_result_offset()));
     1.6      movptr(Address(r15_thread, JavaThread::vm_result_offset()), NULL_WORD);
     1.7 -    verify_oop(oop_result);
     1.8 +    verify_oop(oop_result, "broken oop in call_VM_base");
     1.9    }
    1.10  }
    1.11  
    1.12 @@ -4689,6 +4689,10 @@
    1.13    popq(r12);
    1.14  }
    1.15  
    1.16 +#ifndef PRODUCT
    1.17 +extern "C" void findpc(intptr_t x);
    1.18 +#endif
    1.19 +
    1.20  void MacroAssembler::debug(char* msg, int64_t pc, int64_t regs[]) {
    1.21    // In order to get locks to work, we need to fake a in_VM state
    1.22    if (ShowMessageBoxOnError ) {
    1.23 @@ -4707,6 +4711,11 @@
    1.24      if (os::message_box(msg, "Execution stopped, print registers?")) {
    1.25        ttyLocker ttyl;
    1.26        tty->print_cr("rip = 0x%016lx", pc);
    1.27 +#ifndef PRODUCT
    1.28 +      tty->cr();
    1.29 +      findpc(pc);
    1.30 +      tty->cr();
    1.31 +#endif
    1.32        tty->print_cr("rax = 0x%016lx", regs[15]);
    1.33        tty->print_cr("rbx = 0x%016lx", regs[12]);
    1.34        tty->print_cr("rcx = 0x%016lx", regs[14]);
    1.35 @@ -5187,7 +5196,7 @@
    1.36    bind(ok);
    1.37    popq(rscratch1);
    1.38  #endif
    1.39 -  verify_oop(r);
    1.40 +  verify_oop(r, "broken oop in encode_heap_oop");
    1.41    testq(r, r);
    1.42    cmovq(Assembler::equal, r, r12_heapbase);
    1.43    subq(r, r12_heapbase);
    1.44 @@ -5203,11 +5212,28 @@
    1.45    stop("null oop passed to encode_heap_oop_not_null");
    1.46    bind(ok);
    1.47  #endif
    1.48 -  verify_oop(r);
    1.49 +  verify_oop(r, "broken oop in encode_heap_oop_not_null");
    1.50    subq(r, r12_heapbase);
    1.51    shrq(r, LogMinObjAlignmentInBytes);
    1.52  }
    1.53  
    1.54 +void MacroAssembler::encode_heap_oop_not_null(Register dst, Register src) {
    1.55 +  assert (UseCompressedOops, "should be compressed");
    1.56 +#ifdef ASSERT
    1.57 +  Label ok;
    1.58 +  testq(src, src);
    1.59 +  jcc(Assembler::notEqual, ok);
    1.60 +  stop("null oop passed to encode_heap_oop_not_null2");
    1.61 +  bind(ok);
    1.62 +#endif
    1.63 +  verify_oop(src, "broken oop in encode_heap_oop_not_null2");
    1.64 +  if (dst != src) {
    1.65 +    movq(dst, src);
    1.66 +  }
    1.67 +  subq(dst, r12_heapbase);
    1.68 +  shrq(dst, LogMinObjAlignmentInBytes);
    1.69 +}
    1.70 +
    1.71  void  MacroAssembler::decode_heap_oop(Register r) {
    1.72    assert (UseCompressedOops, "should be compressed");
    1.73  #ifdef ASSERT
    1.74 @@ -5232,7 +5258,7 @@
    1.75     leaq(r, Address(r12_heapbase, r, Address::times_8, 0));
    1.76  #endif
    1.77    bind(done);
    1.78 -  verify_oop(r);
    1.79 +  verify_oop(r, "broken oop in decode_heap_oop");
    1.80  }
    1.81  
    1.82  void  MacroAssembler::decode_heap_oop_not_null(Register r) {
    1.83 @@ -5243,6 +5269,14 @@
    1.84    leaq(r, Address(r12_heapbase, r, Address::times_8, 0));
    1.85  }
    1.86  
    1.87 +void  MacroAssembler::decode_heap_oop_not_null(Register dst, Register src) {
    1.88 +  assert (UseCompressedOops, "should only be used for compressed headers");
    1.89 +  // Cannot assert, unverified entry point counts instructions (see .ad file)
    1.90 +  // vtableStubs also counts instructions in pd_code_size_limit.
    1.91 +  assert(Address::times_8 == LogMinObjAlignmentInBytes, "decode alg wrong");
    1.92 +  leaq(dst, Address(r12_heapbase, src, Address::times_8, 0));
    1.93 +}
    1.94 +
    1.95  Assembler::Condition MacroAssembler::negate_condition(Assembler::Condition cond) {
    1.96    switch (cond) {
    1.97      // Note some conditions are synonyms for others

mercurial