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

Unified Diff: runtime/vm/intermediate_language.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/intermediate_language.h ('k') | runtime/vm/locations.h » ('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 8f4da359d2dd34e922139df4127c34516961efa9..082d506e86d2812e7d6d9c9af24482789d41bd68 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -2040,6 +2040,43 @@ void MaterializeObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
+// This function should be kept in sync with
+// FlowGraphCompiler::SlowPathEnvironmentFor().
+void MaterializeObjectInstr::RemapRegisters(intptr_t* fpu_reg_slots,
+ intptr_t* cpu_reg_slots) {
+ for (intptr_t i = 0; i < InputCount(); i++) {
+ Location loc = LocationAt(i);
+ if (loc.IsRegister()) {
+ intptr_t index = cpu_reg_slots[loc.reg()];
+ ASSERT(index >= 0);
+ locations_[i] = Location::StackSlot(index);
+ } else if (loc.IsFpuRegister()) {
+ intptr_t index = fpu_reg_slots[loc.fpu_reg()];
+ ASSERT(index >= 0);
+ Value* value = InputAt(i);
+ switch (value->definition()->representation()) {
+ case kUnboxedDouble:
+ case kUnboxedMint:
+ locations_[i] = Location::DoubleStackSlot(index);
+ break;
+ case kUnboxedFloat32x4:
+ case kUnboxedInt32x4:
+ case kUnboxedFloat64x2:
+ locations_[i] = Location::QuadStackSlot(index);
+ break;
+ default:
+ 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());
+ }
+ }
+}
+
+
LocationSummary* StoreContextInstr::MakeLocationSummary(bool optimizing) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/locations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698