Chromium Code Reviews| 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 |