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

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: Fix test Created 5 years, 2 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-array-builder.cc ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.h
diff --git a/src/interpreter/bytecode-generator.h b/src/interpreter/bytecode-generator.h
index d76b3564a675398162b91d99a99e12faee21ee3d..3ce65322cc4314c81798e37397b6531d70583451 100644
--- a/src/interpreter/bytecode-generator.h
+++ b/src/interpreter/bytecode-generator.h
@@ -24,6 +24,9 @@ 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:
class ControlScope;
class ControlScopeForIteration;
@@ -32,7 +35,8 @@ class BytecodeGenerator : public AstVisitor {
void VisitArithmeticExpression(BinaryOperation* binop);
void VisitPropertyLoad(Register obj, Property* expr);
- void VisitVariableLoad(Variable* variable);
+ void VisitVariableLoad(Variable* variable, FeedbackVectorSlot slot);
+ void VisitVariableAssignment(Variable* variable, FeedbackVectorSlot slot);
// Dispatched from VisitUnaryOperation.
void VisitVoid(UnaryOperation* expr);
@@ -46,15 +50,21 @@ class BytecodeGenerator : public AstVisitor {
inline void set_control_scope(ControlScope* scope) { control_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;
Strength language_mode_strength() const;
int feedback_index(FeedbackVectorSlot slot) const;
+ Register current_context() const;
BytecodeArrayBuilder builder_;
CompilationInfo* info_;
Scope* scope_;
+ ZoneVector<Handle<Object>> globals_;
ControlScope* control_scope_;
+
+ // TODO(rmcilroy): Encapsulate this in an environment object.
+ Register current_context_;
};
} // namespace interpreter
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698