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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 1690973002: [interpreter] Correctly thread through catch prediction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecode-generator.h ('k') | src/interpreter/control-flow-builders.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 022f41efa54ca550a3ffc6bd0c1d8c4e3e6d5294..67d81c605a163165873d2f3b6fcb77de5592dc89 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -301,7 +301,12 @@ class BytecodeGenerator::ControlScopeForTryCatch final
public:
ControlScopeForTryCatch(BytecodeGenerator* generator,
TryCatchBuilder* try_catch_builder)
- : ControlScope(generator) {}
+ : ControlScope(generator) {
+ generator->try_catch_nesting_level_++;
+ }
+ virtual ~ControlScopeForTryCatch() {
+ generator()->try_catch_nesting_level_--;
+ }
protected:
bool Execute(Command command, Statement* statement) override {
@@ -328,7 +333,12 @@ class BytecodeGenerator::ControlScopeForTryFinally final
DeferredCommands* commands)
: ControlScope(generator),
try_finally_builder_(try_finally_builder),
- commands_(commands) {}
+ commands_(commands) {
+ generator->try_finally_nesting_level_++;
+ }
+ virtual ~ControlScopeForTryFinally() {
+ generator()->try_finally_nesting_level_--;
+ }
protected:
bool Execute(Command command, Statement* statement) override {
@@ -543,7 +553,9 @@ BytecodeGenerator::BytecodeGenerator(Isolate* isolate, Zone* zone)
execution_control_(nullptr),
execution_context_(nullptr),
execution_result_(nullptr),
- register_allocator_(nullptr) {
+ register_allocator_(nullptr),
+ try_catch_nesting_level_(0),
+ try_finally_nesting_level_(0) {
InitializeAstVisitor(isolate);
}
@@ -1150,7 +1162,7 @@ void BytecodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) {
void BytecodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* stmt) {
- TryFinallyBuilder try_control_builder(builder());
+ TryFinallyBuilder try_control_builder(builder(), IsInsideTryCatch());
Register no_reg;
// We keep a record of all paths that enter the finally-block to be able to
« no previous file with comments | « src/interpreter/bytecode-generator.h ('k') | src/interpreter/control-flow-builders.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698