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 26 matching lines...) Expand all Loading... |
37 return v8::Utils::OpenHandle( | 37 return v8::Utils::OpenHandle( |
38 *v8::Handle<v8::Function>::Cast(CompileRun(source))); | 38 *v8::Handle<v8::Function>::Cast(CompileRun(source))); |
39 } | 39 } |
40 | 40 |
41 | 41 |
42 class DeoptCodegenTester { | 42 class DeoptCodegenTester { |
43 public: | 43 public: |
44 explicit DeoptCodegenTester(HandleAndZoneScope* scope, const char* src) | 44 explicit DeoptCodegenTester(HandleAndZoneScope* scope, const char* src) |
45 : scope_(scope), | 45 : scope_(scope), |
46 function(NewFunction(src)), | 46 function(NewFunction(src)), |
47 parse_info(scope->main_zone()), | 47 parse_info(scope->main_zone(), function), |
48 info(parse_info.InitializeFromJSFunction(function)), | 48 info(&parse_info), |
49 bailout_id(-1) { | 49 bailout_id(-1) { |
50 CHECK(Parser::ParseStatic(&parse_info)); | 50 CHECK(Parser::ParseStatic(&parse_info)); |
51 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); | 51 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); |
52 CHECK(Compiler::Analyze(&parse_info)); | 52 CHECK(Compiler::Analyze(&parse_info)); |
53 CHECK(Compiler::EnsureDeoptimizationSupport(&info)); | 53 CHECK(Compiler::EnsureDeoptimizationSupport(&info)); |
54 | 54 |
55 DCHECK(info.shared_info()->has_deoptimization_support()); | 55 DCHECK(info.shared_info()->has_deoptimization_support()); |
56 | 56 |
57 graph = new (scope_->main_zone()) Graph(scope_->main_zone()); | 57 graph = new (scope_->main_zone()) Graph(scope_->main_zone()); |
58 } | 58 } |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 Handle<Object> result; | 286 Handle<Object> result; |
287 bool has_pending_exception = | 287 bool has_pending_exception = |
288 !Execution::Call(isolate, t.function, | 288 !Execution::Call(isolate, t.function, |
289 isolate->factory()->undefined_value(), 0, NULL, | 289 isolate->factory()->undefined_value(), 0, NULL, |
290 false).ToHandle(&result); | 290 false).ToHandle(&result); |
291 CHECK(!has_pending_exception); | 291 CHECK(!has_pending_exception); |
292 CHECK(result->SameValue(Smi::FromInt(42))); | 292 CHECK(result->SameValue(Smi::FromInt(42))); |
293 } | 293 } |
294 | 294 |
295 #endif | 295 #endif |
OLD | NEW |