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

Side by Side Diff: src/execution.cc

Issue 953463002: Reland "Correctly propagate terminate exception in TryCall." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comments 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 | « no previous file | src/factory.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/execution.h" 5 #include "src/execution.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 v8::TryCatch catcher; 203 v8::TryCatch catcher;
204 catcher.SetVerbose(false); 204 catcher.SetVerbose(false);
205 catcher.SetCaptureMessage(false); 205 catcher.SetCaptureMessage(false);
206 206
207 maybe_result = Invoke(false, func, receiver, argc, args); 207 maybe_result = Invoke(false, func, receiver, argc, args);
208 208
209 if (maybe_result.is_null()) { 209 if (maybe_result.is_null()) {
210 DCHECK(catcher.HasCaught()); 210 DCHECK(catcher.HasCaught());
211 DCHECK(isolate->has_pending_exception()); 211 DCHECK(isolate->has_pending_exception());
212 DCHECK(isolate->external_caught_exception()); 212 DCHECK(isolate->external_caught_exception());
213 if (exception_out != NULL) { 213 if (isolate->pending_exception() ==
214 if (isolate->pending_exception() == 214 isolate->heap()->termination_exception()) {
215 isolate->heap()->termination_exception()) { 215 is_termination = true;
216 is_termination = true; 216 } else {
217 } else { 217 if (exception_out != NULL) {
218 *exception_out = v8::Utils::OpenHandle(*catcher.Exception()); 218 *exception_out = v8::Utils::OpenHandle(*catcher.Exception());
219 } 219 }
220 } 220 }
221 isolate->OptionalRescheduleException(true); 221 isolate->OptionalRescheduleException(true);
222 } 222 }
223 223
224 DCHECK(!isolate->has_pending_exception()); 224 DCHECK(!isolate->has_pending_exception());
225 DCHECK(!isolate->external_caught_exception());
226 } 225 }
227 if (is_termination) isolate->TerminateExecution(); 226
227 // Re-request terminate execution interrupt to trigger later.
228 if (is_termination) isolate->stack_guard()->RequestTerminateExecution();
229
228 return maybe_result; 230 return maybe_result;
229 } 231 }
230 232
231 233
232 Handle<Object> Execution::GetFunctionDelegate(Isolate* isolate, 234 Handle<Object> Execution::GetFunctionDelegate(Isolate* isolate,
233 Handle<Object> object) { 235 Handle<Object> object) {
234 DCHECK(!object->IsJSFunction()); 236 DCHECK(!object->IsJSFunction());
235 Factory* factory = isolate->factory(); 237 Factory* factory = isolate->factory();
236 238
237 // If you return a function from here, it will be called when an 239 // If you return a function from here, it will be called when an
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 } 679 }
678 680
679 isolate_->counters()->stack_interrupts()->Increment(); 681 isolate_->counters()->stack_interrupts()->Increment();
680 isolate_->counters()->runtime_profiler_ticks()->Increment(); 682 isolate_->counters()->runtime_profiler_ticks()->Increment();
681 isolate_->runtime_profiler()->OptimizeNow(); 683 isolate_->runtime_profiler()->OptimizeNow();
682 684
683 return isolate_->heap()->undefined_value(); 685 return isolate_->heap()->undefined_value();
684 } 686 }
685 687
686 } } // namespace v8::internal 688 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698