Index: src/ia32/lithium-ia32.cc |
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc |
index 100a2d44fac07075fccb776cac2e511c5e1b4a12..c65340471390aeadabfdfbf0f732f5e3dd1b5a4a 100644 |
--- a/src/ia32/lithium-ia32.cc |
+++ b/src/ia32/lithium-ia32.cc |
@@ -268,7 +268,15 @@ void LUnaryMathOperation::PrintDataTo(StringStream* stream) { |
void LLoadContextSlot::PrintDataTo(StringStream* stream) { |
- stream->Add("(%d, %d)", context_chain_length(), slot_index()); |
+ InputAt(0)->PrintTo(stream); |
+ stream->Add("[%d]", slot_index()); |
+} |
+ |
+ |
+void LStoreContextSlot::PrintDataTo(StringStream* stream) { |
+ InputAt(0)->PrintTo(stream); |
+ stream->Add("[%d] <- ", slot_index()); |
+ InputAt(1)->PrintTo(stream); |
} |
@@ -1140,13 +1148,26 @@ LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) { |
} |
+LInstruction* LChunkBuilder::DoContext(HContext* instr) { |
+ return DefineAsRegister(new LContext); |
+} |
+ |
+ |
+LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) { |
+ LOperand* context = UseRegisterAtStart(instr->value()); |
+ return DefineAsRegister(new LOuterContext(context)); |
+} |
+ |
+ |
LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) { |
- return DefineAsRegister(new LGlobalObject); |
+ LOperand* context = UseRegisterAtStart(instr->value()); |
+ return DefineAsRegister(new LGlobalObject(context)); |
} |
LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) { |
- return DefineAsRegister(new LGlobalReceiver); |
+ LOperand* global_object = UseRegisterAtStart(instr->value()); |
+ return DefineAsRegister(new LGlobalReceiver(global_object)); |
} |
@@ -1651,7 +1672,26 @@ LInstruction* LChunkBuilder::DoStoreGlobal(HStoreGlobal* instr) { |
LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { |
- return DefineAsRegister(new LLoadContextSlot); |
+ LOperand* context = UseRegisterAtStart(instr->value()); |
+ return DefineAsRegister(new LLoadContextSlot(context)); |
+} |
+ |
+ |
+LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { |
+ HValue* stored_value = instr->value(); |
+ bool skip_write_barrier = stored_value->type().IsSmi() || |
Vitaly Repeshko
2011/01/27 14:05:21
Add NeedsWriteBarrier predicate to HStoreContextSl
Kevin Millikin (Chromium)
2011/02/03 08:37:23
Yes, done.
|
+ (stored_value->IsConstant() && |
+ HConstant::cast(stored_value)->InOldSpace()); |
+ |
+ LOperand* context = skip_write_barrier |
+ ? UseRegisterAtStart(instr->context()) |
+ : UseTempRegister(instr->context()); |
+ LOperand* value = skip_write_barrier |
+ ? UseRegister(stored_value) |
+ : UseTempRegister(stored_value); |
+ LOperand* temp = skip_write_barrier ? NULL : TempRegister(); |
+ |
+ return new LStoreContextSlot(context, value, temp); |
} |
@@ -1749,7 +1789,8 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { |
// We only need a scratch register if we have a write barrier or we |
// have a store into the properties array (not in-object-property). |
LOperand* temp = (!instr->is_in_object() || needs_write_barrier) |
- ? TempRegister() : NULL; |
+ ? TempRegister() |
+ : NULL; |
return new LStoreNamedField(obj, val, temp); |
} |