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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 } | 472 } |
473 | 473 |
474 | 474 |
475 Node* JSGenericLowering::LowerJSLoadContext(Node* node) { | 475 Node* JSGenericLowering::LowerJSLoadContext(Node* node) { |
476 ContextAccess access = OpParameter<ContextAccess>(node); | 476 ContextAccess access = OpParameter<ContextAccess>(node); |
477 // TODO(mstarzinger): Use simplified operators instead of machine operators | 477 // TODO(mstarzinger): Use simplified operators instead of machine operators |
478 // here so that load/store optimization can be applied afterwards. | 478 // here so that load/store optimization can be applied afterwards. |
479 for (int i = 0; i < access.depth(); ++i) { | 479 for (int i = 0; i < access.depth(); ++i) { |
480 node->ReplaceInput( | 480 node->ReplaceInput( |
481 0, graph()->NewNode( | 481 0, graph()->NewNode( |
482 machine()->Load(kMachineTagged), | 482 machine()->Load(kMachAnyTagged), |
483 NodeProperties::GetValueInput(node, 0), | 483 NodeProperties::GetValueInput(node, 0), |
484 Int32Constant(Context::SlotOffset(Context::PREVIOUS_INDEX)), | 484 Int32Constant(Context::SlotOffset(Context::PREVIOUS_INDEX)), |
485 NodeProperties::GetEffectInput(node))); | 485 NodeProperties::GetEffectInput(node))); |
486 } | 486 } |
487 node->ReplaceInput(1, Int32Constant(Context::SlotOffset(access.index()))); | 487 node->ReplaceInput(1, Int32Constant(Context::SlotOffset(access.index()))); |
488 PatchOperator(node, machine()->Load(kMachineTagged)); | 488 PatchOperator(node, machine()->Load(kMachAnyTagged)); |
489 return node; | 489 return node; |
490 } | 490 } |
491 | 491 |
492 | 492 |
493 Node* JSGenericLowering::LowerJSStoreContext(Node* node) { | 493 Node* JSGenericLowering::LowerJSStoreContext(Node* node) { |
494 ContextAccess access = OpParameter<ContextAccess>(node); | 494 ContextAccess access = OpParameter<ContextAccess>(node); |
495 // TODO(mstarzinger): Use simplified operators instead of machine operators | 495 // TODO(mstarzinger): Use simplified operators instead of machine operators |
496 // here so that load/store optimization can be applied afterwards. | 496 // here so that load/store optimization can be applied afterwards. |
497 for (int i = 0; i < access.depth(); ++i) { | 497 for (int i = 0; i < access.depth(); ++i) { |
498 node->ReplaceInput( | 498 node->ReplaceInput( |
499 0, graph()->NewNode( | 499 0, graph()->NewNode( |
500 machine()->Load(kMachineTagged), | 500 machine()->Load(kMachAnyTagged), |
501 NodeProperties::GetValueInput(node, 0), | 501 NodeProperties::GetValueInput(node, 0), |
502 Int32Constant(Context::SlotOffset(Context::PREVIOUS_INDEX)), | 502 Int32Constant(Context::SlotOffset(Context::PREVIOUS_INDEX)), |
503 NodeProperties::GetEffectInput(node))); | 503 NodeProperties::GetEffectInput(node))); |
504 } | 504 } |
505 node->ReplaceInput(2, NodeProperties::GetValueInput(node, 1)); | 505 node->ReplaceInput(2, NodeProperties::GetValueInput(node, 1)); |
506 node->ReplaceInput(1, Int32Constant(Context::SlotOffset(access.index()))); | 506 node->ReplaceInput(1, Int32Constant(Context::SlotOffset(access.index()))); |
507 PatchOperator(node, machine()->Store(kMachineTagged, kFullWriteBarrier)); | 507 PatchOperator(node, machine()->Store(kMachAnyTagged, kFullWriteBarrier)); |
508 return node; | 508 return node; |
509 } | 509 } |
510 | 510 |
511 | 511 |
512 Node* JSGenericLowering::LowerJSCallConstruct(Node* node) { | 512 Node* JSGenericLowering::LowerJSCallConstruct(Node* node) { |
513 int arity = OpParameter<int>(node); | 513 int arity = OpParameter<int>(node); |
514 CallConstructStub stub(isolate(), NO_CALL_CONSTRUCTOR_FLAGS); | 514 CallConstructStub stub(isolate(), NO_CALL_CONSTRUCTOR_FLAGS); |
515 CodeStubInterfaceDescriptor* d = GetInterfaceDescriptor(isolate(), &stub); | 515 CodeStubInterfaceDescriptor* d = GetInterfaceDescriptor(isolate(), &stub); |
516 CallDescriptor* desc = linkage()->GetStubCallDescriptor( | 516 CallDescriptor* desc = linkage()->GetStubCallDescriptor( |
517 d, arity, DeoptimizationSupportForNode(node)); | 517 d, arity, DeoptimizationSupportForNode(node)); |
(...skipping 23 matching lines...) Expand all Loading... |
541 | 541 |
542 Node* JSGenericLowering::LowerJSCallRuntime(Node* node) { | 542 Node* JSGenericLowering::LowerJSCallRuntime(Node* node) { |
543 Runtime::FunctionId function = OpParameter<Runtime::FunctionId>(node); | 543 Runtime::FunctionId function = OpParameter<Runtime::FunctionId>(node); |
544 int arity = OperatorProperties::GetValueInputCount(node->op()); | 544 int arity = OperatorProperties::GetValueInputCount(node->op()); |
545 ReplaceWithRuntimeCall(node, function, arity); | 545 ReplaceWithRuntimeCall(node, function, arity); |
546 return node; | 546 return node; |
547 } | 547 } |
548 } | 548 } |
549 } | 549 } |
550 } // namespace v8::internal::compiler | 550 } // namespace v8::internal::compiler |
OLD | NEW |