| 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-factory.h" | 5 #include "src/code-factory.h" |
| 6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
| 7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
| 8 #include "src/compiler/js-generic-lowering.h" | 8 #include "src/compiler/js-generic-lowering.h" |
| 9 #include "src/compiler/js-graph.h" |
| 9 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
| 10 #include "src/compiler/node-matchers.h" | 11 #include "src/compiler/node-matchers.h" |
| 11 #include "src/compiler/node-properties.h" | 12 #include "src/compiler/node-properties.h" |
| 12 #include "src/compiler/operator-properties.h" | 13 #include "src/compiler/operator-properties.h" |
| 13 #include "src/unique.h" | 14 #include "src/unique.h" |
| 14 | 15 |
| 15 namespace v8 { | 16 namespace v8 { |
| 16 namespace internal { | 17 namespace internal { |
| 17 namespace compiler { | 18 namespace compiler { |
| 18 | 19 |
| 19 JSGenericLowering::JSGenericLowering(bool is_typing_enabled, JSGraph* jsgraph) | 20 JSGenericLowering::JSGenericLowering(bool is_typing_enabled, JSGraph* jsgraph) |
| 20 : is_typing_enabled_(is_typing_enabled), jsgraph_(jsgraph) {} | 21 : is_typing_enabled_(is_typing_enabled), jsgraph_(jsgraph) {} |
| 21 | 22 |
| 22 | 23 |
| 24 JSGenericLowering::~JSGenericLowering() {} |
| 25 |
| 26 |
| 23 Reduction JSGenericLowering::Reduce(Node* node) { | 27 Reduction JSGenericLowering::Reduce(Node* node) { |
| 24 switch (node->opcode()) { | 28 switch (node->opcode()) { |
| 25 #define DECLARE_CASE(x) \ | 29 #define DECLARE_CASE(x) \ |
| 26 case IrOpcode::k##x: \ | 30 case IrOpcode::k##x: \ |
| 27 Lower##x(node); \ | 31 Lower##x(node); \ |
| 28 break; | 32 break; |
| 29 JS_OP_LIST(DECLARE_CASE) | 33 JS_OP_LIST(DECLARE_CASE) |
| 30 #undef DECLARE_CASE | 34 #undef DECLARE_CASE |
| 31 case IrOpcode::kBranch: | 35 case IrOpcode::kBranch: |
| 32 // TODO(mstarzinger): If typing is enabled then simplified lowering will | 36 // TODO(mstarzinger): If typing is enabled then simplified lowering will |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 Node* ephi = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, merge); | 511 Node* ephi = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, merge); |
| 508 | 512 |
| 509 // Relax controls of {node}, i.e. make it free floating. | 513 // Relax controls of {node}, i.e. make it free floating. |
| 510 NodeProperties::ReplaceWithValue(node, node, ephi, merge); | 514 NodeProperties::ReplaceWithValue(node, node, ephi, merge); |
| 511 NodeProperties::ReplaceEffectInput(ephi, efalse, 1); | 515 NodeProperties::ReplaceEffectInput(ephi, efalse, 1); |
| 512 | 516 |
| 513 // Turn the stack check into a runtime call. | 517 // Turn the stack check into a runtime call. |
| 514 ReplaceWithRuntimeCall(node, Runtime::kStackGuard); | 518 ReplaceWithRuntimeCall(node, Runtime::kStackGuard); |
| 515 } | 519 } |
| 516 | 520 |
| 521 |
| 522 Zone* JSGenericLowering::zone() const { return graph()->zone(); } |
| 523 |
| 524 |
| 525 Isolate* JSGenericLowering::isolate() const { return jsgraph()->isolate(); } |
| 526 |
| 527 |
| 528 Graph* JSGenericLowering::graph() const { return jsgraph()->graph(); } |
| 529 |
| 530 |
| 531 CommonOperatorBuilder* JSGenericLowering::common() const { |
| 532 return jsgraph()->common(); |
| 533 } |
| 534 |
| 535 |
| 536 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 537 return jsgraph()->machine(); |
| 538 } |
| 539 |
| 517 } // namespace compiler | 540 } // namespace compiler |
| 518 } // namespace internal | 541 } // namespace internal |
| 519 } // namespace v8 | 542 } // namespace v8 |
| OLD | NEW |