| Index: src/interpreter/bytecode-generator.h
|
| diff --git a/src/interpreter/bytecode-generator.h b/src/interpreter/bytecode-generator.h
|
| index 3ce65322cc4314c81798e37397b6531d70583451..1fa34ae7ea160287ba717aa478ebf7bfebc48558 100644
|
| --- a/src/interpreter/bytecode-generator.h
|
| +++ b/src/interpreter/bytecode-generator.h
|
| @@ -30,6 +30,10 @@ class BytecodeGenerator : public AstVisitor {
|
| private:
|
| class ControlScope;
|
| class ControlScopeForIteration;
|
| + class ExpressionResultScope;
|
| + class AccumulatorResultScope;
|
| + class EffectResultScope;
|
| + class RegisterResultScope;
|
|
|
| DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
|
|
|
| @@ -43,6 +47,17 @@ 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, TemporaryRegisterScope* temporary_register_scope);
|
| + void VisitForEffect(Expression* node);
|
| +
|
| + void SetResultRegister(Register reg);
|
| + Register GetResultRegister();
|
| + bool ResultRegisterIsEmpty() const;
|
| +
|
| inline BytecodeArrayBuilder* builder() { return &builder_; }
|
| inline Scope* scope() const { return scope_; }
|
| inline void set_scope(Scope* scope) { scope_ = scope; }
|
| @@ -51,6 +66,10 @@ 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 +84,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
|
|
|