Remove hidden value tracking of event listeners.

It duplicates work done by wrapper tracing. This change:
- reduces time spent in a microbenchmark of add/removeEventListener
  by 30% (approximately, measured on Linux)
- simplifies code (including removing some custom callback epilogues)
- avoids the need for an additional internal field on EventTarget
  (other than Node) wrappers

Change-Id: I06023a6bb01ac54bb9e514def17c0aaf4ae50bf0
Reviewed-on: https://chromium-review.googlesource.com/576472
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491479}
diff --git a/third_party/WebKit/Source/bindings/bindings.gni b/third_party/WebKit/Source/bindings/bindings.gni
index 7b1137f..ac55188 100644
--- a/third_party/WebKit/Source/bindings/bindings.gni
+++ b/third_party/WebKit/Source/bindings/bindings.gni
@@ -18,7 +18,6 @@
                     "core/v8/custom/V8EventTargetCustom.cpp",
                     "core/v8/custom/V8HTMLAllCollectionCustom.cpp",
                     "core/v8/custom/V8HTMLPlugInElementCustom.cpp",
-                    "core/v8/custom/V8MediaQueryListCustom.cpp",
                     "core/v8/custom/V8MessageChannelCustom.cpp",
                     "core/v8/custom/V8MessageEventCustom.cpp",
                     "core/v8/custom/V8PopStateEventCustom.cpp",
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8BindingForCore.cpp b/third_party/WebKit/Source/bindings/core/v8/V8BindingForCore.cpp
index 8542ff8..9bfa5187 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8BindingForCore.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8BindingForCore.cpp
@@ -898,28 +898,6 @@
   return iterator_getter->IsFunction();
 }
 
-void MoveEventListenerToNewWrapper(v8::Isolate* isolate,
-                                   v8::Local<v8::Object> object,
-                                   EventListener* old_value,
-                                   v8::Local<v8::Value> new_value,
-                                   int array_index) {
-  if (old_value) {
-    V8AbstractEventListener* old_listener =
-        V8AbstractEventListener::Cast(old_value);
-    if (old_listener) {
-      v8::Local<v8::Object> old_listener_object =
-          old_listener->GetExistingListenerObject();
-      if (!old_listener_object.IsEmpty()) {
-        RemoveHiddenValueFromArray(isolate, object, old_listener_object,
-                                   array_index);
-      }
-    }
-  }
-  // Non-callable input is treated as null and ignored
-  if (new_value->IsFunction())
-    AddHiddenValueToArray(isolate, object, new_value, array_index);
-}
-
 v8::Isolate* ToIsolate(ExecutionContext* context) {
   if (context && context->IsDocument())
     return V8PerIsolateData::MainThreadIsolate();
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8BindingForCore.h b/third_party/WebKit/Source/bindings/core/v8/V8BindingForCore.h
index 95be8227..c77d5584 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8BindingForCore.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8BindingForCore.h
@@ -64,7 +64,6 @@
 // dependencies to core/.
 
 class DOMWindow;
-class EventListener;
 class EventTarget;
 class ExceptionState;
 class ExecutionContext;
@@ -606,12 +605,6 @@
                              const String& enum_name,
                              ExceptionState&);
 
-CORE_EXPORT void MoveEventListenerToNewWrapper(v8::Isolate*,
-                                               v8::Local<v8::Object>,
-                                               EventListener* old_value,
-                                               v8::Local<v8::Value> new_value,
-                                               int cache_index);
-
 // Result values for platform object 'deleter' methods,
 // http://www.w3.org/TR/WebIDL/#delete
 enum DeleteResult { kDeleteSuccess, kDeleteReject, kDeleteUnknownProperty };
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp
index 788a365..418c4d66 100644
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp
@@ -49,14 +49,6 @@
   }
 }
 
-void V8EventTarget::addEventListenerMethodEpilogueCustom(
-    const v8::FunctionCallbackInfo<v8::Value>& info,
-    EventTarget* impl) {
-  if (info.Length() >= 2 && info[1]->IsObject() && !impl->ToNode())
-    AddHiddenValueToArray(info.GetIsolate(), info.Holder(), info[1],
-                          V8EventTarget::eventListenerCacheIndex);
-}
-
 void V8EventTarget::removeEventListenerMethodPrologueCustom(
     const v8::FunctionCallbackInfo<v8::Value>& info,
     EventTarget*) {
@@ -70,12 +62,4 @@
   }
 }
 
-void V8EventTarget::removeEventListenerMethodEpilogueCustom(
-    const v8::FunctionCallbackInfo<v8::Value>& info,
-    EventTarget* impl) {
-  if (info.Length() >= 2 && info[1]->IsObject() && !impl->ToNode())
-    RemoveHiddenValueFromArray(info.GetIsolate(), info.Holder(), info[1],
-                               V8EventTarget::eventListenerCacheIndex);
-}
-
 }  // namespace blink
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8MediaQueryListCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8MediaQueryListCustom.cpp
deleted file mode 100644
index 730cdbc..0000000
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8MediaQueryListCustom.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2015 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "bindings/core/v8/V8MediaQueryList.h"
-
-namespace blink {
-
-void V8MediaQueryList::addListenerMethodEpilogueCustom(
-    const v8::FunctionCallbackInfo<v8::Value>& info,
-    MediaQueryList* impl) {
-  if (info.Length() >= 1 && info[0]->IsObject() && !impl->ToNode())
-    AddHiddenValueToArray(info.GetIsolate(), info.Holder(), info[0],
-                          V8EventTarget::eventListenerCacheIndex);
-}
-
-void V8MediaQueryList::removeListenerMethodEpilogueCustom(
-    const v8::FunctionCallbackInfo<v8::Value>& info,
-    MediaQueryList* impl) {
-  if (info.Length() >= 1 && info[0]->IsObject() && !impl->ToNode())
-    RemoveHiddenValueFromArray(info.GetIsolate(), info.Holder(), info[0],
-                               V8EventTarget::eventListenerCacheIndex);
-}
-
-}  // namespace blink
diff --git a/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl
index b64698a..92c73805 100644
--- a/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl
+++ b/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl
@@ -368,11 +368,7 @@
   {% endif %}
 
   // Prepare the value to be set.
