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

Unified Diff: runtime/vm/ast.h

Issue 8678031: Optimize type checks of list and map literals. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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 | « runtime/lib/literal_factory.dart ('k') | runtime/vm/ast_printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.h
===================================================================
--- runtime/vm/ast.h (revision 1825)
+++ runtime/vm/ast.h (working copy)
@@ -20,6 +20,7 @@
V(ReturnNode, "return") \
V(LiteralNode, "literal") \
V(TypeNode, "type") \
+ V(AssignableNode, "assignable") \
V(BinaryOpNode, "binop") \
V(StringConcatNode, "concat") \
V(ComparisonNode, "compare") \
@@ -372,6 +373,39 @@
};
+class AssignableNode : public AstNode {
+ public:
+ AssignableNode(intptr_t token_index,
+ AstNode* expr,
+ const Type& type,
+ const String& dst_name)
+ : AstNode(token_index), expr_(expr), type_(type), dst_name_(dst_name) {
+ ASSERT(expr_ != NULL);
+ ASSERT(type_.IsZoneHandle());
+ ASSERT(!type_.IsNull());
+ ASSERT(type_.IsFinalized());
+ ASSERT(dst_name_.IsZoneHandle());
+ }
+
+ AstNode* expr() const { return expr_; }
+ const Type& type() const { return type_; }
+ const String& dst_name() const { return dst_name_; }
+
+ virtual void VisitChildren(AstNodeVisitor* visitor) const {
+ expr()->Visit(visitor);
+ }
+
+ DECLARE_COMMON_NODE_FUNCTIONS(AssignableNode);
+
+ private:
+ AstNode* expr_;
+ const Type& type_;
+ const String& dst_name_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(AssignableNode);
+};
+
+
class ClosureNode : public AstNode {
public:
ClosureNode(intptr_t token_index,
« no previous file with comments | « runtime/lib/literal_factory.dart ('k') | runtime/vm/ast_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698