<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[208028] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/208028">208028</a></dd>
<dt>Author</dt> <dd>utatane.tea@gmail.com</dd>
<dt>Date</dt> <dd>2016-10-27 20:56:50 -0700 (Thu, 27 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[DOM] Add JSEventType
https://bugs.webkit.org/show_bug.cgi?id=164096

Reviewed by Darin Adler.

Event is inherited by many Event classes. But, Event's accessors and interfaces are
frequently called. For example, event.{type, target, srcElement} for accessors. And
event.stopPropagation() and event.preventDefault() functions.

However, since the user-visible event instance is typically the instance of the subclass,
jsDynamicCast&lt;JSEvent*&gt;() walks several classes before it succeeds. It is costly.

In this patch, we add a new WebCore JSType JSEventType for JSEvent and add a new
function jsEventCast. That supports a super fast cast operation. And it paves the way
for implementing DOM accessors of Event in DOMJIT.

No behavior change.

* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMWrapper.h:
* bindings/js/JSEventCustom.h: Added.
(WebCore::jsEventCast):
* bindings/scripts/CodeGeneratorJS.pm:
(GetJSTypeForNode):
(GenerateHeader):
(GetCastingHelperForThisObject):
* bindings/scripts/test/JS/JSTestEventConstructor.h:
(WebCore::JSTestEventConstructor::createStructure):
* dom/Event.idl:
* domjit/DOMJITHelpers.h:
(WebCore::DOMJIT::branchIfEvent):
(WebCore::DOMJIT::branchIfNotEvent):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMWrapperh">trunk/Source/WebCore/bindings/js/JSDOMWrapper.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h</a></li>
<li><a href="#trunkSourceWebCoredomEventidl">trunk/Source/WebCore/dom/Event.idl</a></li>
<li><a href="#trunkSourceWebCoredomjitDOMJITHelpersh">trunk/Source/WebCore/domjit/DOMJITHelpers.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsjsJSEventCustomh">trunk/Source/WebCore/bindings/js/JSEventCustom.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208027 => 208028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-28 03:55:54 UTC (rev 208027)
+++ trunk/Source/WebCore/ChangeLog        2016-10-28 03:56:50 UTC (rev 208028)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2016-10-27  Yusuke Suzuki  &lt;utatane.tea@gmail.com&gt;
+
+        [DOM] Add JSEventType
+        https://bugs.webkit.org/show_bug.cgi?id=164096
+
+        Reviewed by Darin Adler.
+
+        Event is inherited by many Event classes. But, Event's accessors and interfaces are
+        frequently called. For example, event.{type, target, srcElement} for accessors. And
+        event.stopPropagation() and event.preventDefault() functions.
+
+        However, since the user-visible event instance is typically the instance of the subclass,
+        jsDynamicCast&lt;JSEvent*&gt;() walks several classes before it succeeds. It is costly.
+
+        In this patch, we add a new WebCore JSType JSEventType for JSEvent and add a new
+        function jsEventCast. That supports a super fast cast operation. And it paves the way
+        for implementing DOM accessors of Event in DOMJIT.
+
+        No behavior change.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSDOMWrapper.h:
+        * bindings/js/JSEventCustom.h: Added.
+        (WebCore::jsEventCast):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GetJSTypeForNode):
+        (GenerateHeader):
+        (GetCastingHelperForThisObject):
+        * bindings/scripts/test/JS/JSTestEventConstructor.h:
+        (WebCore::JSTestEventConstructor::createStructure):
+        * dom/Event.idl:
+        * domjit/DOMJITHelpers.h:
+        (WebCore::DOMJIT::branchIfEvent):
+        (WebCore::DOMJIT::branchIfNotEvent):
+
</ins><span class="cx"> 2016-10-27  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rename StyleRareNonInheritedData::opacity to m_opacity
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (208027 => 208028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-28 03:55:54 UTC (rev 208027)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-28 03:56:50 UTC (rev 208028)
</span><span class="lines">@@ -6201,6 +6201,7 @@
</span><span class="cx">                 E1FF8F6D180DB5BE00132674 /* CryptoAlgorithmRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF8F6B180DB5BE00132674 /* CryptoAlgorithmRegistry.h */; };
</span><span class="cx">                 E3150EA61DA7219000194012 /* JSNodeDOMJIT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E3AFA9641DA6E908002861BD /* JSNodeDOMJIT.cpp */; };
</span><span class="cx">                 E3150EA71DA7219300194012 /* DOMJITHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = E3150EA51DA7218D00194012 /* DOMJITHelpers.h */; };
</span><ins>+                E3565B7B1DC2D6C900217DBD /* JSEventCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = E34EE49F1DC2D57500EAA9D3 /* JSEventCustom.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 E35CA14D1DBC3A3F00F83516 /* DOMJITAbstractHeapRepository.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E35CA14B1DBC3A3C00F83516 /* DOMJITAbstractHeapRepository.cpp */; };
</span><span class="cx">                 E35CA14E1DBC3A4200F83516 /* DOMJITAbstractHeapRepository.h in Headers */ = {isa = PBXBuildFile; fileRef = E35CA14C1DBC3A3C00F83516 /* DOMJITAbstractHeapRepository.h */; };
</span><span class="cx">                 E377FE4D1DADE16500CDD025 /* NodeConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = E3D049931DADC04500718F3C /* NodeConstants.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -14031,6 +14032,7 @@
</span><span class="cx">                 E1FF8F6A180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmRegistry.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E1FF8F6B180DB5BE00132674 /* CryptoAlgorithmRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRegistry.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E3150EA51DA7218D00194012 /* DOMJITHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMJITHelpers.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                E34EE49F1DC2D57500EAA9D3 /* JSEventCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEventCustom.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E35CA14B1DBC3A3C00F83516 /* DOMJITAbstractHeapRepository.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMJITAbstractHeapRepository.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E35CA14C1DBC3A3C00F83516 /* DOMJITAbstractHeapRepository.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMJITAbstractHeapRepository.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E38838941BAD145F00D62EE3 /* ScriptModuleLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptModuleLoader.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -21609,6 +21611,7 @@
</span><span class="cx">                                 65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */,
</span><span class="cx">                                 F3D461461161D53200CA0D09 /* JSErrorHandler.cpp */,
</span><span class="cx">                                 F3D461471161D53200CA0D09 /* JSErrorHandler.h */,
</span><ins>+                                E34EE49F1DC2D57500EAA9D3 /* JSEventCustom.h */,
</ins><span class="cx">                                 BC60901E0E91B8EC000C68B5 /* JSEventTargetCustom.cpp */,
</span><span class="cx">                                 46B63F6B1C6E8CDF002E914B /* JSEventTargetCustom.h */,
</span><span class="cx">                                 3314ACE910892086000F0E56 /* JSExceptionBase.cpp */,
</span><span class="lines">@@ -25506,6 +25509,7 @@
</span><span class="cx">                                 B885E8D511E06DD2009FFBF4 /* InspectorApplicationCacheAgent.h in Headers */,
</span><span class="cx">                                 1C81B95C0E97330800266E07 /* InspectorClient.h in Headers */,
</span><span class="cx">                                 1C81B95A0E97330800266E07 /* InspectorController.h in Headers */,
</span><ins>+                                E3565B7B1DC2D6C900217DBD /* JSEventCustom.h in Headers */,
</ins><span class="cx">                                 82AB1744124B99EC00C5069D /* InspectorCSSAgent.h in Headers */,
</span><span class="cx">                                 4A9CC82116BF9BB400EC645A /* InspectorCSSOMWrappers.h in Headers */,
</span><span class="cx">                                 7AB0B1C11211A62200A76940 /* InspectorDatabaseAgent.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWrapperh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWrapper.h (208027 => 208028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWrapper.h        2016-10-28 03:55:54 UTC (rev 208027)
+++ trunk/Source/WebCore/bindings/js/JSDOMWrapper.h        2016-10-28 03:56:50 UTC (rev 208028)
</span><span class="lines">@@ -30,13 +30,18 @@
</span><span class="cx"> class JSDOMWindow;
</span><span class="cx"> class ScriptExecutionContext;
</span><span class="cx"> 
</span><del>-// We encode Node type into JSType. The format is the following.
-// offset | 7 | 6 5 4 | 3 2 1 0  |
-// value  | 1 | Kind  | NodeType |
</del><ins>+// JSC allows us to extend JSType. If the highest bit is set, we can add any Object types and they are
+// recognized as OtherObj in JSC. And we encode Node type into JSType if the given JSType is subclass of Node.
+// offset | 7 | 6 | 5   4 | 3   2   1   0  |
+// value  | 1 | 0 |  Non-node DOM types    |
+// If the given JSType is a subclass of Node, the format is the following.
+// offset | 7 | 6 | 5   4 | 3   2   1   0  |
+// value  | 1 | 1 |  Kind |       NodeType |
</ins><span class="cx"> static const uint8_t JSNodeTypeMask                  = 0b00001111;
</span><span class="cx"> 
</span><span class="cx"> static const uint8_t JSDOMWrapperType                = 0b10000000;
</span><del>-static const uint8_t JSNodeType                      = 0b10010000;
</del><ins>+static const uint8_t JSEventType                     = 0b10000001;
+static const uint8_t JSNodeType                      = 0b11000000;
</ins><span class="cx"> static const uint8_t JSTextNodeType                  = JSNodeType | NodeConstants::TEXT_NODE;
</span><span class="cx"> static const uint8_t JSProcessingInstructionNodeType = JSNodeType | NodeConstants::PROCESSING_INSTRUCTION_NODE;
</span><span class="cx"> static const uint8_t JSDocumentTypeNodeType          = JSNodeType | NodeConstants::DOCUMENT_TYPE_NODE;
</span><span class="lines">@@ -45,7 +50,7 @@
</span><span class="cx"> static const uint8_t JSCommentNodeType               = JSNodeType | NodeConstants::COMMENT_NODE;
</span><span class="cx"> static const uint8_t JSCDATASectionNodeType          = JSNodeType | NodeConstants::CDATA_SECTION_NODE;
</span><span class="cx"> static const uint8_t JSAttrNodeType                  = JSNodeType | NodeConstants::ATTRIBUTE_NODE;
</span><del>-static const uint8_t JSElementType                   = 0b10100000 | NodeConstants::ELEMENT_NODE;
</del><ins>+static const uint8_t JSElementType                   = 0b11010000 | NodeConstants::ELEMENT_NODE;
</ins><span class="cx"> 
</span><span class="cx"> static_assert(JSDOMWrapperType &gt; JSC::LastJSCObjectType, &quot;JSC::JSType offers the highest bit.&quot;);
</span><span class="cx"> static_assert(NodeConstants::LastNodeType &lt;= JSNodeTypeMask, &quot;NodeType should be represented in 4bit.&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSEventCustomh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/js/JSEventCustom.h (0 => 208028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSEventCustom.h                                (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSEventCustom.h        2016-10-28 03:56:50 UTC (rev 208028)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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.
+ */
+
+#pragma once
+
+#include &quot;JSDOMBinding.h&quot;
+
+namespace WebCore {
+
+ALWAYS_INLINE JSEvent* jsEventCast(JSC::JSValue value)
+{
+    if (UNLIKELY(!value.isCell()))
+        return nullptr;
+    return value.asCell()-&gt;type() == JSEventType ? JSC::jsCast&lt;JSEvent*&gt;(value) : nullptr;
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (208027 => 208028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-28 03:55:54 UTC (rev 208027)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-28 03:56:50 UTC (rev 208028)
</span><span class="lines">@@ -1216,7 +1216,7 @@
</span><span class="cx"> 
</span><span class="cx"> sub GetJSTypeForNode
</span><span class="cx"> {
</span><del>-    my ($codeGenerator, $interface) = @_;
</del><ins>+    my ($interface) = @_;
</ins><span class="cx"> 
</span><span class="cx">     if ($codeGenerator-&gt;InheritsInterface($interface, &quot;Document&quot;)) {
</span><span class="cx">         return &quot;JSDocumentWrapperType&quot;;
</span><span class="lines">@@ -1446,8 +1446,10 @@
</span><span class="cx">     if (IsDOMGlobalObject($interface)) {
</span><span class="cx">         push(@headerContent, &quot;        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::GlobalObjectType, StructureFlags), info());\n&quot;);
</span><span class="cx">     } elsif ($codeGenerator-&gt;InheritsInterface($interface, &quot;Node&quot;)) {
</span><del>-        my $type = GetJSTypeForNode($codeGenerator, $interface);
</del><ins>+        my $type = GetJSTypeForNode($interface);
</ins><span class="cx">         push(@headerContent, &quot;        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::JSType($type), StructureFlags), info());\n&quot;);
</span><ins>+    } elsif ($codeGenerator-&gt;InheritsInterface($interface, &quot;Event&quot;)) {
+        push(@headerContent, &quot;        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::JSType(JSEventType), StructureFlags), info());\n&quot;);
</ins><span class="cx">     } else {
</span><span class="cx">         push(@headerContent, &quot;        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());\n&quot;);
</span><span class="cx">     }
</span><span class="lines">@@ -2488,6 +2490,7 @@
</span><span class="cx">     return &quot;jsElementCast&quot; if $interfaceName eq &quot;Element&quot;;
</span><span class="cx">     return &quot;jsDocumentCast&quot; if $interfaceName eq &quot;Document&quot;;
</span><span class="cx">     return &quot;jsEventTargetCast&quot; if $interfaceName eq &quot;EventTarget&quot;;
</span><ins>+    return &quot;jsEventCast&quot; if $interfaceName eq &quot;Event&quot;;
</ins><span class="cx">     return &quot;jsDynamicCast&lt;JS$interfaceName*&gt;&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h (208027 => 208028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h        2016-10-28 03:55:54 UTC (rev 208027)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h        2016-10-28 03:56:50 UTC (rev 208028)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> 
</span><span class="cx">     static JSC::Structure* createStructure(JSC::VM&amp; vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
</span><span class="cx">     {
</span><del>-        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
</del><ins>+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::JSType(JSEventType), StructureFlags), info());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static JSC::JSValue getConstructor(JSC::VM&amp;, const JSC::JSGlobalObject*);
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Event.idl (208027 => 208028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Event.idl        2016-10-28 03:55:54 UTC (rev 208027)
+++ trunk/Source/WebCore/dom/Event.idl        2016-10-28 03:56:50 UTC (rev 208028)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx">     CustomToJSObject,
</span><span class="cx">     ExportToWrappedFunction,
</span><span class="cx">     Exposed=(Window,Worker),
</span><ins>+    JSCustomHeader,
</ins><span class="cx"> ] interface Event {
</span><span class="cx">     // PhaseType
</span><span class="cx">     const unsigned short NONE = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoredomjitDOMJITHelpersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/domjit/DOMJITHelpers.h (208027 => 208028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/domjit/DOMJITHelpers.h        2016-10-28 03:55:54 UTC (rev 208027)
+++ trunk/Source/WebCore/domjit/DOMJITHelpers.h        2016-10-28 03:56:50 UTC (rev 208028)
</span><span class="lines">@@ -98,6 +98,16 @@
</span><span class="cx">         CCallHelpers::TrustedImm32(JSC::JSType(JSDOMWrapperType)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+inline CCallHelpers::Jump branchIfEvent(CCallHelpers&amp; jit, GPRReg target)
+{
+    return jit.branchIfType(target, JSC::JSType(JSEventType));
+}
+
+inline CCallHelpers::Jump branchIfNotEvent(CCallHelpers&amp; jit, GPRReg target)
+{
+    return jit.branchIfNotType(target, JSC::JSType(JSEventType));
+}
+
</ins><span class="cx"> inline CCallHelpers::Jump branchIfNode(CCallHelpers&amp; jit, GPRReg target)
</span><span class="cx"> {
</span><span class="cx">     return jit.branch8(
</span></span></pre>
</div>
</div>

</body>
</html>