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/access-builder.h" | 5 #include "src/compiler/access-builder.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/simplified-operator-reducer.h" | 9 #include "src/compiler/simplified-operator-reducer.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 class SimplifiedOperatorReducerTest : public TypedGraphTest { | 23 class SimplifiedOperatorReducerTest : public TypedGraphTest { |
24 public: | 24 public: |
25 explicit SimplifiedOperatorReducerTest(int num_parameters = 1) | 25 explicit SimplifiedOperatorReducerTest(int num_parameters = 1) |
26 : TypedGraphTest(num_parameters), simplified_(zone()) {} | 26 : TypedGraphTest(num_parameters), simplified_(zone()) {} |
27 ~SimplifiedOperatorReducerTest() OVERRIDE {} | 27 ~SimplifiedOperatorReducerTest() OVERRIDE {} |
28 | 28 |
29 protected: | 29 protected: |
30 Reduction Reduce(Node* node) { | 30 Reduction Reduce(Node* node) { |
31 MachineOperatorBuilder machine(zone()); | 31 MachineOperatorBuilder machine(zone()); |
32 JSOperatorBuilder javascript(zone()); | 32 JSOperatorBuilder javascript(zone()); |
33 JSGraph jsgraph(graph(), common(), &javascript, &machine); | 33 JSGraph jsgraph(isolate(), graph(), common(), &javascript, &machine); |
34 SimplifiedOperatorReducer reducer(&jsgraph); | 34 SimplifiedOperatorReducer reducer(&jsgraph); |
35 return reducer.Reduce(node); | 35 return reducer.Reduce(node); |
36 } | 36 } |
37 | 37 |
38 SimplifiedOperatorBuilder* simplified() { return &simplified_; } | 38 SimplifiedOperatorBuilder* simplified() { return &simplified_; } |
39 | 39 |
40 private: | 40 private: |
41 SimplifiedOperatorBuilder simplified_; | 41 SimplifiedOperatorBuilder simplified_; |
42 }; | 42 }; |
43 | 43 |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 Reduce(graph()->NewNode(simplified()->ChangeUint32ToTagged(), | 429 Reduce(graph()->NewNode(simplified()->ChangeUint32ToTagged(), |
430 Int32Constant(bit_cast<int32_t>(n)))); | 430 Int32Constant(bit_cast<int32_t>(n)))); |
431 ASSERT_TRUE(reduction.Changed()); | 431 ASSERT_TRUE(reduction.Changed()); |
432 EXPECT_THAT(reduction.replacement(), IsNumberConstant(BitEq(FastUI2D(n)))); | 432 EXPECT_THAT(reduction.replacement(), IsNumberConstant(BitEq(FastUI2D(n)))); |
433 } | 433 } |
434 } | 434 } |
435 | 435 |
436 } // namespace compiler | 436 } // namespace compiler |
437 } // namespace internal | 437 } // namespace internal |
438 } // namespace v8 | 438 } // namespace v8 |
OLD | NEW |