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

Unified Diff: src/ast.h

Issue 11093074: Get rid of static module allocation, do it in code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed last comments; added other back-ends Created 8 years, 1 month 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 | « src/arm/macro-assembler-arm.h ('k') | src/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 802ac65962501dfa47db0f43f4e4de95c984a145..c83c490b099f9c64642fcc08110ebff1bd6f12a8 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -75,6 +75,7 @@ namespace internal {
#define STATEMENT_NODE_LIST(V) \
V(Block) \
+ V(ModuleStatement) \
V(ExpressionStatement) \
V(EmptyStatement) \
V(IfStatement) \
@@ -522,7 +523,7 @@ class ModuleDeclaration: public Declaration {
ModuleDeclaration(VariableProxy* proxy,
Module* module,
Scope* scope)
- : Declaration(proxy, LET, scope),
+ : Declaration(proxy, MODULE, scope),
module_(module) {
}
@@ -645,6 +646,25 @@ class ModuleUrl: public Module {
};
+class ModuleStatement: public Statement {
+ public:
+ DECLARE_NODE_TYPE(ModuleStatement)
+
+ VariableProxy* proxy() const { return proxy_; }
+ Block* body() const { return body_; }
+
+ protected:
+ ModuleStatement(VariableProxy* proxy, Block* body)
+ : proxy_(proxy),
+ body_(body) {
+ }
+
+ private:
+ VariableProxy* proxy_;
+ Block* body_;
+};
+
+
class IterationStatement: public BreakableStatement {
public:
// Type testing & conversion.
@@ -1417,7 +1437,7 @@ class VariableProxy: public Expression {
void MarkAsTrivial() { is_trivial_ = true; }
void MarkAsLValue() { is_lvalue_ = true; }
- // Bind this proxy to the variable var.
+ // Bind this proxy to the variable var. Interfaces must match.
void BindTo(Variable* var);
protected:
@@ -2647,6 +2667,11 @@ class AstNodeFactory BASE_EMBEDDED {
STATEMENT_WITH_LABELS(SwitchStatement)
#undef STATEMENT_WITH_LABELS
+ ModuleStatement* NewModuleStatement(VariableProxy* proxy, Block* body) {
+ ModuleStatement* stmt = new(zone_) ModuleStatement(proxy, body);
+ VISIT_AND_RETURN(ModuleStatement, stmt)
+ }
+
ExpressionStatement* NewExpressionStatement(Expression* expression) {
ExpressionStatement* stmt = new(zone_) ExpressionStatement(expression);
VISIT_AND_RETURN(ExpressionStatement, stmt)
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698