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/v8.h" | 5 #include "src/v8.h" |
6 #include "test/cctest/cctest.h" | 6 #include "test/cctest/cctest.h" |
7 | 7 |
8 #include "src/compiler/code-generator.h" | 8 #include "src/compiler/code-generator.h" |
9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 class DeoptCodegenTester { | 41 class DeoptCodegenTester { |
42 public: | 42 public: |
43 explicit DeoptCodegenTester(HandleAndZoneScope* scope, const char* src) | 43 explicit DeoptCodegenTester(HandleAndZoneScope* scope, const char* src) |
44 : scope_(scope), | 44 : scope_(scope), |
45 function(NewFunction(src)), | 45 function(NewFunction(src)), |
46 info(function, scope->main_zone()), | 46 info(function, scope->main_zone()), |
47 bailout_id(-1) { | 47 bailout_id(-1) { |
48 CHECK(Parser::Parse(&info)); | 48 CHECK(Parser::Parse(&info)); |
49 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); | 49 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); |
50 CHECK(Compiler::Analyze(&info)); | 50 CHECK(Rewriter::Rewrite(&info)); |
| 51 CHECK(Scope::Analyze(&info)); |
| 52 CHECK(AstNumbering::Renumber(info.function(), info.zone())); |
51 CHECK(Compiler::EnsureDeoptimizationSupport(&info)); | 53 CHECK(Compiler::EnsureDeoptimizationSupport(&info)); |
52 | 54 |
53 DCHECK(info.shared_info()->has_deoptimization_support()); | 55 DCHECK(info.shared_info()->has_deoptimization_support()); |
54 | 56 |
55 graph = new (scope_->main_zone()) Graph(scope_->main_zone()); | 57 graph = new (scope_->main_zone()) Graph(scope_->main_zone()); |
56 } | 58 } |
57 | 59 |
58 virtual ~DeoptCodegenTester() { delete code; } | 60 virtual ~DeoptCodegenTester() { delete code; } |
59 | 61 |
60 void GenerateCodeFromSchedule(Schedule* schedule) { | 62 void GenerateCodeFromSchedule(Schedule* schedule) { |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 Handle<Object> result; | 310 Handle<Object> result; |
309 bool has_pending_exception = | 311 bool has_pending_exception = |
310 !Execution::Call(isolate, t.function, | 312 !Execution::Call(isolate, t.function, |
311 isolate->factory()->undefined_value(), 0, NULL, | 313 isolate->factory()->undefined_value(), 0, NULL, |
312 false).ToHandle(&result); | 314 false).ToHandle(&result); |
313 CHECK(!has_pending_exception); | 315 CHECK(!has_pending_exception); |
314 CHECK(result->SameValue(Smi::FromInt(42))); | 316 CHECK(result->SameValue(Smi::FromInt(42))); |
315 } | 317 } |
316 | 318 |
317 #endif | 319 #endif |
OLD | NEW |