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

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

Issue 1378523005: [Interpreter] Add support for global declarations and load/store of global variables (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_toplevel
Patch Set: 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..b1f11470bcdd7c75b2a4fbd6d9641493788a1efd 100644
--- a/src/interpreter/bytecode-generator.h
+++ b/src/interpreter/bytecode-generator.h
@@ -24,25 +24,35 @@ class BytecodeGenerator : public AstVisitor {
AST_NODE_LIST(DECLARE_VISIT)
#undef DECLARE_VISIT
+ // Visiting function for declarations list is overridden.
+ void VisitDeclarations(ZoneList<Declaration*>* declarations) override;
+
private:
DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
void VisitArithmeticExpression(BinaryOperation* binop);
void VisitPropertyLoad(Register obj, Property* expr);
- void VisitVariableLoad(Variable* variable);
+ void VisitVariableLoad(Variable* variable, FeedbackVectorICSlot slot);
+ void VisitVariableAssignment(Variable* variable, FeedbackVectorICSlot slot);
inline BytecodeArrayBuilder& builder() { return builder_; }
inline Scope* scope() const { return scope_; }
inline void set_scope(Scope* scope) { scope_ = scope; }
inline CompilationInfo* info() const { return info_; }
inline void set_info(CompilationInfo* info) { info_ = info; }
+ ZoneVector<Handle<Object>>* globals() { return &globals_; }
LanguageMode language_mode() const;
int feedback_index(FeedbackVectorICSlot slot) const;
+ Register current_context() const;
BytecodeArrayBuilder builder_;
CompilationInfo* info_;
Scope* scope_;
+ ZoneVector<Handle<Object>> globals_;
+
+ // TODO(rmcilroy): Encapsulate this in an environment object.
+ Register current_context_;
};
} // namespace interpreter

Powered by Google App Engine
This is Rietveld 408576698