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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 395943003: Support allocation sinking for compound objects. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: improve tests Created 6 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/intermediate_language.h ('k') | tests/language/vm/allocation_sinking_vm_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index e23603fb493170adaf9683639b5a2d613187e894..a65c8234aff5a3df1fc39c984d59b21bc693fbd7 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -2281,6 +2281,11 @@ void MaterializeObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// FlowGraphCompiler::SlowPathEnvironmentFor().
void MaterializeObjectInstr::RemapRegisters(intptr_t* fpu_reg_slots,
intptr_t* cpu_reg_slots) {
+ if (registers_remapped_) {
+ return;
+ }
+ registers_remapped_ = true;
+
for (intptr_t i = 0; i < InputCount(); i++) {
Location loc = LocationAt(i);
if (loc.IsRegister()) {
@@ -2305,11 +2310,10 @@ void MaterializeObjectInstr::RemapRegisters(intptr_t* fpu_reg_slots,
}
} else if (loc.IsPairLocation()) {
UNREACHABLE();
- } else if (loc.IsInvalid()) {
- // We currently only perform one iteration of allocation
- // sinking, so we do not expect to find materialized objects
- // here.
- ASSERT(!InputAt(i)->definition()->IsMaterializeObject());
+ } else if (loc.IsInvalid() &&
+ InputAt(i)->definition()->IsMaterializeObject()) {
+ InputAt(i)->definition()->AsMaterializeObject()->RemapRegisters(
+ fpu_reg_slots, cpu_reg_slots);
}
}
}
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | tests/language/vm/allocation_sinking_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698