Reviewers: dcarney,

Message:
PTAL

Description:
Handlify ExecutableAccessorInfo::ClearSetter since it allocates.

BUG=chromium:478556
LOG=n

Please review this at https://codereview.chromium.org/1107853002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+8, -5 lines):
  M src/objects.h
  M src/objects.cc
  M src/objects-inl.h


Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 8ff7866f0a08b325a02cc93e012736c2bbdc89df..4f747af01bc4a78226722509c14c6d6878c41b2b 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -6999,11 +6999,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: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 0cd8b71a77dcd83161c8ed35d526a7a5cdb325c4..199696384fce63136739b575b2b83453873ca3d4 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -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: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 9076e3ffd4dd182228e3ae6ea2c990e6848cd732..88e1e381080b8c2fa6bd93411cbb5c1f51b21ba7 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -10559,7 +10559,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);


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to