-  {% if attribute.idl_type == 'EventHandler' %}
-  {% if not is_node %}
-  MoveEventListenerToNewWrapper(isolate, holder, {{attribute.event_handler_getter_expression}}, v8Value, {{v8_class}}::eventListenerCacheIndex);
-  {% endif %}
-  {% else %}{# not EventHandler #}
+  {% if attribute.idl_type != 'EventHandler' %}
   {{v8_value_to_local_cpp_value(attribute) | indent(2)}}
   {% endif %}
 
diff --git a/third_party/WebKit/Source/bindings/templates/interface.h.tmpl b/third_party/WebKit/Source/bindings/templates/interface.h.tmpl
index c51d57d2..d561fcd 100644
--- a/third_party/WebKit/Source/bindings/templates/interface.h.tmpl
+++ b/third_party/WebKit/Source/bindings/templates/interface.h.tmpl
@@ -111,18 +111,12 @@
   static void legacyCallCustom(const v8::FunctionCallbackInfo<v8::Value>&);
   {% endif %}
   {# Custom internal fields #}
-  {% set custom_internal_field_counter = 0 %}
-  {% if is_event_target and not is_node %}
-  {# Event listeners on DOM nodes are explicitly supported in the GC controller. #}
-  static const int eventListenerCacheIndex = kV8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}};
-  {% set custom_internal_field_counter = custom_internal_field_counter + 1 %}
-  {% endif %}
   {# persistentHandleIndex must be the last field, if it is present.
      Detailed explanation: https://codereview.chromium.org/139173012
      FIXME: Remove this internal field, and share one field for either:
      * a persistent handle (if the object is in oilpan) or
      * a C++ pointer to the DOM object (if the object is not in oilpan) #}
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}};
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
   {# End custom internal fields #}
   {% if prepare_prototype_and_interface_object_func %}
   {{exported}}static void preparePrototypeAndInterfaceObject(v8::Local<v8::Context>, const DOMWrapperWorld&, v8::Local<v8::Object> prototypeObject, v8::Local<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfaceTemplate);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.h b/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.h
index 6094f0e..218b412 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.h
@@ -37,7 +37,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestArrayBuffer>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.h b/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.h
index f9c8d2aa..9771c1d 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.h
@@ -37,7 +37,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestArrayBufferView>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.h b/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.h
index 28f220f..b41de67 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.h
@@ -40,7 +40,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestDataView>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.h b/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.h
index e2bb5397..727641b 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.h
@@ -42,7 +42,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<SVGTestInterface>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.h
index 21ea6fb..f5e3cd5 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.h
@@ -42,7 +42,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestCallbackFunctions>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.h
index 250b0d5..92215cc6 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.h
@@ -43,7 +43,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestConstants>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   static void installFeatureName1(v8::Isolate*, const DOMWrapperWorld&, v8::Local<v8::Object> instance, v8::Local<v8::Object> prototype, v8::Local<v8::Function> interface);
   static void installFeatureName1(ScriptState*, v8::Local<v8::Object> instance);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.h
index 68b1f8f8..c23d69a 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.h
@@ -50,7 +50,7 @@
   static void namedPropertyQueryCustom(const AtomicString&, const v8::PropertyCallbackInfo<v8::Integer>&);
   static void namedPropertyDeleterCustom(const AtomicString&, const v8::PropertyCallbackInfo<v8::Boolean>&);
   static void namedPropertyEnumeratorCustom(const v8::PropertyCallbackInfo<v8::Array>&);
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.h
index 3a82a7f..df4e4a7 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.h
@@ -51,7 +51,7 @@
   static void namedPropertyQueryCustom(const AtomicString&, const v8::PropertyCallbackInfo<v8::Integer>&);
   static void namedPropertyDeleterCustom(const AtomicString&, const v8::PropertyCallbackInfo<v8::Boolean>&);
   static void namedPropertyEnumeratorCustom(const v8::PropertyCallbackInfo<v8::Array>&);
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.h
index e93eda5e..403bd6d 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.h
@@ -51,7 +51,7 @@
   static void namedPropertyQueryCustom(const AtomicString&, const v8::PropertyCallbackInfo<v8::Integer>&);
   static void namedPropertyDeleterCustom(const AtomicString&, const v8::PropertyCallbackInfo<v8::Boolean>&);
   static void namedPropertyEnumeratorCustom(const v8::PropertyCallbackInfo<v8::Array>&);
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
index ccca509..f9b066e 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
@@ -822,7 +822,6 @@
   TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder);
 
   // Prepare the value to be set.
-  MoveEventListenerToNewWrapper(isolate, holder, impl->implementsEventHandlerAttribute(), v8Value, V8TestInterface::eventListenerCacheIndex);
 
   impl->setImplementsEventHandlerAttribute(V8EventListenerHelper::GetEventListener(ScriptState::ForReceiverObject(info), v8Value, true, kListenerFindOrCreate));
 }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.h
