Move code generation for storing to a reference out of the AST nodes, and

onto the platform-specific Reference class defined in codegen-*.cc.  This
removes all of the static code generator functions.
Review URL: http://codereview.chromium.org/6527

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@460 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5058924d
...@@ -140,9 +140,6 @@ class Statement: public Node { ...@@ -140,9 +140,6 @@ class Statement: public Node {
}; };
class Reference;
enum InitState { CONST_INIT, NOT_CONST_INIT };
class Expression: public Node { class Expression: public Node {
public: public:
virtual Expression* AsExpression() { return this; } virtual Expression* AsExpression() { return this; }
...@@ -153,17 +150,6 @@ class Expression: public Node { ...@@ -153,17 +150,6 @@ class Expression: public Node {
// statement. This is used to transform postfix increments to // statement. This is used to transform postfix increments to
// (faster) prefix increments. // (faster) prefix increments.
virtual void MarkAsStatement() { /* do nothing */ } 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(CodeGenerator* cgen,
Reference* ref,
InitState init_state) {
UNREACHABLE();
}
}; };
...@@ -758,13 +744,6 @@ class VariableProxy: public Expression { ...@@ -758,13 +744,6 @@ class VariableProxy: public Expression {
// Bind this proxy to the variable var. // Bind this proxy to the variable var.
void BindTo(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(CodeGenerator* cgen,
Reference* ref,
InitState init_state);
protected: protected:
Handle<String> name_; Handle<String> name_;
Variable* var_; // resolved variable, or NULL Variable* var_; // resolved variable, or NULL
...@@ -840,13 +819,6 @@ class Slot: public Expression { ...@@ -840,13 +819,6 @@ class Slot: public Expression {
Type type() const { return type_; } Type type() const { return type_; }
int index() const { return index_; } 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(CodeGenerator* cgen,
Reference* ref,
InitState init_state);
private: private:
Variable* var_; Variable* var_;
Type type_; Type type_;
...@@ -874,13 +846,6 @@ class Property: public Expression { ...@@ -874,13 +846,6 @@ class Property: public Expression {
// during preparsing. // during preparsing.
static Property* this_property() { return &this_property_; } 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(CodeGenerator* cgen,
Reference* ref,
InitState init_state);
private: private:
Expression* obj_; Expression* obj_;
Expression* key_; Expression* key_;
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment