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 {
};
class Reference;
enum InitState { CONST_INIT, NOT_CONST_INIT };
class Expression: public Node {
public:
virtual Expression* AsExpression() { return this; }
......@@ -153,17 +150,6 @@ class Expression: public Node {
// 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(CodeGenerator* cgen,
Reference* ref,
InitState init_state) {
UNREACHABLE();
}
};
......@@ -758,13 +744,6 @@ class VariableProxy: public Expression {
// 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(CodeGenerator* cgen,
Reference* ref,
InitState init_state);
protected:
Handle<String> name_;
Variable* var_; // resolved variable, or NULL
......@@ -840,13 +819,6 @@ class Slot: public Expression {
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(CodeGenerator* cgen,
Reference* ref,
InitState init_state);
private:
Variable* var_;
Type type_;
......@@ -874,13 +846,6 @@ class Property: public Expression {
// 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(CodeGenerator* cgen,
Reference* ref,
InitState init_state);
private:
Expression* obj_;
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