index 931caecc..0e28b3f 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.h
@@ -46,7 +46,7 @@
   }
   static void implementsCustomVoidMethodMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&);
   static void legacyCallCustom(const v8::FunctionCallbackInfo<v8::Value>&);
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
   CORE_EXPORT static void preparePrototypeAndInterfaceObject(v8::Local<v8::Context>, const DOMWrapperWorld&, v8::Local<v8::Object> prototypeObject, v8::Local<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfaceTemplate);
 
   CORE_EXPORT static void UpdateWrapperTypeInfo(
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.h
index 0e807b1..8fc17985 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.h
@@ -42,7 +42,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterface2>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
   CORE_EXPORT static void preparePrototypeAndInterfaceObject(v8::Local<v8::Context>, const DOMWrapperWorld&, v8::Local<v8::Object> prototypeObject, v8::Local<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfaceTemplate) {}
 
   CORE_EXPORT static void UpdateWrapperTypeInfo(
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.h
index 8b9e202..8cb8efe 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.h
@@ -50,7 +50,7 @@
   static void namedPropertyQueryCustom(const AtomicString&, const v8::PropertyCallbackInfo<v8::Integer>&);
   static void namedPropertyDeleterCustom(const AtomicString&, const v8::PropertyCallbackInfo<v8::Boolean>&);
   static void namedPropertyEnumeratorCustom(const v8::PropertyCallbackInfo<v8::Array>&);
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.h
index 026d63ed..c13de37 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.h
@@ -42,7 +42,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterfaceCheckSecurity>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.h
index 17acaab..52ee1115 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.h
@@ -51,7 +51,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterfaceConstructor>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
   CORE_EXPORT static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.h
index c818f4b..41cfbdf 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.h
@@ -42,7 +42,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterfaceConstructor2>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
   CORE_EXPORT static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.h
index 48b1465..5a9da06 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.h
@@ -42,7 +42,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterfaceConstructor3>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
   CORE_EXPORT static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.h
index 92b90a4..70388a7 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.h
@@ -42,7 +42,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterfaceConstructor4>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
   CORE_EXPORT static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.h
index 04658967..0fa19458 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.h
@@ -43,7 +43,7 @@
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterfaceCustomConstructor>());
   }
   static void constructorCustom(const v8::FunctionCallbackInfo<v8::Value>&);
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
   CORE_EXPORT static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.h
index 95cabae0..5eb231a 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.h
@@ -43,7 +43,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterfaceDocument>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.h
index 682baa4..6a0b1b3 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.h
@@ -42,7 +42,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterfaceEmpty>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.h
index 48dbf59..cc3518f 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.h
@@ -43,7 +43,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterfaceEventInitConstructor>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
   CORE_EXPORT static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.h
index ba129a3b..8736174c 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.h
@@ -51,8 +51,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterfaceEventTarget>());
   }
-  static const int eventListenerCacheIndex = kV8DefaultWrapperInternalFieldCount + 0;
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 1;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.h
index 3ec554c..f682acb 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.h
@@ -43,8 +43,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterfaceGarbageCollected>());
   }
-  static const int eventListenerCacheIndex = kV8DefaultWrapperInternalFieldCount + 0;
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 1;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
   CORE_EXPORT static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.h
index 4efac1b..0b1875d 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.h
@@ -50,7 +50,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterfaceNamedConstructor>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.h
index 13bd20d9..5b048e5 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.h
@@ -50,7 +50,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterfaceNamedConstructor2>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.h
index 4006d8b..946706b 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.h
@@ -43,7 +43,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterfaceNode>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.h
index c0110b4..3674ee4 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.h
@@ -42,7 +42,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterfaceOriginTrialEnabled>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.h
index 5e4b2eda..bcab084 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.h
@@ -42,7 +42,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterfaceSecureContext>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
   CORE_EXPORT static void preparePrototypeAndInterfaceObject(v8::Local<v8::Context>, const DOMWrapperWorld&, v8::Local<v8::Object> prototypeObject, v8::Local<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfaceTemplate);
 
   // Callback functions
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.h
index 9088eb8..d5a1b8a 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.h
@@ -43,7 +43,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestNode>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
   CORE_EXPORT static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
index b44b2fe..db35b36 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
@@ -1702,7 +1702,6 @@
   TestObject* impl = V8TestObject::toImpl(holder);
 
   // Prepare the value to be set.
-  MoveEventListenerToNewWrapper(isolate, holder, impl->eventHandlerAttribute(), v8Value, V8TestObject::eventListenerCacheIndex);
 
   impl->setEventHandlerAttribute(V8EventListenerHelper::GetEventListener(ScriptState::ForReceiverObject(info), v8Value, true, kListenerFindOrCreate));
 }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.h
