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

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

Issue 928213003: Model exceptional edges from call nodes in TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. 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/verifier.cc ('k') | test/unittests/compiler/common-operator-unittest.cc » ('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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 " return r;" 111 " return r;"
112 "})"; 112 "})";
113 FunctionTester T(src); 113 FunctionTester T(src);
114 114
115 T.CheckCall(T.Val("-A-D-"), T.true_value(), T.false_value()); 115 T.CheckCall(T.Val("-A-D-"), T.true_value(), T.false_value());
116 T.CheckCall(T.Val("-A-B-D-"), T.false_value(), T.true_value()); 116 T.CheckCall(T.Val("-A-B-D-"), T.false_value(), T.true_value());
117 T.CheckCall(T.Val("-A-B-C-D-"), T.false_value(), T.false_value()); 117 T.CheckCall(T.Val("-A-B-C-D-"), T.false_value(), T.false_value());
118 } 118 }
119 119
120 120
121 TEST(CatchCall) {
122 i::FLAG_turbo_exceptions = true;
123 const char* src =
124 "(function(fun) {"
125 " var r = '-';"
126 " try {"
127 " r += 'A-';"
128 " fun();"
129 " } catch (e) {"
130 " r += e;"
131 " }"
132 " return r;"
133 "})";
134 FunctionTester T(src);
135
136 CompileRun("function thrower() { throw 'T-'; }");
137 #if 0 // TODO(mstarzinger): Enable once we have exception handlers.
138 T.CheckCall(T.Val("-A-T-"), T.NewFunction("thrower"));
139 #endif
140 }
141
142
121 TEST(Finally) { 143 TEST(Finally) {
122 i::FLAG_turbo_exceptions = true; 144 i::FLAG_turbo_exceptions = true;
123 const char* src = 145 const char* src =
124 "(function(a,b) {" 146 "(function(a,b) {"
125 " var r = '-';" 147 " var r = '-';"
126 " try {" 148 " try {"
127 " r += 'A-';" 149 " r += 'A-';"
128 " } finally {" 150 " } finally {"
129 " r += 'B-';" 151 " r += 'B-';"
130 " }" 152 " }"
(...skipping 20 matching lines...) Expand all
151 " r += 'D-';" 173 " r += 'D-';"
152 " }" 174 " }"
153 " return r;" 175 " return r;"
154 "})"; 176 "})";
155 FunctionTester T(src); 177 FunctionTester T(src);
156 178
157 T.CheckCall(T.Val("-A-"), T.true_value(), T.false_value()); 179 T.CheckCall(T.Val("-A-"), T.true_value(), T.false_value());
158 T.CheckCall(T.Val("-A-B-D-"), T.false_value(), T.true_value()); 180 T.CheckCall(T.Val("-A-B-D-"), T.false_value(), T.true_value());
159 T.CheckCall(T.Val("-A-B-C-D-"), T.false_value(), T.false_value()); 181 T.CheckCall(T.Val("-A-B-C-D-"), T.false_value(), T.false_value());
160 } 182 }
OLDNEW
« no previous file with comments | « src/compiler/verifier.cc ('k') | test/unittests/compiler/common-operator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698