| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "v8.h" | |
| 6 | |
| 7 #include "function-tester.h" | |
| 8 | |
| 9 using namespace v8::internal; | |
| 10 using namespace v8::internal::compiler; | |
| 11 | |
| 12 | |
| 13 TEST(TurboSimpleDeopt) { | |
| 14 FLAG_allow_natives_syntax = true; | |
| 15 FLAG_turbo_deoptimization = true; | |
| 16 | |
| 17 FunctionTester T( | |
| 18 "(function f(a) {" | |
| 19 "var b = 1;" | |
| 20 "if (!%IsOptimized()) return 0;" | |
| 21 "%DeoptimizeFunction(f);" | |
| 22 "if (%IsOptimized()) return 0;" | |
| 23 "return a + b; })"); | |
| 24 | |
| 25 T.CheckCall(T.Val(2), T.Val(1)); | |
| 26 } | |
| 27 | |
| 28 | |
| 29 TEST(TurboTrivialDeopt) { | |
| 30 FLAG_allow_natives_syntax = true; | |
| 31 FLAG_turbo_deoptimization = true; | |
| 32 | |
| 33 FunctionTester T( | |
| 34 "(function foo() {" | |
| 35 "%DeoptimizeFunction(foo);" | |
| 36 "return 1; })"); | |
| 37 | |
| 38 T.CheckCall(T.Val(1)); | |
| 39 } | |
| OLD | NEW |