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 27 matching lines...) Expand all Loading... |
38 | 38 |
39 | 39 |
40 class DeoptCodegenTester { | 40 class DeoptCodegenTester { |
41 public: | 41 public: |
42 explicit DeoptCodegenTester(HandleAndZoneScope* scope, const char* src) | 42 explicit DeoptCodegenTester(HandleAndZoneScope* scope, const char* src) |
43 : scope_(scope), | 43 : scope_(scope), |
44 function(NewFunction(src)), | 44 function(NewFunction(src)), |
45 info(function, scope->main_zone()), | 45 info(function, scope->main_zone()), |
46 bailout_id(-1) { | 46 bailout_id(-1) { |
47 CHECK(Parser::Parse(&info)); | 47 CHECK(Parser::Parse(&info)); |
48 StrictMode strict_mode = info.function()->strict_mode(); | |
49 info.SetStrictMode(strict_mode); | |
50 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); | 48 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); |
51 CHECK(Rewriter::Rewrite(&info)); | 49 CHECK(Rewriter::Rewrite(&info)); |
52 CHECK(Scope::Analyze(&info)); | 50 CHECK(Scope::Analyze(&info)); |
53 CHECK_NE(NULL, info.scope()); | 51 CHECK_NE(NULL, info.scope()); |
54 Handle<ScopeInfo> scope_info = ScopeInfo::Create(info.scope(), info.zone()); | 52 Handle<ScopeInfo> scope_info = ScopeInfo::Create(info.scope(), info.zone()); |
55 info.shared_info()->set_scope_info(*scope_info); | 53 info.shared_info()->set_scope_info(*scope_info); |
56 | 54 |
57 FunctionTester::EnsureDeoptimizationSupport(&info); | 55 FunctionTester::EnsureDeoptimizationSupport(&info); |
58 | 56 |
59 DCHECK(info.shared_info()->has_deoptimization_support()); | 57 DCHECK(info.shared_info()->has_deoptimization_support()); |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 Handle<Object> result; | 308 Handle<Object> result; |
311 bool has_pending_exception = | 309 bool has_pending_exception = |
312 !Execution::Call(isolate, t.function, | 310 !Execution::Call(isolate, t.function, |
313 isolate->factory()->undefined_value(), 0, NULL, | 311 isolate->factory()->undefined_value(), 0, NULL, |
314 false).ToHandle(&result); | 312 false).ToHandle(&result); |
315 CHECK(!has_pending_exception); | 313 CHECK(!has_pending_exception); |
316 CHECK(result->SameValue(Smi::FromInt(42))); | 314 CHECK(result->SameValue(Smi::FromInt(42))); |
317 } | 315 } |
318 | 316 |
319 #endif | 317 #endif |
OLD | NEW |