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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 246303004: Fixes bug where we would occasionally materialize a corrupted object. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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/exceptions.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler.cc
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index a31718e40554a386c088c45dd502faade07aa222..37f55af3aae97a4e0930f8b16dcbe1459d362afc 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -549,11 +549,18 @@ void FlowGraphCompiler::RecordSafepoint(LocationSummary* locs) {
}
-// This function must be in sync with FlowGraphCompiler::RecordSafepoint and
-// FlowGraphCompiler::SaveLiveRegisters.
+// This function must be kept in sync with:
+//
+// FlowGraphCompiler::RecordSafepoint
+// FlowGraphCompiler::SaveLiveRegisters
+// MaterializeObjectInstr::RemapRegisters
+//
Environment* FlowGraphCompiler::SlowPathEnvironmentFor(
Instruction* instruction) {
- if (instruction->env() == NULL) return NULL;
+ if (instruction->env() == NULL) {
+ ASSERT(!is_optimizing());
+ return NULL;
+ }
Environment* env = instruction->env()->DeepCopy();
// 1. Iterate the registers in the order they will be spilled to compute
@@ -611,9 +618,16 @@ Environment* FlowGraphCompiler::SlowPathEnvironmentFor(
default:
UNREACHABLE();
}
+ } else if (loc.IsInvalid()) {
+ Definition* def =
+ it.CurrentValue()->definition();
+ ASSERT(def != NULL);
+ if (def->IsMaterializeObject()) {
+ def->AsMaterializeObject()->RemapRegisters(fpu_reg_slots,
+ cpu_reg_slots);
+ }
}
}
-
return env;
}
« no previous file with comments | « runtime/vm/exceptions.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698