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

Unified Diff: src/objects.cc

Issue 2445333002: Ensure slow properties for simple {__proto__:null} literals. (Closed)
Patch Set: fixing typo Created 3 years, 9 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
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 4a9769668d4c04045073654d6bd849d712a6c7f4..ea29e69ed8b485e485ac463c5d9c0bff5185805d 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -8672,9 +8672,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
@@ -8692,7 +8691,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.

Powered by Google App Engine
This is Rietveld 408576698