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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 info(function, scope->main_zone()), | 44 info(function, scope->main_zone()), |
45 bailout_id(-1) { | 45 bailout_id(-1) { |
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 if (!info.shared_info().is_null()) { | |
Michael Starzinger
2014/08/14 08:48:07
Likewise.
sigurds
2014/08/14 09:53:33
Done.
| |
55 Handle<ScopeInfo> scope_info = | |
56 ScopeInfo::Create(info.scope(), info.zone()); | |
57 info.shared_info()->set_scope_info(*scope_info); | |
58 } | |
59 | |
54 FunctionTester::EnsureDeoptimizationSupport(&info); | 60 FunctionTester::EnsureDeoptimizationSupport(&info); |
55 | 61 |
56 DCHECK(info.shared_info()->has_deoptimization_support()); | 62 DCHECK(info.shared_info()->has_deoptimization_support()); |
57 | 63 |
58 graph = new (scope_->main_zone()) Graph(scope_->main_zone()); | 64 graph = new (scope_->main_zone()) Graph(scope_->main_zone()); |
59 } | 65 } |
60 | 66 |
61 virtual ~DeoptCodegenTester() { delete code; } | 67 virtual ~DeoptCodegenTester() { delete code; } |
62 | 68 |
63 void GenerateCodeFromSchedule(Schedule* schedule) { | 69 void GenerateCodeFromSchedule(Schedule* schedule) { |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
335 Handle<Object> result; | 341 Handle<Object> result; |
336 bool has_pending_exception = | 342 bool has_pending_exception = |
337 !Execution::Call(isolate, t.function, | 343 !Execution::Call(isolate, t.function, |
338 isolate->factory()->undefined_value(), 0, NULL, | 344 isolate->factory()->undefined_value(), 0, NULL, |
339 false).ToHandle(&result); | 345 false).ToHandle(&result); |
340 CHECK(!has_pending_exception); | 346 CHECK(!has_pending_exception); |
341 CHECK(result->SameValue(Smi::FromInt(42))); | 347 CHECK(result->SameValue(Smi::FromInt(42))); |
342 } | 348 } |
343 | 349 |
344 #endif | 350 #endif |
OLD | NEW |