<!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>[165521] trunk/Source</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/165521">165521</a></dd>
<dt>Author</dt> <dd>bburg@apple.com</dd>
<dt>Date</dt> <dd>2014-03-12 17:41:58 -0700 (Wed, 12 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Replay: add infrastructure for memoizing nondeterministic DOM APIs
https://bugs.webkit.org/show_bug.cgi?id=129445

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

There was a bug in the replay inputs code generator that would include
headers for definitions of enum classes, even though they can be safely
forward-declared.

* replay/scripts/CodeGeneratorReplayInputs.py:
(Generator.generate_includes): Only include for copy constructor if the
type is a heavy scalar (i.e., String, URL), not a normal scalar
(i.e., int, double, enum classes).

(Generator.generate_type_forward_declarations): Forward-declare scalars
that are enums or enum classes.

Source/WebCore:

Add two pieces of infrastructure to support memoization of selected DOM APIs.

The first piece is MemoizedDOMResult, a templated replay input class that knows
how to serialize a DOM API's return value, ctype, and exception code.

The second piece is the addition of a new IDL attribute called `Nondeterministic`.
When placed on a DOM function or attribute, the code generator will emit code
to save the DOM API's return value or use a memoized return value instead,
depending on the current replay state. This new emitted code path is behind
a feature flag.

No new tests, as no new inputs are addressed by this change. Per-DOM API replay
regression tests will be added when those APIs are marked as nondeterministic.

* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm: Add support of the `Nondeterministic` attribute.
(GenerateImplementation): Handle cases for attributes and getters with exceptions.
(GenerateImplementationFunctionCall): Handle function calls with and without exceptions.
(GetNativeTypeForMemoization): Added. Converts DOMString to WTF::String.
* bindings/scripts/IDLAttributes.txt: Add new `Nondeterministic` attribute.
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::jsTestEventTargetPrototypeFunctionItem):
(WebCore::jsTestEventTargetPrototypeFunctionDispatchEvent):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
(WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjAttrWithGetterException):
(WebCore::jsTestObjStringAttrWithGetterException):
(WebCore::jsTestObjWithScriptStateAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::jsTestObjNullableStringValue):
(WebCore::jsTestObjPrototypeFunctionByteMethod):
(WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionOctetMethod):
(WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionLongMethod):
(WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionObjMethod):
(WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionMethodReturningSequence):
(WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
(WebCore::jsTestObjPrototypeFunctionWithScriptStateObj):
(WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
(WebCore::jsTestObjPrototypeFunctionConditionalMethod1):
(WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
(WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
(WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
(WebCore::jsTestObjPrototypeFunctionGetSVGDocument):
(WebCore::jsTestObjPrototypeFunctionMutablePointFunction):
(WebCore::jsTestObjPrototypeFunctionImmutablePointFunction):
(WebCore::jsTestObjPrototypeFunctionStrictFunction):
(WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
(WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsAttrWithGetterException):
(WebCore::jsTestTypedefsStringAttrWithGetterException):
(WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
(WebCore::jsTestTypedefsPrototypeFunctionImmutablePointFunction):
(WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction):
(WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction2):
(WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude):

* replay/AllReplayInputs.h:
* replay/MemoizedDOMResult.cpp: Added.
(WebCore::MemoizedDOMResultBase::type):
(WebCore::MemoizedDOMResultBase::createFromEncodedResult):
(InputTraits&lt;MemoizedDOMResultBase&gt;::type):
(InputTraits&lt;MemoizedDOMResultBase&gt;::encode):
(InputTraits&lt;MemoizedDOMResultBase&gt;::decode):

* replay/MemoizedDOMResult.h: Added. Every specialization of MemoizedDOMResult&lt;T&gt;
stores a binding name, ctype, result value of type T, and optional exception code.
The ctype-specific code uses the CTypeTraits struct to abstract over enum names and
compiler types. The actual encode/decode methods just use methods from EncodingTraits&lt;T&gt;.

(WebCore::MemoizedDOMResultBase::MemoizedDOMResultBase):
(WebCore::MemoizedDOMResultBase::~MemoizedDOMResultBase):
(WebCore::MemoizedDOMResultBase::attribute):
(WebCore::MemoizedDOMResultBase::ctype):
(WebCore::MemoizedDOMResultBase::exceptionCode):
(WebCore::CTypeTraits::decode):
(WebCore::MemoizedDOMResultBase::convertTo):
(JSC::InputTraits&lt;MemoizedDOMResultBase&gt;::queue):
* replay/ReplayInputTypes.cpp: See below.
(WebCore::ReplayInputTypes::ReplayInputTypes):
* replay/ReplayInputTypes.h: See below.
* replay/SerializationMethods.cpp: We need to special-case the encoding
and decoding of MemoizedDOMResult inputs because the input is not part of
the generated per-framework replay inputs enum.
(JSC::EncodingTraits&lt;NondeterministicInputBase&gt;::encodeValue):
(JSC::EncodingTraits&lt;NondeterministicInputBase&gt;::decodeValue):

* replay/WebInputs.json: Add the EncodedCType enum as an external enum type,
so that we can use a generated EncodingTraits specialization to encode the enum.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorereplayscriptsCodeGeneratorReplayInputspy">trunk/Source/JavaScriptCore/replay/scripts/CodeGeneratorReplayInputs.py</a></li>
<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="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLAttributestxt">trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp</a></li>
<li><a href="#trunkSourceWebCorereplayAllReplayInputsh">trunk/Source/WebCore/replay/AllReplayInputs.h</a></li>
<li><a href="#trunkSourceWebCorereplayReplayInputTypescpp">trunk/Source/WebCore/replay/ReplayInputTypes.cpp</a></li>
<li><a href="#trunkSourceWebCorereplayReplayInputTypesh">trunk/Source/WebCore/replay/ReplayInputTypes.h</a></li>
<li><a href="#trunkSourceWebCorereplaySerializationMethodscpp">trunk/Source/WebCore/replay/SerializationMethods.cpp</a></li>
<li><a href="#trunkSourceWebCorereplayWebInputsjson">trunk/Source/WebCore/replay/WebInputs.json</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorereplayMemoizedDOMResultcpp">trunk/Source/WebCore/replay/MemoizedDOMResult.cpp</a></li>
<li><a href="#trunkSourceWebCorereplayMemoizedDOMResulth">trunk/Source/WebCore/replay/MemoizedDOMResult.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (165520 => 165521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-03-13 00:38:38 UTC (rev 165520)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-03-13 00:41:58 UTC (rev 165521)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2014-03-12  Brian Burg  &lt;bburg@apple.com&gt;
+
+        Web Replay: add infrastructure for memoizing nondeterministic DOM APIs
+        https://bugs.webkit.org/show_bug.cgi?id=129445
+
+        Reviewed by Timothy Hatcher.
+
+        There was a bug in the replay inputs code generator that would include
+        headers for definitions of enum classes, even though they can be safely
+        forward-declared.
+
+        * replay/scripts/CodeGeneratorReplayInputs.py:
+        (Generator.generate_includes): Only include for copy constructor if the
+        type is a heavy scalar (i.e., String, URL), not a normal scalar
+        (i.e., int, double, enum classes).
+
+        (Generator.generate_type_forward_declarations): Forward-declare scalars
+        that are enums or enum classes.
+
</ins><span class="cx"> 2014-03-12  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Disable REMOTE_INSPECTOR in earlier OS X releases
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorereplayscriptsCodeGeneratorReplayInputspy"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/replay/scripts/CodeGeneratorReplayInputs.py (165520 => 165521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/replay/scripts/CodeGeneratorReplayInputs.py        2014-03-13 00:38:38 UTC (rev 165520)
+++ trunk/Source/JavaScriptCore/replay/scripts/CodeGeneratorReplayInputs.py        2014-03-13 00:41:58 UTC (rev 165521)
</span><span class="lines">@@ -630,7 +630,7 @@
</span><span class="cx">             # headers with the relevant class declaration.
</span><span class="cx">             include_for_enclosing_class = _type.is_enum() and _type.enclosing_class is not None
</span><span class="cx">             # Include headers for types like URL and String which are copied, not owned or shared.
</span><del>-            include_for_copyable_member = _type.mode is TypeModes.HEAVY_SCALAR or _type.mode is TypeModes.SCALAR
</del><ins>+            include_for_copyable_member = _type.mode is TypeModes.HEAVY_SCALAR
</ins><span class="cx">             if (not includes_for_types) ^ (include_for_destructor or include_for_enclosing_class or include_for_copyable_member):
</span><span class="cx">                 continue
</span><span class="cx"> 
</span><span class="lines">@@ -665,8 +665,10 @@
</span><span class="cx">                 continue
</span><span class="cx">             if _type.enclosing_class is not None:
</span><span class="cx">                 continue
</span><del>-            if _type.mode == TypeModes.SCALAR or _type.mode == TypeModes.HEAVY_SCALAR:
</del><ins>+            if _type.mode == TypeModes.HEAVY_SCALAR:
</ins><span class="cx">                 continue
</span><ins>+            if _type.mode == TypeModes.SCALAR and not (_type.is_enum() or _type.is_enum_class()):
+                continue
</ins><span class="cx">             if _type.is_enum():
</span><span class="cx">                 declaration = &quot;enum %s : %s;&quot; % (_type.type_name(), _type.underlying_storage)
</span><span class="cx">             else:
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (165520 => 165521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-13 00:38:38 UTC (rev 165520)
+++ trunk/Source/WebCore/ChangeLog        2014-03-13 00:41:58 UTC (rev 165521)
</span><span class="lines">@@ -1,3 +1,109 @@
</span><ins>+2014-03-12  Brian Burg  &lt;bburg@apple.com&gt;
+
+        Web Replay: add infrastructure for memoizing nondeterministic DOM APIs
+        https://bugs.webkit.org/show_bug.cgi?id=129445
+
+        Reviewed by Timothy Hatcher.
+
+        Add two pieces of infrastructure to support memoization of selected DOM APIs.
+
+        The first piece is MemoizedDOMResult, a templated replay input class that knows
+        how to serialize a DOM API's return value, ctype, and exception code.
+
+        The second piece is the addition of a new IDL attribute called `Nondeterministic`.
+        When placed on a DOM function or attribute, the code generator will emit code
+        to save the DOM API's return value or use a memoized return value instead,
+        depending on the current replay state. This new emitted code path is behind
+        a feature flag.
+
+        No new tests, as no new inputs are addressed by this change. Per-DOM API replay
+        regression tests will be added when those APIs are marked as nondeterministic.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/scripts/CodeGeneratorJS.pm: Add support of the `Nondeterministic` attribute.
+        (GenerateImplementation): Handle cases for attributes and getters with exceptions.
+        (GenerateImplementationFunctionCall): Handle function calls with and without exceptions.
+        (GetNativeTypeForMemoization): Added. Converts DOMString to WTF::String.
+        * bindings/scripts/IDLAttributes.txt: Add new `Nondeterministic` attribute.
+        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
+        (WebCore::jsTestEventTargetPrototypeFunctionItem):
+        (WebCore::jsTestEventTargetPrototypeFunctionDispatchEvent):
+        * bindings/scripts/test/JS/JSTestInterface.cpp:
+        (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
+        (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::jsTestObjAttrWithGetterException):
+        (WebCore::jsTestObjStringAttrWithGetterException):
+        (WebCore::jsTestObjWithScriptStateAttributeRaises):
+        (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
+        (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
+        (WebCore::jsTestObjNullableStringValue):
+        (WebCore::jsTestObjPrototypeFunctionByteMethod):
+        (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
+        (WebCore::jsTestObjPrototypeFunctionOctetMethod):
+        (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
+        (WebCore::jsTestObjPrototypeFunctionLongMethod):
+        (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
+        (WebCore::jsTestObjPrototypeFunctionObjMethod):
+        (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
+        (WebCore::jsTestObjPrototypeFunctionMethodReturningSequence):
+        (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
+        (WebCore::jsTestObjPrototypeFunctionWithScriptStateObj):
+        (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException):
+        (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
+        (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
+        (WebCore::jsTestObjPrototypeFunctionConditionalMethod1):
+        (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
+        (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
+        (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
+        (WebCore::jsTestObjPrototypeFunctionGetSVGDocument):
+        (WebCore::jsTestObjPrototypeFunctionMutablePointFunction):
+        (WebCore::jsTestObjPrototypeFunctionImmutablePointFunction):
+        (WebCore::jsTestObjPrototypeFunctionStrictFunction):
+        (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
+        (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        (WebCore::jsTestTypedefsAttrWithGetterException):
+        (WebCore::jsTestTypedefsStringAttrWithGetterException):
+        (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
+        (WebCore::jsTestTypedefsPrototypeFunctionImmutablePointFunction):
+        (WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction):
+        (WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction2):
+        (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude):
+
+        * replay/AllReplayInputs.h:
+        * replay/MemoizedDOMResult.cpp: Added.
+        (WebCore::MemoizedDOMResultBase::type):
+        (WebCore::MemoizedDOMResultBase::createFromEncodedResult):
+        (InputTraits&lt;MemoizedDOMResultBase&gt;::type):
+        (InputTraits&lt;MemoizedDOMResultBase&gt;::encode):
+        (InputTraits&lt;MemoizedDOMResultBase&gt;::decode):
+
+        * replay/MemoizedDOMResult.h: Added. Every specialization of MemoizedDOMResult&lt;T&gt;
+        stores a binding name, ctype, result value of type T, and optional exception code.
+        The ctype-specific code uses the CTypeTraits struct to abstract over enum names and
+        compiler types. The actual encode/decode methods just use methods from EncodingTraits&lt;T&gt;.
+
+        (WebCore::MemoizedDOMResultBase::MemoizedDOMResultBase):
+        (WebCore::MemoizedDOMResultBase::~MemoizedDOMResultBase):
+        (WebCore::MemoizedDOMResultBase::attribute):
+        (WebCore::MemoizedDOMResultBase::ctype):
+        (WebCore::MemoizedDOMResultBase::exceptionCode):
+        (WebCore::CTypeTraits::decode):
+        (WebCore::MemoizedDOMResultBase::convertTo):
+        (JSC::InputTraits&lt;MemoizedDOMResultBase&gt;::queue):
+        * replay/ReplayInputTypes.cpp: See below.
+        (WebCore::ReplayInputTypes::ReplayInputTypes):
+        * replay/ReplayInputTypes.h: See below.
+        * replay/SerializationMethods.cpp: We need to special-case the encoding
+        and decoding of MemoizedDOMResult inputs because the input is not part of
+        the generated per-framework replay inputs enum.
+        (JSC::EncodingTraits&lt;NondeterministicInputBase&gt;::encodeValue):
+        (JSC::EncodingTraits&lt;NondeterministicInputBase&gt;::decodeValue):
+
+        * replay/WebInputs.json: Add the EncodedCType enum as an external enum type,
+        so that we can use a generated EncodingTraits specialization to encode the enum.
+
</ins><span class="cx"> 2014-03-11  Jae Hyun Park  &lt;jaepark@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Make HTMLCanvasElement::is3D private
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (165520 => 165521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-03-13 00:38:38 UTC (rev 165520)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-03-13 00:41:58 UTC (rev 165521)
</span><span class="lines">@@ -3510,6 +3510,8 @@
</span><span class="cx">                 990A1A0518ADA48400183FD1 /* ReplayInputTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 990A19F518ADA48400183FD1 /* ReplayInputTypes.h */; };
</span><span class="cx">                 9920398218B95BC600B39AF9 /* UserInputBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9920398018B95BC600B39AF9 /* UserInputBridge.cpp */; };
</span><span class="cx">                 9920398318B95BC600B39AF9 /* UserInputBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 9920398118B95BC600B39AF9 /* UserInputBridge.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                99C7CCB318C663E40032E413 /* MemoizedDOMResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 99C7CCB218C663E40032E413 /* MemoizedDOMResult.h */; };
+                99C7CCB518C6B8990032E413 /* MemoizedDOMResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99C7CCB418C6B8990032E413 /* MemoizedDOMResult.cpp */; };
</ins><span class="cx">                 99CC0B4D18BE9849006CEBCC /* AllReplayInputs.h in Headers */ = {isa = PBXBuildFile; fileRef = 99CC0B3818BE9849006CEBCC /* AllReplayInputs.h */; };
</span><span class="cx">                 99CC0B4E18BE9849006CEBCC /* CapturingInputCursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99CC0B3918BE9849006CEBCC /* CapturingInputCursor.cpp */; };
</span><span class="cx">                 99CC0B4F18BE9849006CEBCC /* CapturingInputCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 99CC0B3A18BE9849006CEBCC /* CapturingInputCursor.h */; };
</span><span class="lines">@@ -10512,6 +10514,8 @@
</span><span class="cx">                 990A19F518ADA48400183FD1 /* ReplayInputTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReplayInputTypes.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9920398018B95BC600B39AF9 /* UserInputBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserInputBridge.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9920398118B95BC600B39AF9 /* UserInputBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInputBridge.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                99C7CCB218C663E40032E413 /* MemoizedDOMResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoizedDOMResult.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                99C7CCB418C6B8990032E413 /* MemoizedDOMResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoizedDOMResult.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 99CC0B3818BE9849006CEBCC /* AllReplayInputs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AllReplayInputs.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 99CC0B3918BE9849006CEBCC /* CapturingInputCursor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CapturingInputCursor.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 99CC0B3A18BE9849006CEBCC /* CapturingInputCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CapturingInputCursor.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -17935,6 +17939,8 @@
</span><span class="cx">                                 99CC0B3B18BE9849006CEBCC /* EventLoopInputDispatcher.cpp */,
</span><span class="cx">                                 99CC0B3C18BE9849006CEBCC /* EventLoopInputDispatcher.h */,
</span><span class="cx">                                 99CC0B3D18BE9849006CEBCC /* FunctorInputCursor.h */,
</span><ins>+                                99C7CCB418C6B8990032E413 /* MemoizedDOMResult.cpp */,
+                                99C7CCB218C663E40032E413 /* MemoizedDOMResult.h */,
</ins><span class="cx">                                 99CC0B3E18BE9849006CEBCC /* ReplayController.cpp */,
</span><span class="cx">                                 99CC0B3F18BE9849006CEBCC /* ReplayController.h */,
</span><span class="cx">                                 99CC0B4018BE9849006CEBCC /* ReplayingInputCursor.cpp */,
</span><span class="lines">@@ -23846,6 +23852,7 @@
</span><span class="cx">                                 977B386C122883E900B81FF8 /* HTMLEntitySearch.h in Headers */,
</span><span class="cx">                                 977B386D122883E900B81FF8 /* HTMLEntityTable.h in Headers */,
</span><span class="cx">                                 A81369D4097374F600D74463 /* HTMLFieldSetElement.h in Headers */,
</span><ins>+                                99C7CCB318C663E40032E413 /* MemoizedDOMResult.h in Headers */,
</ins><span class="cx">                                 A8CFF7A60A156978000A4234 /* HTMLFontElement.h in Headers */,
</span><span class="cx">                                 977B386F122883E900B81FF8 /* HTMLFormattingElementList.h in Headers */,
</span><span class="cx">                                 A81369CE097374F600D74463 /* HTMLFormControlElement.h in Headers */,
</span><span class="lines">@@ -28905,6 +28912,7 @@
</span><span class="cx">                                 B237C8A70D344D110013F707 /* SVGFontData.cpp in Sources */,
</span><span class="cx">                                 B2A1F2AA0CEF0ABF00442F6A /* SVGFontElement.cpp in Sources */,
</span><span class="cx">                                 B2227A140D00BF220071B782 /* SVGFontFaceElement.cpp in Sources */,
</span><ins>+                                99C7CCB518C6B8990032E413 /* MemoizedDOMResult.cpp in Sources */,
</ins><span class="cx">                                 B2227A170D00BF220071B782 /* SVGFontFaceFormatElement.cpp in Sources */,
</span><span class="cx">                                 B2227A1A0D00BF220071B782 /* SVGFontFaceNameElement.cpp in Sources */,
</span><span class="cx">                                 B2227A1D0D00BF220071B782 /* SVGFontFaceSrcElement.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (165520 => 165521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2014-03-13 00:38:38 UTC (rev 165520)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2014-03-13 00:41:58 UTC (rev 165521)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> # Copyright (C) 2006 Anders Carlsson &lt;andersca@mac.com&gt;
</span><span class="cx"> # Copyright (C) 2006, 2007 Samuel Weinig &lt;sam@webkit.org&gt;
</span><span class="cx"> # Copyright (C) 2006 Alexey Proskuryakov &lt;ap@webkit.org&gt;
</span><del>-# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
</del><ins>+# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx"> # Copyright (C) 2009 Cameron McCormack &lt;cam@mcc.id.au&gt;
</span><span class="cx"> # Copyright (C) Research In Motion Limited 2010. All rights reserved.
</span><span class="cx"> # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="lines">@@ -2118,6 +2118,7 @@
</span><span class="cx">             $codeGenerator-&gt;AssertNotSequenceType($type);
</span><span class="cx">             my $getFunctionName = GetAttributeGetterName($interfaceName, $className, $attribute);
</span><span class="cx">             my $implGetterFunctionName = $codeGenerator-&gt;WK_lcfirst($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;ImplementedAs&quot;} || $name);
</span><ins>+            my $getterExceptions = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;GetterRaisesException&quot;};
</ins><span class="cx"> 
</span><span class="cx">             my $attributeConditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute-&gt;signature);
</span><span class="cx">             push(@implContent, &quot;#if ${attributeConditionalString}\n&quot;) if $attributeConditionalString;
</span><span class="lines">@@ -2151,6 +2152,12 @@
</span><span class="cx">                 push(@implContent, &quot;    UNUSED_PARAM(slotBase);\n&quot;);
</span><span class="cx">             }
</span><span class="cx"> 
</span><ins>+            my @arguments = ();
+            if ($getterExceptions &amp;&amp; !HasCustomGetter($attribute-&gt;signature-&gt;extendedAttributes)) {
+                push(@arguments, &quot;ec&quot;);
+                push(@implContent, &quot;    ExceptionCode ec = 0;\n&quot;);
+            }
+
</ins><span class="cx">             # Global constructors can be disabled at runtime.
</span><span class="cx">             if ($attribute-&gt;signature-&gt;type =~ /Constructor$/) {
</span><span class="cx">                 if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;EnabledAtRuntime&quot;}) {
</span><span class="lines">@@ -2181,6 +2188,38 @@
</span><span class="cx">                 push(@implContent, &quot;        return JSValue::encode(jsUndefined());\n&quot;);
</span><span class="cx">             }
</span><span class="cx"> 
</span><ins>+            if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Nondeterministic&quot;}) {
+                $implIncludes{&quot;&lt;replay/InputCursor.h&gt;&quot;} = 1;
+                push(@implContent, &quot;#if ENABLE(WEB_REPLAY)\n&quot;);
+                push(@implContent, &quot;    JSGlobalObject* globalObject = exec-&gt;lexicalGlobalObject();\n&quot;);
+                push(@implContent, &quot;    InputCursor&amp; cursor = globalObject-&gt;inputCursor();\n&quot;);
+
+                $implIncludes{&quot;MemoizedDOMResult.h&quot;} = 1;
+                my $nativeType = GetNativeType($type);
+                my $memoizedType = GetNativeTypeForMemoization($type);
+                my $exceptionCode = $getterExceptions ? &quot;ec&quot; : &quot;0&quot;;
+                push(@implContent, &quot;    DEFINE_STATIC_LOCAL(const AtomicString, bindingName, (\&quot;$interfaceName.$name\&quot;, AtomicString::ConstructFromLiteral));\n&quot;);
+                push(@implContent, &quot;    if (cursor.isCapturing()) {\n&quot;);
+                push(@implContent, &quot;        $memoizedType memoizedResult = castedThis-&gt;impl().$implGetterFunctionName(&quot; . join(&quot;, &quot;, @arguments) . &quot;);\n&quot;);
+                push(@implContent, &quot;        cursor.appendInput&lt;MemoizedDOMResult&lt;$memoizedType&gt;&gt;(bindingName, memoizedResult, $exceptionCode);\n&quot;);
+                push(@implContent, &quot;        JSValue result = &quot; . NativeToJSValue($attribute-&gt;signature, 0, $interfaceName, &quot;memoizedResult&quot;, &quot;castedThis&quot;) . &quot;;\n&quot;);
+                push(@implContent, &quot;        setDOMException(exec, ec);\n&quot;) if $getterExceptions;
+                push(@implContent, &quot;        return JSValue::encode(result);\n&quot;);
+                push(@implContent, &quot;     }\n&quot;);
+                push(@implContent, &quot;\n&quot;);
+                push(@implContent, &quot;     if (cursor.isReplaying()) {\n&quot;);
+                push(@implContent, &quot;        $memoizedType memoizedResult;\n&quot;);
+                push(@implContent, &quot;        MemoizedDOMResultBase* input = cursor.fetchInput&lt;MemoizedDOMResultBase&gt;();\n&quot;);
+                push(@implContent, &quot;        if (input &amp;&amp; input-&gt;convertTo&lt;$memoizedType&gt;(memoizedResult)) {\n&quot;);
+                # FIXME: the generated code should report an error if an input cannot be fetched or converted.
+                push(@implContent, &quot;            JSValue result = &quot; . NativeToJSValue($attribute-&gt;signature, 0, $interfaceName, &quot;memoizedResult&quot;, &quot;castedThis&quot;) . &quot;;\n&quot;);
+                push(@implContent, &quot;            setDOMException(exec, input-&gt;exceptionCode());\n&quot;) if $getterExceptions;
+                push(@implContent, &quot;            return JSValue::encode(result);\n&quot;);
+                push(@implContent, &quot;        }\n&quot;);
+                push(@implContent, &quot;    }\n&quot;);
+                push(@implContent, &quot;#endif\n&quot;);
+            } # attribute Nondeterministic
+
</ins><span class="cx">             if (HasCustomGetter($attribute-&gt;signature-&gt;extendedAttributes)) {
</span><span class="cx">                 push(@implContent, &quot;    return JSValue::encode(castedThis-&gt;$implGetterFunctionName(exec));\n&quot;);
</span><span class="cx">             } elsif ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;CheckSecurityForNode&quot;}) {
</span><span class="lines">@@ -2273,9 +2312,6 @@
</span><span class="cx">                 push(@implContent, &quot;    return JSValue::encode(result);\n&quot;);
</span><span class="cx"> 
</span><span class="cx">             } else {
</span><del>-                my @arguments = (&quot;ec&quot;);
-                push(@implContent, &quot;    ExceptionCode ec = 0;\n&quot;);
-
</del><span class="cx">                 if ($isNullable) {
</span><span class="cx">                     push(@implContent, &quot;    bool isNull = false;\n&quot;);
</span><span class="cx">                     unshift(@arguments, &quot;isNull&quot;);
</span><span class="lines">@@ -2285,10 +2321,10 @@
</span><span class="cx"> 
</span><span class="cx">                 if ($svgPropertyOrListPropertyType) {
</span><span class="cx">                     push(@implContent, &quot;    $svgPropertyOrListPropertyType impl(*castedThis-&gt;impl());\n&quot;);
</span><del>-                    push(@implContent, &quot;    JSC::JSValue result = &quot; . NativeToJSValue($attribute-&gt;signature, 0, $interfaceName, &quot;impl.$implGetterFunctionName(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;, &quot;castedThis&quot;) . &quot;;\n&quot;);
</del><ins>+                    push(@implContent, &quot;    JSValue result = &quot; . NativeToJSValue($attribute-&gt;signature, 0, $interfaceName, &quot;impl.$implGetterFunctionName(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;, &quot;castedThis&quot;) . &quot;;\n&quot;);
</ins><span class="cx">                 } else {
</span><span class="cx">                     push(@implContent, &quot;    $interfaceName&amp; impl = castedThis-&gt;impl();\n&quot;);
</span><del>-                    push(@implContent, &quot;    JSC::JSValue result = &quot; . NativeToJSValue($attribute-&gt;signature, 0, $interfaceName, &quot;impl.$implGetterFunctionName(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;, &quot;castedThis&quot;) . &quot;;\n&quot;);
</del><ins>+                    push(@implContent, &quot;    JSValue result = &quot; . NativeToJSValue($attribute-&gt;signature, 0, $interfaceName, &quot;impl.$implGetterFunctionName(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;, &quot;castedThis&quot;) . &quot;;\n&quot;);
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 if ($isNullable) {
</span><span class="lines">@@ -3501,11 +3537,26 @@
</span><span class="cx">     my $svgPropertyType = shift;
</span><span class="cx">     my $interfaceName = shift;
</span><span class="cx"> 
</span><ins>+    my $nondeterministic = $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Nondeterministic&quot;};
</ins><span class="cx">     my $raisesException = $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;RaisesException&quot;};
</span><span class="cx"> 
</span><span class="cx">     if ($function-&gt;signature-&gt;type eq &quot;void&quot;) {
</span><del>-        push(@implContent, $indent . &quot;$functionString;\n&quot;);
-        push(@implContent, $indent . &quot;setDOMException(exec, ec);\n&quot;) if $raisesException;
</del><ins>+        if ($nondeterministic) {
+            $implIncludes{&quot;&lt;replay/InputCursor.h&gt;&quot;} = 1;
+            push(@implContent, &quot;#if ENABLE(WEB_REPLAY)\n&quot;);
+            push(@implContent, $indent . &quot;InputCursor&amp; cursor = exec-&gt;lexicalGlobalObject()-&gt;inputCursor();\n&quot;);
+            push(@implContent, $indent . &quot;if (!cursor.isReplaying()) {\n&quot;);
+            push(@implContent, $indent . &quot;    $functionString;\n&quot;);
+            push(@implContent, $indent . &quot;    setDOMException(exec, ec);\n&quot;) if $raisesException;
+            push(@implContent, $indent . &quot;}\n&quot;);
+            push(@implContent, &quot;#else\n&quot;);
+            push(@implContent, $indent . &quot;$functionString;\n&quot;);
+            push(@implContent, $indent . &quot;setDOMException(exec, ec);\n&quot;) if $raisesException;
+            push(@implContent, &quot;#endif\n&quot;);
+        } else {
+            push(@implContent, $indent . &quot;$functionString;\n&quot;);
+            push(@implContent, $indent . &quot;setDOMException(exec, ec);\n&quot;) if $raisesException;
+        }
</ins><span class="cx"> 
</span><span class="cx">         if ($svgPropertyType and !$function-&gt;isStatic) {
</span><span class="cx">             if ($raisesException) {
</span><span class="lines">@@ -3519,8 +3570,39 @@
</span><span class="cx">         push(@implContent, $indent . &quot;return JSValue::encode(jsUndefined());\n&quot;);
</span><span class="cx">     } else {
</span><span class="cx">         my $thisObject = $function-&gt;isStatic ? 0 : &quot;castedThis&quot;;
</span><del>-        push(@implContent, &quot;\n&quot; . $indent . &quot;JSC::JSValue result = &quot; . NativeToJSValue($function-&gt;signature, 1, $interfaceName, $functionString, $thisObject) . &quot;;\n&quot;);
-        push(@implContent, $indent . &quot;setDOMException(exec, ec);\n&quot;) if $raisesException;
</del><ins>+        if ($nondeterministic) {
+            $implIncludes{&quot;MemoizedDOMResult.h&quot;} = 1;
+            $implIncludes{&quot;&lt;replay/InputCursor.h&gt;&quot;} = 1;
+            my $nativeType = GetNativeTypeFromSignature($function-&gt;signature);
+            my $memoizedType = GetNativeTypeForMemoization($function-&gt;signature-&gt;type);
+            my $bindingName = $interfaceName . &quot;.&quot; . $function-&gt;signature-&gt;name;
+            push(@implContent, $indent . &quot;JSValue result;\n&quot;);
+            push(@implContent, &quot;#if ENABLE(WEB_REPLAY)\n&quot;);
+            push(@implContent, $indent . &quot;InputCursor&amp; cursor = exec-&gt;lexicalGlobalObject()-&gt;inputCursor();\n&quot;);
+            push(@implContent, $indent . &quot;DEFINE_STATIC_LOCAL(const AtomicString, bindingName, (\&quot;$bindingName\&quot;, AtomicString::ConstructFromLiteral));\n&quot;);
+            push(@implContent, $indent . &quot;if (cursor.isCapturing()) {\n&quot;);
+            push(@implContent, $indent . &quot;    $nativeType memoizedResult = $functionString;\n&quot;);
+            my $exceptionCode = $raisesException ? &quot;ec&quot; : &quot;0&quot;;
+            push(@implContent, $indent . &quot;    cursor.appendInput&lt;MemoizedDOMResult&lt;$memoizedType&gt;&gt;(bindingName, memoizedResult, $exceptionCode);\n&quot;);
+            push(@implContent, $indent . &quot;    result = &quot; . NativeToJSValue($function-&gt;signature, 1, $interfaceName, &quot;memoizedResult&quot;, $thisObject) . &quot;;\n&quot;);
+            push(@implContent, $indent . &quot;} else if (cursor.isReplaying()) {\n&quot;);
+            push(@implContent, $indent . &quot;    MemoizedDOMResultBase* input = cursor.fetchInput&lt;MemoizedDOMResultBase&gt;();\n&quot;);
+            push(@implContent, $indent . &quot;    $memoizedType memoizedResult;\n&quot;);
+            # FIXME: the generated code should report an error if an input cannot be fetched or converted.
+            push(@implContent, $indent . &quot;    if (input &amp;&amp; input-&gt;convertTo&lt;$memoizedType&gt;(memoizedResult)) {\n&quot;);
+            push(@implContent, $indent . &quot;        result = &quot; . NativeToJSValue($function-&gt;signature, 1, $interfaceName, &quot;memoizedResult&quot;, $thisObject) . &quot;;\n&quot;);
+            push(@implContent, $indent . &quot;        ec = input-&gt;exceptionCode();\n&quot;) if $raisesException;
+            push(@implContent, $indent . &quot;    } else\n&quot;);
+            push(@implContent, $indent . &quot;        result = &quot; . NativeToJSValue($function-&gt;signature, 1, $interfaceName, $functionString, $thisObject) . &quot;;\n&quot;);
+            push(@implContent, $indent . &quot;} else\n&quot;);
+            push(@implContent, $indent . &quot;    result = &quot; . NativeToJSValue($function-&gt;signature, 1, $interfaceName, $functionString, $thisObject) . &quot;;\n&quot;);
+            push(@implContent, &quot;#else\n&quot;);
+            push(@implContent, $indent . &quot;result = &quot; . NativeToJSValue($function-&gt;signature, 1, $interfaceName, $functionString, $thisObject) . &quot;;\n&quot;);
+            push(@implContent, &quot;#endif\n&quot;);
+        } else {
+            push(@implContent, $indent . &quot;JSValue result = &quot; . NativeToJSValue($function-&gt;signature, 1, $interfaceName, $functionString, $thisObject) . &quot;;\n&quot;);
+        }
+        push(@implContent, &quot;\n&quot; . $indent . &quot;setDOMException(exec, ec);\n&quot;) if $raisesException;
</ins><span class="cx"> 
</span><span class="cx">         if ($codeGenerator-&gt;ExtendedAttributeContains($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;CallWith&quot;}, &quot;ScriptState&quot;)) {
</span><span class="cx">             push(@implContent, $indent . &quot;if (UNLIKELY(exec-&gt;hadException()))\n&quot;);
</span><span class="lines">@@ -3608,6 +3690,14 @@
</span><span class="cx">     return GetNativeType($type);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub GetNativeTypeForMemoization
+{
+    my $type = shift;
+    return &quot;String&quot; if $type eq &quot;DOMString&quot;;
+
+    return GetNativeType($type);
+}
+
</ins><span class="cx"> sub GetSVGPropertyTypes
</span><span class="cx"> {
</span><span class="cx">     my $implType = shift;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLAttributestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (165520 => 165521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2014-03-13 00:38:38 UTC (rev 165520)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2014-03-13 00:41:58 UTC (rev 165521)
</span><span class="lines">@@ -85,6 +85,7 @@
</span><span class="cx"> NamedConstructor=*
</span><span class="cx"> NewImpurePropertyFiresWatchpoints
</span><span class="cx"> NoInterfaceObject
</span><ins>+Nondeterministic
</ins><span class="cx"> NotEnumerable
</span><span class="cx"> NotDeletable
</span><span class="cx"> ObjCCustomImplementation
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp (165520 => 165521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2014-03-13 00:38:38 UTC (rev 165520)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2014-03-13 00:41:58 UTC (rev 165521)
</span><span class="lines">@@ -210,8 +210,7 @@
</span><span class="cx">     }
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-
-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.item(index)));
</del><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.item(index)));
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -259,8 +258,8 @@
</span><span class="cx">     Event* evt(toEvent(exec-&gt;argument(0)));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><ins>+    JSValue result = jsBoolean(impl.dispatchEvent(evt, ec));
</ins><span class="cx"> 
</span><del>-    JSC::JSValue result = jsBoolean(impl.dispatchEvent(evt, ec));
</del><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (165520 => 165521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2014-03-13 00:38:38 UTC (rev 165520)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2014-03-13 00:41:58 UTC (rev 165521)
</span><span class="lines">@@ -685,8 +685,8 @@
</span><span class="cx">     TestObj* objArg(toTestObj(exec-&gt;argument(1)));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.implementsMethod2(scriptContext, strArg, objArg, ec)));
</ins><span class="cx"> 
</span><del>-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.implementsMethod2(scriptContext, strArg, objArg, ec)));
</del><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -751,8 +751,8 @@
</span><span class="cx">     TestObj* objArg(toTestObj(exec-&gt;argument(1)));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(TestSupplemental::supplementalMethod2(&amp;impl, scriptContext, strArg, objArg, ec)));
</ins><span class="cx"> 
</span><del>-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(TestSupplemental::supplementalMethod2(&amp;impl, scriptContext, strArg, objArg, ec)));
</del><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (165520 => 165521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2014-03-13 00:38:38 UTC (rev 165520)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2014-03-13 00:41:58 UTC (rev 165521)
</span><span class="lines">@@ -939,7 +939,7 @@
</span><span class="cx">     }
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     TestObj&amp; impl = castedThis-&gt;impl();
</span><del>-    JSC::JSValue result = jsNumber(impl.attrWithGetterException(ec));
</del><ins>+    JSValue result = jsNumber(impl.attrWithGetterException(ec));
</ins><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -978,7 +978,7 @@
</span><span class="cx">     }
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     TestObj&amp; impl = castedThis-&gt;impl();
</span><del>-    JSC::JSValue result = jsStringWithCache(exec, impl.stringAttrWithGetterException(ec));
</del><ins>+    JSValue result = jsStringWithCache(exec, impl.stringAttrWithGetterException(ec));
</ins><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -1072,7 +1072,7 @@
</span><span class="cx">     }
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     TestObj&amp; impl = castedThis-&gt;impl();
</span><del>-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.withScriptStateAttributeRaises(exec, ec)));
</del><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.withScriptStateAttributeRaises(exec, ec)));
</ins><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -1095,7 +1095,7 @@
</span><span class="cx">     if (!scriptContext)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     TestObj&amp; impl = castedThis-&gt;impl();
</span><del>-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.withScriptExecutionContextAttributeRaises(scriptContext, ec)));
</del><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.withScriptExecutionContextAttributeRaises(scriptContext, ec)));
</ins><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -1139,7 +1139,7 @@
</span><span class="cx">     if (!scriptContext)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     TestObj&amp; impl = castedThis-&gt;impl();
</span><del>-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, ec)));
</del><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, ec)));
</ins><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -1658,7 +1658,7 @@
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     bool isNull = false;
</span><span class="cx">     TestObj&amp; impl = castedThis-&gt;impl();
</span><del>-    JSC::JSValue result = jsNumber(impl.nullableStringValue(isNull, ec));
</del><ins>+    JSValue result = jsNumber(impl.nullableStringValue(isNull, ec));
</ins><span class="cx">     if (isNull)
</span><span class="cx">         return JSValue::encode(jsNull());
</span><span class="cx">     setDOMException(exec, ec);
</span><span class="lines">@@ -2673,8 +2673,7 @@
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     TestObj&amp; impl = castedThis-&gt;impl();
</span><del>-
-    JSC::JSValue result = jsNumber(impl.byteMethod());
</del><ins>+    JSValue result = jsNumber(impl.byteMethod());
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2697,8 +2696,7 @@
</span><span class="cx">     TestObj* objArg(toTestObj(exec-&gt;argument(2)));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-
-    JSC::JSValue result = jsNumber(impl.byteMethodWithArgs(byteArg, strArg, objArg));
</del><ins>+    JSValue result = jsNumber(impl.byteMethodWithArgs(byteArg, strArg, objArg));
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2710,8 +2708,7 @@
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     TestObj&amp; impl = castedThis-&gt;impl();
</span><del>-
-    JSC::JSValue result = jsNumber(impl.octetMethod());
</del><ins>+    JSValue result = jsNumber(impl.octetMethod());
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2734,8 +2731,7 @@
</span><span class="cx">     TestObj* objArg(toTestObj(exec-&gt;argument(2)));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-
-    JSC::JSValue result = jsNumber(impl.octetMethodWithArgs(octetArg, strArg, objArg));
</del><ins>+    JSValue result = jsNumber(impl.octetMethodWithArgs(octetArg, strArg, objArg));
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2747,8 +2743,7 @@
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     TestObj&amp; impl = castedThis-&gt;impl();
</span><del>-
-    JSC::JSValue result = jsNumber(impl.longMethod());
</del><ins>+    JSValue result = jsNumber(impl.longMethod());
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2771,8 +2766,7 @@
</span><span class="cx">     TestObj* objArg(toTestObj(exec-&gt;argument(2)));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-
-    JSC::JSValue result = jsNumber(impl.longMethodWithArgs(longArg, strArg, objArg));
</del><ins>+    JSValue result = jsNumber(impl.longMethodWithArgs(longArg, strArg, objArg));
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2784,8 +2778,7 @@
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     TestObj&amp; impl = castedThis-&gt;impl();
</span><del>-
-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.objMethod()));
</del><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.objMethod()));
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2808,8 +2801,7 @@
</span><span class="cx">     TestObj* objArg(toTestObj(exec-&gt;argument(2)));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-
-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.objMethodWithArgs(longArg, strArg, objArg)));
</del><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.objMethodWithArgs(longArg, strArg, objArg)));
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2843,8 +2835,7 @@
</span><span class="cx">     int longArg(toInt32(exec, exec-&gt;argument(0), NormalConversion));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-
-    JSC::JSValue result = jsArray(exec, castedThis-&gt;globalObject(), impl.methodReturningSequence(longArg));
</del><ins>+    JSValue result = jsArray(exec, castedThis-&gt;globalObject(), impl.methodReturningSequence(longArg));
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2884,8 +2875,8 @@
</span><span class="cx">     TestObj* objArg(toTestObj(exec-&gt;argument(1)));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.methodThatRequiresAllArgsAndThrows(strArg, objArg, ec)));
</ins><span class="cx"> 
</span><del>-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.methodThatRequiresAllArgsAndThrows(strArg, objArg, ec)));
</del><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -3011,8 +3002,7 @@
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     TestObj&amp; impl = castedThis-&gt;impl();
</span><del>-
-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.withScriptStateObj(exec)));
</del><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.withScriptStateObj(exec)));
</ins><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(result);
</span><span class="lines">@@ -3041,8 +3031,8 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     TestObj&amp; impl = castedThis-&gt;impl();
</span><span class="cx">     ExceptionCode ec = 0;
</span><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.withScriptStateObjException(exec, ec)));
</ins><span class="cx"> 
</span><del>-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.withScriptStateObjException(exec, ec)));
</del><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -3091,8 +3081,8 @@
</span><span class="cx">     ScriptExecutionContext* scriptContext = jsCast&lt;JSDOMGlobalObject*&gt;(exec-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><span class="cx">     if (!scriptContext)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateObjException(exec, scriptContext, ec)));
</ins><span class="cx"> 
</span><del>-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateObjException(exec, scriptContext, ec)));
</del><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -3110,8 +3100,7 @@
</span><span class="cx">     ScriptExecutionContext* scriptContext = jsCast&lt;JSDOMGlobalObject*&gt;(exec-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><span class="cx">     if (!scriptContext)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-
-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateWithSpaces(exec, scriptContext)));
</del><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateWithSpaces(exec, scriptContext)));
</ins><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(result);
</span><span class="lines">@@ -3353,8 +3342,7 @@
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     TestObj&amp; impl = castedThis-&gt;impl();
</span><del>-
-    JSC::JSValue result = jsStringWithCache(exec, impl.conditionalMethod1());
</del><ins>+    JSValue result = jsStringWithCache(exec, impl.conditionalMethod1());
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3633,16 +3621,14 @@
</span><span class="cx"> 
</span><span class="cx">     size_t argsCount = exec-&gt;argumentCount();
</span><span class="cx">     if (argsCount &lt;= 0) {
</span><del>-
-        JSC::JSValue result = jsNumber(TestObj::classMethodWithOptional());
</del><ins>+        JSValue result = jsNumber(TestObj::classMethodWithOptional());
</ins><span class="cx">         return JSValue::encode(result);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     int arg(toInt32(exec, exec-&gt;argument(0), NormalConversion));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-
-    JSC::JSValue result = jsNumber(TestObj::classMethodWithOptional(arg));
</del><ins>+    JSValue result = jsNumber(TestObj::classMethodWithOptional(arg));
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3761,8 +3747,8 @@
</span><span class="cx">     Vector&lt;String&gt; values(toNativeArray&lt;String&gt;(exec, exec-&gt;argument(0)));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><ins>+    JSValue result = jsArray(exec, castedThis-&gt;globalObject(), impl.stringArrayFunction(values, ec));
</ins><span class="cx"> 
</span><del>-    JSC::JSValue result = jsArray(exec, castedThis-&gt;globalObject(), impl.stringArrayFunction(values, ec));
</del><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -3781,8 +3767,8 @@
</span><span class="cx">     RefPtr&lt;DOMStringList&gt; values(toDOMStringList(exec, exec-&gt;argument(0)));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.domStringListFunction(values, ec)));
</ins><span class="cx"> 
</span><del>-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.domStringListFunction(values, ec)));
</del><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -3798,8 +3784,8 @@
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     if (!shouldAllowAccessToNode(exec, impl.getSVGDocument(ec)))
</span><span class="cx">         return JSValue::encode(jsNull());
</span><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.getSVGDocument(ec)));
</ins><span class="cx"> 
</span><del>-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.getSVGDocument(ec)));
</del><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -3880,8 +3866,7 @@
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     TestObj&amp; impl = castedThis-&gt;impl();
</span><del>-
-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(SVGPropertyTearOff&lt;SVGPoint&gt;::create(impl.mutablePointFunction())));
</del><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(SVGPropertyTearOff&lt;SVGPoint&gt;::create(impl.mutablePointFunction())));
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3893,8 +3878,7 @@
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     TestObj&amp; impl = castedThis-&gt;impl();
</span><del>-
-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(SVGPropertyTearOff&lt;SVGPoint&gt;::create(impl.immutablePointFunction())));
</del><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(SVGPropertyTearOff&lt;SVGPoint&gt;::create(impl.immutablePointFunction())));
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3930,8 +3914,8 @@
</span><span class="cx">     int b(toInt32(exec, exec-&gt;argument(2), NormalConversion));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.strictFunction(str, a, b, ec)));
</ins><span class="cx"> 
</span><del>-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.strictFunction(str, a, b, ec)));
</del><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -3955,8 +3939,8 @@
</span><span class="cx">     Vector&lt;unsigned&gt; a(toNativeArray&lt;unsigned&gt;(exec, exec-&gt;argument(1)));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.strictFunctionWithSequence(objArg, a, ec)));
</ins><span class="cx"> 
</span><del>-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.strictFunctionWithSequence(objArg, a, ec)));
</del><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -3980,8 +3964,8 @@
</span><span class="cx">     Vector&lt;int&gt; array(toNativeArray&lt;int&gt;(exec, exec-&gt;argument(1)));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.strictFunctionWithArray(objArg, array, ec)));
</ins><span class="cx"> 
</span><del>-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(impl.strictFunctionWithArray(objArg, array, ec)));
</del><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (165520 => 165521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2014-03-13 00:38:38 UTC (rev 165520)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2014-03-13 00:41:58 UTC (rev 165521)
</span><span class="lines">@@ -245,7 +245,7 @@
</span><span class="cx">     }
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     TestTypedefs&amp; impl = castedThis-&gt;impl();
</span><del>-    JSC::JSValue result = jsNumber(impl.attrWithGetterException(ec));
</del><ins>+    JSValue result = jsNumber(impl.attrWithGetterException(ec));
</ins><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -284,7 +284,7 @@
</span><span class="cx">     }
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     TestTypedefs&amp; impl = castedThis-&gt;impl();
</span><del>-    JSC::JSValue result = jsStringWithCache(exec, impl.stringAttrWithGetterException(ec));
</del><ins>+    JSValue result = jsStringWithCache(exec, impl.stringAttrWithGetterException(ec));
</ins><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -506,8 +506,7 @@
</span><span class="cx">     Vector&lt;RefPtr&lt;SerializedScriptValue&gt;&gt; sequenceArg((toRefPtrNativeArray&lt;SerializedScriptValue, JSSerializedScriptValue&gt;(exec, exec-&gt;argument(0), &amp;toSerializedScriptValue)));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-
-    JSC::JSValue result = jsNumber(impl.methodWithSequenceArg(sequenceArg));
</del><ins>+    JSValue result = jsNumber(impl.methodWithSequenceArg(sequenceArg));
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -573,8 +572,7 @@
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestTypedefs::info());
</span><span class="cx">     TestTypedefs&amp; impl = castedThis-&gt;impl();
</span><del>-
-    JSC::JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(SVGPropertyTearOff&lt;SVGPoint&gt;::create(impl.immutablePointFunction())));
</del><ins>+    JSValue result = toJS(exec, castedThis-&gt;globalObject(), WTF::getPtr(SVGPropertyTearOff&lt;SVGPoint&gt;::create(impl.immutablePointFunction())));
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -592,8 +590,8 @@
</span><span class="cx">     Vector&lt;String&gt; values(toNativeArray&lt;String&gt;(exec, exec-&gt;argument(0)));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><ins>+    JSValue result = jsArray(exec, castedThis-&gt;globalObject(), impl.stringArrayFunction(values, ec));
</ins><span class="cx"> 
</span><del>-    JSC::JSValue result = jsArray(exec, castedThis-&gt;globalObject(), impl.stringArrayFunction(values, ec));
</del><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -612,8 +610,8 @@
</span><span class="cx">     Vector&lt;String&gt; values(toNativeArray&lt;String&gt;(exec, exec-&gt;argument(0)));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><ins>+    JSValue result = jsArray(exec, castedThis-&gt;globalObject(), impl.stringArrayFunction2(values, ec));
</ins><span class="cx"> 
</span><del>-    JSC::JSValue result = jsArray(exec, castedThis-&gt;globalObject(), impl.stringArrayFunction2(values, ec));
</del><span class="cx">     setDOMException(exec, ec);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -631,8 +629,7 @@
</span><span class="cx">     Vector&lt;RefPtr&lt;TestEventTarget&gt;&gt; sequenceArg((toRefPtrNativeArray&lt;TestEventTarget, JSTestEventTarget&gt;(exec, exec-&gt;argument(0), &amp;toTestEventTarget)));
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-
-    JSC::JSValue result = jsBoolean(impl.callWithSequenceThatRequiresInclude(sequenceArg));
</del><ins>+    JSValue result = jsBoolean(impl.callWithSequenceThatRequiresInclude(sequenceArg));
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorereplayAllReplayInputsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/AllReplayInputs.h (165520 => 165521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/AllReplayInputs.h        2014-03-13 00:38:38 UTC (rev 165520)
+++ trunk/Source/WebCore/replay/AllReplayInputs.h        2014-03-13 00:41:58 UTC (rev 165521)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_REPLAY)
</span><span class="cx"> 
</span><ins>+#include &quot;MemoizedDOMResult.h&quot;
</ins><span class="cx"> #include &quot;WebReplayInputs.h&quot;
</span><span class="cx"> #include &lt;JavaScriptCore/JSReplayInputs.h&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorereplayMemoizedDOMResultcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/replay/MemoizedDOMResult.cpp (0 => 165521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/MemoizedDOMResult.cpp                                (rev 0)
+++ trunk/Source/WebCore/replay/MemoizedDOMResult.cpp        2014-03-13 00:41:58 UTC (rev 165521)
</span><span class="lines">@@ -0,0 +1,109 @@
</span><ins>+/*
+ * Copyright (C) 2014 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS
+ * IS&quot; 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
+ * HOLDER 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 &quot;config.h&quot;
+#include &quot;MemoizedDOMResult.h&quot;
+
+#if ENABLE(WEB_REPLAY)
+
+#include &quot;ReplayInputTypes.h&quot;
+#include &quot;SerializationMethods.h&quot;
+#include &quot;WebReplayInputs.h&quot;
+
+namespace WebCore {
+
+const AtomicString&amp; MemoizedDOMResultBase::type() const
+{
+    return inputTypes().MemoizedDOMResult;
+}
+
+std::unique_ptr&lt;MemoizedDOMResultBase&gt; MemoizedDOMResultBase::createFromEncodedResult(const String&amp; attribute, EncodedCType ctype, EncodedValue encodedValue, ExceptionCode exceptionCode)
+{
+    switch (ctype) {
+#define CREATE_DECODE_SWITCH_CASE(name, type) \
+    case CTypeTraits&lt;type&gt;::encodedType: { \
+        CTypeTraits&lt;type&gt;::CType result; \
+        if (!EncodingTraits&lt;type&gt;::decodeValue(encodedValue, result)) \
+            return nullptr; \
+        return std::make_unique&lt;MemoizedDOMResult&lt;type&gt;&gt;(attribute, result, exceptionCode); \
+    } \
+\
+
+FOR_EACH_MEMOIZED_CTYPE(CREATE_DECODE_SWITCH_CASE)
+#undef CREATE_DECODE_SWITCH_CASE
+    }
+}
+
+} // namespace WebCore
+
+namespace JSC {
+
+using WebCore::EncodedCType;
+using WebCore::ExceptionCode;
+using WebCore::MemoizedDOMResult;
+using WebCore::SerializedScriptValue;
+
+const AtomicString&amp; InputTraits&lt;MemoizedDOMResultBase&gt;::type()
+{
+    return WebCore::inputTypes().MemoizedDOMResult;
+}
+
+void InputTraits&lt;MemoizedDOMResultBase&gt;::encode(EncodedValue&amp; encodedValue, const MemoizedDOMResultBase&amp; input)
+{
+    encodedValue.put&lt;String&gt;(ASCIILiteral(&quot;attribute&quot;), input.attribute());
+    encodedValue.put&lt;EncodedCType&gt;(ASCIILiteral(&quot;ctype&quot;), input.ctype());
+    encodedValue.put&lt;EncodedValue&gt;(ASCIILiteral(&quot;result&quot;), input.encodedResult());
+    if (input.exceptionCode())
+        encodedValue.put&lt;ExceptionCode&gt;(ASCIILiteral(&quot;exceptionCode&quot;), input.exceptionCode());
+}
+
+bool InputTraits&lt;MemoizedDOMResultBase&gt;::decode(EncodedValue&amp; encodedValue, std::unique_ptr&lt;MemoizedDOMResultBase&gt;&amp; input)
+{
+    String attribute;
+    if (!encodedValue.get&lt;String&gt;(ASCIILiteral(&quot;attribute&quot;), attribute))
+        return false;
+
+    EncodedCType ctype;
+    if (!encodedValue.get&lt;EncodedCType&gt;(ASCIILiteral(&quot;ctype&quot;), ctype))
+        return false;
+
+    EncodedValue encodedResult;
+    if (!encodedValue.get&lt;EncodedValue&gt;(ASCIILiteral(&quot;result&quot;), encodedResult))
+        return false;
+
+    ExceptionCode exceptionCode = 0;
+    encodedValue.get&lt;ExceptionCode&gt;(ASCIILiteral(&quot;exceptionCode&quot;), exceptionCode);
+
+    std::unique_ptr&lt;MemoizedDOMResultBase&gt; decodedInput = MemoizedDOMResultBase::createFromEncodedResult(attribute, ctype, encodedResult, exceptionCode);
+    if (!decodedInput)
+        return false;
+    input = std::move(decodedInput);
+    return true;
+}
+
+} // namespace JSC
+
+#endif // ENABLE(WEB_REPLAY)
</ins></span></pre></div>
<a id="trunkSourceWebCorereplayMemoizedDOMResulth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/replay/MemoizedDOMResult.h (0 => 165521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/MemoizedDOMResult.h                                (rev 0)
+++ trunk/Source/WebCore/replay/MemoizedDOMResult.h        2014-03-13 00:41:58 UTC (rev 165521)
</span><span class="lines">@@ -0,0 +1,159 @@
</span><ins>+/*
+ * Copyright (C) 2012 University of Washington. All rights reserved.
+ * Copyright (C) 2014 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS
+ * IS&quot; 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
+ * HOLDER 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.
+ */
+
+#ifndef MemoizedDOMResult_h
+#define MemoizedDOMResult_h
+
+#if ENABLE(WEB_REPLAY)
+
+#include &lt;replay/EncodedValue.h&gt;
+#include &lt;replay/NondeterministicInput.h&gt;
+
+namespace WebCore {
+
+class SerializedScriptValue;
+
+typedef int ExceptionCode;
+
+// Add new memoized ctypes here. The first argument is the enum value,
+// which cannot conflict with built-in primitive types. The second is
+// the actual C type that is used to specialize CTypeTraits. New enum
+// values should also be added to the definition in WebInputs.json.
+#define FOR_EACH_MEMOIZED_CTYPE(macro) \
+    macro(Boolean, bool) \
+    macro(Int, int) \
+    macro(String, String) \
+    macro(Unsigned, unsigned) \
+    \
+// end of FOR_EACH_MEMOIZED_CTYPE
+
+// We encode this enum so that we can recover MemoizedType when decoding the input
+// and then call the correct specialized MemoizedDOMResult&lt;T&gt; constructor.
+enum class EncodedCType {
+#define CREATE_ENUM_VALUE(name, type) name,
+
+FOR_EACH_MEMOIZED_CTYPE(CREATE_ENUM_VALUE)
+#undef CREATE_ENUM_VALUE
+};
+
+class MemoizedDOMResultBase : public NondeterministicInputBase {
+public:
+    MemoizedDOMResultBase(const String&amp; attribute, EncodedCType ctype, ExceptionCode exceptionCode = 0)
+        : m_attribute(attribute)
+        , m_ctype(ctype)
+        , m_exceptionCode(exceptionCode) { }
+
+    virtual ~MemoizedDOMResultBase() { }
+
+    static std::unique_ptr&lt;MemoizedDOMResultBase&gt; createFromEncodedResult(const String&amp; attribute, EncodedCType, EncodedValue, ExceptionCode);
+
+    template&lt;typename T&gt;
+    bool convertTo(T&amp; decodedValue);
+
+    virtual EncodedValue encodedResult() const = 0;
+    virtual InputQueue queue() const final override { return InputQueue::ScriptMemoizedData; }
+    virtual const AtomicString&amp; type() const final override;
+
+    const String&amp; attribute() const { return m_attribute; }
+    EncodedCType ctype() const { return m_ctype; }
+    ExceptionCode exceptionCode() const { return m_exceptionCode; }
+private:
+    String m_attribute;
+    EncodedCType m_ctype;
+    ExceptionCode m_exceptionCode;
+};
+
+template&lt;typename T&gt;
+struct CTypeTraits {
+    static bool decode(EncodedValue&amp; encodedValue, T&amp; decodedValue)
+    {
+        return EncodingTraits&lt;T&gt;::decodeValue(encodedValue, decodedValue);
+    }
+};
+
+#define CREATE_CTYPE_TRAITS(_name, _type) \
+template&lt;&gt; \
+struct CTypeTraits&lt;_type&gt; { \
+    typedef _type CType; \
+    static const EncodedCType encodedType = EncodedCType::_name; \
+}; \
+
+FOR_EACH_MEMOIZED_CTYPE(CREATE_CTYPE_TRAITS)
+#undef CREATE_CTYPE_TRAITS
+
+template&lt;typename MemoizedType&gt;
+class MemoizedDOMResult final : public MemoizedDOMResultBase {
+public:
+    MemoizedDOMResult(const String&amp; attribute, typename CTypeTraits&lt;MemoizedType&gt;::CType result, ExceptionCode exceptionCode)
+        : MemoizedDOMResultBase(attribute, CTypeTraits&lt;MemoizedType&gt;::encodedType, exceptionCode)
+        , m_result(result) { }
+    virtual ~MemoizedDOMResult() { }
+
+    virtual EncodedValue encodedResult() const override
+    {
+        return EncodingTraits&lt;MemoizedType&gt;::encodeValue(m_result);
+    }
+
+    typename CTypeTraits&lt;MemoizedType&gt;::CType result() const { return m_result; }
+private:
+    typename CTypeTraits&lt;MemoizedType&gt;::CType m_result;
+};
+
+// This is used by clients of the memoized DOM result to get out the memoized
+// value without performing a cast to MemoizedDOMResult&lt;T&gt; and calling result().
+template&lt;typename T&gt;
+bool MemoizedDOMResultBase::convertTo(T&amp; convertedValue)
+{
+    // Type tag doesn't match; fail to decode the value.
+    if (m_ctype != CTypeTraits&lt;T&gt;::encodedType)
+        return false;
+
+    MemoizedDOMResult&lt;T&gt;&amp; castedResult = static_cast&lt;MemoizedDOMResult&lt;T&gt;&amp;&gt;(*this);
+    convertedValue = castedResult.result();
+    return true;
+}
+
+} // namespace WebCore
+
+using WebCore::MemoizedDOMResultBase;
+
+namespace JSC {
+
+template&lt;&gt;
+struct InputTraits&lt;MemoizedDOMResultBase&gt; {
+    static InputQueue queue() { return InputQueue::ScriptMemoizedData; }
+    static const AtomicString&amp; type();
+
+    static void encode(EncodedValue&amp;, const MemoizedDOMResultBase&amp; input);
+    static bool decode(EncodedValue&amp;, std::unique_ptr&lt;MemoizedDOMResultBase&gt;&amp; input);
+};
+
+} // namespace JSC
+
+#endif // ENABLE(WEB_REPLAY)
+
+#endif // MemoizedDOMResult_h
</ins></span></pre></div>
<a id="trunkSourceWebCorereplayReplayInputTypescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/ReplayInputTypes.cpp (165520 => 165521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/ReplayInputTypes.cpp        2014-03-13 00:38:38 UTC (rev 165520)
+++ trunk/Source/WebCore/replay/ReplayInputTypes.cpp        2014-03-13 00:41:58 UTC (rev 165521)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx">     : dummy(0)
</span><span class="cx"> JS_REPLAY_INPUT_NAMES_FOR_EACH(INITIALIZE_INPUT_TYPE)
</span><span class="cx"> WEB_REPLAY_INPUT_NAMES_FOR_EACH(INITIALIZE_INPUT_TYPE)
</span><ins>+INITIALIZE_INPUT_TYPE(MemoizedDOMResult)
</ins><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(dummy);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorereplayReplayInputTypesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/ReplayInputTypes.h (165520 => 165521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/ReplayInputTypes.h        2014-03-13 00:38:38 UTC (rev 165520)
+++ trunk/Source/WebCore/replay/ReplayInputTypes.h        2014-03-13 00:41:58 UTC (rev 165521)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> #define DECLARE_REPLAY_INPUT_TYPES(name) AtomicString name;
</span><span class="cx">     JS_REPLAY_INPUT_NAMES_FOR_EACH(DECLARE_REPLAY_INPUT_TYPES)
</span><span class="cx">     WEB_REPLAY_INPUT_NAMES_FOR_EACH(DECLARE_REPLAY_INPUT_TYPES)
</span><ins>+    DECLARE_REPLAY_INPUT_TYPES(MemoizedDOMResult);
</ins><span class="cx"> #undef DECLARE_REPLAY_INPUT_TYPES
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorereplaySerializationMethodscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/SerializationMethods.cpp (165520 => 165521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/SerializationMethods.cpp        2014-03-13 00:38:38 UTC (rev 165520)
+++ trunk/Source/WebCore/replay/SerializationMethods.cpp        2014-03-13 00:41:58 UTC (rev 165521)
</span><span class="lines">@@ -63,6 +63,12 @@
</span><span class="cx">     WEB_REPLAY_INPUT_NAMES_FOR_EACH(ENCODE_IF_TYPE_TAG_MATCHES)
</span><span class="cx"> #undef ENCODE_IF_TYPE_TAG_MATCHES
</span><span class="cx"> 
</span><ins>+    // The macro won't work here because of the class template argument.
+    if (type == inputTypes().MemoizedDOMResult) {
+        InputTraits&lt;MemoizedDOMResultBase&gt;::encode(encodedValue, static_cast&lt;const MemoizedDOMResultBase&amp;&gt;(input));
+        return encodedValue;
+    }
+
</ins><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx">     return EncodedValue();
</span><span class="cx"> }
</span><span class="lines">@@ -87,6 +93,15 @@
</span><span class="cx">     WEB_REPLAY_INPUT_NAMES_FOR_EACH(DECODE_IF_TYPE_TAG_MATCHES)
</span><span class="cx"> #undef DECODE_IF_TYPE_TAG_MATCHES
</span><span class="cx"> 
</span><ins>+    if (type == inputTypes().MemoizedDOMResult) {
+        std::unique_ptr&lt;MemoizedDOMResultBase&gt; decodedInput;
+        if (!InputTraits&lt;MemoizedDOMResultBase&gt;::decode(encodedValue, decodedInput))
+            return false;
+
+        input = std::move(decodedInput);
+        return true;
+    }
+
</ins><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorereplayWebInputsjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/WebInputs.json (165520 => 165521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/WebInputs.json        2014-03-13 00:38:38 UTC (rev 165520)
+++ trunk/Source/WebCore/replay/WebInputs.json        2014-03-13 00:41:58 UTC (rev 165521)
</span><span class="lines">@@ -31,6 +31,17 @@
</span><span class="cx">                 &quot;header&quot;: &quot;platform/URL.h&quot;
</span><span class="cx">             },
</span><span class="cx">             {
</span><ins>+                &quot;name&quot;: &quot;EncodedCType&quot;, &quot;mode&quot;: &quot;SCALAR&quot;, &quot;storage&quot;: &quot;uint8_t&quot;,
+                &quot;flags&quot;: [&quot;ENUM_CLASS&quot;],
+                &quot;values&quot;: [
+                    &quot;Boolean&quot;,
+                    &quot;Int&quot;,
+                    &quot;String&quot;,
+                    &quot;Unsigned&quot;
+                ],
+                &quot;header&quot;: &quot;replay/MemoizedDOMResult.h&quot;
+            },
+            {
</ins><span class="cx">                 &quot;name&quot;: &quot;SecurityOrigin&quot;, &quot;mode&quot;: &quot;SHARED&quot;,
</span><span class="cx">                 &quot;header&quot;: &quot;page/SecurityOrigin.h&quot;
</span><span class="cx">             },
</span></span></pre>
</div>
</div>

</body>
</html>