Mercurial > hg > truffle
comparison src/cpu/x86/vm/assembler_x86_64.cpp @ 117:deadee49286e
6644928: Internal Error (src/share/vm/code/relocInfo.hpp:1089)
Summary: Cardtable base can be zero, ExternalAddress can't take a NULL.
author | sgoldman |
---|---|
date | Fri, 11 Apr 2008 06:18:44 -0700 |
parents | d6fe2e4959d6 |
children | fb75a7673531 |
comparison
equal
deleted
inserted
replaced
109:9f4457a14b58 | 117:deadee49286e |
---|---|
4425 void MacroAssembler::store_check_part_2(Register obj) { | 4425 void MacroAssembler::store_check_part_2(Register obj) { |
4426 BarrierSet* bs = Universe::heap()->barrier_set(); | 4426 BarrierSet* bs = Universe::heap()->barrier_set(); |
4427 assert(bs->kind() == BarrierSet::CardTableModRef, "Wrong barrier set kind"); | 4427 assert(bs->kind() == BarrierSet::CardTableModRef, "Wrong barrier set kind"); |
4428 CardTableModRefBS* ct = (CardTableModRefBS*)bs; | 4428 CardTableModRefBS* ct = (CardTableModRefBS*)bs; |
4429 assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code"); | 4429 assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code"); |
4430 ExternalAddress cardtable((address)ct->byte_map_base); | 4430 |
4431 Address index(noreg, obj, Address::times_1); | 4431 // The calculation for byte_map_base is as follows: |
4432 movb(as_Address(ArrayAddress(cardtable, index)), 0); | 4432 // byte_map_base = _byte_map - (uintptr_t(low_bound) >> card_shift); |
4433 // So this essentially converts an address to a displacement and | |
4434 // it will never need to be relocated. On 64bit however the value may be too | |
4435 // large for a 32bit displacement | |
4436 | |
4437 intptr_t disp = (intptr_t) ct->byte_map_base; | |
4438 if (is_simm32(disp)) { | |
4439 Address cardtable(noreg, obj, Address::times_1, disp); | |
4440 movb(cardtable, 0); | |
4441 } else { | |
4442 // By doing it as an ExternalAddress disp could be converted to a rip-relative | |
4443 // displacement and done in a single instruction given favorable mapping and | |
4444 // a smarter version of as_Address. Worst case it is two instructions which | |
4445 // is no worse off then loading disp into a register and doing as a simple | |
4446 // Address() as above. | |
4447 // We can't do as ExternalAddress as the only style since if disp == 0 we'll | |
4448 // assert since NULL isn't acceptable in a reloci (see 6644928). In any case | |
4449 // in some cases we'll get a single instruction version. | |
4450 | |
4451 ExternalAddress cardtable((address)disp); | |
4452 Address index(noreg, obj, Address::times_1); | |
4453 movb(as_Address(ArrayAddress(cardtable, index)), 0); | |
4454 } | |
4455 | |
4433 } | 4456 } |
4434 | 4457 |
4435 void MacroAssembler::c2bool(Register x) { | 4458 void MacroAssembler::c2bool(Register x) { |
4436 // implements x == 0 ? 0 : 1 | 4459 // implements x == 0 ? 0 : 1 |
4437 // note: must only look at least-significant byte of x | 4460 // note: must only look at least-significant byte of x |