| 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 | 6 |
| 7 #include "test/cctest/compiler/function-tester.h" | 7 #include "test/cctest/compiler/function-tester.h" |
| 8 | 8 |
| 9 using namespace v8::internal; | 9 using namespace v8::internal; |
| 10 using namespace v8::internal::compiler; | 10 using namespace v8::internal::compiler; |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 "(function f(a) {" | 225 "(function f(a) {" |
| 226 " try {" | 226 " try {" |
| 227 " %DeoptimizeFunction(f);" | 227 " %DeoptimizeFunction(f);" |
| 228 " throw a;" | 228 " throw a;" |
| 229 " } catch (e) {" | 229 " } catch (e) {" |
| 230 " return e + 1;" | 230 " return e + 1;" |
| 231 " }" | 231 " }" |
| 232 "})"; | 232 "})"; |
| 233 FunctionTester T(src); | 233 FunctionTester T(src); |
| 234 | 234 |
| 235 #if 0 // TODO(mstarzinger): Enable once we can. | |
| 236 T.CheckCall(T.Val(2), T.Val(1)); | 235 T.CheckCall(T.Val(2), T.Val(1)); |
| 237 #endif | |
| 238 } | 236 } |
| 239 | 237 |
| 240 | 238 |
| 241 TEST(DeoptCatch) { | 239 TEST(DeoptCatch) { |
| 242 i::FLAG_turbo_exceptions = true; | 240 i::FLAG_turbo_exceptions = true; |
| 243 i::FLAG_turbo_deoptimization = true; | 241 i::FLAG_turbo_deoptimization = true; |
| 244 const char* src = | 242 const char* src = |
| 245 "(function f(a) {" | 243 "(function f(a) {" |
| 246 " try {" | 244 " try {" |
| 247 " throw a;" | 245 " throw a;" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 " } finally {" | 282 " } finally {" |
| 285 " %DeoptimizeFunction(f);" | 283 " %DeoptimizeFunction(f);" |
| 286 " }" | 284 " }" |
| 287 "})"; | 285 "})"; |
| 288 FunctionTester T(src); | 286 FunctionTester T(src); |
| 289 | 287 |
| 290 #if 0 // TODO(mstarzinger): Enable once we can. | 288 #if 0 // TODO(mstarzinger): Enable once we can. |
| 291 T.CheckThrows(T.NewObject("new Error"), T.Val(1)); | 289 T.CheckThrows(T.NewObject("new Error"), T.Val(1)); |
| 292 #endif | 290 #endif |
| 293 } | 291 } |
| OLD | NEW |