Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Side by Side Diff: test/cctest/compiler/test-run-jsexceptions.cc

Issue 972943004: [turbofan] Add test coverage for deopt within try-catch. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/compiler/try-deopt.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 " r += 'D-';" 175 " r += 'D-';"
176 " }" 176 " }"
177 " return r;" 177 " return r;"
178 "})"; 178 "})";
179 FunctionTester T(src); 179 FunctionTester T(src);
180 180
181 T.CheckCall(T.Val("-A-"), T.true_value(), T.false_value()); 181 T.CheckCall(T.Val("-A-"), T.true_value(), T.false_value());
182 T.CheckCall(T.Val("-A-B-D-"), T.false_value(), T.true_value()); 182 T.CheckCall(T.Val("-A-B-D-"), T.false_value(), T.true_value());
183 T.CheckCall(T.Val("-A-B-C-D-"), T.false_value(), T.false_value()); 183 T.CheckCall(T.Val("-A-B-C-D-"), T.false_value(), T.false_value());
184 } 184 }
185
186
187 TEST(DeoptTry) {
188 i::FLAG_turbo_exceptions = true;
189 i::FLAG_turbo_deoptimization = true;
190 const char* src =
191 "(function f(a) {"
192 " try {"
193 " %DeoptimizeFunction(f);"
194 " throw a;"
195 " } catch (e) {"
196 " return e + 1;"
197 " }"
198 "})";
199 FunctionTester T(src);
200
201 #if 0 // TODO(mstarzinger): Enable once we can.
202 T.CheckCall(T.Val(2), T.Val(1));
203 #endif
204 }
205
206
207 TEST(DeoptCatch) {
208 i::FLAG_turbo_exceptions = true;
209 i::FLAG_turbo_deoptimization = true;
210 const char* src =
211 "(function f(a) {"
212 " try {"
213 " throw a;"
214 " } catch (e) {"
215 " %DeoptimizeFunction(f);"
216 " return e + 1;"
217 " }"
218 "})";
219 FunctionTester T(src);
220
221 T.CheckCall(T.Val(2), T.Val(1));
222 }
223
224
225 TEST(DeoptFinallyReturn) {
226 i::FLAG_turbo_exceptions = true;
227 i::FLAG_turbo_deoptimization = true;
228 const char* src =
229 "(function f(a) {"
230 " try {"
231 " throw a;"
232 " } finally {"
233 " %DeoptimizeFunction(f);"
234 " return a + 1;"
235 " }"
236 "})";
237 FunctionTester T(src);
238
239 T.CheckCall(T.Val(2), T.Val(1));
240 }
241
242
243 TEST(DeoptFinallyReThrow) {
244 i::FLAG_turbo_exceptions = true;
245 i::FLAG_turbo_deoptimization = true;
246 const char* src =
247 "(function f(a) {"
248 " try {"
249 " throw a;"
250 " } finally {"
251 " %DeoptimizeFunction(f);"
252 " }"
253 "})";
254 FunctionTester T(src);
255
256 #if 0 // TODO(mstarzinger): Enable once we can.
257 T.CheckThrows(T.NewObject("new Error"), T.Val(1));
258 #endif
259 }
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/compiler/try-deopt.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698