Reduce number of deopts caused by ForceDelete.
authorverwaest <verwaest@chromium.org>
Tue, 13 Jan 2015 18:05:35 +0000 (10:05 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 13 Jan 2015 18:05:49 +0000 (18:05 +0000)
BUG=

Review URL: https://codereview.chromium.org/845403002

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

src/api.cc
src/objects.cc

index 99b0bb8..1903e47 100644 (file)
@@ -3065,14 +3065,6 @@ bool v8::Object::ForceDelete(v8::Handle<Value> key) {
   i::Handle<i::JSObject> self = Utils::OpenHandle(this);
   i::Handle<i::Object> key_obj = Utils::OpenHandle(*key);
 
-  // When deleting a property on the global object using ForceDelete
-  // deoptimize all functions as optimized code does not check for the hole
-  // value with DontDelete properties.  We have to deoptimize all contexts
-  // because of possible cross-context inlined functions.
-  if (self->IsJSGlobalProxy() || self->IsGlobalObject()) {
-    i::Deoptimizer::DeoptimizeAll(isolate);
-  }
-
   EXCEPTION_PREAMBLE(isolate);
   i::Handle<i::Object> obj;
   has_pending_exception =
index 826d976..9edbdc9 100644 (file)
@@ -557,6 +557,9 @@ Handle<Object> JSObject::DeleteNormalizedProperty(Handle<JSObject> object,
         }
 #endif
         JSObject::MigrateToMap(object, new_map);
+        // Optimized code does not check for the hole value for non-configurable
+        // properties.
+        Deoptimizer::DeoptimizeGlobalObject(*object);
       }
       Handle<PropertyCell> cell(PropertyCell::cast(dictionary->ValueAt(entry)));
       Handle<Object> value = isolate->factory()->the_hole_value();