Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 1ff56694c08f3a9a4d18fc820ff1ab2311b775d9..d630338baf44c2ed636f17bbfd5835288bcf2c95 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -8699,9 +8699,8 @@ Handle<Map> Map::TransitionToImmutableProto(Handle<Map> map) { |
return new_map; |
} |
-Handle<Map> Map::CopyInitialMap(Handle<Map> map, int instance_size, |
- int in_object_properties, |
- int unused_property_fields) { |
+namespace { |
+void EnsureInitialMap(Handle<Map> map) { |
#ifdef DEBUG |
Isolate* isolate = map->GetIsolate(); |
// Strict function maps have Function as a constructor but the |
@@ -8719,7 +8718,21 @@ Handle<Map> Map::CopyInitialMap(Handle<Map> map, int instance_size, |
DCHECK(map->owns_descriptors()); |
DCHECK_EQ(map->NumberOfOwnDescriptors(), |
map->instance_descriptors()->number_of_descriptors()); |
+} |
+} // namespace |
+// static |
+Handle<Map> Map::CopyInitialMapNormalized(Handle<Map> map, |
+ PropertyNormalizationMode mode) { |
+ EnsureInitialMap(map); |
+ return CopyNormalized(map, mode); |
+} |
+ |
+// static |
+Handle<Map> Map::CopyInitialMap(Handle<Map> map, int instance_size, |
+ int in_object_properties, |
+ int unused_property_fields) { |
+ EnsureInitialMap(map); |
Handle<Map> result = RawCopy(map, instance_size); |
// Please note instance_type and instance_size are set when allocated. |