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/compiler/change-lowering.h" | 5 #include "src/compiler/change-lowering.h" |
6 #include "src/compiler/js-graph.h" | 6 #include "src/compiler/js-graph.h" |
7 #include "src/compiler/node-properties-inl.h" | 7 #include "src/compiler/node-properties-inl.h" |
8 #include "src/compiler/simplified-operator.h" | 8 #include "src/compiler/simplified-operator.h" |
9 #include "src/compiler/typer.h" | |
10 #include "test/unittests/compiler/compiler-test-utils.h" | 9 #include "test/unittests/compiler/compiler-test-utils.h" |
11 #include "test/unittests/compiler/graph-unittest.h" | 10 #include "test/unittests/compiler/graph-unittest.h" |
12 #include "testing/gmock-support.h" | 11 #include "testing/gmock-support.h" |
13 | 12 |
14 using testing::_; | 13 using testing::_; |
15 using testing::AllOf; | 14 using testing::AllOf; |
16 using testing::Capture; | 15 using testing::Capture; |
17 using testing::CaptureEq; | 16 using testing::CaptureEq; |
18 | 17 |
19 namespace v8 { | 18 namespace v8 { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 int SmiValueSize() const { | 57 int SmiValueSize() const { |
59 return Is32() ? SmiTagging<4>::SmiValueSize() | 58 return Is32() ? SmiTagging<4>::SmiValueSize() |
60 : SmiTagging<8>::SmiValueSize(); | 59 : SmiTagging<8>::SmiValueSize(); |
61 } | 60 } |
62 | 61 |
63 Node* Parameter(int32_t index = 0) { | 62 Node* Parameter(int32_t index = 0) { |
64 return graph()->NewNode(common()->Parameter(index), graph()->start()); | 63 return graph()->NewNode(common()->Parameter(index), graph()->start()); |
65 } | 64 } |
66 | 65 |
67 Reduction Reduce(Node* node) { | 66 Reduction Reduce(Node* node) { |
68 Typer typer(zone()); | |
69 MachineOperatorBuilder machine(WordRepresentation()); | 67 MachineOperatorBuilder machine(WordRepresentation()); |
70 JSOperatorBuilder javascript(zone()); | 68 JSOperatorBuilder javascript(zone()); |
71 JSGraph jsgraph(graph(), common(), &javascript, &typer, &machine); | 69 JSGraph jsgraph(graph(), common(), &javascript, &machine); |
72 CompilationInfo info(isolate(), zone()); | 70 CompilationInfo info(isolate(), zone()); |
73 Linkage linkage(&info); | 71 Linkage linkage(&info); |
74 ChangeLowering reducer(&jsgraph, &linkage); | 72 ChangeLowering reducer(&jsgraph, &linkage); |
75 return reducer.Reduce(node); | 73 return reducer.Reduce(node); |
76 } | 74 } |
77 | 75 |
78 SimplifiedOperatorBuilder* simplified() { return &simplified_; } | 76 SimplifiedOperatorBuilder* simplified() { return &simplified_; } |
79 | 77 |
80 Matcher<Node*> IsAllocateHeapNumber(const Matcher<Node*>& effect_matcher, | 78 Matcher<Node*> IsAllocateHeapNumber(const Matcher<Node*>& effect_matcher, |
81 const Matcher<Node*>& control_matcher) { | 79 const Matcher<Node*>& control_matcher) { |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 IsIfTrue(AllOf(CaptureEq(&branch), | 452 IsIfTrue(AllOf(CaptureEq(&branch), |
455 IsBranch(IsUint32LessThanOrEqual( | 453 IsBranch(IsUint32LessThanOrEqual( |
456 val, IsInt32Constant(SmiMaxValue())), | 454 val, IsInt32Constant(SmiMaxValue())), |
457 graph()->start()))), | 455 graph()->start()))), |
458 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); | 456 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); |
459 } | 457 } |
460 | 458 |
461 } // namespace compiler | 459 } // namespace compiler |
462 } // namespace internal | 460 } // namespace internal |
463 } // namespace v8 | 461 } // namespace v8 |
OLD | NEW |