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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 CompilationInfo info(isolate(), zone()); | 72 CompilationInfo info(isolate(), zone()); |
73 Linkage linkage(zone(), &info); | 73 Linkage linkage(zone(), &info); |
74 ChangeLowering reducer(&jsgraph, &linkage); | 74 ChangeLowering reducer(&jsgraph, &linkage); |
75 return reducer.Reduce(node); | 75 return reducer.Reduce(node); |
76 } | 76 } |
77 | 77 |
78 SimplifiedOperatorBuilder* simplified() { return &simplified_; } | 78 SimplifiedOperatorBuilder* simplified() { return &simplified_; } |
79 | 79 |
80 Matcher<Node*> IsAllocateHeapNumber(const Matcher<Node*>& effect_matcher, | 80 Matcher<Node*> IsAllocateHeapNumber(const Matcher<Node*>& effect_matcher, |
81 const Matcher<Node*>& control_matcher) { | 81 const Matcher<Node*>& control_matcher) { |
82 return IsCall( | 82 return IsCall(_, IsHeapConstant(Unique<HeapObject>::CreateImmovable( |
83 _, IsHeapConstant(Unique<HeapObject>::CreateImmovable( | 83 AllocateHeapNumberStub(isolate()).GetCode())), |
84 CEntryStub(isolate(), 1).GetCode())), | 84 IsNumberConstant(0.0), effect_matcher, control_matcher); |
85 IsExternalConstant(ExternalReference( | |
86 Runtime::FunctionForId(Runtime::kAllocateHeapNumber), isolate())), | |
87 IsInt32Constant(0), IsNumberConstant(0.0), effect_matcher, | |
88 control_matcher); | |
89 } | 85 } |
90 Matcher<Node*> IsLoadHeapNumber(const Matcher<Node*>& value_matcher, | 86 Matcher<Node*> IsLoadHeapNumber(const Matcher<Node*>& value_matcher, |
91 const Matcher<Node*>& control_matcher) { | 87 const Matcher<Node*>& control_matcher) { |
92 return IsLoad(kMachFloat64, value_matcher, | 88 return IsLoad(kMachFloat64, value_matcher, |
93 IsIntPtrConstant(HeapNumberValueOffset()), graph()->start(), | 89 IsIntPtrConstant(HeapNumberValueOffset()), graph()->start(), |
94 control_matcher); | 90 control_matcher); |
95 } | 91 } |
96 Matcher<Node*> IsIntPtrConstant(int value) { | 92 Matcher<Node*> IsIntPtrConstant(int value) { |
97 return Is32() ? IsInt32Constant(value) : IsInt64Constant(value); | 93 return Is32() ? IsInt32Constant(value) : IsInt64Constant(value); |
98 } | 94 } |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 IsIfTrue(AllOf(CaptureEq(&branch), | 453 IsIfTrue(AllOf(CaptureEq(&branch), |
458 IsBranch(IsUint32LessThanOrEqual( | 454 IsBranch(IsUint32LessThanOrEqual( |
459 val, IsInt32Constant(SmiMaxValue())), | 455 val, IsInt32Constant(SmiMaxValue())), |
460 graph()->start()))), | 456 graph()->start()))), |
461 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); | 457 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); |
462 } | 458 } |
463 | 459 |
464 } // namespace compiler | 460 } // namespace compiler |
465 } // namespace internal | 461 } // namespace internal |
466 } // namespace v8 | 462 } // namespace v8 |
OLD | NEW |