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

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

Issue 2146493002: Move catch prediction into frontend. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Disable test on Turbofan 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/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 42eb99600fbfe5810b3ad355b3933e24f8e0da15..1159b69fd3dac4195797311f5d5d67f9ad77c5ab 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -295,12 +295,7 @@ class BytecodeGenerator::ControlScopeForTryCatch final
public:
ControlScopeForTryCatch(BytecodeGenerator* generator,
TryCatchBuilder* try_catch_builder)
- : ControlScope(generator) {
- generator->try_catch_nesting_level_++;
- }
- virtual ~ControlScopeForTryCatch() {
- generator()->try_catch_nesting_level_--;
- }
+ : ControlScope(generator) {}
protected:
bool Execute(Command command, Statement* statement) override {
@@ -326,12 +321,7 @@ class BytecodeGenerator::ControlScopeForTryFinally final
DeferredCommands* commands)
: ControlScope(generator),
try_finally_builder_(try_finally_builder),
- commands_(commands) {
- generator->try_finally_nesting_level_++;
- }
- virtual ~ControlScopeForTryFinally() {
- generator()->try_finally_nesting_level_--;
- }
+ commands_(commands) {}
protected:
bool Execute(Command command, Statement* statement) override {
@@ -557,9 +547,7 @@ BytecodeGenerator::BytecodeGenerator(CompilationInfo* info)
execution_result_(nullptr),
register_allocator_(nullptr),
generator_resume_points_(info->literal()->yield_count(), info->zone()),
- generator_state_(),
- try_catch_nesting_level_(0),
- try_finally_nesting_level_(0) {
+ generator_state_() {
InitializeAstVisitor(isolate());
}
@@ -1189,7 +1177,7 @@ void BytecodeGenerator::VisitForOfStatement(ForOfStatement* stmt) {
}
void BytecodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) {
- TryCatchBuilder try_control_builder(builder());
+ TryCatchBuilder try_control_builder(builder(), stmt->catch_predicted());
Register no_reg;
// Preserve the context in a dedicated register, so that it can be restored
@@ -1225,7 +1213,7 @@ void BytecodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) {
}
void BytecodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* stmt) {
- TryFinallyBuilder try_control_builder(builder(), IsInsideTryCatch());
+ TryFinallyBuilder try_control_builder(builder(), stmt->catch_predicted());
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