| 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/frames-inl.h" | 5 #include "src/frames-inl.h" |
| 6 #include "test/cctest/cctest.h" | 6 #include "test/cctest/cctest.h" |
| 7 #include "test/cctest/compiler/function-tester.h" | 7 #include "test/cctest/compiler/function-tester.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 " var is_opt = IsOptimized;" | 90 " var is_opt = IsOptimized;" |
| 91 " try {" | 91 " try {" |
| 92 " DeoptAndThrow(f);" | 92 " DeoptAndThrow(f);" |
| 93 " } finally {" | 93 " } finally {" |
| 94 " return is_opt();" | 94 " return is_opt();" |
| 95 " }" | 95 " }" |
| 96 "})"); | 96 "})"); |
| 97 | 97 |
| 98 CompileRun("function DeoptAndThrow(f) { %DeoptimizeFunction(f); throw 0; }"); | 98 CompileRun("function DeoptAndThrow(f) { %DeoptimizeFunction(f); throw 0; }"); |
| 99 InstallIsOptimizedHelper(CcTest::isolate()); | 99 InstallIsOptimizedHelper(CcTest::isolate()); |
| 100 #if 0 // TODO(4195,mstarzinger): Reproduces on MIPS64, re-enable once fixed. | |
| 101 T.CheckCall(T.false_value()); | 100 T.CheckCall(T.false_value()); |
| 102 #endif | |
| 103 } | 101 } |
| 104 | 102 |
| 105 | 103 |
| 106 TEST(DeoptTrivial) { | 104 TEST(DeoptTrivial) { |
| 107 FLAG_allow_natives_syntax = true; | 105 FLAG_allow_natives_syntax = true; |
| 108 | 106 |
| 109 FunctionTester T( | 107 FunctionTester T( |
| 110 "(function foo() {" | 108 "(function foo() {" |
| 111 " %DeoptimizeFunction(foo);" | 109 " %DeoptimizeFunction(foo);" |
| 112 " return 1;" | 110 " return 1;" |
| 113 "})"); | 111 "})"); |
| 114 | 112 |
| 115 T.CheckCall(T.Val(1)); | 113 T.CheckCall(T.Val(1)); |
| 116 } | 114 } |
| 117 | 115 |
| 118 } // namespace compiler | 116 } // namespace compiler |
| 119 } // namespace internal | 117 } // namespace internal |
| 120 } // namespace v8 | 118 } // namespace v8 |
| OLD | NEW |