Prototype objects never share their map, and hence cannot be in deprecated state.
authorverwaest <verwaest@chromium.org>
Mon, 23 Feb 2015 18:25:38 +0000 (10:25 -0800)
committerCommit bot <commit-bot@chromium.org>
Mon, 23 Feb 2015 18:25:54 +0000 (18:25 +0000)
Review URL: https://codereview.chromium.org/955433002

Cr-Commit-Position: refs/heads/master@{#26802}

src/ic/handler-compiler.cc
src/objects.cc
src/objects.h

index 4fd61b4f41cfc65bb6a431f9ffcf906a0b3b75d7..15dc941503e8309798b78ea47f2ba01ec2fa8465 100644 (file)
@@ -74,7 +74,7 @@ Handle<Code> PropertyHandlerCompiler::GetCode(Code::Kind kind,
                                               Handle<Name> name) {
   Code::Flags flags = Code::ComputeHandlerFlags(kind, type, cache_holder());
   Handle<Code> code = GetCodeWithFlags(flags, name);
-  PROFILE(isolate(), CodeCreateEvent(Logger::STUB_TAG, *code, *name));
+  PROFILE(isolate(), CodeCreateEvent(Logger::HANDLER_TAG, *code, *name));
 #ifdef DEBUG
   code->VerifyEmbeddedObjects();
 #endif
index ea4b6644c11c3ddda184b086a35969637533821c..7a3490286ae12379c78838aa97a7890a94a8f955 100644 (file)
@@ -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 d4af4a6255c1d1d1765f8d66ea2e7c0e1436978e..8b6f1e2e621c39339c02891c090b12b83add0df8 100644 (file)
@@ -6068,12 +6068,9 @@ class Map: public HeapObject {
   // Returns a non-deprecated version of the input. If the input was not
   // 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.
+  // descriptor array of the map. Returns MaybeHandle<Map>() if no updated map
+  // is found.
   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