| 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 "test/unittests/compiler/graph-unittest.h" | 5 #include "test/unittests/compiler/graph-unittest.h" |
| 6 | 6 |
| 7 #include "src/compiler/js-builtin-reducer.h" | 7 #include "src/compiler/js-builtin-reducer.h" |
| 8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
| 9 #include "src/compiler/node-properties-inl.h" | 9 #include "src/compiler/node-properties-inl.h" |
| 10 #include "src/compiler/typer.h" | 10 #include "src/compiler/typer.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 JSBuiltinReducer reducer(&jsgraph); | 28 JSBuiltinReducer reducer(&jsgraph); |
| 29 return reducer.Reduce(node); | 29 return reducer.Reduce(node); |
| 30 } | 30 } |
| 31 | 31 |
| 32 Node* Parameter(Type* t, int32_t index = 0) { | 32 Node* Parameter(Type* t, int32_t index = 0) { |
| 33 Node* n = graph()->NewNode(common()->Parameter(index), graph()->start()); | 33 Node* n = graph()->NewNode(common()->Parameter(index), graph()->start()); |
| 34 NodeProperties::SetBounds(n, Bounds(Type::None(), t)); | 34 NodeProperties::SetBounds(n, Bounds(Type::None(), t)); |
| 35 return n; | 35 return n; |
| 36 } | 36 } |
| 37 | 37 |
| 38 Node* UndefinedConstant() { | |
| 39 return HeapConstant( | |
| 40 Unique<HeapObject>::CreateImmovable(factory()->undefined_value())); | |
| 41 } | |
| 42 | |
| 43 JSOperatorBuilder* javascript() { return &javascript_; } | 38 JSOperatorBuilder* javascript() { return &javascript_; } |
| 44 | 39 |
| 45 private: | 40 private: |
| 46 JSOperatorBuilder javascript_; | 41 JSOperatorBuilder javascript_; |
| 47 }; | 42 }; |
| 48 | 43 |
| 49 | 44 |
| 50 namespace { | 45 namespace { |
| 51 | 46 |
| 52 // TODO(mstarzinger): Find a common place and unify with test-js-typed-lowering. | 47 // TODO(mstarzinger): Find a common place and unify with test-js-typed-lowering. |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 Reduction r = Reduce(call); | 228 Reduction r = Reduce(call); |
| 234 | 229 |
| 235 ASSERT_TRUE(r.Changed()); | 230 ASSERT_TRUE(r.Changed()); |
| 236 EXPECT_THAT(r.replacement(), IsTruncateFloat64ToFloat32(p0)); | 231 EXPECT_THAT(r.replacement(), IsTruncateFloat64ToFloat32(p0)); |
| 237 } | 232 } |
| 238 } | 233 } |
| 239 | 234 |
| 240 } // namespace compiler | 235 } // namespace compiler |
| 241 } // namespace internal | 236 } // namespace internal |
| 242 } // namespace v8 | 237 } // namespace v8 |
| OLD | NEW |