Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(751)

Unified Diff: src/ast.h

Issue 1889: Remove some of the state-dependent behavior from the code generator.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/codegen-arm.cc » ('j') | src/codegen-arm.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « no previous file | src/codegen-arm.cc » ('j') | src/codegen-arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698