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

Unified Diff: src/ast/ast-numbering.cc

Issue 2161263003: [debug] use catch prediction flag for promise rejections. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « src/ast/ast.h ('k') | src/ast/prettyprinter.cc » ('j') | src/isolate.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast-numbering.cc
diff --git a/src/ast/ast-numbering.cc b/src/ast/ast-numbering.cc
index 1be5940adc38654356e1e61bdec91dedf0ef7a36..e9b6db230da65a27d2bbff5162b9fcfda57fef50 100644
--- a/src/ast/ast-numbering.cc
+++ b/src/ast/ast-numbering.cc
@@ -20,7 +20,7 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
properties_(zone),
slot_cache_(zone),
dont_optimize_reason_(kNoReason),
- catch_predicted_(false) {
+ catch_prediction_(HandlerTable::UNCAUGHT) {
InitializeAstVisitor(isolate);
}
@@ -80,7 +80,7 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
// The slot cache allows us to reuse certain feedback vector slots.
FeedbackVectorSlotCache slot_cache_;
BailoutReason dont_optimize_reason_;
- bool catch_predicted_;
+ HandlerTable::CatchPrediction catch_prediction_;
DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
DISALLOW_COPY_AND_ASSIGN(AstNumberingVisitor);
@@ -292,15 +292,16 @@ void AstNumberingVisitor::VisitTryCatchStatement(TryCatchStatement* node) {
IncrementNodeCount();
DisableCrankshaft(kTryCatchStatement);
{
- const bool old_catch_predicted = catch_predicted_;
- // If the node's clear_pending_message flag is unset, we assume that the
- // catch block is a ReThrow and hence predict uncaught (unless caught by
- // outer handlers). Otherwise, we predict caught.
- const bool not_rethrow = node->clear_pending_message();
- catch_predicted_ = catch_predicted_ || not_rethrow;
- node->set_catch_predicted(catch_predicted_);
+ const HandlerTable::CatchPrediction old_prediction = catch_prediction_;
+ // This node uses its own prediction, unless it's "uncaught", in which case
+ // we adopt the prediction of the outer try-block.
Michael Starzinger 2016/07/20 09:20:18 nit: s/outer/surrounding/
+ HandlerTable::CatchPrediction catch_prediction = node->catch_prediction();
+ if (catch_prediction != HandlerTable::UNCAUGHT) {
+ catch_prediction_ = catch_prediction;
+ }
+ node->set_catch_prediction(catch_prediction_);
Visit(node->try_block());
- catch_predicted_ = old_catch_predicted;
+ catch_prediction_ = old_prediction;
}
Visit(node->catch_block());
}
@@ -311,7 +312,7 @@ void AstNumberingVisitor::VisitTryFinallyStatement(TryFinallyStatement* node) {
DisableCrankshaft(kTryFinallyStatement);
// We can't know whether the finally block will override ("catch") an
// exception thrown in the try block, so we just adopt the outer prediction.
- node->set_catch_predicted(catch_predicted_);
+ node->set_catch_prediction(catch_prediction_);
Visit(node->try_block());
Visit(node->finally_block());
}
« no previous file with comments | « src/ast/ast.h ('k') | src/ast/prettyprinter.cc » ('j') | src/isolate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698