Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 0a82ab73700be23b5257767a2c3eae6e4334c600..dcce931da943de6073052cc17fc9e60d3aefb09a 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -285,13 +285,14 @@ bool Object::HasValidElements() { |
MaybeObject* Object::AllocateNewStorageFor(Heap* heap, |
- Representation representation) { |
+ Representation representation, |
+ PretenureFlag tenure) { |
if (!FLAG_track_double_fields) return this; |
if (!representation.IsDouble()) return this; |
if (IsUninitialized()) { |
- return heap->AllocateHeapNumber(0); |
+ return heap->AllocateHeapNumber(0, tenure); |
} |
- return heap->AllocateHeapNumber(Number()); |
+ return heap->AllocateHeapNumber(Number(), tenure); |
} |
@@ -1541,6 +1542,19 @@ MaybeObject* JSObject::ResetElements() { |
} |
+MaybeObject* JSObject::TryMigrateInstance() { |
+ Map* new_map = map()->CurrentMapForDeprecated(); |
+ if (new_map == NULL) return Smi::FromInt(0); |
+ 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; |
+} |
+ |
+ |
Handle<String> JSObject::ExpectedTransitionKey(Handle<Map> map) { |
DisallowHeapAllocation no_gc; |
if (!map->HasTransitionArray()) return Handle<String>::null(); |