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

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: Missed comments. 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
Index: src/interpreter/bytecode-generator.h
diff --git a/src/interpreter/bytecode-generator.h b/src/interpreter/bytecode-generator.h
index e79ff787e9246ba278bddfa09a3e48daf21a7fc2..a9ee53aee7e61b85a6875668b7a93e24fbc9b262 100644
--- a/src/interpreter/bytecode-generator.h
+++ b/src/interpreter/bytecode-generator.h
@@ -31,14 +31,17 @@ class BytecodeGenerator : public AstVisitor {
class ContextScope;
class ControlScope;
class ControlScopeForIteration;
+ class ExpressionResultScope;
+ class EffectResultScope;
+ class AccumulatorResultScope;
+ class RegisterResultScope;
void MakeBytecodeBody();
Register NextContextRegister() const;
DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
- Register VisitArguments(ZoneList<Expression*>* arguments,
- TemporaryRegisterScope* caller_scope);
+ Register VisitArguments(ZoneList<Expression*>* arguments);
void VisitArithmeticExpression(BinaryOperation* binop);
void VisitCommaExpression(BinaryOperation* binop);
void VisitLogicalOrExpression(BinaryOperation* binop);
@@ -61,6 +64,18 @@ class BytecodeGenerator : public AstVisitor {
void VisitTypeOf(UnaryOperation* expr);
void VisitNot(UnaryOperation* expr);
+ // Visitors for obtaining expression result in the accumulator, in a
+ // register, or just getting the effect.
+ void VisitForAccumulatorValue(Expression* expression);
+ MUST_USE_RESULT Register VisitForRegisterValue(Expression* expression);
+ void VisitForEffect(Expression* node);
+
+ // Binary expression state machine and load-store tracking.
+ void PrepareForBinaryExpression();
+ void RecordStoreToRegister(Register reg);
+ Register LoadFromAliasedRegister(Register reg);
rmcilroy 2015/10/20 16:39:20 nit - move these into a seperate block from Prepar
oth 2015/10/20 20:58:42 Done.
+ void CompleteBinaryExpression();
+
inline BytecodeArrayBuilder* builder() { return &builder_; }
inline Isolate* isolate() const { return isolate_; }
@@ -79,6 +94,10 @@ class BytecodeGenerator : public AstVisitor {
inline void set_execution_context(ContextScope* context) {
execution_context_ = context;
}
+ inline void set_result_scope(ExpressionResultScope* result_scope) {
+ result_scope_ = result_scope;
+ }
+ ExpressionResultScope* result_scope() const { return result_scope_; }
rmcilroy 2015/10/20 16:39:20 optional nit - should we call this execution_resul
oth 2015/10/20 20:58:42 Done.
ZoneVector<Handle<Object>>* globals() { return &globals_; }
inline LanguageMode language_mode() const;
@@ -93,6 +112,10 @@ class BytecodeGenerator : public AstVisitor {
ZoneVector<Handle<Object>> globals_;
ControlScope* execution_control_;
ContextScope* execution_context_;
+ ExpressionResultScope* result_scope_;
+
+ int binary_expression_depth_;
+ ZoneSet<int> binary_expression_hazard_set_;
};
} // namespace interpreter

Powered by Google App Engine
This is Rietveld 408576698