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

Side by Side Diff: runtime/vm/ast.h

Issue 10878042: Propagate type of list literal from parser to ast, graph, and optimizer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | runtime/vm/object.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_AST_H_ 5 #ifndef VM_AST_H_
6 #define VM_AST_H_ 6 #define VM_AST_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 private: 239 private:
240 GrowableArray<AstNode*> nodes_; 240 GrowableArray<AstNode*> nodes_;
241 Array& names_; 241 Array& names_;
242 242
243 DISALLOW_COPY_AND_ASSIGN(ArgumentListNode); 243 DISALLOW_COPY_AND_ASSIGN(ArgumentListNode);
244 }; 244 };
245 245
246 246
247 class ArrayNode : public AstNode { 247 class ArrayNode : public AstNode {
248 public: 248 public:
249 ArrayNode(intptr_t token_pos, const AbstractTypeArguments& type_arguments) 249 ArrayNode(intptr_t token_pos, const AbstractType& type)
250 : AstNode(token_pos), 250 : AstNode(token_pos),
251 type_arguments_(type_arguments), 251 type_(type),
252 elements_(4) { 252 elements_() {
253 ASSERT(type_arguments_.IsZoneHandle()); 253 ASSERT(type_.IsZoneHandle());
254 ASSERT(!type_.IsNull());
255 ASSERT(type_.IsFinalized());
254 } 256 }
255 257
256 void VisitChildren(AstNodeVisitor* visitor) const; 258 void VisitChildren(AstNodeVisitor* visitor) const;
257 259
258 intptr_t length() const { return elements_.length(); } 260 intptr_t length() const { return elements_.length(); }
259 261
260 AstNode* ElementAt(intptr_t index) const { return elements_[index]; } 262 AstNode* ElementAt(intptr_t index) const { return elements_[index]; }
261 void SetElementAt(intptr_t index, AstNode* value) { 263 void SetElementAt(intptr_t index, AstNode* value) {
262 elements_[index] = value; 264 elements_[index] = value;
263 } 265 }
264 void AddElement(AstNode* expr) { elements_.Add(expr); } 266 void AddElement(AstNode* expr) { elements_.Add(expr); }
265 267
266 const AbstractTypeArguments& type_arguments() const { 268 const AbstractType& type() const { return type_; }
267 return type_arguments_;
268 }
269 269
270 DECLARE_COMMON_NODE_FUNCTIONS(ArrayNode); 270 DECLARE_COMMON_NODE_FUNCTIONS(ArrayNode);
271 271
272 private: 272 private:
273 const AbstractTypeArguments& type_arguments_; 273 const AbstractType& type_;
274 GrowableArray<AstNode*> elements_; 274 GrowableArray<AstNode*> elements_;
275 275
276 DISALLOW_IMPLICIT_CONSTRUCTORS(ArrayNode); 276 DISALLOW_IMPLICIT_CONSTRUCTORS(ArrayNode);
277 }; 277 };
278 278
279 279
280 class LiteralNode : public AstNode { 280 class LiteralNode : public AstNode {
281 public: 281 public:
282 LiteralNode(intptr_t token_pos, const Instance& literal) 282 LiteralNode(intptr_t token_pos, const Instance& literal)
283 : AstNode(token_pos), literal_(literal) { 283 : AstNode(token_pos), literal_(literal) {
(...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 const LocalVariable& context_var_; 1651 const LocalVariable& context_var_;
1652 1652
1653 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); 1653 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode);
1654 }; 1654 };
1655 1655
1656 } // namespace dart 1656 } // namespace dart
1657 1657
1658 #undef DECLARE_COMMON_NODE_FUNCTIONS 1658 #undef DECLARE_COMMON_NODE_FUNCTIONS
1659 1659
1660 #endif // VM_AST_H_ 1660 #endif // VM_AST_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698