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

Side by Side Diff: runtime/vm/ast_printer.cc

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 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 | « runtime/vm/ast.h ('k') | runtime/vm/code_generator_ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #include "vm/ast_printer.h" 5 #include "vm/ast_printer.h"
6 6
7 #include "vm/handles.h" 7 #include "vm/handles.h"
8 #include "vm/object.h" 8 #include "vm/object.h"
9 #include "vm/os.h" 9 #include "vm/os.h"
10 #include "vm/parser.h" 10 #include "vm/parser.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 OS::Print("'%s'", literal.ToCString()); 121 OS::Print("'%s'", literal.ToCString());
122 } 122 }
123 123
124 124
125 void AstPrinter::VisitTypeNode(TypeNode* node) { 125 void AstPrinter::VisitTypeNode(TypeNode* node) {
126 const Type& type = node->type(); 126 const Type& type = node->type();
127 OS::Print("'%s'", String::Handle(type.Name()).ToCString()); 127 OS::Print("'%s'", String::Handle(type.Name()).ToCString());
128 } 128 }
129 129
130 130
131 void AstPrinter::VisitAssignableNode(AssignableNode* node) {
132 OS::Print("(assignable ");
133 node->expr()->Visit(this);
134 const Type& type = node->type();
135 const String& dst_name = node->dst_name();
136 OS::Print(" to type '%s' of '%s')",
137 String::Handle(type.Name()).ToCString(),
138 dst_name.ToCString());
139 }
140
141
131 void AstPrinter::VisitPrimaryNode(PrimaryNode* node) { 142 void AstPrinter::VisitPrimaryNode(PrimaryNode* node) {
132 OS::Print("***** PRIMARY NODE IN AST ***** (%s '%s')", 143 OS::Print("***** PRIMARY NODE IN AST ***** (%s '%s')",
133 node->Name(), node->primary().ToCString()); 144 node->Name(), node->primary().ToCString());
134 } 145 }
135 146
136 147
137 void AstPrinter::VisitComparisonNode(ComparisonNode* node) { 148 void AstPrinter::VisitComparisonNode(ComparisonNode* node) {
138 VisitGenericAstNode(node); 149 VisitGenericAstNode(node);
139 } 150 }
140 151
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 ASSERT(node_sequence != NULL); 479 ASSERT(node_sequence != NULL);
469 AstPrinter ast_printer; 480 AstPrinter ast_printer;
470 const char* function_name = 481 const char* function_name =
471 parsed_function.function().ToFullyQualifiedCString(); 482 parsed_function.function().ToFullyQualifiedCString();
472 OS::Print("Ast for function '%s' {\n", function_name); 483 OS::Print("Ast for function '%s' {\n", function_name);
473 node_sequence->Visit(&ast_printer); 484 node_sequence->Visit(&ast_printer);
474 OS::Print("}\n"); 485 OS::Print("}\n");
475 } 486 }
476 487
477 } // namespace dart 488 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/code_generator_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698