| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 CHECK(Parser::Parse(&info)); | 46 CHECK(Parser::Parse(&info)); |
| 47 StrictMode strict_mode = info.function()->strict_mode(); | 47 StrictMode strict_mode = info.function()->strict_mode(); |
| 48 info.SetStrictMode(strict_mode); | 48 info.SetStrictMode(strict_mode); |
| 49 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); | 49 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); |
| 50 CHECK(Rewriter::Rewrite(&info)); | 50 CHECK(Rewriter::Rewrite(&info)); |
| 51 CHECK(Scope::Analyze(&info)); | 51 CHECK(Scope::Analyze(&info)); |
| 52 CHECK_NE(NULL, info.scope()); | 52 CHECK_NE(NULL, info.scope()); |
| 53 | 53 |
| 54 FunctionTester::EnsureDeoptimizationSupport(&info); | 54 FunctionTester::EnsureDeoptimizationSupport(&info); |
| 55 | 55 |
| 56 ASSERT(info.shared_info()->has_deoptimization_support()); | 56 DCHECK(info.shared_info()->has_deoptimization_support()); |
| 57 | 57 |
| 58 graph = new (scope_->main_zone()) Graph(scope_->main_zone()); | 58 graph = new (scope_->main_zone()) Graph(scope_->main_zone()); |
| 59 } | 59 } |
| 60 | 60 |
| 61 virtual ~DeoptCodegenTester() { delete code; } | 61 virtual ~DeoptCodegenTester() { delete code; } |
| 62 | 62 |
| 63 void GenerateCodeFromSchedule(Schedule* schedule) { | 63 void GenerateCodeFromSchedule(Schedule* schedule) { |
| 64 OFStream os(stdout); | 64 OFStream os(stdout); |
| 65 os << *schedule; | 65 os << *schedule; |
| 66 | 66 |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 Handle<Object> result; | 327 Handle<Object> result; |
| 328 bool has_pending_exception = | 328 bool has_pending_exception = |
| 329 !Execution::Call(isolate, t.function, | 329 !Execution::Call(isolate, t.function, |
| 330 isolate->factory()->undefined_value(), 0, NULL, | 330 isolate->factory()->undefined_value(), 0, NULL, |
| 331 false).ToHandle(&result); | 331 false).ToHandle(&result); |
| 332 CHECK(!has_pending_exception); | 332 CHECK(!has_pending_exception); |
| 333 CHECK(result->SameValue(Smi::FromInt(42))); | 333 CHECK(result->SameValue(Smi::FromInt(42))); |
| 334 } | 334 } |
| 335 | 335 |
| 336 #endif | 336 #endif |
| OLD | NEW |