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

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

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, 4 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
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 #include "vm/flow_graph_builder.h" 5 #include "vm/flow_graph_builder.h"
6 6
7 #include "vm/ast_printer.h" 7 #include "vm/ast_printer.h"
8 #include "vm/code_descriptors.h" 8 #include "vm/code_descriptors.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flags.h" 10 #include "vm/flags.h"
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 void EffectGraphVisitor::VisitArrayNode(ArrayNode* node) { 1287 void EffectGraphVisitor::VisitArrayNode(ArrayNode* node) {
1288 // Translate the array elements and collect their values. 1288 // Translate the array elements and collect their values.
1289 ZoneGrowableArray<PushArgumentInstr*>* arguments = 1289 ZoneGrowableArray<PushArgumentInstr*>* arguments =
1290 new ZoneGrowableArray<PushArgumentInstr*>(node->length()); 1290 new ZoneGrowableArray<PushArgumentInstr*>(node->length());
1291 for (int i = 0; i < node->length(); ++i) { 1291 for (int i = 0; i < node->length(); ++i) {
1292 ValueGraphVisitor for_value(owner(), temp_index()); 1292 ValueGraphVisitor for_value(owner(), temp_index());
1293 node->ElementAt(i)->Visit(&for_value); 1293 node->ElementAt(i)->Visit(&for_value);
1294 Append(for_value); 1294 Append(for_value);
1295 arguments->Add(PushArgument(for_value.value())); 1295 arguments->Add(PushArgument(for_value.value()));
1296 } 1296 }
1297 const AbstractTypeArguments& type_args =
1298 AbstractTypeArguments::ZoneHandle(node->type().arguments());
1297 Value* element_type = BuildInstantiatedTypeArguments(node->token_pos(), 1299 Value* element_type = BuildInstantiatedTypeArguments(node->token_pos(),
1298 node->type_arguments()); 1300 type_args);
1299 CreateArrayComp* create = new CreateArrayComp(node->token_pos(), 1301 CreateArrayComp* create = new CreateArrayComp(node->token_pos(),
1300 owner()->try_index(), 1302 owner()->try_index(),
1301 arguments, 1303 arguments,
1304 node->type(),
1302 element_type); 1305 element_type);
1303 ReturnComputation(create); 1306 ReturnComputation(create);
1304 } 1307 }
1305 1308
1306 1309
1307 void EffectGraphVisitor::VisitClosureNode(ClosureNode* node) { 1310 void EffectGraphVisitor::VisitClosureNode(ClosureNode* node) {
1308 const Function& function = node->function(); 1311 const Function& function = node->function();
1309 1312
1310 Value* receiver = NULL; 1313 Value* receiver = NULL;
1311 if (function.IsNonImplicitClosureFunction()) { 1314 if (function.IsNonImplicitClosureFunction()) {
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
2413 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 2416 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
2414 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 2417 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
2415 OS::SNPrint(chars, len, kFormat, function_name, reason); 2418 OS::SNPrint(chars, len, kFormat, function_name, reason);
2416 const Error& error = Error::Handle( 2419 const Error& error = Error::Handle(
2417 LanguageError::New(String::Handle(String::New(chars)))); 2420 LanguageError::New(String::Handle(String::New(chars))));
2418 Isolate::Current()->long_jump_base()->Jump(1, error); 2421 Isolate::Current()->long_jump_base()->Jump(1, error);
2419 } 2422 }
2420 2423
2421 2424
2422 } // namespace dart 2425 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/intermediate_language.h » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698