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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 10933019: Improve moves of Smi and null objects. Add result cid to List constructor calls. Add tracing of inl… (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 12183)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -1662,6 +1662,29 @@
}
+static intptr_t GetResultCidOfConstructor(ConstructorCallNode* node) {
+ if (node->constructor().IsFactory()) {
+ const Function& function = node->constructor();
+ const Library& core_impl_lib = Library::Handle(Library::CoreImplLibrary());
+ const Class& function_class = Class::Handle(function.Owner());
+
+ if (function_class.library() == core_impl_lib.raw()) {
Vyacheslav Egorov (Google) 2012/09/11 12:30:40 This code is very tied to the actual behavior of L
srdjan 2012/09/11 15:23:16 Done & Done
+ if (function_class.Name() == Symbols::ListImplementation()) {
+ if (function.name() == Symbols::ListFactory()) {
+ if (node->arguments()->length() == 0) {
+ return kGrowableObjectArrayCid;
+ } else {
+ ASSERT(node->arguments()->length() == 1);
+ return kArrayCid;
+ }
+ }
+ }
+ }
+ }
+ return kDynamicCid; // Result cid not known.
+}
+
+
void EffectGraphVisitor::VisitConstructorCallNode(ConstructorCallNode* node) {
InlineBailout("EffectGraphVisitor::VisitConstructorCallNode");
if (node->constructor().IsFactory()) {
@@ -1678,6 +1701,8 @@
node->constructor(),
node->arguments()->names(),
arguments);
+ // List factories return kArrayCid or kGrowableObjectArrayCid.
+ call->set_result_cid(GetResultCidOfConstructor(node));
ReturnDefinition(call);
return;
}
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698