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

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

Issue 1392933002: [Interpreter] Reduce temporary register usage in generated bytecode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. 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 | « no previous file | src/interpreter/bytecode-generator.cc » ('j') | src/interpreter/bytecode-generator.cc » ('J')
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 3ce65322cc4314c81798e37397b6531d70583451..802e6e1fc8d04a6c2fd3433384392ac8602c0123 100644
--- a/src/interpreter/bytecode-generator.h
+++ b/src/interpreter/bytecode-generator.h
@@ -30,6 +30,9 @@ class BytecodeGenerator : public AstVisitor {
private:
class ControlScope;
class ControlScopeForIteration;
+ class ExpressionResultScope;
+ class AccumulatorResultScope;
+ class RegisterResultScope;
DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
@@ -43,6 +46,13 @@ class BytecodeGenerator : public AstVisitor {
void VisitTypeOf(UnaryOperation* expr);
void VisitNot(UnaryOperation* expr);
+ void VisitForAccumulatorValue(Expression* expression);
rmcilroy 2015/10/08 16:54:26 Could we have some comments on when these are expe
oth 2015/10/09 12:50:48 Done.
+ void VisitForRegisterValue(Expression* expression,
rmcilroy 2015/10/08 16:54:26 Could VisitForRegisterValue just return the Regist
oth 2015/10/09 12:50:48 Done.
rmcilroy 2015/10/09 13:02:56 What did you think of storing the register in the
+ TemporaryRegisterScope* temporary_register_scope);
+ MUST_USE_RESULT Register GetResultRegister();
+ void DropResultRegister();
rmcilroy 2015/10/08 16:54:26 Doesn't look like this is necessary as a seperate
oth 2015/10/09 12:50:48 Done. Right there was an intermediate step that al
+ void SetResultRegister(Register reg);
+
inline BytecodeArrayBuilder* builder() { return &builder_; }
inline Scope* scope() const { return scope_; }
inline void set_scope(Scope* scope) { scope_ = scope; }
@@ -51,6 +61,12 @@ class BytecodeGenerator : public AstVisitor {
inline CompilationInfo* info() const { return info_; }
inline void set_info(CompilationInfo* info) { info_ = info; }
ZoneVector<Handle<Object>>* globals() { return &globals_; }
+ inline void set_result_scope(ExpressionResultScope* result_scope) {
+ result_scope_ = result_scope;
+ }
+ inline ExpressionResultScope* result_scope() const {
+ return result_scope_;
+ }
LanguageMode language_mode() const;
Strength language_mode_strength() const;
@@ -65,6 +81,8 @@ class BytecodeGenerator : public AstVisitor {
// TODO(rmcilroy): Encapsulate this in an environment object.
Register current_context_;
+ ExpressionResultScope* result_scope_;
+ Maybe<Register> result_register_;
};
} // namespace interpreter
« no previous file with comments | « no previous file | src/interpreter/bytecode-generator.cc » ('j') | src/interpreter/bytecode-generator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698