Chromium Code Reviews| Index: runtime/vm/ast.h |
| =================================================================== |
| --- runtime/vm/ast.h (revision 34781) |
| +++ runtime/vm/ast.h (working copy) |
| @@ -440,7 +440,8 @@ |
| : AstNode(token_pos), |
| function_(function), |
| receiver_(receiver), |
| - scope_(scope) { |
| + scope_(scope), |
| + is_deferred_reference_(false) { |
| ASSERT(function_.IsZoneHandle()); |
| ASSERT((function_.IsNonImplicitClosureFunction() && |
| (receiver_ == NULL) && (scope_ != NULL)) || |
| @@ -454,6 +455,8 @@ |
| AstNode* receiver() const { return receiver_; } |
| LocalScope* scope() const { return scope_; } |
| + void set_is_deferred(bool value) { is_deferred_reference_ = value; } |
| + |
| virtual void VisitChildren(AstNodeVisitor* visitor) const { |
| if (receiver() != NULL) { |
| receiver()->Visit(visitor); |
| @@ -470,6 +473,7 @@ |
| const Function& function_; |
| AstNode* receiver_; |
| LocalScope* scope_; |
| + bool is_deferred_reference_; |
| DISALLOW_IMPLICIT_CONSTRUCTORS(ClosureNode); |
| }; |
| @@ -482,12 +486,17 @@ |
| class PrimaryNode : public AstNode { |
| public: |
| PrimaryNode(intptr_t token_pos, const Object& primary) |
| - : AstNode(token_pos), primary_(primary) { |
| + : AstNode(token_pos), |
| + primary_(primary), |
| + is_deferred_reference_(false) { |
| ASSERT(primary_.IsNotTemporaryScopedHandle()); |
| } |
| const Object& primary() const { return primary_; } |
| + void set_is_deferred(bool value) { is_deferred_reference_ = value; } |
| + bool is_deferred_reference() const { return is_deferred_reference_; } |
| + |
| bool IsSuper() const { |
| return primary().IsString() && (primary().raw() == Symbols::Super().raw()); |
| } |
| @@ -498,6 +507,7 @@ |
| private: |
| const Object& primary_; |
| + bool is_deferred_reference_; |
| DISALLOW_IMPLICIT_CONSTRUCTORS(PrimaryNode); |
| }; |
| @@ -669,7 +679,6 @@ |
| }; |
| - |
| class UnaryOpNode : public AstNode { |
| public: |
| // Returns optimized version, e.g., for ('-' '1') ('-1') literal is returned. |
| @@ -1139,11 +1148,12 @@ |
| class LoadStaticFieldNode : public AstNode { |
| public: |
| LoadStaticFieldNode(intptr_t token_pos, const Field& field) |
| - : AstNode(token_pos), field_(field) { |
| + : AstNode(token_pos), field_(field), is_deferred_reference_(false) { |
| ASSERT(field_.IsZoneHandle()); |
| } |
| const Field& field() const { return field_; } |
| + void set_is_deferred(bool value) { is_deferred_reference_ = value; } |
| virtual void VisitChildren(AstNodeVisitor* visitor) const { } |
| @@ -1155,13 +1165,17 @@ |
| virtual const Instance* EvalConstExpr() const { |
| ASSERT(field_.is_static()); |
| - return field_.is_const() ? &Instance::ZoneHandle(field_.value()) : NULL; |
| +if (is_deferred_reference_) printf("DDDDD\n"); |
|
srdjan
2014/04/07 17:19:10
Why only four Ds?
hausner
2014/04/07 17:30:27
Eins zwei drei vier fünf...
DDDDDone.
|
| + return !is_deferred_reference_ && field_.is_const() |
| + ? &Instance::ZoneHandle(field_.value()) |
| + : NULL; |
| } |
| DECLARE_COMMON_NODE_FUNCTIONS(LoadStaticFieldNode); |
| private: |
| const Field& field_; |
| + bool is_deferred_reference_; |
| DISALLOW_IMPLICIT_CONSTRUCTORS(LoadStaticFieldNode); |
| }; |
| @@ -1385,7 +1399,8 @@ |
| receiver_(receiver), |
| cls_(cls), |
| field_name_(field_name), |
| - is_super_getter_(is_super_getter) { |
| + is_super_getter_(is_super_getter), |
| + is_deferred_reference_(false) { |
| ASSERT(cls_.IsZoneHandle()); |
| ASSERT(field_name_.IsZoneHandle()); |
| ASSERT(field_name_.IsSymbol()); |
| @@ -1401,6 +1416,7 @@ |
| const Class& cls() const { return cls_; } |
| const String& field_name() const { return field_name_; } |
| bool is_super_getter() const { return is_super_getter_; } |
| + void set_is_deferred(bool value) { is_deferred_reference_ = value; } |
| virtual void VisitChildren(AstNodeVisitor* visitor) const { } |
| @@ -1416,6 +1432,7 @@ |
| const Class& cls_; |
| const String& field_name_; |
| const bool is_super_getter_; |
| + bool is_deferred_reference_; |
| DISALLOW_IMPLICIT_CONSTRUCTORS(StaticGetterNode); |
| }; |