| Index: src/ia32/macro-assembler-ia32.cc
|
| diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc
|
| index 53ffa39357c97a47aa53df3f934a712fb30e9380..3bce05215c181b58819573ae73115b76ef9043e6 100644
|
| --- a/src/ia32/macro-assembler-ia32.cc
|
| +++ b/src/ia32/macro-assembler-ia32.cc
|
| @@ -2399,19 +2399,48 @@ void MacroAssembler::PushHeapObject(Handle<HeapObject> object) {
|
| void MacroAssembler::CmpWeakValue(Register value, Handle<WeakCell> cell,
|
| Register scratch) {
|
| mov(scratch, cell);
|
| - cmp(value, FieldOperand(scratch, WeakCell::kValueOffset));
|
| + cmp(value,
|
| + FieldOperand(scratch, WeakCell::kValueOffsetDontForgetTheReadBarrier));
|
| }
|
|
|
|
|
| -void MacroAssembler::GetWeakValue(Register value, Handle<WeakCell> cell) {
|
| +void MacroAssembler::GetWeakValueNoReadBarrier(Register value,
|
| + Handle<WeakCell> cell) {
|
| mov(value, cell);
|
| - mov(value, FieldOperand(value, WeakCell::kValueOffset));
|
| + mov(value,
|
| + FieldOperand(value, WeakCell::kValueOffsetDontForgetTheReadBarrier));
|
| +}
|
| +
|
| +
|
| +void MacroAssembler::LoadWeakValueNoReadBarrier(Register value,
|
| + Handle<WeakCell> cell,
|
| + Label* miss) {
|
| + GetWeakValueNoReadBarrier(value, cell);
|
| + JumpIfSmi(value, miss);
|
| +}
|
| +
|
| +
|
| +void MacroAssembler::GetWeakValue(Register value, Register scratch,
|
| + Handle<WeakCell> cell) {
|
| + DCHECK(!value.is(scratch));
|
| + mov(value, cell);
|
| +
|
| + // The read barrier means we have to overwrite the cell map with the one that
|
| + // indicates the cell has been read from. TODO(erikcorry): This should not
|
| + // emit reloc info unless the serializer is enabled: the map is not going to
|
| + // move or die.
|
| + Handle<Map> weak_cell_map(isolate()->heap()->used_weak_cell_map());
|
| + mov(scratch, weak_cell_map);
|
| + mov(FieldOperand(value, HeapObject::kMapOffset), scratch);
|
| +
|
| + mov(value,
|
| + FieldOperand(value, WeakCell::kValueOffsetDontForgetTheReadBarrier));
|
| }
|
|
|
|
|
| void MacroAssembler::LoadWeakValue(Register value, Handle<WeakCell> cell,
|
| - Label* miss) {
|
| - GetWeakValue(value, cell);
|
| + Register scratch, Label* miss) {
|
| + GetWeakValue(value, scratch, cell);
|
| JumpIfSmi(value, miss);
|
| }
|
|
|
|
|