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

Unified Diff: src/isolate.cc

Issue 2572623002: PromiseHandle port to TF (Closed)
Patch Set: Address comments Created 4 years 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
« no previous file with comments | « src/interface-descriptors.h ('k') | src/js/promise.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index def08f1ab7c90a97a8c61ec594a48c7653e4d504..64d22eb427b92cf51e56a0b065ae9ba5e30c37be 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1342,10 +1342,18 @@ HandlerTable::CatchPrediction PredictException(JavaScriptFrame* frame) {
frame->Summarize(&summaries);
for (const FrameSummary& summary : summaries) {
Handle<AbstractCode> code = summary.abstract_code();
- if (code->IsCode() && code->kind() == AbstractCode::BUILTIN &&
- code->GetCode()->is_promise_rejection()) {
- return HandlerTable::PROMISE;
+ if (code->IsCode() && code->kind() == AbstractCode::BUILTIN) {
+ if (code->GetCode()->is_promise_rejection()) {
+ return HandlerTable::PROMISE;
+ }
+
+ // This the exception throw in PromiseHandle which doesn't
+ // cause a promise rejection.
+ if (code->GetCode()->is_exception_caught()) {
+ return HandlerTable::CAUGHT;
+ }
}
+
if (code->kind() == AbstractCode::OPTIMIZED_FUNCTION) {
DCHECK(summary.function()->shared()->asm_function());
// asm code cannot contain try-catch.
« no previous file with comments | « src/interface-descriptors.h ('k') | src/js/promise.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698