From a4b7d45c7b524acca070282c6ceeaf54e5ef4883 Mon Sep 17 00:00:00 2001 From: verwaest Date: Mon, 27 Apr 2015 03:18:51 -0700 Subject: [PATCH] Handlify ExecutableAccessorInfo::ClearSetter since it allocates. BUG=chromium:478556 LOG=n Review URL: https://codereview.chromium.org/1107853002 Cr-Commit-Position: refs/heads/master@{#28065} --- src/objects-inl.h | 7 ++++--- src/objects.cc | 4 +++- src/objects.h | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/objects-inl.h b/src/objects-inl.h index 2e77f92..b505baa 100644 --- a/src/objects-inl.h +++ b/src/objects-inl.h @@ -7059,11 +7059,12 @@ bool AccessorInfo::IsCompatibleReceiver(Object* receiver) { } -void ExecutableAccessorInfo::clear_setter() { - auto foreign = GetIsolate()->factory()->NewForeign( +// static +void ExecutableAccessorInfo::ClearSetter(Handle info) { + auto foreign = info->GetIsolate()->factory()->NewForeign( reinterpret_cast( reinterpret_cast(nullptr))); - set_setter(*foreign); + info->set_setter(*foreign); } diff --git a/src/objects.cc b/src/objects.cc index f373329..828a0a6 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -4247,7 +4247,9 @@ MaybeHandle JSObject::SetOwnPropertyIgnoreAttributes( // By clearing the setter we don't have to introduce a lookup to // the setter, simply make it unavailable to reflect the // attributes. - if (attributes & READ_ONLY) new_data->clear_setter(); + if (attributes & READ_ONLY) { + ExecutableAccessorInfo::ClearSetter(new_data); + } SetPropertyCallback(object, name, new_data, attributes); if (is_observed) { RETURN_ON_EXCEPTION( diff --git a/src/objects.h b/src/objects.h index 68db075..8f8a353 100644 --- a/src/objects.h +++ b/src/objects.h @@ -10563,7 +10563,7 @@ class ExecutableAccessorInfo: public AccessorInfo { static const int kDataOffset = kSetterOffset + kPointerSize; static const int kSize = kDataOffset + kPointerSize; - inline void clear_setter(); + static inline void ClearSetter(Handle info); private: DISALLOW_IMPLICIT_CONSTRUCTORS(ExecutableAccessorInfo); -- 2.7.4