From dc8f4c8ce327d538480e3facd1aeef8ab120daa2 Mon Sep 17 00:00:00 2001 From: verwaest Date: Tue, 13 Jan 2015 10:05:35 -0800 Subject: [PATCH] Reduce number of deopts caused by ForceDelete. BUG= Review URL: https://codereview.chromium.org/845403002 Cr-Commit-Position: refs/heads/master@{#26044} --- src/api.cc | 8 -------- src/objects.cc | 3 +++ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/api.cc b/src/api.cc index 99b0bb8..1903e47 100644 --- a/src/api.cc +++ b/src/api.cc @@ -3065,14 +3065,6 @@ bool v8::Object::ForceDelete(v8::Handle key) { i::Handle self = Utils::OpenHandle(this); i::Handle 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 obj; has_pending_exception = diff --git a/src/objects.cc b/src/objects.cc index 826d976..9edbdc9 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -557,6 +557,9 @@ Handle JSObject::DeleteNormalizedProperty(Handle object, } #endif JSObject::MigrateToMap(object, new_map); + // Optimized code does not check for the hole value for non-configurable + // properties. + Deoptimizer::DeoptimizeGlobalObject(*object); } Handle cell(PropertyCell::cast(dictionary->ValueAt(entry))); Handle value = isolate->factory()->the_hole_value(); -- 2.7.4