Reviewers: Igor Sheludko,

Message:
PTAL

Description:
Prototype objects never share their map, and hence cannot be in deprecated
state.

Please review this at https://codereview.chromium.org/955433002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+10, -28 lines):
  M src/objects.h
  M src/objects.cc


Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index ea4b6644c11c3ddda184b086a35969637533821c..7a3490286ae12379c78838aa97a7890a94a8f955 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -2931,30 +2931,7 @@ Handle<Map> Map::GeneralizeAllFieldRepresentations(


 // static
-MaybeHandle<Map> Map::TryUpdate(Handle<Map> map) {
-  Handle<Map> proto_map(map);
-  while (proto_map->prototype()->IsJSObject()) {
-    Handle<JSObject> holder(JSObject::cast(proto_map->prototype()));
-    proto_map = Handle<Map>(holder->map());
- if (proto_map->is_deprecated() && JSObject::TryMigrateInstance(holder)) {
-      proto_map = Handle<Map>(holder->map());
-    }
-  }
-  return TryUpdateInternal(map);
-}
-
-
-// static
-Handle<Map> Map::Update(Handle<Map> map) {
-  if (!map->is_deprecated()) return map;
-  return ReconfigureProperty(map, -1, kData, NONE, Representation::None(),
-                             HeapType::None(map->GetIsolate()),
-                             ALLOW_IN_DESCRIPTOR);
-}
-
-
-// static
-MaybeHandle<Map> Map::TryUpdateInternal(Handle<Map> old_map) {
+MaybeHandle<Map> Map::TryUpdate(Handle<Map> old_map) {
   DisallowHeapAllocation no_allocation;
   DisallowDeoptimization no_deoptimization(old_map->GetIsolate());

@@ -3018,6 +2995,15 @@ MaybeHandle<Map> Map::TryUpdateInternal(Handle<Map> old_map) {
 }


+// static
+Handle<Map> Map::Update(Handle<Map> map) {
+  if (!map->is_deprecated()) return map;
+  return ReconfigureProperty(map, -1, kData, NONE, Representation::None(),
+                             HeapType::None(map->GetIsolate()),
+                             ALLOW_IN_DESCRIPTOR);
+}
+
+
MaybeHandle<Object> JSObject::SetPropertyWithInterceptor(LookupIterator* it, Handle<Object> value) {
   Handle<Name> name = it->name();
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index d4af4a6255c1d1d1765f8d66ea2e7c0e1436978e..7e23282b6c533b20bc9d67d317665338d56e31c3 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -6069,11 +6069,7 @@ class Map: public HeapObject {
// deprecated, it is directly returned. Otherwise, the non-deprecated version // is found by re-transitioning from the root of the transition tree using the
   // descriptor array of the map. Returns NULL if no updated map is found.
- // This method also applies any pending migrations along the prototype chain.
   static MaybeHandle<Map> TryUpdate(Handle<Map> map) WARN_UNUSED_RESULT;
-  // Same as above, but does not touch the prototype chain.
-  static MaybeHandle<Map> TryUpdateInternal(Handle<Map> map)
-      WARN_UNUSED_RESULT;

// Returns a non-deprecated version of the input. This method may deprecate
   // existing maps along the way if encodings conflict. Not for use while


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to