| 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 28 matching lines...) Expand all Loading... |
| 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 info(function, scope->main_zone()), | 47 info(function, scope->main_zone()), |
| 48 bailout_id(-1) { | 48 bailout_id(-1) { |
| 49 CHECK(Parser::Parse(&info)); | 49 CHECK(Parser::ParseStatic(&info)); |
| 50 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); | 50 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); |
| 51 CHECK(Compiler::Analyze(&info)); | 51 CHECK(Compiler::Analyze(&info)); |
| 52 CHECK(Compiler::EnsureDeoptimizationSupport(&info)); | 52 CHECK(Compiler::EnsureDeoptimizationSupport(&info)); |
| 53 | 53 |
| 54 DCHECK(info.shared_info()->has_deoptimization_support()); | 54 DCHECK(info.shared_info()->has_deoptimization_support()); |
| 55 | 55 |
| 56 graph = new (scope_->main_zone()) Graph(scope_->main_zone()); | 56 graph = new (scope_->main_zone()) Graph(scope_->main_zone()); |
| 57 } | 57 } |
| 58 | 58 |
| 59 virtual ~DeoptCodegenTester() {} | 59 virtual ~DeoptCodegenTester() {} |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 Handle<Object> result; | 284 Handle<Object> result; |
| 285 bool has_pending_exception = | 285 bool has_pending_exception = |
| 286 !Execution::Call(isolate, t.function, | 286 !Execution::Call(isolate, t.function, |
| 287 isolate->factory()->undefined_value(), 0, NULL, | 287 isolate->factory()->undefined_value(), 0, NULL, |
| 288 false).ToHandle(&result); | 288 false).ToHandle(&result); |
| 289 CHECK(!has_pending_exception); | 289 CHECK(!has_pending_exception); |
| 290 CHECK(result->SameValue(Smi::FromInt(42))); | 290 CHECK(result->SameValue(Smi::FromInt(42))); |
| 291 } | 291 } |
| 292 | 292 |
| 293 #endif | 293 #endif |
| OLD | NEW |