Print this page


Split Close
Expand all
Collapse all
          --- old/src/cpu/x86/vm/assembler_x86_32.cpp
          +++ new/src/cpu/x86/vm/assembler_x86_32.cpp
↓ open down ↓ 3397 lines elided ↑ open up ↑
3398 3398    assert(bs->kind() == BarrierSet::CardTableModRef, "Wrong barrier set kind");
3399 3399    shrl(obj, CardTableModRefBS::card_shift);
3400 3400  }
3401 3401  
3402 3402  
3403 3403  void MacroAssembler::store_check_part_2(Register obj) {
3404 3404    BarrierSet* bs = Universe::heap()->barrier_set();
3405 3405    assert(bs->kind() == BarrierSet::CardTableModRef, "Wrong barrier set kind");
3406 3406    CardTableModRefBS* ct = (CardTableModRefBS*)bs;
3407 3407    assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
3408      -  ExternalAddress cardtable((address)ct->byte_map_base);
3409      -  Address index(noreg, obj, Address::times_1);
3410 3408  
3411      -  movb(as_Address(ArrayAddress(cardtable, index)), 0);
     3409 +  // The calculation for byte_map_base is as follows:
     3410 +  // byte_map_base = _byte_map - (uintptr_t(low_bound) >> card_shift);
     3411 +  // So this essentially converts an address to a displacement and
     3412 +  // it will never need to be relocated. On 64bit however the value may be too
     3413 +  // large for a 32bit displacement
     3414 +
     3415 +  intptr_t disp = (intptr_t) ct->byte_map_base;
     3416 +  Address cardtable(noreg, obj, Address::times_1, disp);
     3417 +  movb(cardtable, 0);
3412 3418  }
3413 3419  
3414 3420  
3415 3421  void MacroAssembler::c2bool(Register x) {
3416 3422    // implements x == 0 ? 0 : 1
3417 3423    // note: must only look at least-significant byte of x
3418 3424    //       since C-style booleans are stored in one byte
3419 3425    //       only! (was bug)
3420 3426    andl(x, 0xFF);
3421 3427    setb(Assembler::notZero, x);
↓ open down ↓ 1574 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX