Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index 020518db0d0c6e60223e0278cf0ffbe4d61852b4..2b1d2967bbfa1af189534b454a147240b9324737 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -1937,20 +1937,30 @@ void LCodeGen::DoLoadGlobal(LLoadGlobal* instr) { |
void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) { |
+ Register object = ToRegister(instr->temp1()); |
+ Register scratch = ToRegister(instr->temp2()); |
Register value = ToRegister(instr->InputAt(0)); |
- Operand cell_operand = Operand::Cell(instr->hydrogen()->cell()); |
+ Handle<JSGlobalPropertyCell> cell_handle(instr->hydrogen()->cell()); |
// If the cell we are storing to contains the hole it could have |
// been deleted from the property dictionary. In that case, we need |
// to update the property details in the property dictionary to mark |
// it as no longer deleted. We deoptimize in that case. |
if (instr->hydrogen()->check_hole_value()) { |
- __ cmp(cell_operand, Factory::the_hole_value()); |
+ __ cmp(Operand::Cell(cell_handle), Factory::the_hole_value()); |
DeoptimizeIf(equal, instr->environment()); |
} |
// Store the value. |
- __ mov(cell_operand, value); |
+ __ mov(object, Immediate(cell_handle)); |
+ __ mov(FieldOperand(object, JSGlobalPropertyCell::kValueOffset), value); |
+ |
+ NearLabel done; |
+ __ test(value, Immediate(kSmiTagMask)); |
+ __ j(zero, &done); |
+ __ IncrementalMarkingRecordWrite(object, value, scratch); |
Erik Corry
2011/02/22 12:27:19
This looks rather horrible in terms of some perfor
Vyacheslav Egorov (Chromium)
2011/02/23 14:31:46
Yes.
|
+ __ bind(&done); |
+ |
} |