From: verwaest Date: Mon, 27 Apr 2015 10:18:51 +0000 (-0700) Subject: Handlify ExecutableAccessorInfo::ClearSetter since it allocates. X-Git-Tag: upstream/4.7.83~2975 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a4b7d45c7b524acca070282c6ceeaf54e5ef4883;p=platform%2Fupstream%2Fv8.git 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} --- 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);