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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 "(function f(a) {" | 229 "(function f(a) {" |
230 " try {" | 230 " try {" |
231 " throw a;" | 231 " throw a;" |
232 " } finally {" | 232 " } finally {" |
233 " %DeoptimizeFunction(f);" | 233 " %DeoptimizeFunction(f);" |
234 " return a + 1;" | 234 " return a + 1;" |
235 " }" | 235 " }" |
236 "})"; | 236 "})"; |
237 FunctionTester T(src); | 237 FunctionTester T(src); |
238 | 238 |
239 #if 0 // TODO(mstarzinger): Currently fails on no-snap AMR64 simulator. | |
240 T.CheckCall(T.Val(2), T.Val(1)); | 239 T.CheckCall(T.Val(2), T.Val(1)); |
241 #endif | |
242 } | 240 } |
243 | 241 |
244 | 242 |
245 TEST(DeoptFinallyReThrow) { | 243 TEST(DeoptFinallyReThrow) { |
246 i::FLAG_turbo_exceptions = true; | 244 i::FLAG_turbo_exceptions = true; |
247 i::FLAG_turbo_deoptimization = true; | 245 i::FLAG_turbo_deoptimization = true; |
248 const char* src = | 246 const char* src = |
249 "(function f(a) {" | 247 "(function f(a) {" |
250 " try {" | 248 " try {" |
251 " throw a;" | 249 " throw a;" |
252 " } finally {" | 250 " } finally {" |
253 " %DeoptimizeFunction(f);" | 251 " %DeoptimizeFunction(f);" |
254 " }" | 252 " }" |
255 "})"; | 253 "})"; |
256 FunctionTester T(src); | 254 FunctionTester T(src); |
257 | 255 |
258 #if 0 // TODO(mstarzinger): Enable once we can. | 256 #if 0 // TODO(mstarzinger): Enable once we can. |
259 T.CheckThrows(T.NewObject("new Error"), T.Val(1)); | 257 T.CheckThrows(T.NewObject("new Error"), T.Val(1)); |
260 #endif | 258 #endif |
261 } | 259 } |
OLD | NEW |