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

Unified Diff: src/compiler-dispatcher/compiler-dispatcher.cc

Issue 2612753002: Add more tests for compiler-dispatcher (Closed)
Patch Set: Created 3 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: src/compiler-dispatcher/compiler-dispatcher.cc
diff --git a/src/compiler-dispatcher/compiler-dispatcher.cc b/src/compiler-dispatcher/compiler-dispatcher.cc
index 47c04b8b44a39792173dd26443179bf137f9745e..782a6ed855ea78a03f7e9829ef6f33b966e515fa 100644
--- a/src/compiler-dispatcher/compiler-dispatcher.cc
+++ b/src/compiler-dispatcher/compiler-dispatcher.cc
@@ -22,7 +22,6 @@ enum class ExceptionHandling { kSwallow, kThrow };
bool DoNextStepOnMainThread(Isolate* isolate, CompilerDispatcherJob* job,
ExceptionHandling exception_handling) {
DCHECK(ThreadId::Current().Equals(isolate->thread_id()));
- v8::TryCatch try_catch(reinterpret_cast<v8::Isolate*>(isolate));
jochen (gone - plz use gerrit) 2017/01/04 08:23:22 turns out that we only create a pending exception,
switch (job->status()) {
case CompileJobStatus::kInitial:
job->PrepareToParseOnMainThread();
@@ -53,10 +52,13 @@ bool DoNextStepOnMainThread(Isolate* isolate, CompilerDispatcherJob* job,
break;
}
- if (exception_handling == ExceptionHandling::kThrow &&
- try_catch.HasCaught()) {
- DCHECK(job->status() == CompileJobStatus::kFailed);
- try_catch.ReThrow();
+ if (job->status() == CompileJobStatus::kFailed) {
+ DCHECK(isolate->has_pending_exception());
+ if (exception_handling == ExceptionHandling::kSwallow) {
+ isolate->clear_pending_exception();
+ }
+ } else {
+ DCHECK(!isolate->has_pending_exception());
}
vogelheim 2017/01/04 10:08:49 nitpick: Hmm... How about: DCHECK_EQ(job->status(
jochen (gone - plz use gerrit) 2017/01/04 10:23:18 will do in a follow-up
return job->status() != CompileJobStatus::kFailed;
}

Powered by Google App Engine
This is Rietveld 408576698