Index: src/compiler/js-generic-lowering.cc |
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc |
index 5085e9feb9e0ad0563b042e2dae3169de313d385..130d62591c0611d9bfbdab650b4feefaa656492e 100644 |
--- a/src/compiler/js-generic-lowering.cc |
+++ b/src/compiler/js-generic-lowering.cc |
@@ -370,9 +370,16 @@ Node* JSGenericLowering::LowerJSInstanceOf(Node* node) { |
Node* JSGenericLowering::LowerJSLoadContext(Node* node) { |
ContextAccess access = OpParameter<ContextAccess>(node); |
- PatchInsertInput(node, 1, SmiConstant(access.depth())); |
- PatchInsertInput(node, 2, SmiConstant(access.index())); |
- ReplaceWithRuntimeCall(node, Runtime::kLoadContextRelative, 3); |
+ for (int i = 0; i < access.depth(); ++i) { |
titzer
2014/07/31 11:02:16
Please leave a TODO here because I think we want t
Michael Starzinger
2014/07/31 11:18:32
Done.
|
+ node->ReplaceInput( |
+ 0, graph()->NewNode( |
+ machine()->Load(machine()->word()), |
titzer
2014/07/31 11:02:16
You need kMachineTagged here, otherwise the regist
Michael Starzinger
2014/07/31 11:18:32
Done. Nice catch.
|
+ NodeProperties::GetValueInput(node, 0), |
+ Int32Constant(Context::SlotOffset(Context::PREVIOUS_INDEX)), |
+ NodeProperties::GetEffectInput(node))); |
+ } |
+ node->ReplaceInput(1, Int32Constant(Context::SlotOffset(access.index()))); |
+ PatchOperator(node, machine()->Load(machine()->word())); |
return node; |
} |