Chromium Code Reviews| Index: src/ast.h |
| =================================================================== |
| --- src/ast.h (revision 246) |
| +++ src/ast.h (working copy) |
| @@ -140,6 +140,8 @@ |
| }; |
| +class Reference; |
| + |
| class Expression: public Node { |
| public: |
| virtual Expression* AsExpression() { return this; } |
| @@ -150,6 +152,18 @@ |
| // statement. This is used to transform postfix increments to |
| // (faster) prefix increments. |
| virtual void MarkAsStatement() { /* do nothing */ } |
| + |
| + // Generate code to store into an expression evaluated as the left-hand |
| + // side of an assignment. The code will expect the stored value on top of |
| + // the expression stack, and a reference containing the expression |
| + // immediately below that. This function is overridden for expression |
| + // types that can be stored into. |
| + virtual void GenerateStoreCode(MacroAssembler* masm, |
| + Scope* scope, |
| + Reference* ref, |
| + bool is_const_init) { |
|
iposva
2008/09/10 18:01:44
Can you please use an enum for the is_const_init t
Kevin Millikin (Chromium)
2008/09/11 07:15:55
Done. InitState with values CONST_INIT and NOT_CO
|
| + UNREACHABLE(); |
| + } |
| }; |
| @@ -753,6 +767,14 @@ |
| // Bind this proxy to the variable var. |
| void BindTo(Variable* var); |
| + // Generate code to store into an expression evaluated as the left-hand |
| + // side of an assignment. The code will expect the stored value on top of |
| + // the expression stack, and a reference containing the expression |
| + // immediately below that. |
| + virtual void GenerateStoreCode(MacroAssembler* masm, |
| + Scope* scope, |
| + Reference* ref, |
| + bool is_const_init); |
| protected: |
| Handle<String> name_; |
| Variable* var_; // resolved variable, or NULL |
| @@ -828,6 +850,14 @@ |
| Type type() const { return type_; } |
| int index() const { return index_; } |
| + // Generate code to store into an expression evaluated as the left-hand |
| + // side of an assignment. The code will expect the stored value on top of |
| + // the expression stack, and a reference containing the expression |
| + // immediately below that. |
| + virtual void GenerateStoreCode(MacroAssembler* masm, |
| + Scope* scope, |
| + Reference* ref, |
| + bool is_const_init); |
| private: |
| Variable* var_; |
| Type type_; |
| @@ -855,6 +885,14 @@ |
| // during preparsing. |
| static Property* this_property() { return &this_property_; } |
| + // Generate code to store into an expression evaluated as the left-hand |
| + // side of an assignment. The code will expect the stored value on top of |
| + // the expression stack, and a reference containing the expression |
| + // immediately below that. |
| + virtual void GenerateStoreCode(MacroAssembler* masm, |
| + Scope* scope, |
| + Reference* ref, |
| + bool is_const_init); |
| private: |
| Expression* obj_; |
| Expression* key_; |