index c2d7a0d..0426fe4 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.h
@@ -69,7 +69,7 @@
   static void customImplementedAsLongAttributeAttributeSetterCustom(v8::Local<v8::Value>, const v8::FunctionCallbackInfo<v8::Value>&);
   static void customGetterImplementedAsLongAttributeAttributeGetterCustom(const v8::FunctionCallbackInfo<v8::Value>&);
   static void customSetterImplementedAsLongAttributeAttributeSetterCustom(v8::Local<v8::Value>, const v8::FunctionCallbackInfo<v8::Value>&);
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
   CORE_EXPORT static void preparePrototypeAndInterfaceObject(v8::Local<v8::Context>, const DOMWrapperWorld&, v8::Local<v8::Object> prototypeObject, v8::Local<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfaceTemplate);
 
   static void installFeatureName(v8::Isolate*, const DOMWrapperWorld&, v8::Local<v8::Object> instance, v8::Local<v8::Object> prototype, v8::Local<v8::Function> interface);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.h
index 3c9b745..24a4aa4 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.h
@@ -43,7 +43,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestSpecialOperations>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.h
index 87859030..0217186 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.h
@@ -42,7 +42,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestSpecialOperationsNotEnumerable>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.h
index f51472e..ecf571e05 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.h
@@ -47,7 +47,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestTypedefs>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
   CORE_EXPORT static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.h b/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.h
index 9ad3e51a..9f504a8 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.h
@@ -40,7 +40,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestUint8ClampedArray>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 };
diff --git a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.h b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.h
index 125bbbe..d22e4e7 100644
--- a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.h
+++ b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.h
@@ -46,7 +46,7 @@
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestInterface5Implementation>());
   }
   static void legacyCallCustom(const v8::FunctionCallbackInfo<v8::Value>&);
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
   MODULES_EXPORT static void preparePrototypeAndInterfaceObject(v8::Local<v8::Context>, const DOMWrapperWorld&, v8::Local<v8::Object> prototypeObject, v8::Local<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfaceTemplate);
 
   // Callback functions
diff --git a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestSubObject.h b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestSubObject.h
index f9c4d40..633c647 100644
--- a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestSubObject.h
+++ b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestSubObject.h
@@ -43,7 +43,7 @@
   static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) {
     visitor->TraceWrappersWithManualWriteBarrier(scriptWrappable->ToImpl<TestSubObject>());
   }
-  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0;
+  static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount;
 
   // Callback functions
 
diff --git a/third_party/WebKit/Source/core/css/MediaQueryList.idl b/third_party/WebKit/Source/core/css/MediaQueryList.idl
index 4f1175c..cd276f2 100644
--- a/third_party/WebKit/Source/core/css/MediaQueryList.idl
+++ b/third_party/WebKit/Source/core/css/MediaQueryList.idl
@@ -29,7 +29,7 @@
     // exist as aliases for addEventListener for backwards compatibility
     // with older versions of this interface. See the note at
     // https://dev.w3.org/csswg/cssom-view/#dom-mediaquerylist-removelistener
-    [ImplementedAs=addDeprecatedListener, Custom=CallEpilogue] void addListener(EventListener? listener);
-    [ImplementedAs=removeDeprecatedListener, Custom=CallEpilogue]void removeListener(EventListener? listener);
+    [ImplementedAs=addDeprecatedListener] void addListener(EventListener? listener);
+    [ImplementedAs=removeDeprecatedListener] void removeListener(EventListener? listener);
     attribute EventHandler onchange;
 };
