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

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

Issue 1373903005: [Interpreter] Add for/while/do support to the bytecode generator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate feedback from mstarzinger which revealed use after destruction bug. Created 5 years, 3 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.h
diff --git a/src/interpreter/bytecode-generator.h b/src/interpreter/bytecode-generator.h
index 99536c33fb52fbf8d092eaff624fdd936ee675e5..e303941dfbf38570c45827542f4b8b43faec8035 100644
--- a/src/interpreter/bytecode-generator.h
+++ b/src/interpreter/bytecode-generator.h
@@ -25,15 +25,21 @@ class BytecodeGenerator : public AstVisitor {
#undef DECLARE_VISIT
private:
+ class ControlScope;
+ class ControlScopeForBreakable;
rmcilroy 2015/10/01 09:18:56 doesn't exist?
oth 2015/10/01 11:43:02 Done.
+ class ControlScopeForIteration;
+
DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
void VisitArithmeticExpression(BinaryOperation* binop);
void VisitPropertyLoad(Register obj, Property* expr);
void VisitVariableLoad(Variable* variable);
- inline BytecodeArrayBuilder& builder() { return builder_; }
+ inline BytecodeArrayBuilder* builder() { return &builder_; }
inline Scope* scope() const { return scope_; }
inline void set_scope(Scope* scope) { scope_ = scope; }
+ inline ControlScope* control_scope() const { return control_scope_; }
+ inline void set_control_scope(ControlScope* scope) { control_scope_ = scope; }
inline CompilationInfo* info() const { return info_; }
inline void set_info(CompilationInfo* info) { info_ = info; }
@@ -43,6 +49,7 @@ class BytecodeGenerator : public AstVisitor {
BytecodeArrayBuilder builder_;
CompilationInfo* info_;
Scope* scope_;
+ ControlScope* control_scope_;
};
} // namespace interpreter

Powered by Google App Engine
This is Rietveld 408576698