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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 19370003: Enable allocation sinking for closures. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed comments Created 7 years, 5 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/flow_graph_inliner.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 25661)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -1327,7 +1327,6 @@
}
AddToGuardedFields(field);
}
- load->set_field_name(String::Handle(field.name()).ToCString());
// Discard the environment from the original instruction because the load
// can't deoptimize.
@@ -4780,8 +4779,8 @@
if (alloc->ArgumentCount() > 0) {
ASSERT(alloc->ArgumentCount() == 2);
- const Class& cls = Class::Handle(alloc->constructor().Owner());
- intptr_t type_args_offset = cls.type_arguments_field_offset();
+ intptr_t type_args_offset =
+ alloc->cls().type_arguments_field_offset();
if (load->offset_in_bytes() == type_args_offset) {
(*out_values)[load->place_id()] =
alloc->PushArgumentAt(0)->value()->definition();
@@ -7175,7 +7174,7 @@
use != NULL;
use = use->next_use()) {
if (!(use->instruction()->IsStoreInstanceField() &&
- use->use_index() == 0)) {
+ (use->use_index() == 0))) {
return false;
}
}
@@ -7313,6 +7312,7 @@
// present there.
static void AddInstruction(GrowableArray<Instruction*>* exits,
Instruction* exit) {
+ ASSERT(!exit->IsGraphEntry());
for (intptr_t i = 0; i < exits->length(); i++) {
if ((*exits)[i] == exit) {
return;
@@ -7388,10 +7388,9 @@
false, // !static
false, // !final
false, // !const
- Class::Handle(alloc->constructor().Owner()),
+ alloc->cls(),
0)); // No token position.
- const Class& cls = Class::Handle(alloc->constructor().Owner());
- type_args_field.SetOffset(cls.type_arguments_field_offset());
+ type_args_field.SetOffset(alloc->cls().type_arguments_field_offset());
AddField(fields, type_args_field);
}
@@ -7404,9 +7403,8 @@
}
// Insert materializations at environment uses.
- const Class& cls = Class::Handle(alloc->constructor().Owner());
for (intptr_t i = 0; i < exits.length(); i++) {
- CreateMaterializationAt(exits[i], alloc, cls, *fields);
+ CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields);
}
}
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698