OLD | NEW |
---|---|
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 #include "src/compiler/common-operator.h" | 6 #include "src/compiler/common-operator.h" |
7 #include "src/compiler/graph-inl.h" | 7 #include "src/compiler/graph-inl.h" |
8 #include "src/compiler/js-generic-lowering.h" | 8 #include "src/compiler/js-generic-lowering.h" |
9 #include "src/compiler/machine-operator.h" | 9 #include "src/compiler/machine-operator.h" |
10 #include "src/compiler/node-aux-data-inl.h" | 10 #include "src/compiler/node-aux-data-inl.h" |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
363 CallDescriptor* desc = linkage()->GetStubCallDescriptor(d, 0); | 363 CallDescriptor* desc = linkage()->GetStubCallDescriptor(d, 0); |
364 Node* stub_code = CodeConstant(stub.GetCode()); | 364 Node* stub_code = CodeConstant(stub.GetCode()); |
365 PatchInsertInput(node, 0, stub_code); | 365 PatchInsertInput(node, 0, stub_code); |
366 PatchOperator(node, common()->Call(desc)); | 366 PatchOperator(node, common()->Call(desc)); |
367 return node; | 367 return node; |
368 } | 368 } |
369 | 369 |
370 | 370 |
371 Node* JSGenericLowering::LowerJSLoadContext(Node* node) { | 371 Node* JSGenericLowering::LowerJSLoadContext(Node* node) { |
372 ContextAccess access = OpParameter<ContextAccess>(node); | 372 ContextAccess access = OpParameter<ContextAccess>(node); |
373 PatchInsertInput(node, 1, SmiConstant(access.depth())); | 373 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.
| |
374 PatchInsertInput(node, 2, SmiConstant(access.index())); | 374 node->ReplaceInput( |
375 ReplaceWithRuntimeCall(node, Runtime::kLoadContextRelative, 3); | 375 0, graph()->NewNode( |
376 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.
| |
377 NodeProperties::GetValueInput(node, 0), | |
378 Int32Constant(Context::SlotOffset(Context::PREVIOUS_INDEX)), | |
379 NodeProperties::GetEffectInput(node))); | |
380 } | |
381 node->ReplaceInput(1, Int32Constant(Context::SlotOffset(access.index()))); | |
382 PatchOperator(node, machine()->Load(machine()->word())); | |
376 return node; | 383 return node; |
377 } | 384 } |
378 | 385 |
379 | 386 |
380 Node* JSGenericLowering::LowerJSStoreContext(Node* node) { | 387 Node* JSGenericLowering::LowerJSStoreContext(Node* node) { |
381 ContextAccess access = OpParameter<ContextAccess>(node); | 388 ContextAccess access = OpParameter<ContextAccess>(node); |
382 PatchInsertInput(node, 1, SmiConstant(access.depth())); | 389 PatchInsertInput(node, 1, SmiConstant(access.depth())); |
383 PatchInsertInput(node, 2, SmiConstant(access.index())); | 390 PatchInsertInput(node, 2, SmiConstant(access.index())); |
384 ReplaceWithRuntimeCall(node, Runtime::kStoreContextRelative, 4); | 391 ReplaceWithRuntimeCall(node, Runtime::kStoreContextRelative, 4); |
385 return node; | 392 return node; |
(...skipping 30 matching lines...) Expand all Loading... | |
416 | 423 |
417 Node* JSGenericLowering::LowerJSCallRuntime(Node* node) { | 424 Node* JSGenericLowering::LowerJSCallRuntime(Node* node) { |
418 Runtime::FunctionId function = OpParameter<Runtime::FunctionId>(node); | 425 Runtime::FunctionId function = OpParameter<Runtime::FunctionId>(node); |
419 int arity = NodeProperties::GetValueInputCount(node); | 426 int arity = NodeProperties::GetValueInputCount(node); |
420 ReplaceWithRuntimeCall(node, function, arity); | 427 ReplaceWithRuntimeCall(node, function, arity); |
421 return node; | 428 return node; |
422 } | 429 } |
423 } | 430 } |
424 } | 431 } |
425 } // namespace v8::internal::compiler | 432 } // namespace v8::internal::compiler |
OLD | NEW |