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

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

Issue 896783002: Turn throws into basic block terminators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_trycatch-1
Patch Set: Created 5 years, 10 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 | « src/compiler/scheduler.cc ('k') | no next file » | 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;
11 11
12 TEST(Throw) { 12 TEST(Throw) {
13 i::FLAG_turbo_exceptions = true;
13 FunctionTester T("(function(a,b) { if (a) { throw b; } else { return b; }})"); 14 FunctionTester T("(function(a,b) { if (a) { throw b; } else { return b; }})");
14 15
15 T.CheckThrows(T.true_value(), T.NewObject("new Error")); 16 T.CheckThrows(T.true_value(), T.NewObject("new Error"));
16 T.CheckCall(T.Val(23), T.false_value(), T.Val(23)); 17 T.CheckCall(T.Val(23), T.false_value(), T.Val(23));
17 } 18 }
18 19
19 20
20 TEST(ThrowSourcePosition) { 21 TEST(ThrowSourcePosition) {
21 static const char* src = 22 static const char* src =
22 "(function(a, b) { \n" 23 "(function(a, b) { \n"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 " r += 'D-';" 151 " r += 'D-';"
151 " }" 152 " }"
152 " return r;" 153 " return r;"
153 "})"; 154 "})";
154 FunctionTester T(src); 155 FunctionTester T(src);
155 156
156 T.CheckCall(T.Val("-A-"), T.true_value(), T.false_value()); 157 T.CheckCall(T.Val("-A-"), T.true_value(), T.false_value());
157 T.CheckCall(T.Val("-A-B-D-"), T.false_value(), T.true_value()); 158 T.CheckCall(T.Val("-A-B-D-"), T.false_value(), T.true_value());
158 T.CheckCall(T.Val("-A-B-C-D-"), T.false_value(), T.false_value()); 159 T.CheckCall(T.Val("-A-B-C-D-"), T.false_value(), T.false_value());
159 } 160 }
OLDNEW
« no previous file with comments | « src/compiler/scheduler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698