OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/compiler/js-intrinsic-lowering.h" | 5 #include "src/compiler/js-intrinsic-lowering.h" |
6 | 6 |
7 #include <stack> | 7 #include <stack> |
8 | 8 |
9 #include "src/compiler/access-builder.h" | 9 #include "src/compiler/access-builder.h" |
10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
11 #include "src/compiler/node-matchers.h" | 11 #include "src/compiler/node-matchers.h" |
12 #include "src/compiler/node-properties.h" | 12 #include "src/compiler/node-properties.h" |
13 #include "src/compiler/operator-properties.h" | 13 #include "src/compiler/operator-properties.h" |
14 #include "src/counters.h" | 14 #include "src/counters.h" |
15 #include "src/objects-inl.h" | 15 #include "src/objects-inl.h" |
16 | 16 |
17 namespace v8 { | 17 namespace v8 { |
18 namespace internal { | 18 namespace internal { |
19 namespace compiler { | 19 namespace compiler { |
20 | 20 |
21 JSIntrinsicLowering::JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph, | 21 JSIntrinsicLowering::JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph, |
22 DeoptimizationMode mode) | 22 DeoptimizationMode mode) |
23 : AdvancedReducer(editor), | 23 : AdvancedReducer(editor), jsgraph_(jsgraph), mode_(mode) {} |
24 jsgraph_(jsgraph), | |
25 mode_(mode), | |
26 simplified_(jsgraph->zone()) {} | |
27 | 24 |
28 | 25 |
29 Reduction JSIntrinsicLowering::Reduce(Node* node) { | 26 Reduction JSIntrinsicLowering::Reduce(Node* node) { |
30 if (node->opcode() != IrOpcode::kJSCallRuntime) return NoChange(); | 27 if (node->opcode() != IrOpcode::kJSCallRuntime) return NoChange(); |
31 const Runtime::Function* const f = | 28 const Runtime::Function* const f = |
32 Runtime::FunctionForId(CallRuntimeParametersOf(node->op()).id()); | 29 Runtime::FunctionForId(CallRuntimeParametersOf(node->op()).id()); |
33 if (f->intrinsic_type != Runtime::IntrinsicType::INLINE) return NoChange(); | 30 if (f->intrinsic_type != Runtime::IntrinsicType::INLINE) return NoChange(); |
34 switch (f->function_id) { | 31 switch (f->function_id) { |
35 case Runtime::kInlineConstructDouble: | 32 case Runtime::kInlineConstructDouble: |
36 return ReduceConstructDouble(node); | 33 return ReduceConstructDouble(node); |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 | 598 |
602 JSOperatorBuilder* JSIntrinsicLowering::javascript() const { | 599 JSOperatorBuilder* JSIntrinsicLowering::javascript() const { |
603 return jsgraph_->javascript(); | 600 return jsgraph_->javascript(); |
604 } | 601 } |
605 | 602 |
606 | 603 |
607 MachineOperatorBuilder* JSIntrinsicLowering::machine() const { | 604 MachineOperatorBuilder* JSIntrinsicLowering::machine() const { |
608 return jsgraph()->machine(); | 605 return jsgraph()->machine(); |
609 } | 606 } |
610 | 607 |
| 608 |
| 609 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { |
| 610 return jsgraph()->simplified(); |
| 611 } |
| 612 |
611 } // namespace compiler | 613 } // namespace compiler |
612 } // namespace internal | 614 } // namespace internal |
613 } // namespace v8 | 615 } // namespace v8 |
OLD | NEW |