| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 "(function f(a) {" | 232 "(function f(a) {" |
| 233 " try {" | 233 " try {" |
| 234 " %DeoptimizeFunction(f);" | 234 " %DeoptimizeFunction(f);" |
| 235 " throw a;" | 235 " throw a;" |
| 236 " } catch (e) {" | 236 " } catch (e) {" |
| 237 " return e + 1;" | 237 " return e + 1;" |
| 238 " }" | 238 " }" |
| 239 "})"; | 239 "})"; |
| 240 FunctionTester T(src); | 240 FunctionTester T(src); |
| 241 | 241 |
| 242 #if 0 // TODO(mstarzinger): Enable once we can. | |
| 243 T.CheckCall(T.Val(2), T.Val(1)); | 242 T.CheckCall(T.Val(2), T.Val(1)); |
| 244 #endif | |
| 245 } | 243 } |
| 246 | 244 |
| 247 | 245 |
| 248 TEST(DeoptCatch) { | 246 TEST(DeoptCatch) { |
| 249 i::FLAG_turbo_exceptions = true; | 247 i::FLAG_turbo_exceptions = true; |
| 250 i::FLAG_turbo_deoptimization = true; | 248 i::FLAG_turbo_deoptimization = true; |
| 251 const char* src = | 249 const char* src = |
| 252 "(function f(a) {" | 250 "(function f(a) {" |
| 253 " try {" | 251 " try {" |
| 254 " throw a;" | 252 " throw a;" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 " } finally {" | 289 " } finally {" |
| 292 " %DeoptimizeFunction(f);" | 290 " %DeoptimizeFunction(f);" |
| 293 " }" | 291 " }" |
| 294 "})"; | 292 "})"; |
| 295 FunctionTester T(src); | 293 FunctionTester T(src); |
| 296 | 294 |
| 297 #if 0 // TODO(mstarzinger): Enable once we can. | 295 #if 0 // TODO(mstarzinger): Enable once we can. |
| 298 T.CheckThrows(T.NewObject("new Error"), T.Val(1)); | 296 T.CheckThrows(T.NewObject("new Error"), T.Val(1)); |
| 299 #endif | 297 #endif |
| 300 } | 298 } |
| OLD | NEW |