Handlify ExecutableAccessorInfo::ClearSetter since it allocates.
authorverwaest <verwaest@chromium.org>
Mon, 27 Apr 2015 10:18:51 +0000 (03:18 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 27 Apr 2015 10:18:30 +0000 (10:18 +0000)
BUG=chromium:478556
LOG=n

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

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

src/objects-inl.h
src/objects.cc
src/objects.h

index 2e77f92..b505baa 100644 (file)
@@ -7059,11 +7059,12 @@ bool AccessorInfo::IsCompatibleReceiver(Object* receiver) {
 }
 
 
-void ExecutableAccessorInfo::clear_setter() {
-  auto foreign = GetIsolate()->factory()->NewForeign(
+// static
+void ExecutableAccessorInfo::ClearSetter(Handle<ExecutableAccessorInfo> info) {
+  auto foreign = info->GetIsolate()->factory()->NewForeign(
       reinterpret_cast<v8::internal::Address>(
           reinterpret_cast<intptr_t>(nullptr)));
-  set_setter(*foreign);
+  info->set_setter(*foreign);
 }
 
 
index f373329..828a0a6 100644 (file)
@@ -4247,7 +4247,9 @@ MaybeHandle<Object> 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(
index 68db075..8f8a353 100644 (file)
@@ -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<ExecutableAccessorInfo> info);
 
  private:
   DISALLOW_IMPLICIT_CONSTRUCTORS(ExecutableAccessorInfo);