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

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: ... 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
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 42eb99600fbfe5810b3ad355b3933e24f8e0da15..e66a4994b85f702d9ee66f31064fca18366af489 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -295,12 +295,8 @@ 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) {}
+ virtual ~ControlScopeForTryCatch() {}
Michael Starzinger 2016/07/12 14:11:12 nit: Class is final, implicit destructor is good e
protected:
bool Execute(Command command, Statement* statement) override {
@@ -326,12 +322,8 @@ 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) {}
+ virtual ~ControlScopeForTryFinally() {}
Michael Starzinger 2016/07/12 14:11:12 nit: Class is final, implicit destructor is good e
protected:
bool Execute(Command command, Statement* statement) override {
@@ -557,9 +549,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 +1179,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 +1215,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

Powered by Google App Engine
This is Rietveld 408576698