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-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/compiler/access-builder.h" | 6 #include "src/compiler/access-builder.h" |
7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
8 #include "src/compiler/js-operator.h" | 8 #include "src/compiler/js-operator.h" |
9 #include "src/compiler/js-typed-lowering.h" | 9 #include "src/compiler/js-typed-lowering.h" |
10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 class JSTypedLoweringTest : public TypedGraphTest { | 74 class JSTypedLoweringTest : public TypedGraphTest { |
75 public: | 75 public: |
76 JSTypedLoweringTest() : TypedGraphTest(3), javascript_(zone()) {} | 76 JSTypedLoweringTest() : TypedGraphTest(3), javascript_(zone()) {} |
77 ~JSTypedLoweringTest() override {} | 77 ~JSTypedLoweringTest() override {} |
78 | 78 |
79 protected: | 79 protected: |
80 Reduction Reduce(Node* node) { | 80 Reduction Reduce(Node* node) { |
81 MachineOperatorBuilder machine(zone()); | 81 MachineOperatorBuilder machine(zone()); |
82 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine); | 82 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine); |
83 JSTypedLowering reducer(&jsgraph, zone()); | 83 // TODO(titzer): mock the GraphReducer here for better unit testing. |
| 84 GraphReducer graph_reducer(graph(), zone()); |
| 85 JSTypedLowering reducer(&graph_reducer, &jsgraph, zone()); |
84 return reducer.Reduce(node); | 86 return reducer.Reduce(node); |
85 } | 87 } |
86 | 88 |
87 Node* EmptyFrameState() { | 89 Node* EmptyFrameState() { |
88 MachineOperatorBuilder machine(zone()); | 90 MachineOperatorBuilder machine(zone()); |
89 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine); | 91 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine); |
90 return jsgraph.EmptyFrameState(); | 92 return jsgraph.EmptyFrameState(); |
91 } | 93 } |
92 | 94 |
93 Handle<JSArrayBuffer> NewArrayBuffer(void* bytes, size_t byte_length) { | 95 Handle<JSArrayBuffer> NewArrayBuffer(void* bytes, size_t byte_length) { |
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 EXPECT_THAT(r.replacement(), | 989 EXPECT_THAT(r.replacement(), |
988 IsFinish(IsAllocate(IsNumberConstant(Context::SizeFor( | 990 IsFinish(IsAllocate(IsNumberConstant(Context::SizeFor( |
989 Context::MIN_CONTEXT_SLOTS)), | 991 Context::MIN_CONTEXT_SLOTS)), |
990 effect, control), | 992 effect, control), |
991 _)); | 993 _)); |
992 } | 994 } |
993 | 995 |
994 } // namespace compiler | 996 } // namespace compiler |
995 } // namespace internal | 997 } // namespace internal |
996 } // namespace v8 | 998 } // namespace v8 |
OLD | NEW |