| Index: runtime/vm/ast.h
|
| ===================================================================
|
| --- runtime/vm/ast.h (revision 482)
|
| +++ runtime/vm/ast.h (working copy)
|
| @@ -38,8 +38,6 @@
|
| V(ArgumentListNode, "args") \
|
| V(ArrayNode, "array") \
|
| V(ClosureNode, "closure") \
|
| - V(ImplicitInstanceClosureNode, "implicit instance closure") \
|
| - V(ImplicitStaticClosureNode, "implicit static closure") \
|
| V(InstanceCallNode, "instance call") \
|
| V(StaticCallNode, "static call") \
|
| V(ClosureCallNode, "closure call") \
|
| @@ -363,75 +361,41 @@
|
|
|
| class ClosureNode : public AstNode {
|
| public:
|
| - ClosureNode(intptr_t token_index, const Function& function, LocalScope* scope)
|
| - : AstNode(token_index), function_(function), scope_(scope) {
|
| + ClosureNode(intptr_t token_index,
|
| + const Function& function,
|
| + AstNode* receiver, // Non-null for implicit instance closures.
|
| + LocalScope* scope) // Null for implicit closures.
|
| + : AstNode(token_index),
|
| + function_(function),
|
| + receiver_(receiver),
|
| + scope_(scope) {
|
| ASSERT(function.IsZoneHandle());
|
| - ASSERT(function.IsNonImplicitClosureFunction());
|
| - ASSERT(scope_ != NULL);
|
| + ASSERT((function.IsNonImplicitClosureFunction() &&
|
| + (receiver_ == NULL) && (scope_ != NULL)) ||
|
| + (function.IsImplicitInstanceClosureFunction() &&
|
| + (receiver_ != NULL) && (scope_ == NULL)) ||
|
| + (function.IsImplicitStaticClosureFunction() &&
|
| + (receiver_ == NULL) && (scope_ == NULL)));
|
| }
|
|
|
| const Function& function() const { return function_; }
|
| + AstNode* receiver() const { return receiver_; }
|
| LocalScope* scope() const { return scope_; }
|
|
|
| - virtual void VisitChildren(AstNodeVisitor* visitor) const { }
|
| -
|
| - DECLARE_COMMON_NODE_FUNCTIONS(ClosureNode);
|
| -
|
| - private:
|
| - const Function& function_;
|
| - LocalScope* scope_;
|
| -
|
| - DISALLOW_IMPLICIT_CONSTRUCTORS(ClosureNode);
|
| -};
|
| -
|
| -
|
| -class ImplicitStaticClosureNode : public AstNode {
|
| - public:
|
| - ImplicitStaticClosureNode(intptr_t token_index, const Function& function)
|
| - : AstNode(token_index), function_(function) {
|
| - ASSERT(function.IsZoneHandle());
|
| - ASSERT(function.IsImplicitStaticClosureFunction());
|
| - }
|
| -
|
| - const Function& function() const { return function_; }
|
| -
|
| - virtual void VisitChildren(AstNodeVisitor* visitor) const { }
|
| -
|
| - DECLARE_COMMON_NODE_FUNCTIONS(ImplicitStaticClosureNode);
|
| -
|
| - private:
|
| - const Function& function_;
|
| -
|
| - DISALLOW_IMPLICIT_CONSTRUCTORS(ImplicitStaticClosureNode);
|
| -};
|
| -
|
| -
|
| -class ImplicitInstanceClosureNode : public AstNode {
|
| - public:
|
| - ImplicitInstanceClosureNode(intptr_t token_index,
|
| - const Function& function,
|
| - AstNode* receiver)
|
| - : AstNode(token_index), function_(function), receiver_(receiver) {
|
| - ASSERT(function.IsZoneHandle());
|
| - ASSERT(function.IsImplicitInstanceClosureFunction());
|
| - }
|
| -
|
| - const Function& function() const { return function_; }
|
| - AstNode* receiver() const { return receiver_; }
|
| -
|
| virtual void VisitChildren(AstNodeVisitor* visitor) const {
|
| if (receiver() != NULL) {
|
| receiver()->Visit(visitor);
|
| }
|
| }
|
|
|
| - DECLARE_COMMON_NODE_FUNCTIONS(ImplicitInstanceClosureNode);
|
| + DECLARE_COMMON_NODE_FUNCTIONS(ClosureNode);
|
|
|
| private:
|
| const Function& function_;
|
| AstNode* receiver_;
|
| + LocalScope* scope_;
|
|
|
| - DISALLOW_IMPLICIT_CONSTRUCTORS(ImplicitInstanceClosureNode);
|
| + DISALLOW_IMPLICIT_CONSTRUCTORS(ClosureNode);
|
| };
|
|
|
|
|
|
|