Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 169475791d05ff9672dfff163ba14dde0506bea5..6c1ecbb322ea00211813ba6c9584fcbf8a227b5b 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -1567,14 +1567,27 @@ MaybeObject* JSObject::MigrateInstance() { |
// Converting any field to the most specific type will cause the |
// GeneralizeFieldRepresentation algorithm to create the most general existing |
// transition that matches the object. This achieves what is needed. |
- return GeneralizeFieldRepresentation(0, Representation::None()); |
+ Map* original_map = map(); |
+ MaybeObject* maybe_result = GeneralizeFieldRepresentation( |
+ 0, Representation::None()); |
+ JSObject* result; |
+ if (FLAG_trace_migration && maybe_result->To(&result)) { |
+ PrintInstanceMigration(stdout, original_map, result->map()); |
+ } |
+ return maybe_result; |
} |
MaybeObject* JSObject::TryMigrateInstance() { |
Map* new_map = map()->CurrentMapForDeprecated(); |
if (new_map == NULL) return Smi::FromInt(0); |
- return MigrateToMap(new_map); |
+ Map* original_map = map(); |
+ MaybeObject* maybe_result = MigrateToMap(new_map); |
+ JSObject* result; |
+ if (FLAG_trace_migration && maybe_result->To(&result)) { |
+ PrintInstanceMigration(stdout, original_map, result->map()); |
+ } |
+ return maybe_result; |
} |