diff --git a/third_party/WebKit/Source/core/events/EventTarget.idl b/third_party/WebKit/Source/core/events/EventTarget.idl
index 9faf117..7567440b 100644
--- a/third_party/WebKit/Source/core/events/EventTarget.idl
+++ b/third_party/WebKit/Source/core/events/EventTarget.idl
@@ -25,7 +25,7 @@
     Exposed=(Window,Worker),
     ImmutablePrototype
 ] interface EventTarget {
-    [Custom=(CallPrologue,CallEpilogue)] void addEventListener(DOMString type, EventListener? listener, optional (AddEventListenerOptions or boolean) options);
-    [Custom=(CallPrologue,CallEpilogue)] void removeEventListener(DOMString type, EventListener? listener, optional (EventListenerOptions or boolean) options);
+    [Custom=CallPrologue] void addEventListener(DOMString type, EventListener? listener, optional (AddEventListenerOptions or boolean) options);
+    [Custom=CallPrologue] void removeEventListener(DOMString type, EventListener? listener, optional (EventListenerOptions or boolean) options);
     [ImplementedAs=dispatchEventForBindings, RaisesException, RuntimeCallStatsCounter=EventTargetDispatchEvent] boolean dispatchEvent(Event event);
 };
diff --git a/third_party/WebKit/Source/platform/bindings/V8Binding.cpp b/third_party/WebKit/Source/platform/bindings/V8Binding.cpp
index 783f0cc..4340382 100644
--- a/third_party/WebKit/Source/platform/bindings/V8Binding.cpp
+++ b/third_party/WebKit/Source/platform/bindings/V8Binding.cpp
@@ -41,41 +41,6 @@
              : function;
 }
 
-bool AddHiddenValueToArray(v8::Isolate* isolate,
-                           v8::Local<v8::Object> object,
-                           v8::Local<v8::Value> value,
-                           int array_index) {
-  DCHECK(!value.IsEmpty());
-  v8::Local<v8::Value> array_value = object->GetInternalField(array_index);
-  if (array_value->IsNull() || array_value->IsUndefined()) {
-    array_value = v8::Array::New(isolate);
-    object->SetInternalField(array_index, array_value);
-  }
-
-  v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(array_value);
-  return V8CallBoolean(array->CreateDataProperty(isolate->GetCurrentContext(),
-                                                 array->Length(), value));
-}
-
-void RemoveHiddenValueFromArray(v8::Isolate* isolate,
-                                v8::Local<v8::Object> object,
-                                v8::Local<v8::Value> value,
-                                int array_index) {
-  v8::Local<v8::Value> array_value = object->GetInternalField(array_index);
-  if (!array_value->IsArray())
-    return;
-  v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(array_value);
-  for (int i = array->Length() - 1; i >= 0; --i) {
-    v8::Local<v8::Value> item;
-    if (!array->Get(isolate->GetCurrentContext(), i).ToLocal(&item))
-      return;
-    if (item->StrictEquals(value)) {
-      array->Delete(isolate->GetCurrentContext(), i).ToChecked();
-      return;
-    }
-  }
-}
-
 v8::Local<v8::Value> FreezeV8Object(v8::Local<v8::Value> value,
                                     v8::Isolate* isolate) {
   value.As<v8::Object>()
diff --git a/third_party/WebKit/Source/platform/bindings/V8Binding.h b/third_party/WebKit/Source/platform/bindings/V8Binding.h
index 3b350a7..55acc83 100644
--- a/third_party/WebKit/Source/platform/bindings/V8Binding.h
+++ b/third_party/WebKit/Source/platform/bindings/V8Binding.h
@@ -363,17 +363,6 @@
   V8SetReturnValue(info, properties);
 }
 
-// These methods store hidden values into an array that is stored in the
-// internal field of a DOM wrapper.
-PLATFORM_EXPORT bool AddHiddenValueToArray(v8::Isolate*,
-                                           v8::Local<v8::Object>,
-                                           v8::Local<v8::Value>,
-                                           int cache_index);
-PLATFORM_EXPORT void RemoveHiddenValueFromArray(v8::Isolate*,
-                                                v8::Local<v8::Object>,
-                                                v8::Local<v8::Value>,
-                                                int cache_index);
-
 // Freeze a V8 object. The type of the first parameter and the return value is
 // intentionally v8::Value so that this function can wrap ToV8().
 // If the argument isn't an object, this will crash.