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/change-lowering.h" | 6 #include "src/compiler/change-lowering.h" |
7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
8 #include "src/compiler/node-properties-inl.h" | 8 #include "src/compiler/node-properties-inl.h" |
9 #include "src/compiler/simplified-operator.h" | 9 #include "src/compiler/simplified-operator.h" |
10 #include "test/unittests/compiler/compiler-test-utils.h" | 10 #include "test/unittests/compiler/compiler-test-utils.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 int SmiShiftAmount() const { return kSmiTagSize + SmiShiftSize(); } | 54 int SmiShiftAmount() const { return kSmiTagSize + SmiShiftSize(); } |
55 int SmiShiftSize() const { | 55 int SmiShiftSize() const { |
56 return Is32() ? SmiTagging<4>::SmiShiftSize() | 56 return Is32() ? SmiTagging<4>::SmiShiftSize() |
57 : SmiTagging<8>::SmiShiftSize(); | 57 : SmiTagging<8>::SmiShiftSize(); |
58 } | 58 } |
59 int SmiValueSize() const { | 59 int SmiValueSize() const { |
60 return Is32() ? SmiTagging<4>::SmiValueSize() | 60 return Is32() ? SmiTagging<4>::SmiValueSize() |
61 : SmiTagging<8>::SmiValueSize(); | 61 : SmiTagging<8>::SmiValueSize(); |
62 } | 62 } |
63 | 63 |
64 Node* Parameter(int32_t index = 0) { | |
65 return graph()->NewNode(common()->Parameter(index), graph()->start()); | |
66 } | |
67 | |
68 Reduction Reduce(Node* node) { | 64 Reduction Reduce(Node* node) { |
69 MachineOperatorBuilder machine(zone(), WordRepresentation()); | 65 MachineOperatorBuilder machine(zone(), WordRepresentation()); |
70 JSOperatorBuilder javascript(zone()); | 66 JSOperatorBuilder javascript(zone()); |
71 JSGraph jsgraph(graph(), common(), &javascript, &machine); | 67 JSGraph jsgraph(graph(), common(), &javascript, &machine); |
72 CompilationInfo info(isolate(), zone()); | 68 CompilationInfo info(isolate(), zone()); |
73 Linkage linkage(zone(), &info); | 69 Linkage linkage(zone(), &info); |
74 ChangeLowering reducer(&jsgraph, &linkage); | 70 ChangeLowering reducer(&jsgraph, &linkage); |
75 return reducer.Reduce(node); | 71 return reducer.Reduce(node); |
76 } | 72 } |
77 | 73 |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 IsIfTrue(AllOf(CaptureEq(&branch), | 451 IsIfTrue(AllOf(CaptureEq(&branch), |
456 IsBranch(IsUint32LessThanOrEqual( | 452 IsBranch(IsUint32LessThanOrEqual( |
457 val, IsInt32Constant(SmiMaxValue())), | 453 val, IsInt32Constant(SmiMaxValue())), |
458 graph()->start()))), | 454 graph()->start()))), |
459 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); | 455 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); |
460 } | 456 } |
461 | 457 |
462 } // namespace compiler | 458 } // namespace compiler |
463 } // namespace internal | 459 } // namespace internal |
464 } // namespace v8 | 460 } // namespace v8 |
OLD | NEW |