src/cpu/x86/vm/assembler_x86_64.cpp

changeset 621
cf1821c649d9
parent 614
1f809e010142
parent 617
44abbb0d4c18
child 631
d1605aabd0a1
child 779
6aae2f9d0294
     1.1 --- a/src/cpu/x86/vm/assembler_x86_64.cpp	Fri Jun 06 13:43:36 2008 -0400
     1.2 +++ b/src/cpu/x86/vm/assembler_x86_64.cpp	Fri Jun 06 14:34:24 2008 -0700
     1.3 @@ -5007,8 +5007,7 @@
     1.4    jcc(Assembler::notEqual, cas_label);
     1.5    // The bias pattern is present in the object's header. Need to check
     1.6    // whether the bias owner and the epoch are both still current.
     1.7 -  load_klass(tmp_reg, obj_reg);
     1.8 -  movq(tmp_reg, Address(tmp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
     1.9 +  load_prototype_header(tmp_reg, obj_reg);
    1.10    orq(tmp_reg, r15_thread);
    1.11    xorq(tmp_reg, swap_reg);
    1.12    andq(tmp_reg, ~((int) markOopDesc::age_mask_in_place));
    1.13 @@ -5082,8 +5081,7 @@
    1.14    //
    1.15    // FIXME: due to a lack of registers we currently blow away the age
    1.16    // bits in this situation. Should attempt to preserve them.
    1.17 -  load_klass(tmp_reg, obj_reg);
    1.18 -  movq(tmp_reg, Address(tmp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
    1.19 +  load_prototype_header(tmp_reg, obj_reg);
    1.20    orq(tmp_reg, r15_thread);
    1.21    if (os::is_MP()) {
    1.22      lock();
    1.23 @@ -5113,8 +5111,7 @@
    1.24    //
    1.25    // FIXME: due to a lack of registers we currently blow away the age
    1.26    // bits in this situation. Should attempt to preserve them.
    1.27 -  load_klass(tmp_reg, obj_reg);
    1.28 -  movq(tmp_reg, Address(tmp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
    1.29 +  load_prototype_header(tmp_reg, obj_reg);
    1.30    if (os::is_MP()) {
    1.31      lock();
    1.32    }
    1.33 @@ -5158,6 +5155,16 @@
    1.34    }
    1.35  }
    1.36  
    1.37 +void MacroAssembler::load_prototype_header(Register dst, Register src) {
    1.38 +  if (UseCompressedOops) {
    1.39 +    movl(dst, Address(src, oopDesc::klass_offset_in_bytes()));
    1.40 +    movq(dst, Address(r12_heapbase, dst, Address::times_8, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
    1.41 +  } else {
    1.42 +    movq(dst, Address(src, oopDesc::klass_offset_in_bytes()));
    1.43 +    movq(dst, Address(dst, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
    1.44 +  }
    1.45 +}
    1.46 +
    1.47  void MacroAssembler::store_klass(Register dst, Register src) {
    1.48    if (UseCompressedOops) {
    1.49      encode_heap_oop_not_null(src);

mercurial