| 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 <limits> | 5 #include <limits> |
| 6 | 6 |
| 7 #include "src/compiler/control-builders.h" | 7 #include "src/compiler/control-builders.h" |
| 8 #include "src/compiler/generic-node-inl.h" | 8 #include "src/compiler/generic-node-inl.h" |
| 9 #include "src/compiler/node-properties-inl.h" | 9 #include "src/compiler/node-properties-inl.h" |
| 10 #include "src/compiler/pipeline.h" | 10 #include "src/compiler/pipeline.h" |
| 11 #include "src/compiler/simplified-lowering.h" | 11 #include "src/compiler/simplified-lowering.h" |
| 12 #include "src/compiler/simplified-node-factory.h" | 12 #include "src/compiler/simplified-node-factory.h" |
| 13 #include "src/compiler/typer.h" | |
| 14 #include "src/compiler/verifier.h" | 13 #include "src/compiler/verifier.h" |
| 15 #include "src/execution.h" | 14 #include "src/execution.h" |
| 16 #include "src/parser.h" | 15 #include "src/parser.h" |
| 17 #include "src/rewriter.h" | 16 #include "src/rewriter.h" |
| 18 #include "src/scopes.h" | 17 #include "src/scopes.h" |
| 19 #include "test/cctest/cctest.h" | 18 #include "test/cctest/cctest.h" |
| 20 #include "test/cctest/compiler/codegen-tester.h" | 19 #include "test/cctest/compiler/codegen-tester.h" |
| 21 #include "test/cctest/compiler/graph-builder-tester.h" | 20 #include "test/cctest/compiler/graph-builder-tester.h" |
| 22 #include "test/cctest/compiler/value-helper.h" | 21 #include "test/cctest/compiler/value-helper.h" |
| 23 | 22 |
| 24 using namespace v8::internal; | 23 using namespace v8::internal; |
| 25 using namespace v8::internal::compiler; | 24 using namespace v8::internal::compiler; |
| 26 | 25 |
| 27 template <typename ReturnType> | 26 template <typename ReturnType> |
| 28 class ChangesLoweringTester : public GraphBuilderTester<ReturnType> { | 27 class ChangesLoweringTester : public GraphBuilderTester<ReturnType> { |
| 29 public: | 28 public: |
| 30 explicit ChangesLoweringTester(MachineType p0 = kMachNone) | 29 explicit ChangesLoweringTester(MachineType p0 = kMachNone) |
| 31 : GraphBuilderTester<ReturnType>(p0), | 30 : GraphBuilderTester<ReturnType>(p0), |
| 32 typer(this->zone()), | 31 jsgraph(this->graph(), this->common()), |
| 33 jsgraph(this->graph(), this->common(), &typer), | |
| 34 lowering(&jsgraph), | 32 lowering(&jsgraph), |
| 35 function(Handle<JSFunction>::null()) {} | 33 function(Handle<JSFunction>::null()) {} |
| 36 | 34 |
| 37 Typer typer; | |
| 38 JSGraph jsgraph; | 35 JSGraph jsgraph; |
| 39 SimplifiedLowering lowering; | 36 SimplifiedLowering lowering; |
| 40 Handle<JSFunction> function; | 37 Handle<JSFunction> function; |
| 41 | 38 |
| 42 Node* start() { return this->graph()->start(); } | 39 Node* start() { return this->graph()->start(); } |
| 43 | 40 |
| 44 template <typename T> | 41 template <typename T> |
| 45 T* CallWithPotentialGC() { | 42 T* CallWithPotentialGC() { |
| 46 // TODO(titzer): we need to wrap the code in a JSFunction and call it via | 43 // TODO(titzer): we need to wrap the code in a JSFunction and call it via |
| 47 // Execution::Call() so that the GC knows about the frame, can walk it, | 44 // Execution::Call() so that the GC knows about the frame, can walk it, |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 | 386 |
| 390 if (TODO_FLOAT64_TO_TAGGED && Pipeline::SupportedTarget()) { | 387 if (TODO_FLOAT64_TO_TAGGED && Pipeline::SupportedTarget()) { |
| 391 FOR_FLOAT64_INPUTS(i) { | 388 FOR_FLOAT64_INPUTS(i) { |
| 392 input = *i; | 389 input = *i; |
| 393 SimulateFullSpace(CcTest::heap()->new_space()); | 390 SimulateFullSpace(CcTest::heap()->new_space()); |
| 394 Object* result = t.CallWithPotentialGC<Object>(); | 391 Object* result = t.CallWithPotentialGC<Object>(); |
| 395 t.CheckNumber(input, result); | 392 t.CheckNumber(input, result); |
| 396 } | 393 } |
| 397 } | 394 } |
| 398 } | 395 } |
| OLD | NEW |