<!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>[151155] branches/dfgFourthTier</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/151155">151155</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2013-06-03 22:37:21 -0700 (Mon, 03 Jun 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Source/JavaScriptCore: Merged from http://svn.webkit.org/repository/webkit/trunk
  ------------------------------------------------------------------------
  <a href="http://trac.webkit.org/projects/webkit/changeset/148639">r148639</a> | mark.lam@apple.com | 2013-04-17 15:37:45 -0700 (Wed, 17 Apr 2013) | 127 lines
  Add LLINT and baseline JIT support for timing out scripts.

  https://bugs.webkit.org/show_bug.cgi?id=114577.
  ------------------------------------------------------------------------
  <a href="http://trac.webkit.org/projects/webkit/changeset/148641">r148641</a> | mark.lam@apple.com | 2013-04-17 15:57:33 -0700 (Wed, 17 Apr 2013) | 10 lines
  Fix broken build. Replaced a static const with a #define.

  https://bugs.webkit.org/show_bug.cgi?id=114577.
  ------------------------------------------------------------------------
  <a href="http://trac.webkit.org/projects/webkit/changeset/148655">r148655</a> | mark.lam@apple.com | 2013-04-17 20:17:44 -0700 (Wed, 17 Apr 2013) | 10 lines
  Avoid using a branch range that is too far for some CPU architectures.

  https://bugs.webkit.org/show_bug.cgi?id=114782.
  ------------------------------------------------------------------------
  <a href="http://trac.webkit.org/projects/webkit/changeset/148709">r148709</a> | mark.lam@apple.com | 2013-04-18 15:45:25 -0700 (Thu, 18 Apr 2013) | 11 lines
  Interpreter entry points should throw the TerminatedExecutionException from the caller frame.

  https://bugs.webkit.org/show_bug.cgi?id=114816.
  ------------------------------------------------------------------------
  <a href="http://trac.webkit.org/projects/webkit/changeset/148893">r148893</a> | mark.lam@apple.com | 2013-04-22 10:37:29 -0700 (Mon, 22 Apr 2013) | 30 lines
  Change baseline JIT watchdog timer check to use the proper fast slow path
  infrastructure.

  https://bugs.webkit.org/show_bug.cgi?id=114963.
  ------------------------------------------------------------------------
  <a href="http://trac.webkit.org/projects/webkit/changeset/148899">r148899</a> | mark.lam@apple.com | 2013-04-22 11:40:58 -0700 (Mon, 22 Apr 2013) | 20 lines
  Fix broken 32-bit build to green the bots.

  https://bugs.webkit.org/show_bug.cgi?id=114968.
  ------------------------------------------------------------------------
  <a href="http://trac.webkit.org/projects/webkit/changeset/148942">r148942</a> | mark.lam@apple.com | 2013-04-22 21:47:08 -0700 (Mon, 22 Apr 2013) | 11 lines
  Fix a typo in MacroAssemblerARMv7.h.

  https://bugs.webkit.org/show_bug.cgi?id=115011.
  ------------------------------------------------------------------------
  <a href="http://trac.webkit.org/projects/webkit/changeset/148989">r148989</a> | mark.lam@apple.com | 2013-04-23 13:54:34 -0700 (Tue, 23 Apr 2013) | 21 lines
  Simplify the baseline JIT loop hint call site.

  https://bugs.webkit.org/show_bug.cgi?id=115052.
  ------------------------------------------------------------------------
  <a href="http://trac.webkit.org/projects/webkit/changeset/149089">r149089</a> | mark.lam@apple.com | 2013-04-24 19:59:51 -0700 (Wed, 24 Apr 2013) | 40 lines
  Add watchdog timer polling for the DFG.

  https://bugs.webkit.org/show_bug.cgi?id=115134.
  ------------------------------------------------------------------------
  <a href="http://trac.webkit.org/projects/webkit/changeset/149420">r149420</a> | mark.lam@apple.com | 2013-04-30 19:38:19 -0700 (Tue, 30 Apr 2013) | 17 lines
  JSContextGroupSetExecutionTimeLimit() should not pass a callback to the
  VM watchdog if its client did not pass one in.

  https://bugs.webkit.org/show_bug.cgi?id=115461.
  ------------------------------------------------------------------------
  <a href="http://trac.webkit.org/projects/webkit/changeset/150449">r150449</a> | mark.lam@apple.com | 2013-05-21 09:44:01 -0700 (Tue, 21 May 2013) | 8 lines
  Added missing assert condition for PositiveOrZero in ARM branch32().

  https://bugs.webkit.org/show_bug.cgi?id=116538.
  ------------------------------------------------------------------------

Source/WebCore: Merged from http://svn.webkit.org/repository/webkit/trunk
  ------------------------------------------------------------------------
  <a href="http://trac.webkit.org/projects/webkit/changeset/148639">r148639</a> | mark.lam@apple.com | 2013-04-17 15:37:45 -0700 (Wed, 17 Apr 2013) | 127 lines
  Add LLINT and baseline JIT support for timing out scripts.

  https://bugs.webkit.org/show_bug.cgi?id=114577.
  ------------------------------------------------------------------------

Source/WTF: Merged from http://svn.webkit.org/repository/webkit/trunk
  ------------------------------------------------------------------------
  <a href="http://trac.webkit.org/projects/webkit/changeset/148639">r148639</a> | mark.lam@apple.com | 2013-04-17 15:37:45 -0700 (Wed, 17 Apr 2013) | 127 lines
  Added currentCPUTime() and currentCPUTimeMS().

  https://bugs.webkit.org/show_bug.cgi?id=114577.
  ------------------------------------------------------------------------</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreAPIJSContextRefcpp">branches/dfgFourthTier/Source/JavaScriptCore/API/JSContextRef.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreAPIJSContextRefPrivateh">branches/dfgFourthTier/Source/JavaScriptCore/API/JSContextRefPrivate.h</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreAPIteststestapic">branches/dfgFourthTier/Source/JavaScriptCore/API/tests/testapi.c</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreCMakeListstxt">branches/dfgFourthTier/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreChangeLog">branches/dfgFourthTier/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreGNUmakefilelistam">branches/dfgFourthTier/Source/JavaScriptCore/GNUmakefile.list.am</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreJavaScriptCorevcprojJavaScriptCoreJavaScriptCorevcproj">branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj">branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters">branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreTargetpri">branches/dfgFourthTier/Source/JavaScriptCore/Target.pri</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreassemblerARMAssemblerh">branches/dfgFourthTier/Source/JavaScriptCore/assembler/ARMAssembler.h</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreassemblerARMv7Assemblerh">branches/dfgFourthTier/Source/JavaScriptCore/assembler/ARMv7Assembler.h</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreassemblerMacroAssemblerARMh">branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerARM.h</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreassemblerMacroAssemblerARMv7h">branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreassemblerMacroAssemblerMIPSh">branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreassemblerMacroAssemblerSH4h">branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerSH4.h</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreassemblerMacroAssemblerX86Commonh">branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreassemblerSH4Assemblerh">branches/dfgFourthTier/Source/JavaScriptCore/assembler/SH4Assembler.h</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCorebytecodeExitKindh">branches/dfgFourthTier/Source/JavaScriptCore/bytecode/ExitKind.h</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp">branches/dfgFourthTier/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoredfgDFGAbstractStatecpp">branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGAbstractState.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoredfgDFGByteCodeParsercpp">branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoredfgDFGFixupPhasecpp">branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoredfgDFGNodeTypeh">branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGNodeType.h</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoredfgDFGPredictionPropagationPhasecpp">branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoredfgDFGSpeculativeJIT32_64cpp">branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoredfgDFGSpeculativeJIT64cpp">branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreinterpreterInterpretercpp">branches/dfgFourthTier/Source/JavaScriptCore/interpreter/Interpreter.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCorejitJITcpp">branches/dfgFourthTier/Source/JavaScriptCore/jit/JIT.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCorejitJITh">branches/dfgFourthTier/Source/JavaScriptCore/jit/JIT.h</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCorejitJITOpcodescpp">branches/dfgFourthTier/Source/JavaScriptCore/jit/JITOpcodes.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCorejitJITOpcodes32_64cpp">branches/dfgFourthTier/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCorejitJITStubscpp">branches/dfgFourthTier/Source/JavaScriptCore/jit/JITStubs.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCorejitJITStubsh">branches/dfgFourthTier/Source/JavaScriptCore/jit/JITStubs.h</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCorellintLLIntExceptionscpp">branches/dfgFourthTier/Source/JavaScriptCore/llint/LLIntExceptions.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCorellintLLIntSlowPathscpp">branches/dfgFourthTier/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCorellintLLIntSlowPathsh">branches/dfgFourthTier/Source/JavaScriptCore/llint/LLIntSlowPaths.h</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCorellintLowLevelInterpreterasm">branches/dfgFourthTier/Source/JavaScriptCore/llint/LowLevelInterpreter.asm</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCorellintLowLevelInterpreter32_64asm">branches/dfgFourthTier/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCorellintLowLevelInterpreter64asm">branches/dfgFourthTier/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreruntimeExceptionHelperscpp">branches/dfgFourthTier/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreruntimeExceptionHelpersh">branches/dfgFourthTier/Source/JavaScriptCore/runtime/ExceptionHelpers.h</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreruntimeVMcpp">branches/dfgFourthTier/Source/JavaScriptCore/runtime/VM.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreruntimeVMh">branches/dfgFourthTier/Source/JavaScriptCore/runtime/VM.h</a></li>
<li><a href="#branchesdfgFourthTierSourceWTFChangeLog">branches/dfgFourthTier/Source/WTF/ChangeLog</a></li>
<li><a href="#branchesdfgFourthTierSourceWTFwtfCurrentTimecpp">branches/dfgFourthTier/Source/WTF/wtf/CurrentTime.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceWTFwtfCurrentTimeh">branches/dfgFourthTier/Source/WTF/wtf/CurrentTime.h</a></li>
<li><a href="#branchesdfgFourthTierSourceWebCoreChangeLog">branches/dfgFourthTier/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchesdfgFourthTierSourceWebCorebindingsjsJSEventListenercpp">branches/dfgFourthTier/Source/WebCore/bindings/js/JSEventListener.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceWebCorebindingsjsSerializedScriptValuecpp">branches/dfgFourthTier/Source/WebCore/bindings/js/SerializedScriptValue.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceWebCorebindingsjsWorkerScriptControllercpp">branches/dfgFourthTier/Source/WebCore/bindings/js/WorkerScriptController.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreruntimeWatchdogcpp">branches/dfgFourthTier/Source/JavaScriptCore/runtime/Watchdog.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreruntimeWatchdogh">branches/dfgFourthTier/Source/JavaScriptCore/runtime/Watchdog.h</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreruntimeWatchdogMaccpp">branches/dfgFourthTier/Source/JavaScriptCore/runtime/WatchdogMac.cpp</a></li>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreruntimeWatchdogNonecpp">branches/dfgFourthTier/Source/JavaScriptCore/runtime/WatchdogNone.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#branchesdfgFourthTierSourceJavaScriptCoreruntimeTerminatorh">branches/dfgFourthTier/Source/JavaScriptCore/runtime/Terminator.h</a></li>
</ul>

<h3>Property Changed</h3>
<ul>
<li><a href="#branchesdfgFourthTier">branches/dfgFourthTier/</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchesdfgFourthTier"></a>
<div class="propset"><h4>Property changes: branches/dfgFourthTier</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4>Modified: svn:mergeinfo</h4></div>
<span class="cx">   + /trunk:53455,146505,146552,147670,147690,147798,147858,148119,148639,148641,148655,148709,148893,148899,148942,148989,149089,149420,150449
</span><a id="branchesdfgFourthTierSourceJavaScriptCoreAPIJSContextRefcpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/API/JSContextRef.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/API/JSContextRef.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/API/JSContextRef.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -79,6 +79,34 @@
</span><span class="cx">     wtfThreadData().setCurrentIdentifierTable(savedIdentifierTable);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static bool internalScriptTimeoutCallback(ExecState* exec, void* callbackPtr, void* callbackData)
+{
+    JSShouldTerminateCallback callback = reinterpret_cast&lt;JSShouldTerminateCallback&gt;(callbackPtr);
+    JSContextRef contextRef = toRef(exec);
+    ASSERT(callback);
+    return callback(contextRef, callbackData);
+}
+
+void JSContextGroupSetExecutionTimeLimit(JSContextGroupRef group, double limit, JSShouldTerminateCallback callback, void* callbackData)
+{
+    VM&amp; vm = *toJS(group);
+    APIEntryShim entryShim(&amp;vm);
+    Watchdog&amp; watchdog = vm.watchdog;
+    if (callback) {
+        void* callbackPtr = reinterpret_cast&lt;void*&gt;(callback);
+        watchdog.setTimeLimit(vm, limit, internalScriptTimeoutCallback, callbackPtr, callbackData);
+    } else
+        watchdog.setTimeLimit(vm, limit);
+}
+
+void JSContextGroupClearExecutionTimeLimit(JSContextGroupRef group)
+{
+    VM&amp; vm = *toJS(group);
+    APIEntryShim entryShim(&amp;vm);
+    Watchdog&amp; watchdog = vm.watchdog;
+    watchdog.setTimeLimit(vm, std::numeric_limits&lt;double&gt;::infinity());
+}
+
</ins><span class="cx"> // From the API's perspective, a global context remains alive iff it has been JSGlobalContextRetained.
</span><span class="cx"> 
</span><span class="cx"> JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass)
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreAPIJSContextRefPrivateh"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/API/JSContextRefPrivate.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/API/JSContextRefPrivate.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/API/JSContextRefPrivate.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -55,6 +55,54 @@
</span><span class="cx"> */
</span><span class="cx"> JS_EXPORT JSStringRef JSContextCreateBacktrace(JSContextRef ctx, unsigned maxStackSize) AVAILABLE_IN_WEBKIT_VERSION_4_0;
</span><span class="cx">     
</span><ins>+
+/*! 
+@typedef JSShouldTerminateCallback
+@abstract The callback invoked when script execution has exceeded the allowed
+ time limit previously specified via JSContextGroupSetExecutionTimeLimit.
+@param ctx The execution context to use.
+@param context User specified context data previously passed to
+ JSContextGroupSetExecutionTimeLimit.
+@discussion If you named your function Callback, you would declare it like this:
+
+ bool Callback(JSContextRef ctx, void* context);
+
+ If you return true, the timed out script will terminate.
+ If you return false, the script will run for another period of the allowed
+ time limit specified via JSContextGroupSetExecutionTimeLimit.
+
+ Within this callback function, you may call JSContextGroupSetExecutionTimeLimit
+ to set a new time limit, or JSContextGroupClearExecutionTimeLimit to cancel the
+ timeout.
+*/
+typedef bool
+(*JSShouldTerminateCallback) (JSContextRef ctx, void* context);
+
+/*!
+@function
+@abstract Sets the script execution time limit.
+@param group The JavaScript context group that this time limit applies to.
+@param limit The time limit of allowed script execution time in seconds.
+@param callback The callback function that will be invoked when the time limit
+ has been reached. This will give you a chance to decide if you want to
+ terminate the script or not. If you pass a NULL callback, the script will be
+ terminated unconditionally when the time limit has been reached.
+@param context User data that you can provide to be passed back to you
+ in your callback.
+
+ In order to guarantee that the execution time limit will take effect, you will
+ need to call JSContextGroupSetExecutionTimeLimit before you start executing
+ any scripts.
+*/
+JS_EXPORT void JSContextGroupSetExecutionTimeLimit(JSContextGroupRef, double limit, JSShouldTerminateCallback, void* context) AVAILABLE_IN_WEBKIT_VERSION_4_0;
+
+/*!
+@function
+@abstract Clears the script execution time limit.
+@param group The JavaScript context group that the time limit is cleared on.
+*/
+JS_EXPORT void JSContextGroupClearExecutionTimeLimit(JSContextGroupRef) AVAILABLE_IN_WEBKIT_VERSION_4_0;
+
</ins><span class="cx"> #ifdef __cplusplus
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreAPIteststestapic"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/API/tests/testapi.c (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/API/tests/testapi.c        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/API/tests/testapi.c        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -33,6 +33,12 @@
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><span class="cx"> #include &lt;wtf/UnusedParam.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC) || PLATFORM(IOS)
+#include &lt;mach/mach.h&gt;
+#include &lt;mach/mach_time.h&gt;
+#include &lt;sys/time.h&gt;
+#endif
+
</ins><span class="cx"> #if OS(WINDOWS)
</span><span class="cx"> #include &lt;windows.h&gt;
</span><span class="cx"> #endif
</span><span class="lines">@@ -1038,6 +1044,68 @@
</span><span class="cx">     val.name = &quot;something&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC) || PLATFORM(IOS)
+static double currentCPUTime()
+{
+    mach_msg_type_number_t infoCount = THREAD_BASIC_INFO_COUNT;
+    thread_basic_info_data_t info;
+
+    /* Get thread information */
+    mach_port_t threadPort = mach_thread_self();
+    thread_info(threadPort, THREAD_BASIC_INFO, (thread_info_t)(&amp;info), &amp;infoCount);
+    mach_port_deallocate(mach_task_self(), threadPort);
+    
+    double time = info.user_time.seconds + info.user_time.microseconds / 1000000.;
+    time += info.system_time.seconds + info.system_time.microseconds / 1000000.;
+    
+    return time;
+}
+
+static JSValueRef currentCPUTime_callAsFunction(JSContextRef ctx, JSObjectRef functionObject, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    UNUSED_PARAM(functionObject);
+    UNUSED_PARAM(thisObject);
+    UNUSED_PARAM(argumentCount);
+    UNUSED_PARAM(arguments);
+    UNUSED_PARAM(exception);
+
+    ASSERT(JSContextGetGlobalContext(ctx) == context);
+    return JSValueMakeNumber(ctx, currentCPUTime());
+}
+
+bool shouldTerminateCallbackWasCalled = false;
+static bool shouldTerminateCallback(JSContextRef ctx, void* context)
+{
+    UNUSED_PARAM(ctx);
+    UNUSED_PARAM(context);
+    shouldTerminateCallbackWasCalled = true;
+    return true;
+}
+
+bool cancelTerminateCallbackWasCalled = false;
+static bool cancelTerminateCallback(JSContextRef ctx, void* context)
+{
+    UNUSED_PARAM(ctx);
+    UNUSED_PARAM(context);
+    cancelTerminateCallbackWasCalled = true;
+    return false;
+}
+
+int extendTerminateCallbackCalled = 0;
+static bool extendTerminateCallback(JSContextRef ctx, void* context)
+{
+    UNUSED_PARAM(context);
+    extendTerminateCallbackCalled++;
+    if (extendTerminateCallbackCalled == 1) {
+        JSContextGroupRef contextGroup = JSContextGetGroup(ctx);
+        JSContextGroupSetExecutionTimeLimit(contextGroup, .200f, extendTerminateCallback, 0);
+        return false;
+    }
+    return true;
+}
+#endif /* PLATFORM(MAC) || PLATFORM(IOS) */
+
+
</ins><span class="cx"> int main(int argc, char* argv[])
</span><span class="cx"> {
</span><span class="cx"> #if OS(WINDOWS)
</span><span class="lines">@@ -1685,6 +1753,159 @@
</span><span class="cx">         free(scriptUTF8);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC) || PLATFORM(IOS)
+    JSStringRef currentCPUTimeStr = JSStringCreateWithUTF8CString(&quot;currentCPUTime&quot;);
+    JSObjectRef currentCPUTimeFunction = JSObjectMakeFunctionWithCallback(context, currentCPUTimeStr, currentCPUTime_callAsFunction);
+    JSObjectSetProperty(context, globalObject, currentCPUTimeStr, currentCPUTimeFunction, kJSPropertyAttributeNone, NULL); 
+    JSStringRelease(currentCPUTimeStr);
+
+    /* Test script timeout: */
+    JSContextGroupSetExecutionTimeLimit(contextGroup, .10f, shouldTerminateCallback, 0);
+    {
+        const char* loopForeverScript = &quot;var startTime = currentCPUTime(); while (true) { if (currentCPUTime() - startTime &gt; .150) break; } &quot;;
+        JSStringRef script = JSStringCreateWithUTF8CString(loopForeverScript);
+        double startTime;
+        double endTime;
+        exception = NULL;
+        shouldTerminateCallbackWasCalled = false;
+        startTime = currentCPUTime();
+        v = JSEvaluateScript(context, script, NULL, NULL, 1, &amp;exception);
+        endTime = currentCPUTime();
+
+        if (((endTime - startTime) &lt; .150f) &amp;&amp; shouldTerminateCallbackWasCalled)
+            printf(&quot;PASS: script timed out as expected.\n&quot;);
+        else {
+            if (!((endTime - startTime) &lt; .150f))
+                printf(&quot;FAIL: script did not timed out as expected.\n&quot;);
+            if (!shouldTerminateCallbackWasCalled)
+                printf(&quot;FAIL: script timeout callback was not called.\n&quot;);
+            failed = true;
+        }
+
+        if (!exception) {
+            printf(&quot;FAIL: TerminatedExecutionException was not thrown.\n&quot;);
+            failed = true;
+        }
+    }
+
+    /* Test the script timeout's TerminatedExecutionException should NOT be catchable: */
+    JSContextGroupSetExecutionTimeLimit(contextGroup, 0.10f, shouldTerminateCallback, 0);
+    {
+        const char* loopForeverScript = &quot;var startTime = currentCPUTime(); try { while (true) { if (currentCPUTime() - startTime &gt; .150) break; } } catch(e) { }&quot;;
+        JSStringRef script = JSStringCreateWithUTF8CString(loopForeverScript);
+        double startTime;
+        double endTime;
+        exception = NULL;
+        shouldTerminateCallbackWasCalled = false;
+        startTime = currentCPUTime();
+        v = JSEvaluateScript(context, script, NULL, NULL, 1, &amp;exception);
+        endTime = currentCPUTime();
+
+        if (((endTime - startTime) &gt;= .150f) || !shouldTerminateCallbackWasCalled) {
+            if (!((endTime - startTime) &lt; .150f))
+                printf(&quot;FAIL: script did not timed out as expected.\n&quot;);
+            if (!shouldTerminateCallbackWasCalled)
+                printf(&quot;FAIL: script timeout callback was not called.\n&quot;);
+            failed = true;
+        }
+
+        if (exception)
+            printf(&quot;PASS: TerminatedExecutionException was not catchable as expected.\n&quot;);
+        else {
+            printf(&quot;FAIL: TerminatedExecutionException was caught.\n&quot;);
+            failed = true;
+        }
+    }
+
+    /* Test script timeout with no callback: */
+    JSContextGroupSetExecutionTimeLimit(contextGroup, .10f, 0, 0);
+    {
+        const char* loopForeverScript = &quot;var startTime = currentCPUTime(); while (true) { if (currentCPUTime() - startTime &gt; .150) break; } &quot;;
+        JSStringRef script = JSStringCreateWithUTF8CString(loopForeverScript);
+        double startTime;
+        double endTime;
+        exception = NULL;
+        startTime = currentCPUTime();
+        v = JSEvaluateScript(context, script, NULL, NULL, 1, &amp;exception);
+        endTime = currentCPUTime();
+
+        if (((endTime - startTime) &lt; .150f) &amp;&amp; shouldTerminateCallbackWasCalled)
+            printf(&quot;PASS: script timed out as expected when no callback is specified.\n&quot;);
+        else {
+            if (!((endTime - startTime) &lt; .150f))
+                printf(&quot;FAIL: script did not timed out as expected when no callback is specified.\n&quot;);
+            failed = true;
+        }
+
+        if (!exception) {
+            printf(&quot;FAIL: TerminatedExecutionException was not thrown.\n&quot;);
+            failed = true;
+        }
+    }
+
+    /* Test script timeout cancellation: */
+    JSContextGroupSetExecutionTimeLimit(contextGroup, 0.10f, cancelTerminateCallback, 0);
+    {
+        const char* loopForeverScript = &quot;var startTime = currentCPUTime(); while (true) { if (currentCPUTime() - startTime &gt; .150) break; } &quot;;
+        JSStringRef script = JSStringCreateWithUTF8CString(loopForeverScript);
+        double startTime;
+        double endTime;
+        exception = NULL;
+        startTime = currentCPUTime();
+        v = JSEvaluateScript(context, script, NULL, NULL, 1, &amp;exception);
+        endTime = currentCPUTime();
+
+        if (((endTime - startTime) &gt;= .150f) &amp;&amp; cancelTerminateCallbackWasCalled &amp;&amp; !exception)
+            printf(&quot;PASS: script timeout was cancelled as expected.\n&quot;);
+        else {
+            if (((endTime - startTime) &lt; .150) || exception)
+                printf(&quot;FAIL: script timeout was not cancelled.\n&quot;);
+            if (!cancelTerminateCallbackWasCalled)
+                printf(&quot;FAIL: script timeout callback was not called.\n&quot;);
+            failed = true;
+        }
+
+        if (exception) {
+            printf(&quot;FAIL: Unexpected TerminatedExecutionException thrown.\n&quot;);
+            failed = true;
+        }
+    }
+
+    /* Test script timeout extension: */
+    JSContextGroupSetExecutionTimeLimit(contextGroup, 0.100f, extendTerminateCallback, 0);
+    {
+        const char* loopForeverScript = &quot;var startTime = currentCPUTime(); while (true) { if (currentCPUTime() - startTime &gt; .500) break; } &quot;;
+        JSStringRef script = JSStringCreateWithUTF8CString(loopForeverScript);
+        double startTime;
+        double endTime;
+        double deltaTime;
+        exception = NULL;
+        startTime = currentCPUTime();
+        v = JSEvaluateScript(context, script, NULL, NULL, 1, &amp;exception);
+        endTime = currentCPUTime();
+        deltaTime = endTime - startTime;
+
+        if ((deltaTime &gt;= .300f) &amp;&amp; (deltaTime &lt; .500f) &amp;&amp; (extendTerminateCallbackCalled == 2) &amp;&amp; exception)
+            printf(&quot;PASS: script timeout was extended as expected.\n&quot;);
+        else {
+            if (deltaTime &lt; .200f)
+                printf(&quot;FAIL: script timeout was not extended as expected.\n&quot;);
+            else if (deltaTime &gt;= .500f)
+                printf(&quot;FAIL: script did not timeout.\n&quot;);
+
+            if (extendTerminateCallbackCalled &lt; 1)
+                printf(&quot;FAIL: script timeout callback was not called.\n&quot;);
+            if (extendTerminateCallbackCalled &lt; 2)
+                printf(&quot;FAIL: script timeout callback was not called after timeout extension.\n&quot;);
+
+            if (!exception)
+                printf(&quot;FAIL: TerminatedExecutionException was not thrown during timeout extension test.\n&quot;);
+
+            failed = true;
+        }
+    }
+#endif /* PLATFORM(MAC) || PLATFORM(IOS) */
+
</ins><span class="cx">     // Clear out local variables pointing at JSObjectRefs to allow their values to be collected
</span><span class="cx">     function = NULL;
</span><span class="cx">     v = NULL;
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/CMakeLists.txt (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/CMakeLists.txt        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/CMakeLists.txt        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -308,6 +308,8 @@
</span><span class="cx">     runtime/StructureRareData.cpp
</span><span class="cx">     runtime/StructureChain.cpp
</span><span class="cx">     runtime/SymbolTable.cpp
</span><ins>+    runtime/Watchdog.cpp
+    runtime/WatchdogNone.cpp
</ins><span class="cx"> 
</span><span class="cx">     tools/CodeProfile.cpp
</span><span class="cx">     tools/CodeProfiling.cpp
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/ChangeLog (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/ChangeLog        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/ChangeLog        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -2,6 +2,68 @@
</span><span class="cx"> 
</span><span class="cx">         Merged from http://svn.webkit.org/repository/webkit/trunk
</span><span class="cx">         ------------------------------------------------------------------------
</span><ins>+        r148639 | mark.lam@apple.com | 2013-04-17 15:37:45 -0700 (Wed, 17 Apr 2013) | 127 lines
+        Add LLINT and baseline JIT support for timing out scripts.
+
+        https://bugs.webkit.org/show_bug.cgi?id=114577.
+        ------------------------------------------------------------------------
+        r148641 | mark.lam@apple.com | 2013-04-17 15:57:33 -0700 (Wed, 17 Apr 2013) | 10 lines
+        Fix broken build. Replaced a static const with a #define.
+
+        https://bugs.webkit.org/show_bug.cgi?id=114577.
+        ------------------------------------------------------------------------
+        r148655 | mark.lam@apple.com | 2013-04-17 20:17:44 -0700 (Wed, 17 Apr 2013) | 10 lines
+        Avoid using a branch range that is too far for some CPU architectures.
+
+        https://bugs.webkit.org/show_bug.cgi?id=114782.
+        ------------------------------------------------------------------------
+        r148709 | mark.lam@apple.com | 2013-04-18 15:45:25 -0700 (Thu, 18 Apr 2013) | 11 lines
+        Interpreter entry points should throw the TerminatedExecutionException from the caller frame.
+
+        https://bugs.webkit.org/show_bug.cgi?id=114816.
+        ------------------------------------------------------------------------
+        r148893 | mark.lam@apple.com | 2013-04-22 10:37:29 -0700 (Mon, 22 Apr 2013) | 30 lines
+        Change baseline JIT watchdog timer check to use the proper fast slow path
+        infrastructure.
+
+        https://bugs.webkit.org/show_bug.cgi?id=114963.
+        ------------------------------------------------------------------------
+        r148899 | mark.lam@apple.com | 2013-04-22 11:40:58 -0700 (Mon, 22 Apr 2013) | 20 lines
+        Fix broken 32-bit build to green the bots.
+
+        https://bugs.webkit.org/show_bug.cgi?id=114968.
+        ------------------------------------------------------------------------
+        r148942 | mark.lam@apple.com | 2013-04-22 21:47:08 -0700 (Mon, 22 Apr 2013) | 11 lines
+        Fix a typo in MacroAssemblerARMv7.h.
+
+        https://bugs.webkit.org/show_bug.cgi?id=115011.
+        ------------------------------------------------------------------------
+        r148989 | mark.lam@apple.com | 2013-04-23 13:54:34 -0700 (Tue, 23 Apr 2013) | 21 lines
+        Simplify the baseline JIT loop hint call site.
+
+        https://bugs.webkit.org/show_bug.cgi?id=115052.
+        ------------------------------------------------------------------------
+        r149089 | mark.lam@apple.com | 2013-04-24 19:59:51 -0700 (Wed, 24 Apr 2013) | 40 lines
+        Add watchdog timer polling for the DFG.
+
+        https://bugs.webkit.org/show_bug.cgi?id=115134.
+        ------------------------------------------------------------------------
+        r149420 | mark.lam@apple.com | 2013-04-30 19:38:19 -0700 (Tue, 30 Apr 2013) | 17 lines
+        JSContextGroupSetExecutionTimeLimit() should not pass a callback to the
+        VM watchdog if its client did not pass one in.
+
+        https://bugs.webkit.org/show_bug.cgi?id=115461.
+        ------------------------------------------------------------------------
+        r150449 | mark.lam@apple.com | 2013-05-21 09:44:01 -0700 (Tue, 21 May 2013) | 8 lines
+        Added missing assert condition for PositiveOrZero in ARM branch32().
+
+        https://bugs.webkit.org/show_bug.cgi?id=116538.
+        ------------------------------------------------------------------------
+
+2013-06-03  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Merged from http://svn.webkit.org/repository/webkit/trunk
+        ------------------------------------------------------------------------
</ins><span class="cx">         r148119 | ggaren@apple.com | 2013-04-10 11:51:47 -0700 (Wed, 10 Apr 2013) | 106 lines
</span><span class="cx">         Removed bitrotted TimeoutChecker code
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/GNUmakefile.list.am (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/GNUmakefile.list.am        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/GNUmakefile.list.am        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -794,10 +794,12 @@
</span><span class="cx">         Source/JavaScriptCore/runtime/StructureTransitionTable.h \
</span><span class="cx">         Source/JavaScriptCore/runtime/SymbolTable.cpp \
</span><span class="cx">         Source/JavaScriptCore/runtime/SymbolTable.h \
</span><del>-        Source/JavaScriptCore/runtime/Terminator.h \
</del><span class="cx">         Source/JavaScriptCore/runtime/Tracing.h \
</span><span class="cx">         Source/JavaScriptCore/runtime/TypedArrayDescriptor.h \
</span><span class="cx">         Source/JavaScriptCore/runtime/Uint16WithFraction.h \
</span><ins>+        Source/JavaScriptCore/runtime/Watchdog.cpp \
+        Source/JavaScriptCore/runtime/Watchdog.h \
+        Source/JavaScriptCore/runtime/WatchdogNone.cpp \
</ins><span class="cx">         Source/JavaScriptCore/runtime/WeakGCMap.h \
</span><span class="cx">         Source/JavaScriptCore/runtime/WeakRandom.h \
</span><span class="cx">         Source/JavaScriptCore/runtime/WriteBarrier.h \
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreJavaScriptCorevcprojJavaScriptCoreJavaScriptCorevcproj"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -1370,14 +1370,22 @@
</span><span class="cx">                                 &gt;
</span><span class="cx">                         &lt;/File&gt;
</span><span class="cx">                         &lt;File
</span><del>-                                RelativePath=&quot;..\..\runtime\Terminator.h&quot;
</del><ins>+                                RelativePath=&quot;..\..\runtime\TypedArrayDescriptor.h&quot;
</ins><span class="cx">                                 &gt;
</span><span class="cx">                         &lt;/File&gt;
</span><span class="cx">                         &lt;File
</span><del>-                                RelativePath=&quot;..\..\runtime\TypedArrayDescriptor.h&quot;
</del><ins>+                                RelativePath=&quot;..\..\runtime\Watchdog.cpp&quot;
</ins><span class="cx">                                 &gt;
</span><span class="cx">                         &lt;/File&gt;
</span><span class="cx">                         &lt;File
</span><ins>+                                RelativePath=&quot;..\..\runtime\Watchdog.h&quot;
+                                &gt;
+                        &lt;/File&gt;
+                        &lt;File
+                                RelativePath=&quot;..\..\runtime\WatchdogNone.cpp&quot;
+                                &gt;
+                        &lt;/File&gt;
+                        &lt;File
</ins><span class="cx">                                 RelativePath=&quot;..\..\runtime\WeakGCMap.h&quot;
</span><span class="cx">                                 &gt;
</span><span class="cx">                         &lt;/File&gt;
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -370,6 +370,8 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\StructureChain.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\StructureRareData.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\SymbolTable.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\runtime\Watchdog.cpp&quot; /&gt;
+    &lt;ClCompile Include=&quot;..\runtime\WatchdogNone.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\tools\CodeProfile.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\tools\CodeProfiling.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\yarr\YarrCanonicalizeUCS2.cpp&quot; /&gt;
</span><span class="lines">@@ -751,10 +753,10 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\StructureRareDataInlines.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\StructureTransitionTable.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\SymbolTable.h&quot; /&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\runtime\Terminator.h&quot; /&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\Tracing.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\TypedArrayDescriptor.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\Uint16WithFraction.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\runtime\Watchdog.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\WeakGCMap.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\WeakRandom.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\WriteBarrier.h&quot; /&gt;
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -714,6 +714,12 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\SymbolTable.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\runtime\Watchdog.cpp&quot;&gt;
+      &lt;Filter&gt;runtime&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\runtime\WatchdogNone.cpp&quot;&gt;
+      &lt;Filter&gt;runtime&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\tools\CodeProfile.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;tools&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -1787,9 +1793,6 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\SymbolTable.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\runtime\Terminator.h&quot;&gt;
-      &lt;Filter&gt;runtime&lt;/Filter&gt;
-    &lt;/ClInclude&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\Tracing.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><span class="lines">@@ -1799,6 +1802,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\Uint16WithFraction.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\runtime\Watchdog.h&quot;&gt;
+      &lt;Filter&gt;runtime&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\WeakGCMap.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -749,7 +749,6 @@
</span><span class="cx">                 969A07990ED1D3AE00F1F681 /* Instruction.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07930ED1D3AE00F1F681 /* Instruction.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 969A079A0ED1D3AE00F1F681 /* Opcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 969A07940ED1D3AE00F1F681 /* Opcode.cpp */; };
</span><span class="cx">                 969A079B0ED1D3AE00F1F681 /* Opcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07950ED1D3AE00F1F681 /* Opcode.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                971EDEA61169E0D3005E4262 /* Terminator.h in Headers */ = {isa = PBXBuildFile; fileRef = 97F6903A1169DF7F00A6BB46 /* Terminator.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">                 978801401471AD920041B016 /* JSDateMath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9788FC221471AD0C0068CE2D /* JSDateMath.cpp */; };
</span><span class="cx">                 978801411471AD920041B016 /* JSDateMath.h in Headers */ = {isa = PBXBuildFile; fileRef = 9788FC231471AD0C0068CE2D /* JSDateMath.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A1712B3B11C7B212007A5315 /* RegExpCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1712B3A11C7B212007A5315 /* RegExpCache.cpp */; };
</span><span class="lines">@@ -962,6 +961,9 @@
</span><span class="cx">                 FEF6835F174343CC00A32E25 /* JITStubsARMv7.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF6835B174343CC00A32E25 /* JITStubsARMv7.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FEF68360174343CC00A32E25 /* JITStubsX86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF6835C174343CC00A32E25 /* JITStubsX86_64.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FEF68361174343CC00A32E25 /* JITStubsX86.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF6835D174343CC00A32E25 /* JITStubsX86.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                FED94F2E171E3E2300BE77A4 /* Watchdog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FED94F2B171E3E2300BE77A4 /* Watchdog.cpp */; };
+                FED94F2F171E3E2300BE77A4 /* Watchdog.h in Headers */ = {isa = PBXBuildFile; fileRef = FED94F2C171E3E2300BE77A4 /* Watchdog.h */; settings = {ATTRIBUTES = (Private, ); };};
+                FED94F30171E3E2300BE77A4 /* WatchdogMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FED94F2D171E3E2300BE77A4 /* WatchdogMac.cpp */; };
</ins><span class="cx"> /* End PBXBuildFile section */
</span><span class="cx"> 
</span><span class="cx"> /* Begin PBXContainerItemProxy section */
</span><span class="lines">@@ -1762,7 +1764,6 @@
</span><span class="cx">                 969A09220ED1E09C00F1F681 /* Completion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Completion.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9788FC221471AD0C0068CE2D /* JSDateMath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDateMath.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9788FC231471AD0C0068CE2D /* JSDateMath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDateMath.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                97F6903A1169DF7F00A6BB46 /* Terminator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Terminator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 A1712B3A11C7B212007A5315 /* RegExpCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegExpCache.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A1712B3E11C7B228007A5315 /* RegExpCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpCache.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A1712B4011C7B235007A5315 /* RegExpKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpKey.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1995,6 +1996,9 @@
</span><span class="cx">                 FEF6835B174343CC00A32E25 /* JITStubsARMv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITStubsARMv7.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FEF6835C174343CC00A32E25 /* JITStubsX86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITStubsX86_64.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FEF6835D174343CC00A32E25 /* JITStubsX86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITStubsX86.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                FED94F2B171E3E2300BE77A4 /* Watchdog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Watchdog.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FED94F2C171E3E2300BE77A4 /* Watchdog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Watchdog.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FED94F2D171E3E2300BE77A4 /* WatchdogMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WatchdogMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx"> /* End PBXFileReference section */
</span><span class="cx"> 
</span><span class="cx"> /* Begin PBXFrameworksBuildPhase section */
</span><span class="lines">@@ -2844,13 +2848,15 @@
</span><span class="cx">                                 BC9041470EB9250900FE26FA /* StructureTransitionTable.h */,
</span><span class="cx">                                 0F919D2715856770004A4E7D /* SymbolTable.cpp */,
</span><span class="cx">                                 14A396A60CD2933100B5B4FF /* SymbolTable.h */,
</span><del>-                                97F6903A1169DF7F00A6BB46 /* Terminator.h */,
</del><span class="cx">                                 5D53726D0E1C546B0021E549 /* Tracing.d */,
</span><span class="cx">                                 5D53726E0E1C54880021E549 /* Tracing.h */,
</span><span class="cx">                                 0FEB3ECB16237F4700AB67AD /* TypedArrayDescriptor.h */,
</span><span class="cx">                                 866739D113BFDE710023D87C /* Uint16WithFraction.h */,
</span><span class="cx">                                 E18E3A570DF9278C00D90B34 /* VM.cpp */,
</span><span class="cx">                                 E18E3A560DF9278C00D90B34 /* VM.h */,
</span><ins>+                                FED94F2B171E3E2300BE77A4 /* Watchdog.cpp */,
+                                FED94F2C171E3E2300BE77A4 /* Watchdog.h */,
+                                FED94F2D171E3E2300BE77A4 /* WatchdogMac.cpp */,
</ins><span class="cx">                                 14BFCE6810CDB1FC00364CCE /* WeakGCMap.h */,
</span><span class="cx">                                 1420BE7A10AA6DDB00F455D2 /* WeakRandom.h */,
</span><span class="cx">                                 A7DCB77912E3D90500911940 /* WriteBarrier.h */,
</span><span class="lines">@@ -3384,6 +3390,7 @@
</span><span class="cx">                                 0FC097A2146B28CC00CF2442 /* DFGThunks.h in Headers */,
</span><span class="cx">                                 0F3B3A2C15475002003ED0FF /* DFGValidate.h in Headers */,
</span><span class="cx">                                 0F2BDC471522802500CD8910 /* DFGValueRecoveryOverride.h in Headers */,
</span><ins>+                                FED94F2F171E3E2300BE77A4 /* Watchdog.h in Headers */,
</ins><span class="cx">                                 0F2BDC481522802900CD8910 /* DFGValueSource.h in Headers */,
</span><span class="cx">                                 0F620174143FCD330068B77C /* DFGVariableAccessData.h in Headers */,
</span><span class="cx">                                 0FDDBFB61666EEDA00C55FEF /* DFGVariableAccessDataDump.h in Headers */,
</span><span class="lines">@@ -3702,7 +3709,6 @@
</span><span class="cx">                                 BC18C46B0E16F5CD00B34460 /* SymbolTable.h in Headers */,
</span><span class="cx">                                 0FDB2CDA1742D804007B3C1B /* DFGFailedFinalizer.h in Headers */,
</span><span class="cx">                                 A784A26411D16622005776AC /* SyntaxChecker.h in Headers */,
</span><del>-                                971EDEA61169E0D3005E4262 /* Terminator.h in Headers */,
</del><span class="cx">                                 0F572D4F16879FDD00E57FBD /* ThunkGenerator.h in Headers */,
</span><span class="cx">                                 A7386556118697B400540279 /* ThunkGenerators.h in Headers */,
</span><span class="cx">                                 141448CD13A1783700F5BA1A /* TinyBloomFilter.h in Headers */,
</span><span class="lines">@@ -4390,6 +4396,7 @@
</span><span class="cx">                                 0FF60AC316740F8800029779 /* ReduceWhitespace.cpp in Sources */,
</span><span class="cx">                                 14280841107EC0930013E7B2 /* RegExp.cpp in Sources */,
</span><span class="cx">                                 A1712B3B11C7B212007A5315 /* RegExpCache.cpp in Sources */,
</span><ins>+                                FED94F30171E3E2300BE77A4 /* WatchdogMac.cpp in Sources */,
</ins><span class="cx">                                 8642C510151C06A90046D4EF /* RegExpCachedResult.cpp in Sources */,
</span><span class="cx">                                 14280842107EC0930013E7B2 /* RegExpConstructor.cpp in Sources */,
</span><span class="cx">                                 0F235BD317178E1C00690C7F /* FTLExitArgument.cpp in Sources */,
</span><span class="lines">@@ -4431,6 +4438,7 @@
</span><span class="cx">                                 0FF42732158EBD58004CB9FF /* UDis86Disassembler.cpp in Sources */,
</span><span class="cx">                                 A76F279415F13C9600517D67 /* UnlinkedCodeBlock.cpp in Sources */,
</span><span class="cx">                                 FE4A331F15BD2E07006F54F3 /* VMInspector.cpp in Sources */,
</span><ins>+                                FED94F2E171E3E2300BE77A4 /* Watchdog.cpp in Sources */,
</ins><span class="cx">                                 0FC81516140511B500CFA603 /* VTableSpectrum.cpp in Sources */,
</span><span class="cx">                                 0FEA0A09170513DB00BB722C /* FTLCapabilities.cpp in Sources */,
</span><span class="cx">                                 0F919D2515853CE0004A4E7D /* Watchpoint.cpp in Sources */,
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreTargetpri"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/Target.pri (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/Target.pri        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/Target.pri        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -329,6 +329,8 @@
</span><span class="cx">     runtime/Structure.cpp \
</span><span class="cx">     runtime/StructureRareData.cpp \
</span><span class="cx">     runtime/SymbolTable.cpp \
</span><ins>+    runtime/Watchdog.cpp \
+    runtime/WatchdogNone.cpp \
</ins><span class="cx">     tools/CodeProfile.cpp \
</span><span class="cx">     tools/CodeProfiling.cpp \
</span><span class="cx">     yarr/YarrJIT.cpp \
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreassemblerARMAssemblerh"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/assembler/ARMAssembler.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/assembler/ARMAssembler.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/assembler/ARMAssembler.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -153,21 +153,21 @@
</span><span class="cx"> 
</span><span class="cx">         // ARM conditional constants
</span><span class="cx">         typedef enum {
</span><del>-            EQ = 0x00000000, // Zero
-            NE = 0x10000000, // Non-zero
-            CS = 0x20000000,
-            CC = 0x30000000,
-            MI = 0x40000000,
-            PL = 0x50000000,
-            VS = 0x60000000,
-            VC = 0x70000000,
-            HI = 0x80000000,
-            LS = 0x90000000,
-            GE = 0xa0000000,
-            LT = 0xb0000000,
-            GT = 0xc0000000,
-            LE = 0xd0000000,
-            AL = 0xe0000000
</del><ins>+            EQ = 0x00000000, // Zero / Equal.
+            NE = 0x10000000, // Non-zero / Not equal.
+            CS = 0x20000000, // Unsigned higher or same.
+            CC = 0x30000000, // Unsigned lower.
+            MI = 0x40000000, // Negative.
+            PL = 0x50000000, // Positive or zero.
+            VS = 0x60000000, // Overflowed.
+            VC = 0x70000000, // Not overflowed.
+            HI = 0x80000000, // Unsigned higher.
+            LS = 0x90000000, // Unsigned lower or same.
+            GE = 0xa0000000, // Signed greater than or equal.
+            LT = 0xb0000000, // Signed less than.
+            GT = 0xc0000000, // Signed greater than.
+            LE = 0xd0000000, // Signed less than or equal.
+            AL = 0xe0000000  // Unconditional / Always execute.
</ins><span class="cx">         } Condition;
</span><span class="cx"> 
</span><span class="cx">         // ARM instruction constants
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreassemblerARMv7Assemblerh"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/assembler/ARMv7Assembler.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/assembler/ARMv7Assembler.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/assembler/ARMv7Assembler.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -493,21 +493,21 @@
</span><span class="cx">     // (HS, LO, HI, LS) -&gt; (AE, B, A, BE)
</span><span class="cx">     // (VS, VC) -&gt; (O, NO)
</span><span class="cx">     typedef enum {
</span><del>-        ConditionEQ,
-        ConditionNE,
-        ConditionHS, ConditionCS = ConditionHS,
-        ConditionLO, ConditionCC = ConditionLO,
-        ConditionMI,
-        ConditionPL,
-        ConditionVS,
-        ConditionVC,
-        ConditionHI,
-        ConditionLS,
-        ConditionGE,
-        ConditionLT,
-        ConditionGT,
-        ConditionLE,
-        ConditionAL,
</del><ins>+        ConditionEQ, // Zero / Equal.
+        ConditionNE, // Non-zero / Not equal.
+        ConditionHS, ConditionCS = ConditionHS, // Unsigned higher or same.
+        ConditionLO, ConditionCC = ConditionLO, // Unsigned lower.
+        ConditionMI, // Negative.
+        ConditionPL, // Positive or zero.
+        ConditionVS, // Overflowed.
+        ConditionVC, // Not overflowed.
+        ConditionHI, // Unsigned higher.
+        ConditionLS, // Unsigned lower or same.
+        ConditionGE, // Signed greater than or equal.
+        ConditionLT, // Signed less than.
+        ConditionGT, // Signed greater than.
+        ConditionLE, // Signed less than or equal.
+        ConditionAL, // Unconditional / Always execute.
</ins><span class="cx">         ConditionInvalid
</span><span class="cx">     } Condition;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreassemblerMacroAssemblerARMh"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerARM.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerARM.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerARM.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx">     enum ResultCondition {
</span><span class="cx">         Overflow = ARMAssembler::VS,
</span><span class="cx">         Signed = ARMAssembler::MI,
</span><ins>+        PositiveOrZero = ARMAssembler::PL,
</ins><span class="cx">         Zero = ARMAssembler::EQ,
</span><span class="cx">         NonZero = ARMAssembler::NE
</span><span class="cx">     };
</span><span class="lines">@@ -688,35 +689,40 @@
</span><span class="cx"> 
</span><span class="cx">     Jump branchAdd32(ResultCondition cond, RegisterID src, RegisterID dest)
</span><span class="cx">     {
</span><del>-        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
</del><ins>+        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero)
+            || (cond == NonZero) || (cond == PositiveOrZero));
</ins><span class="cx">         add32(src, dest);
</span><span class="cx">         return Jump(m_assembler.jmp(ARMCondition(cond)));
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Jump branchAdd32(ResultCondition cond, RegisterID op1, RegisterID op2, RegisterID dest)
</span><span class="cx">     {
</span><del>-        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
</del><ins>+        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero)
+            || (cond == NonZero) || (cond == PositiveOrZero));
</ins><span class="cx">         add32(op1, op2, dest);
</span><span class="cx">         return Jump(m_assembler.jmp(ARMCondition(cond)));
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Jump branchAdd32(ResultCondition cond, TrustedImm32 imm, RegisterID dest)
</span><span class="cx">     {
</span><del>-        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
</del><ins>+        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero)
+            || (cond == NonZero) || (cond == PositiveOrZero));
</ins><span class="cx">         add32(imm, dest);
</span><span class="cx">         return Jump(m_assembler.jmp(ARMCondition(cond)));
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Jump branchAdd32(ResultCondition cond, RegisterID src, TrustedImm32 imm, RegisterID dest)
</span><span class="cx">     {
</span><del>-        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
</del><ins>+        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero)
+            || (cond == NonZero) || (cond == PositiveOrZero));
</ins><span class="cx">         add32(src, imm, dest);
</span><span class="cx">         return Jump(m_assembler.jmp(ARMCondition(cond)));
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Jump branchAdd32(ResultCondition cond, TrustedImm32 imm, AbsoluteAddress dest)
</span><span class="cx">     {
</span><del>-        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
</del><ins>+        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero)
+            || (cond == NonZero) || (cond == PositiveOrZero));
</ins><span class="cx">         add32(imm, dest);
</span><span class="cx">         return Jump(m_assembler.jmp(ARMCondition(cond)));
</span><span class="cx">     }
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreassemblerMacroAssemblerARMv7h"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -121,6 +121,7 @@
</span><span class="cx">     enum ResultCondition {
</span><span class="cx">         Overflow = ARMv7Assembler::ConditionVS,
</span><span class="cx">         Signed = ARMv7Assembler::ConditionMI,
</span><ins>+        PositiveOrZero = ARMv7Assembler::ConditionPL,
</ins><span class="cx">         Zero = ARMv7Assembler::ConditionEQ,
</span><span class="cx">         NonZero = ARMv7Assembler::ConditionNE
</span><span class="cx">     };
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreassemblerMacroAssemblerMIPSh"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -80,6 +80,7 @@
</span><span class="cx">     enum ResultCondition {
</span><span class="cx">         Overflow,
</span><span class="cx">         Signed,
</span><ins>+        PositiveOrZero,
</ins><span class="cx">         Zero,
</span><span class="cx">         NonZero
</span><span class="cx">     };
</span><span class="lines">@@ -1509,7 +1510,7 @@
</span><span class="cx"> 
</span><span class="cx">     Jump branchAdd32(ResultCondition cond, RegisterID src, RegisterID dest)
</span><span class="cx">     {
</span><del>-        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
</del><ins>+        ASSERT((cond == Overflow) || (cond == Signed) || (cond == PositiveOrZero) || (cond == Zero) || (cond == NonZero));
</ins><span class="cx">         if (cond == Overflow) {
</span><span class="cx">             /*
</span><span class="cx">                 move    dest, dataTemp
</span><span class="lines">@@ -1542,6 +1543,12 @@
</span><span class="cx">             m_assembler.slt(cmpTempRegister, dest, MIPSRegisters::zero);
</span><span class="cx">             return branchNotEqual(cmpTempRegister, MIPSRegisters::zero);
</span><span class="cx">         }
</span><ins>+        if (cond == PositiveOrZero) {
+            add32(src, dest);
+            // Check if dest is negative.
+            m_assembler.slt(cmpTempRegister, MIPSRegisters::zero, dest);
+            return branchNotEqual(cmpTempRegister, MIPSRegisters::zero);
+        }
</ins><span class="cx">         if (cond == Zero) {
</span><span class="cx">             add32(src, dest);
</span><span class="cx">             return branchEqual(dest, MIPSRegisters::zero);
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreassemblerMacroAssemblerSH4h"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerSH4.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerSH4.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerSH4.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx">     enum ResultCondition {
</span><span class="cx">         Overflow = SH4Assembler::OF,
</span><span class="cx">         Signed = SH4Assembler::SI,
</span><ins>+        PositiveOrZero = SH4Assembler::NS,
</ins><span class="cx">         Zero = SH4Assembler::EQ,
</span><span class="cx">         NonZero = SH4Assembler::NE
</span><span class="cx">     };
</span><span class="lines">@@ -1906,7 +1907,7 @@
</span><span class="cx"> 
</span><span class="cx">     Jump branchAdd32(ResultCondition cond, RegisterID src, RegisterID dest)
</span><span class="cx">     {
</span><del>-        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
</del><ins>+        ASSERT((cond == Overflow) || (cond == Signed) || (cond == PositiveOrZero) || (cond == Zero) || (cond == NonZero));
</ins><span class="cx"> 
</span><span class="cx">         if (cond == Overflow) {
</span><span class="cx">             m_assembler.addvlRegReg(src, dest);
</span><span class="lines">@@ -1920,6 +1921,12 @@
</span><span class="cx">             return branchFalse();
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        if (cond == PositiveOrZero) {
+            m_assembler.addlRegReg(src, dest);
+            m_assembler.cmppz(dest);
+            return branchTrue();
+        }
+
</ins><span class="cx">         m_assembler.addlRegReg(src, dest);
</span><span class="cx">         compare32(0, dest, Equal);
</span><span class="cx"> 
</span><span class="lines">@@ -1930,7 +1937,7 @@
</span><span class="cx"> 
</span><span class="cx">     Jump branchAdd32(ResultCondition cond, TrustedImm32 imm, RegisterID dest)
</span><span class="cx">     {
</span><del>-        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
</del><ins>+        ASSERT((cond == Overflow) || (cond == Signed) || (cond == PositiveOrZero) || (cond == Zero) || (cond == NonZero));
</ins><span class="cx"> 
</span><span class="cx">         move(imm, scratchReg3);
</span><span class="cx">         return branchAdd32(cond, scratchReg3, dest);
</span><span class="lines">@@ -1938,7 +1945,7 @@
</span><span class="cx"> 
</span><span class="cx">     Jump branchAdd32(ResultCondition cond, RegisterID src, TrustedImm32 imm, RegisterID dest)
</span><span class="cx">     {
</span><del>-        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
</del><ins>+        ASSERT((cond == Overflow) || (cond == Signed) || (cond == PositiveOrZero) || (cond == Zero) || (cond == NonZero));
</ins><span class="cx"> 
</span><span class="cx">         if (src != dest)
</span><span class="cx">             move(src, dest);
</span><span class="lines">@@ -1956,6 +1963,11 @@
</span><span class="cx">             return branchFalse();
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        if (cond == PositiveOrZero) {
+            m_assembler.cmppz(dest);
+            return branchTrue();
+        }
+
</ins><span class="cx">         compare32(0, dest, Equal);
</span><span class="cx"> 
</span><span class="cx">         if (cond == NonZero) // NotEqual
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreassemblerMacroAssemblerX86Commonh"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx">     enum ResultCondition {
</span><span class="cx">         Overflow = X86Assembler::ConditionO,
</span><span class="cx">         Signed = X86Assembler::ConditionS,
</span><ins>+        PositiveOrZero = X86Assembler::ConditionNS,
</ins><span class="cx">         Zero = X86Assembler::ConditionE,
</span><span class="cx">         NonZero = X86Assembler::ConditionNE
</span><span class="cx">     };
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreassemblerSH4Assemblerh"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/assembler/SH4Assembler.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/assembler/SH4Assembler.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/assembler/SH4Assembler.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -341,22 +341,23 @@
</span><span class="cx">     typedef enum {
</span><span class="cx">         EQ = 0x0, // Equal
</span><span class="cx">         NE = 0x1, // Not Equal
</span><del>-        HS = 0x2, // Unsigend Greater Than equal
-        HI = 0x3, // Unsigend Greater Than
-        LS = 0x4, // Unsigend Lower or Same
-        LI = 0x5, // Unsigend Lower
</del><ins>+        HS = 0x2, // Unsigned Greater Than equal
+        HI = 0x3, // Unsigned Greater Than
+        LS = 0x4, // Unsigned Lower or Same
+        LI = 0x5, // Unsigned Lower
</ins><span class="cx">         GE = 0x6, // Greater or Equal
</span><span class="cx">         LT = 0x7, // Less Than
</span><span class="cx">         GT = 0x8, // Greater Than
</span><span class="cx">         LE = 0x9, // Less or Equal
</span><span class="cx">         OF = 0xa, // OverFlow
</span><span class="cx">         SI = 0xb, // Signed
</span><del>-        EQU= 0xc, // Equal or unordered(NaN)
-        NEU= 0xd,
-        GTU= 0xe,
-        GEU= 0xf,
-        LTU= 0x10,
-        LEU= 0x11,
</del><ins>+        NS = 0xc, // Not Signed
+        EQU= 0xd, // Equal or unordered(NaN)
+        NEU= 0xe,
+        GTU= 0xf,
+        GEU= 0x10,
+        LTU= 0x11,
+        LEU= 0x12,
</ins><span class="cx">     } Condition;
</span><span class="cx"> 
</span><span class="cx">     // Opaque label types
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCorebytecodeExitKindh"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/bytecode/ExitKind.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/bytecode/ExitKind.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/bytecode/ExitKind.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -46,7 +46,8 @@
</span><span class="cx">     ArgumentsEscaped, // We exited because arguments escaped but we didn't expect them to.
</span><span class="cx">     NotStringObject, // We exited because we shouldn't have attempted to optimize string object access.
</span><span class="cx">     Uncountable, // We exited for none of the above reasons, and we should not count it. Most uses of this should be viewed as a FIXME.
</span><del>-    UncountableWatchpoint // We exited because of a watchpoint, which isn't counted because watchpoints do tracking themselves.
</del><ins>+    UncountableWatchpoint, // We exited because of a watchpoint, which isn't counted because watchpoints do tracking themselves.
+    WatchdogTimerFired // We exited because we need to service the watchdog timer.
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> const char* exitKindToString(ExitKind);
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -656,9 +656,7 @@
</span><span class="cx"> 
</span><span class="cx"> void BytecodeGenerator::emitLoopHint()
</span><span class="cx"> {
</span><del>-#if ENABLE(DFG_JIT)
</del><span class="cx">     emitOpcode(op_loop_hint);
</span><del>-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void BytecodeGenerator::retrieveLastBinaryOp(int&amp; dstIndex, int&amp; src1Index, int&amp; src2Index)
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoredfgDFGAbstractStatecpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGAbstractState.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGAbstractState.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGAbstractState.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -1547,6 +1547,10 @@
</span><span class="cx">         m_isValid = false;
</span><span class="cx">         break;
</span><span class="cx">             
</span><ins>+    case CheckWatchdogTimer:
+        node-&gt;setCanExit(true);
+        break;
+            
</ins><span class="cx">     case Phantom:
</span><span class="cx">     case InlineStart:
</span><span class="cx">     case Nop:
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoredfgDFGByteCodeParsercpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -3263,9 +3263,13 @@
</span><span class="cx">             if (!m_inlineStackTop-&gt;m_caller)
</span><span class="cx">                 m_currentBlock-&gt;isOSRTarget = true;
</span><span class="cx"> 
</span><del>-            // Emit a phantom node to ensure that there is a placeholder node for this bytecode
-            // op.
-            addToGraph(Phantom);
</del><ins>+            if (m_vm-&gt;watchdog.isEnabled())
+                addToGraph(CheckWatchdogTimer);
+            else {
+                // Emit a phantom node to ensure that there is a placeholder
+                // node for this bytecode op.
+                addToGraph(Phantom);
+            }
</ins><span class="cx">             
</span><span class="cx">             NEXT_OPCODE(op_loop_hint);
</span><span class="cx">         }
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoredfgDFGFixupPhasecpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -906,6 +906,7 @@
</span><span class="cx">         case GarbageValue:
</span><span class="cx">         case CountExecution:
</span><span class="cx">         case ForceOSRExit:
</span><ins>+        case CheckWatchdogTimer:
</ins><span class="cx">             break;
</span><span class="cx"> #else
</span><span class="cx">         default:
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoredfgDFGNodeTypeh"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGNodeType.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGNodeType.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGNodeType.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -264,7 +264,11 @@
</span><span class="cx">     /* This is a pseudo-terminal. It means that execution should fall out of DFG at */\
</span><span class="cx">     /* this point, but execution does continue in the basic block - just in a */\
</span><span class="cx">     /* different compiler. */\
</span><del>-    macro(ForceOSRExit, NodeMustGenerate)
</del><ins>+    macro(ForceOSRExit, NodeMustGenerate) \
+    \
+    /* Checks the watchdog timer. If the timer has fired, we OSR exit to the */ \
+    /* baseline JIT to redo the watchdog timer check, and service the timer. */ \
+    macro(CheckWatchdogTimer, NodeMustGenerate) \
</ins><span class="cx"> 
</span><span class="cx"> // This enum generates a monotonically increasing id for all Node types,
</span><span class="cx"> // and is used by the subsequent enum to fill out the id (as accessed via the NodeIdMask).
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoredfgDFGPredictionPropagationPhasecpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -528,6 +528,7 @@
</span><span class="cx">         case Phantom:
</span><span class="cx">         case PutGlobalVar:
</span><span class="cx">         case PutGlobalVarCheck:
</span><ins>+        case CheckWatchdogTimer:
</ins><span class="cx">             break;
</span><span class="cx">             
</span><span class="cx">         // These gets ignored because it doesn't do anything.
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoredfgDFGSpeculativeJIT32_64cpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -4900,6 +4900,14 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    case CheckWatchdogTimer:
+        speculationCheck(
+            WatchdogTimerFired, JSValueRegs(), 0,
+            m_jit.branchTest8(
+                JITCompiler::NonZero,
+                JITCompiler::AbsoluteAddress(m_jit.vm()-&gt;watchdog.timerDidFireAddress())));
+        break;
+
</ins><span class="cx">     case CountExecution:
</span><span class="cx">         m_jit.add64(TrustedImm32(1), MacroAssembler::AbsoluteAddress(node-&gt;executionCounter()-&gt;address()));
</span><span class="cx">         break;
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoredfgDFGSpeculativeJIT64cpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -4753,6 +4753,14 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    case CheckWatchdogTimer:
+        speculationCheck(
+            WatchdogTimerFired, JSValueRegs(), 0,
+            m_jit.branchTest8(
+                JITCompiler::NonZero,
+                JITCompiler::AbsoluteAddress(m_jit.vm()-&gt;watchdog.timerDidFireAddress())));
+        break;
+
</ins><span class="cx">     case Phantom:
</span><span class="cx">         DFG_NODE_DO_TO_CHILDREN(m_jit.graph(), node, speculate);
</span><span class="cx">         noResult(node);
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreinterpreterInterpretercpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/interpreter/Interpreter.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/interpreter/Interpreter.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/interpreter/Interpreter.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -763,7 +763,7 @@
</span><span class="cx">         return;
</span><span class="cx">     JSObject* errorObject = asObject(error);
</span><span class="cx">     JSGlobalObject* globalObject = 0;
</span><del>-    if (isTerminatedExecutionException(error) || isInterruptedExecutionException(error))
</del><ins>+    if (isTerminatedExecutionException(error))
</ins><span class="cx">         globalObject = vm-&gt;dynamicGlobalObject;
</span><span class="cx">     else
</span><span class="cx">         globalObject = errorObject-&gt;globalObject();
</span><span class="lines">@@ -784,7 +784,7 @@
</span><span class="cx"> NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*&amp; callFrame, JSValue&amp; exceptionValue, unsigned bytecodeOffset)
</span><span class="cx"> {
</span><span class="cx">     CodeBlock* codeBlock = callFrame-&gt;codeBlock();
</span><del>-    bool isInterrupt = false;
</del><ins>+    bool isTermination = false;
</ins><span class="cx"> 
</span><span class="cx">     ASSERT(!exceptionValue.isEmpty());
</span><span class="cx">     ASSERT(!exceptionValue.isCell() || exceptionValue.asCell());
</span><span class="lines">@@ -806,7 +806,7 @@
</span><span class="cx">             addErrorInfo(callFrame, exception, codeBlock-&gt;lineNumberForBytecodeOffset(bytecodeOffset), codeBlock-&gt;ownerExecutable()-&gt;source());
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        isInterrupt = isInterruptedExecutionException(exception) || isTerminatedExecutionException(exception);
</del><ins>+        isTermination = isTerminatedExecutionException(exception);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (Debugger* debugger = callFrame-&gt;dynamicGlobalObject()-&gt;debugger()) {
</span><span class="lines">@@ -817,7 +817,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Calculate an exception handler vPC, unwinding call frames as necessary.
</span><span class="cx">     HandlerInfo* handler = 0;
</span><del>-    while (isInterrupt || !(handler = codeBlock-&gt;handlerForBytecodeOffset(bytecodeOffset))) {
</del><ins>+    while (isTermination || !(handler = codeBlock-&gt;handlerForBytecodeOffset(bytecodeOffset))) {
</ins><span class="cx">         if (!unwindCallFrame(callFrame, exceptionValue, bytecodeOffset, codeBlock)) {
</span><span class="cx">             if (LegacyProfiler* profiler = callFrame-&gt;vm().enabledProfiler())
</span><span class="cx">                 profiler-&gt;exceptionUnwind(callFrame);
</span><span class="lines">@@ -1005,6 +1005,9 @@
</span><span class="cx"> 
</span><span class="cx">     ProgramCodeBlock* codeBlock = &amp;program-&gt;generatedBytecode();
</span><span class="cx"> 
</span><ins>+    if (UNLIKELY(vm.watchdog.didFire(callFrame)))
+        return throwTerminatedExecutionException(callFrame);
+
</ins><span class="cx">     // Push the call frame for this invocation:
</span><span class="cx">     ASSERT(codeBlock-&gt;numParameters() == 1); // 1 parameter for 'this'.
</span><span class="cx">     CallFrame* newCallFrame = m_stack.pushFrame(callFrame, codeBlock, scope, 1, 0);
</span><span class="lines">@@ -1021,6 +1024,7 @@
</span><span class="cx">     JSValue result;
</span><span class="cx">     {
</span><span class="cx">         SamplingTool::CallRecord callRecord(m_sampler.get());
</span><ins>+        Watchdog::Scope watchdogScope(vm.watchdog);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(LLINT_C_LOOP)
</span><span class="cx">         result = LLInt::CLoop::execute(newCallFrame, llint_program_prologue);
</span><span class="lines">@@ -1076,6 +1080,9 @@
</span><span class="cx">     } else
</span><span class="cx">         newCodeBlock = 0;
</span><span class="cx"> 
</span><ins>+    if (UNLIKELY(vm.watchdog.didFire(callFrame)))
+        return throwTerminatedExecutionException(callFrame);
+
</ins><span class="cx">     CallFrame* newCallFrame = m_stack.pushFrame(callFrame, newCodeBlock, scope, argsCount, function);
</span><span class="cx">     if (UNLIKELY(!newCallFrame))
</span><span class="cx">         return checkedReturn(throwStackOverflowError(callFrame));
</span><span class="lines">@@ -1091,6 +1098,7 @@
</span><span class="cx">     JSValue result;
</span><span class="cx">     {
</span><span class="cx">         SamplingTool::CallRecord callRecord(m_sampler.get(), !isJSCall);
</span><ins>+        Watchdog::Scope watchdogScope(vm.watchdog);
</ins><span class="cx"> 
</span><span class="cx">         // Execute the code:
</span><span class="cx">         if (isJSCall) {
</span><span class="lines">@@ -1152,6 +1160,9 @@
</span><span class="cx">     } else
</span><span class="cx">         newCodeBlock = 0;
</span><span class="cx"> 
</span><ins>+    if (UNLIKELY(vm.watchdog.didFire(callFrame)))
+        return throwTerminatedExecutionException(callFrame);
+
</ins><span class="cx">     CallFrame* newCallFrame = m_stack.pushFrame(callFrame, newCodeBlock, scope, argsCount, constructor);
</span><span class="cx">     if (UNLIKELY(!newCallFrame))
</span><span class="cx">         return checkedReturn(throwStackOverflowError(callFrame));
</span><span class="lines">@@ -1167,6 +1178,7 @@
</span><span class="cx">     JSValue result;
</span><span class="cx">     {
</span><span class="cx">         SamplingTool::CallRecord callRecord(m_sampler.get(), !isJSConstruct);
</span><ins>+        Watchdog::Scope watchdogScope(vm.watchdog);
</ins><span class="cx"> 
</span><span class="cx">         // Execute the code.
</span><span class="cx">         if (isJSConstruct) {
</span><span class="lines">@@ -1175,9 +1187,8 @@
</span><span class="cx"> #elif ENABLE(JIT)
</span><span class="cx">             result = constructData.js.functionExecutable-&gt;generatedJITCodeForConstruct()-&gt;execute(&amp;m_stack, newCallFrame, &amp;vm);
</span><span class="cx"> #endif // ENABLE(JIT)
</span><del>-        } else {
</del><ins>+        } else
</ins><span class="cx">             result = JSValue::decode(constructData.native.function(newCallFrame));
</span><del>-        }
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (LegacyProfiler* profiler = vm.enabledProfiler())
</span><span class="lines">@@ -1251,6 +1262,9 @@
</span><span class="cx">     if (LegacyProfiler* profiler = vm.enabledProfiler())
</span><span class="cx">         profiler-&gt;willExecute(closure.oldCallFrame, closure.function);
</span><span class="cx"> 
</span><ins>+    if (UNLIKELY(vm.watchdog.didFire(closure.oldCallFrame)))
+        return throwTerminatedExecutionException(closure.oldCallFrame);
+
</ins><span class="cx">     // The code execution below may push more frames and point the topCallFrame
</span><span class="cx">     // to those newer frames, or it may pop to the top frame to the caller of
</span><span class="cx">     // the current repeat frame, or it may leave the top frame pointing to the
</span><span class="lines">@@ -1265,7 +1279,8 @@
</span><span class="cx">     JSValue result;
</span><span class="cx">     {
</span><span class="cx">         SamplingTool::CallRecord callRecord(m_sampler.get());
</span><del>-        
</del><ins>+        Watchdog::Scope watchdogScope(vm.watchdog);
+
</ins><span class="cx"> #if ENABLE(LLINT_C_LOOP)
</span><span class="cx">         result = LLInt::CLoop::execute(closure.newCallFrame, llint_function_for_call_prologue);
</span><span class="cx"> #elif ENABLE(JIT)
</span><span class="lines">@@ -1344,6 +1359,9 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (UNLIKELY(vm.watchdog.didFire(callFrame)))
+        return throwTerminatedExecutionException(callFrame);
+
</ins><span class="cx">     // Push the frame:
</span><span class="cx">     ASSERT(codeBlock-&gt;numParameters() == 1); // 1 parameter for 'this'.
</span><span class="cx">     CallFrame* newCallFrame = m_stack.pushFrame(callFrame, codeBlock, scope, 1, 0);
</span><span class="lines">@@ -1360,7 +1378,8 @@
</span><span class="cx">     JSValue result;
</span><span class="cx">     {
</span><span class="cx">         SamplingTool::CallRecord callRecord(m_sampler.get());
</span><del>-        
</del><ins>+        Watchdog::Scope watchdogScope(vm.watchdog);
+
</ins><span class="cx"> #if ENABLE(LLINT_C_LOOP)
</span><span class="cx">         result = LLInt::CLoop::execute(newCallFrame, llint_eval_prologue);
</span><span class="cx"> #elif ENABLE(JIT)
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCorejitJITcpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/jit/JIT.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/jit/JIT.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/jit/JIT.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -103,16 +103,15 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DFG_JIT)
</span><del>-void JIT::emitOptimizationCheck(OptimizationCheckKind kind)
</del><ins>+void JIT::emitEnterOptimizationCheck()
</ins><span class="cx"> {
</span><span class="cx">     if (!canBeOptimized())
</span><span class="cx">         return;
</span><del>-    
-    Jump skipOptimize = branchAdd32(Signed, TrustedImm32(kind == LoopOptimizationCheck ? Options::executionCounterIncrementForLoop() : Options::executionCounterIncrementForReturn()), AbsoluteAddress(m_codeBlock-&gt;addressOfJITExecuteCounter()));
</del><ins>+
+    Jump skipOptimize = branchAdd32(Signed, TrustedImm32(Options::executionCounterIncrementForReturn()), AbsoluteAddress(m_codeBlock-&gt;addressOfJITExecuteCounter()));
</ins><span class="cx">     JITStubCall stubCall(this, cti_optimize);
</span><span class="cx">     stubCall.addArgument(TrustedImm32(m_bytecodeOffset));
</span><del>-    if (kind == EnterOptimizationCheck)
-        ASSERT(!m_bytecodeOffset);
</del><ins>+    ASSERT(!m_bytecodeOffset);
</ins><span class="cx">     stubCall.call();
</span><span class="cx">     skipOptimize.link(this);
</span><span class="cx"> }
</span><span class="lines">@@ -459,6 +458,7 @@
</span><span class="cx">         DEFINE_SLOWCASE_OP(op_jngreater)
</span><span class="cx">         DEFINE_SLOWCASE_OP(op_jngreatereq)
</span><span class="cx">         DEFINE_SLOWCASE_OP(op_jtrue)
</span><ins>+        DEFINE_SLOWCASE_OP(op_loop_hint)
</ins><span class="cx">         DEFINE_SLOWCASE_OP(op_lshift)
</span><span class="cx">         DEFINE_SLOWCASE_OP(op_mod)
</span><span class="cx">         DEFINE_SLOWCASE_OP(op_mul)
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCorejitJITh"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/jit/JIT.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/jit/JIT.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/jit/JIT.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -773,6 +773,7 @@
</span><span class="cx">         void emitSlow_op_jngreater(Instruction*, Vector&lt;SlowCaseEntry&gt;::iterator&amp;);
</span><span class="cx">         void emitSlow_op_jngreatereq(Instruction*, Vector&lt;SlowCaseEntry&gt;::iterator&amp;);
</span><span class="cx">         void emitSlow_op_jtrue(Instruction*, Vector&lt;SlowCaseEntry&gt;::iterator&amp;);
</span><ins>+        void emitSlow_op_loop_hint(Instruction*, Vector&lt;SlowCaseEntry&gt;::iterator&amp;);
</ins><span class="cx">         void emitSlow_op_lshift(Instruction*, Vector&lt;SlowCaseEntry&gt;::iterator&amp;);
</span><span class="cx">         void emitSlow_op_mod(Instruction*, Vector&lt;SlowCaseEntry&gt;::iterator&amp;);
</span><span class="cx">         void emitSlow_op_mul(Instruction*, Vector&lt;SlowCaseEntry&gt;::iterator&amp;);
</span><span class="lines">@@ -843,13 +844,12 @@
</span><span class="cx">         // Loads the character value of a single character string into dst.
</span><span class="cx">         void emitLoadCharacterString(RegisterID src, RegisterID dst, JumpList&amp; failures);
</span><span class="cx">         
</span><del>-        enum OptimizationCheckKind { LoopOptimizationCheck, EnterOptimizationCheck };
</del><span class="cx"> #if ENABLE(DFG_JIT)
</span><del>-        void emitOptimizationCheck(OptimizationCheckKind);
</del><ins>+        void emitEnterOptimizationCheck();
</ins><span class="cx"> #else
</span><del>-        void emitOptimizationCheck(OptimizationCheckKind) { }
</del><ins>+        void emitEnterOptimizationCheck() { }
</ins><span class="cx"> #endif
</span><del>-        
</del><ins>+
</ins><span class="cx"> #ifndef NDEBUG
</span><span class="cx">         void printBytecodeOperandTypes(unsigned src1, unsigned src2);
</span><span class="cx"> #endif
</span><span class="lines">@@ -934,11 +934,6 @@
</span><span class="cx"> #endif
</span><span class="cx">     } JIT_CLASS_ALIGNMENT;
</span><span class="cx"> 
</span><del>-    inline void JIT::emit_op_loop_hint(Instruction*)
-    {
-        emitOptimizationCheck(LoopOptimizationCheck);
-    }
-
</del><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(JIT)
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCorejitJITOpcodescpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/jit/JITOpcodes.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/jit/JITOpcodes.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/jit/JITOpcodes.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -837,7 +837,7 @@
</span><span class="cx"> 
</span><span class="cx"> void JIT::emit_op_enter(Instruction*)
</span><span class="cx"> {
</span><del>-    emitOptimizationCheck(EnterOptimizationCheck);
</del><ins>+    emitEnterOptimizationCheck();
</ins><span class="cx">     
</span><span class="cx">     // Even though CTI doesn't use them, we initialize our constant
</span><span class="cx">     // registers to zap stale pointers, to avoid unnecessarily prolonging
</span><span class="lines">@@ -1216,6 +1216,45 @@
</span><span class="cx"> 
</span><span class="cx"> #endif // USE(JSVALUE64)
</span><span class="cx"> 
</span><ins>+void JIT::emit_op_loop_hint(Instruction*)
+{
+    // Emit the JIT optimization check: 
+    if (canBeOptimized())
+        addSlowCase(branchAdd32(PositiveOrZero, TrustedImm32(Options::executionCounterIncrementForLoop()),
+            AbsoluteAddress(m_codeBlock-&gt;addressOfJITExecuteCounter())));
+
+    // Emit the watchdog timer check:
+    if (m_vm-&gt;watchdog.isEnabled())
+        addSlowCase(branchTest8(NonZero, AbsoluteAddress(m_vm-&gt;watchdog.timerDidFireAddress())));
+}
+
+void JIT::emitSlow_op_loop_hint(Instruction*, Vector&lt;SlowCaseEntry&gt;::iterator&amp; iter)
+{
+#if ENABLE(DFG_JIT)
+    // Emit the slow path for the JIT optimization check:
+    if (canBeOptimized()) {
+        linkSlowCase(iter);
+
+        JITStubCall stubCall(this, cti_optimize);
+        stubCall.addArgument(TrustedImm32(m_bytecodeOffset));
+        stubCall.call();
+
+        emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_loop_hint));
+    }
+#endif
+
+    // Emit the slow path of the watchdog timer check:
+    if (m_vm-&gt;watchdog.isEnabled()) {
+        linkSlowCase(iter);
+
+        JITStubCall stubCall(this, cti_handle_watchdog_timer);
+        stubCall.call();
+
+        emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_loop_hint));
+    }
+
+}
+
</ins><span class="cx"> void JIT::emit_resolve_operations(ResolveOperations* resolveOperations, const int* baseVR, const int* valueVR)
</span><span class="cx"> {
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCorejitJITOpcodes32_64cpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -1113,7 +1113,7 @@
</span><span class="cx"> 
</span><span class="cx"> void JIT::emit_op_enter(Instruction*)
</span><span class="cx"> {
</span><del>-    emitOptimizationCheck(EnterOptimizationCheck);
</del><ins>+    emitEnterOptimizationCheck();
</ins><span class="cx">     
</span><span class="cx">     // Even though JIT code doesn't use them, we initialize our constant
</span><span class="cx">     // registers to zap stale pointers, to avoid unnecessarily prolonging
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCorejitJITStubscpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/jit/JITStubs.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/jit/JITStubs.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/jit/JITStubs.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -443,6 +443,18 @@
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+DEFINE_STUB_FUNCTION(void, handle_watchdog_timer)
+{
+    STUB_INIT_STACK_FRAME(stackFrame);
+    CallFrame* callFrame = stackFrame.callFrame;
+    VM* vm = stackFrame.vm;
+    if (UNLIKELY(vm-&gt;watchdog.didFire(callFrame))) {
+        vm-&gt;exception = createTerminatedExecutionException(vm);
+        VM_THROW_EXCEPTION_AT_END();
+        return;
+    }
+}
+
</ins><span class="cx"> DEFINE_STUB_FUNCTION(void*, stack_check)
</span><span class="cx"> {
</span><span class="cx">     STUB_INIT_STACK_FRAME(stackFrame);
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCorejitJITStubsh"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/jit/JITStubs.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/jit/JITStubs.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/jit/JITStubs.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -408,6 +408,7 @@
</span><span class="cx"> int JIT_STUB cti_op_jgreatereq(STUB_ARGS_DECLARATION) WTF_INTERNAL;
</span><span class="cx"> int JIT_STUB cti_op_jtrue(STUB_ARGS_DECLARATION) WTF_INTERNAL;
</span><span class="cx"> void* JIT_STUB cti_op_load_varargs(STUB_ARGS_DECLARATION) WTF_INTERNAL;
</span><ins>+void JIT_STUB cti_handle_watchdog_timer(STUB_ARGS_DECLARATION) WTF_INTERNAL;
</ins><span class="cx"> int JIT_STUB cti_has_property(STUB_ARGS_DECLARATION) WTF_INTERNAL;
</span><span class="cx"> void JIT_STUB cti_op_debug(STUB_ARGS_DECLARATION) WTF_INTERNAL;
</span><span class="cx"> void JIT_STUB cti_op_end(STUB_ARGS_DECLARATION) WTF_INTERNAL;
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCorellintLLIntExceptionscpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/llint/LLIntExceptions.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/llint/LLIntExceptions.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/llint/LLIntExceptions.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -56,27 +56,30 @@
</span><span class="cx">     return LLInt::exceptionInstructions();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Instruction* returnToThrow(ExecState* exec, Instruction* pc)
</del><ins>+static void doThrow(ExecState* exec, Instruction* pc)
</ins><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><ins>+    genericThrow(vm, exec, vm-&gt;exception, pc - exec-&gt;codeBlock()-&gt;instructions().begin());
+}
+
+Instruction* returnToThrow(ExecState* exec, Instruction* pc)
+{
</ins><span class="cx"> #if LLINT_SLOW_PATH_TRACING
</span><ins>+    VM* vm = &amp;exec-&gt;vm();
</ins><span class="cx">     dataLog(&quot;Throwing exception &quot;, vm-&gt;exception, &quot; (returnToThrow).\n&quot;);
</span><span class="cx"> #endif
</span><del>-    genericThrow(vm, exec, vm-&gt;exception, pc - exec-&gt;codeBlock()-&gt;instructions().begin());
-    
</del><ins>+    doThrow(exec, pc);
</ins><span class="cx">     return LLInt::exceptionInstructions();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void* callToThrow(ExecState* exec, Instruction* pc)
</span><span class="cx"> {
</span><ins>+#if LLINT_SLOW_PATH_TRACING
</ins><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><del>-    NativeCallFrameTracer tracer(vm, exec);
-#if LLINT_SLOW_PATH_TRACING
</del><span class="cx">     dataLog(&quot;Throwing exception &quot;, vm-&gt;exception, &quot; (callToThrow).\n&quot;);
</span><span class="cx"> #endif
</span><del>-    genericThrow(vm, exec, vm-&gt;exception, pc - exec-&gt;codeBlock()-&gt;instructions().begin());
-
</del><ins>+    doThrow(exec, pc);
</ins><span class="cx">     return LLInt::getCodePtr(llint_throw_during_call_trampoline);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCorellintLLIntSlowPathscpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -1640,6 +1640,14 @@
</span><span class="cx">         LLINT_THROW(createTypeError(exec, LLINT_OP_C(1).jsValue().toString(exec)-&gt;value(exec)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+LLINT_SLOW_PATH_DECL(slow_path_handle_watchdog_timer)
+{
+    LLINT_BEGIN_NO_SET_PC();
+    if (UNLIKELY(vm.watchdog.didFire(exec)))
+        LLINT_THROW(createTerminatedExecutionException(&amp;vm));
+    LLINT_RETURN_TWO(0, exec);
+}
+
</ins><span class="cx"> LLINT_SLOW_PATH_DECL(slow_path_debug)
</span><span class="cx"> {
</span><span class="cx">     LLINT_BEGIN();
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCorellintLLIntSlowPathsh"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/llint/LLIntSlowPaths.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/llint/LLIntSlowPaths.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/llint/LLIntSlowPaths.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -202,6 +202,7 @@
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_push_name_scope);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_throw);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_throw_static_error);
</span><ins>+LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_handle_watchdog_timer);
</ins><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_debug);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_profile_will_call);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_profile_did_call);
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCorellintLowLevelInterpreterasm"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/llint/LowLevelInterpreter.asm (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -1053,10 +1053,18 @@
</span><span class="cx"> 
</span><span class="cx"> _llint_op_loop_hint:
</span><span class="cx">     traceExecution()
</span><ins>+    loadp JITStackFrame::vm[sp], t1
+    loadb VM::watchdog+Watchdog::m_timerDidFire[t1], t0
+    btbnz t0, .handleWatchdogTimer
+.afterWatchdogTimerCheck:
</ins><span class="cx">     checkSwitchToJITForLoop()
</span><span class="cx">     dispatch(1)
</span><ins>+.handleWatchdogTimer:
+    callWatchdogTimerHandler(.throwHandler)
+    jmp .afterWatchdogTimerCheck
+.throwHandler:
+    jmp _llint_throw_from_slow_path_trampoline
</ins><span class="cx"> 
</span><del>-
</del><span class="cx"> _llint_op_switch_string:
</span><span class="cx">     traceExecution()
</span><span class="cx">     callSlowPath(_llint_slow_path_switch_string)
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCorellintLowLevelInterpreter32_64asm"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -189,6 +189,14 @@
</span><span class="cx">     action(t0)
</span><span class="cx"> end
</span><span class="cx"> 
</span><ins>+macro callWatchdogTimerHandler(throwHandler)
+    storei PC, ArgumentCount + TagOffset[cfr]
+    cCall2(_llint_slow_path_handle_watchdog_timer, cfr, PC)
+    move t1, cfr
+    btpnz t0, throwHandler
+    loadi ArgumentCount + TagOffset[cfr], PC
+end
+
</ins><span class="cx"> macro checkSwitchToJITForLoop()
</span><span class="cx">     checkSwitchToJIT(
</span><span class="cx">         1,
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCorellintLowLevelInterpreter64asm"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -129,6 +129,16 @@
</span><span class="cx">     action(t0)
</span><span class="cx"> end
</span><span class="cx"> 
</span><ins>+macro callWatchdogTimerHandler(throwHandler)
+    storei PC, ArgumentCount + TagOffset[cfr]
+    prepareStateForCCall()
+    cCall2(_llint_slow_path_handle_watchdog_timer, cfr, PC)
+    move t1, cfr
+    btpnz t0, throwHandler
+    move t3, PB
+    loadi ArgumentCount + TagOffset[cfr], PC
+end
+
</ins><span class="cx"> macro checkSwitchToJITForLoop()
</span><span class="cx">     checkSwitchToJIT(
</span><span class="cx">         1,
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreruntimeExceptionHelperscpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -41,33 +41,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-ASSERT_HAS_TRIVIAL_DESTRUCTOR(InterruptedExecutionError);
-
-const ClassInfo InterruptedExecutionError::s_info = { &quot;InterruptedExecutionError&quot;, &amp;Base::s_info, 0, 0, CREATE_METHOD_TABLE(InterruptedExecutionError) };
-
-JSValue InterruptedExecutionError::defaultValue(const JSObject*, ExecState* exec, PreferredPrimitiveType hint)
-{
-    if (hint == PreferString)
-        return jsNontrivialString(exec, String(ASCIILiteral(&quot;JavaScript execution exceeded timeout.&quot;)));
-    return JSValue(QNaN);
-}
-
-JSObject* createInterruptedExecutionException(VM* vm)
-{
-    return InterruptedExecutionError::create(*vm);
-}
-
-bool isInterruptedExecutionException(JSObject* object)
-{
-    return object-&gt;inherits(&amp;InterruptedExecutionError::s_info);
-}
-
-bool isInterruptedExecutionException(JSValue value)
-{
-    return value.inherits(&amp;InterruptedExecutionError::s_info);
-}
-
-
</del><span class="cx"> ASSERT_HAS_TRIVIAL_DESTRUCTOR(TerminatedExecutionError);
</span><span class="cx"> 
</span><span class="cx"> const ClassInfo TerminatedExecutionError::s_info = { &quot;TerminatedExecutionError&quot;, &amp;Base::s_info, 0, 0, CREATE_METHOD_TABLE(TerminatedExecutionError) };
</span><span class="lines">@@ -168,4 +141,10 @@
</span><span class="cx">     return throwError(exec, createStackOverflowError(exec));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSObject* throwTerminatedExecutionException(ExecState* exec)
+{
+    Interpreter::ErrorHandlingMode mode(exec);
+    return throwError(exec, createTerminatedExecutionException(&amp;exec-&gt;vm()));
+}
+
</ins><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreruntimeExceptionHelpersh"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/runtime/ExceptionHelpers.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/runtime/ExceptionHelpers.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/runtime/ExceptionHelpers.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -33,10 +33,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-JS_EXPORT_PRIVATE JSObject* createInterruptedExecutionException(VM*);
-bool isInterruptedExecutionException(JSObject*);
-bool isInterruptedExecutionException(JSValue);
-
</del><span class="cx"> JSObject* createTerminatedExecutionException(VM*);
</span><span class="cx"> bool isTerminatedExecutionException(JSObject*);
</span><span class="cx"> JS_EXPORT_PRIVATE bool isTerminatedExecutionException(JSValue);
</span><span class="lines">@@ -53,35 +49,9 @@
</span><span class="cx"> 
</span><span class="cx"> JSObject* throwOutOfMemoryError(ExecState*);
</span><span class="cx"> JSObject* throwStackOverflowError(ExecState*);
</span><ins>+JSObject* throwTerminatedExecutionException(ExecState*);
</ins><span class="cx"> 
</span><span class="cx"> 
</span><del>-class InterruptedExecutionError : public JSNonFinalObject {
-private:
-    InterruptedExecutionError(VM&amp; vm)
-        : JSNonFinalObject(vm, vm.interruptedExecutionErrorStructure.get())
-    {
-    }
-
-    static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType);
-
-public:
-    typedef JSNonFinalObject Base;
-
-    static InterruptedExecutionError* create(VM&amp; vm)
-    {
-        InterruptedExecutionError* error = new (NotNull, allocateCell&lt;InterruptedExecutionError&gt;(vm.heap)) InterruptedExecutionError(vm);
-        error-&gt;finishCreation(vm);
-        return error;
-    }
-
-    static Structure* createStructure(VM&amp; vm, JSGlobalObject* globalObject, JSValue prototype)
-    {
-        return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &amp;s_info);
-    }
-
-    static const ClassInfo s_info;
-};
-
</del><span class="cx"> class TerminatedExecutionError : public JSNonFinalObject {
</span><span class="cx"> private:
</span><span class="cx">     TerminatedExecutionError(VM&amp; vm)
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreruntimeTerminatorh"></a>
<div class="delfile"><h4>Deleted: branches/dfgFourthTier/Source/JavaScriptCore/runtime/Terminator.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/runtime/Terminator.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/runtime/Terminator.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -1,47 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 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.
- * 3.  Neither the name of Google Inc. (&quot;Google&quot;) nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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 Terminator_h
-#define Terminator_h
-
-namespace JSC {
-
-class Terminator {
-public:
-    Terminator() : m_shouldTerminate(false) { }
-
-    void terminateSoon() { m_shouldTerminate = true; }
-    bool shouldTerminate() const { return m_shouldTerminate; }
-
-private:
-    bool m_shouldTerminate;
-};
-
-} // namespace JSC
-
-#endif // Terminator_h
</del></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreruntimeVMcpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/runtime/VM.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/runtime/VM.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/runtime/VM.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -204,7 +204,6 @@
</span><span class="cx">     structureStructure.set(*this, Structure::createStructure(*this));
</span><span class="cx">     structureRareDataStructure.set(*this, StructureRareData::createStructure(*this, 0, jsNull()));
</span><span class="cx">     debuggerActivationStructure.set(*this, DebuggerActivation::createStructure(*this, 0, jsNull()));
</span><del>-    interruptedExecutionErrorStructure.set(*this, InterruptedExecutionError::createStructure(*this, 0, jsNull()));
</del><span class="cx">     terminatedExecutionErrorStructure.set(*this, TerminatedExecutionError::createStructure(*this, 0, jsNull()));
</span><span class="cx">     stringStructure.set(*this, JSString::createStructure(*this, 0, jsNull()));
</span><span class="cx">     notAnObjectStructure.set(*this, JSNotAnObject::createStructure(*this, 0, jsNull()));
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreruntimeVMh"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/JavaScriptCore/runtime/VM.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/runtime/VM.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/JavaScriptCore/runtime/VM.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -46,9 +46,9 @@
</span><span class="cx"> #include &quot;PrototypeMap.h&quot;
</span><span class="cx"> #include &quot;SmallStrings.h&quot;
</span><span class="cx"> #include &quot;Strong.h&quot;
</span><del>-#include &quot;Terminator.h&quot;
</del><span class="cx"> #include &quot;ThunkGenerators.h&quot;
</span><span class="cx"> #include &quot;TypedArrayDescriptor.h&quot;
</span><ins>+#include &quot;Watchdog.h&quot;
</ins><span class="cx"> #include &quot;WeakRandom.h&quot;
</span><span class="cx"> #include &lt;wtf/BumpPointerAllocator.h&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="lines">@@ -216,6 +216,7 @@
</span><span class="cx">         VMType vmType;
</span><span class="cx">         ClientData* clientData;
</span><span class="cx">         ExecState* topCallFrame;
</span><ins>+        Watchdog watchdog;
</ins><span class="cx"> 
</span><span class="cx">         const HashTable* arrayConstructorTable;
</span><span class="cx">         const HashTable* arrayPrototypeTable;
</span><span class="lines">@@ -238,7 +239,6 @@
</span><span class="cx">         Strong&lt;Structure&gt; structureStructure;
</span><span class="cx">         Strong&lt;Structure&gt; structureRareDataStructure;
</span><span class="cx">         Strong&lt;Structure&gt; debuggerActivationStructure;
</span><del>-        Strong&lt;Structure&gt; interruptedExecutionErrorStructure;
</del><span class="cx">         Strong&lt;Structure&gt; terminatedExecutionErrorStructure;
</span><span class="cx">         Strong&lt;Structure&gt; stringStructure;
</span><span class="cx">         Strong&lt;Structure&gt; notAnObjectStructure;
</span><span class="lines">@@ -330,8 +330,6 @@
</span><span class="cx"> #endif
</span><span class="cx">         NativeExecutable* getHostFunction(NativeFunction, NativeFunction constructor);
</span><span class="cx"> 
</span><del>-        Terminator terminator;
-
</del><span class="cx">         JSValue exception;
</span><span class="cx">         RefCountedArray&lt;StackFrame&gt; exceptionStack;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreruntimeWatchdogcppfromrev148639trunkSourceJavaScriptCoreruntimeWatchdogcpp"></a>
<div class="copfile"><h4>Copied: branches/dfgFourthTier/Source/JavaScriptCore/runtime/Watchdog.cpp (from rev 148639, trunk/Source/JavaScriptCore/runtime/Watchdog.cpp) (0 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/runtime/Watchdog.cpp                                (rev 0)
+++ branches/dfgFourthTier/Source/JavaScriptCore/runtime/Watchdog.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -0,0 +1,199 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;Watchdog.h&quot;
+
+#include &quot;CallFrame.h&quot;
+#include &lt;wtf/CurrentTime.h&gt;
+#include &lt;wtf/MathExtras.h&gt;
+
+namespace JSC {
+
+#define NO_LIMIT std::numeric_limits&lt;double&gt;::infinity()
+
+Watchdog::Watchdog()
+    : m_timerDidFire(false)
+    , m_didFire(false)
+    , m_limit(NO_LIMIT)
+    , m_startTime(0)
+    , m_elapsedTime(0)
+    , m_reentryCount(0)
+    , m_isStopped(true)
+    , m_callback(0)
+    , m_callbackData1(0)
+    , m_callbackData2(0)
+{
+    initTimer();
+}
+
+Watchdog::~Watchdog()
+{
+    ASSERT(!isArmed());
+    stopCountdown();
+    destroyTimer();
+}
+
+void Watchdog::setTimeLimit(VM&amp; vm, double limit,
+    ShouldTerminateCallback callback, void* data1, void* data2)
+{
+    bool wasEnabled = isEnabled();
+
+    if (!m_isStopped)
+        stopCountdown();
+
+    m_didFire = false; // Reset the watchdog.
+
+    m_limit = limit;
+    m_callback = callback;
+    m_callbackData1 = data1;
+    m_callbackData2 = data2;
+
+    // If this is the first time that timeout is being enabled, then any
+    // previously JIT compiled code will not have the needed polling checks.
+    // Hence, we need to flush all the pre-existing compiled code.
+    //
+    // However, if the timeout is already enabled, and we're just changing the
+    // timeout value, then any existing JITted code will have the appropriate
+    // polling checks. Hence, there is no need to re-do this flushing.
+    if (!wasEnabled) {
+        // And if we've previously compiled any functions, we need to revert
+        // them because they don't have the needed polling checks yet.
+        vm.releaseExecutableMemory();
+    }
+
+    startCountdownIfNeeded();
+}
+
+bool Watchdog::didFire(ExecState* exec)
+{
+    if (m_didFire)
+        return true;
+
+    if (!m_timerDidFire)
+        return false;
+    m_timerDidFire = false;
+    stopCountdown();
+
+    double currentTime = currentCPUTime();
+    double deltaTime = currentTime - m_startTime;
+    double totalElapsedTime = m_elapsedTime + deltaTime;
+    if (totalElapsedTime &gt; m_limit) {
+        // Case 1: the allowed CPU time has elapsed.
+
+        // If m_callback is not set, then we terminate by default.
+        // Else, we let m_callback decide if we should terminate or not.
+        bool needsTermination = !m_callback
+            || m_callback(exec, m_callbackData1, m_callbackData2);
+        if (needsTermination) {
+            m_didFire = true;
+            return true;
+        }
+
+        // The m_callback may have set a new limit. So, we may need to restart
+        // the countdown.
+        startCountdownIfNeeded();
+
+    } else {
+        // Case 2: the allowed CPU time has NOT elapsed.
+
+        // Tell the timer to alarm us again when it thinks we've reached the
+        // end of the allowed time.
+        double remainingTime = m_limit - totalElapsedTime;
+        m_elapsedTime = totalElapsedTime;
+        m_startTime = currentTime;
+        startCountdown(remainingTime);
+    }
+
+    return false;
+}
+
+bool Watchdog::isEnabled()
+{
+    return (m_limit != NO_LIMIT);
+}
+
+void Watchdog::fire()
+{
+    m_didFire = true;
+}
+
+void Watchdog::arm()
+{
+    m_reentryCount++;
+    if (m_reentryCount == 1)
+        startCountdownIfNeeded();
+}
+
+void Watchdog::disarm()
+{
+    ASSERT(m_reentryCount &gt; 0);
+    if (m_reentryCount == 1)
+        stopCountdown();
+    m_reentryCount--;
+}
+
+void Watchdog::startCountdownIfNeeded()
+{
+    if (!m_isStopped)
+        return; // Already started.
+
+    if (!isArmed())
+        return; // Not executing JS script. No need to start.
+
+    if (isEnabled()) {
+        m_elapsedTime = 0;
+        m_startTime = currentCPUTime();
+        startCountdown(m_limit);
+    }
+}
+
+void Watchdog::startCountdown(double limit)
+{
+    ASSERT(m_isStopped);
+    m_isStopped = false;
+    startTimer(limit);
+}
+
+void Watchdog::stopCountdown()
+{
+    if (m_isStopped)
+        return;
+    stopTimer();
+    m_isStopped = true;
+}
+
+Watchdog::Scope::Scope(Watchdog&amp; watchdog)
+    : m_watchdog(watchdog)
+{
+    m_watchdog.arm();
+}
+
+Watchdog::Scope::~Scope()
+{
+    m_watchdog.disarm();
+}
+
+} // namespace JSC
</ins></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreruntimeWatchdoghfromrev148639trunkSourceJavaScriptCoreruntimeWatchdogh"></a>
<div class="copfile"><h4>Copied: branches/dfgFourthTier/Source/JavaScriptCore/runtime/Watchdog.h (from rev 148639, trunk/Source/JavaScriptCore/runtime/Watchdog.h) (0 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/runtime/Watchdog.h                                (rev 0)
+++ branches/dfgFourthTier/Source/JavaScriptCore/runtime/Watchdog.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -0,0 +1,116 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef Watchdog_h
+#define Watchdog_h
+
+#if PLATFORM(MAC) || PLATFORM(IOS)
+#include &lt;dispatch/dispatch.h&gt;    
+#endif
+
+namespace JSC {
+
+class ExecState;
+class VM;
+
+class Watchdog {
+public:
+    class Scope;
+
+    Watchdog();
+    ~Watchdog();
+
+    typedef bool (*ShouldTerminateCallback)(ExecState*, void* data1, void* data2);
+    void setTimeLimit(VM&amp;, double seconds, ShouldTerminateCallback = 0, void* data1 = 0, void* data2 = 0);
+
+    // This version of didFire() will check the elapsed CPU time and call the
+    // callback (if needed) to determine if the watchdog should fire.
+    bool didFire(ExecState*);
+
+    bool isEnabled();
+
+    // This version of didFire() is a more efficient version for when we want
+    // to know if the watchdog has fired in the past, and not whether it should
+    // fire right now.
+    JS_EXPORT_PRIVATE bool didFire() { return m_didFire; }
+    JS_EXPORT_PRIVATE void fire();
+
+    void* timerDidFireAddress() { return &amp;m_timerDidFire; }
+
+private:
+    void arm();
+    void disarm();
+    void startCountdownIfNeeded();
+    void startCountdown(double limit);
+    void stopCountdown();
+    bool isArmed() { return !!m_reentryCount; }
+
+    // Platform specific timer implementation:
+    void initTimer();
+    void destroyTimer();
+    void startTimer(double limit);
+    void stopTimer();
+
+    // m_timerDidFire (above) indicates whether the timer fired. The Watchdog
+    // still needs to check if the allowed CPU time has elapsed. If so, then
+    // the Watchdog fires and m_didFire will be set.
+    // NOTE: m_timerDidFire is only set by the platform specific timer
+    // (probably from another thread) but is only cleared in the script thread.
+    bool m_timerDidFire;
+    bool m_didFire;
+
+    // All time units are in seconds.
+    double m_limit;
+    double m_startTime;
+    double m_elapsedTime;
+
+    int m_reentryCount;
+    bool m_isStopped;
+
+    ShouldTerminateCallback m_callback;
+    void* m_callbackData1;
+    void* m_callbackData2;
+
+#if PLATFORM(MAC) || PLATFORM(IOS)
+    dispatch_queue_t m_queue;
+    dispatch_source_t m_timer;
+#endif
+
+    friend class Watchdog::Scope;
+    friend class LLIntOffsetsExtractor;
+};
+
+class Watchdog::Scope {
+public:
+    Scope(Watchdog&amp;);
+    ~Scope();
+
+private:
+    Watchdog&amp; m_watchdog;
+};
+
+} // namespace JSC
+
+#endif // Watchdog_h
</ins></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreruntimeWatchdogMaccppfromrev148639trunkSourceJavaScriptCoreruntimeWatchdogMaccpp"></a>
<div class="copfile"><h4>Copied: branches/dfgFourthTier/Source/JavaScriptCore/runtime/WatchdogMac.cpp (from rev 148639, trunk/Source/JavaScriptCore/runtime/WatchdogMac.cpp) (0 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/runtime/WatchdogMac.cpp                                (rev 0)
+++ branches/dfgFourthTier/Source/JavaScriptCore/runtime/WatchdogMac.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;Watchdog.h&quot;
+
+namespace JSC {
+
+void Watchdog::initTimer()
+{
+    m_queue = 0;
+    m_timer = 0;
+}
+
+void Watchdog::destroyTimer()
+{
+    ASSERT(!m_timer);
+    if (m_queue)
+        dispatch_release(m_queue);
+}
+
+void Watchdog::startTimer(double limit)
+{
+    ASSERT(!m_timer);
+    if (!m_queue)
+        m_queue = dispatch_queue_create(&quot;jsc.watchdog.queue&quot;, 0);
+    m_timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, m_queue);
+
+    dispatch_source_set_timer(m_timer,
+        dispatch_time(DISPATCH_TIME_NOW, limit * NSEC_PER_SEC),
+        DISPATCH_TIME_FOREVER, 0);
+
+    dispatch_source_set_event_handler(m_timer, ^{
+        m_timerDidFire = true;
+    });
+
+    dispatch_resume(m_timer);
+}
+
+void Watchdog::stopTimer()
+{
+    ASSERT(m_queue);
+    dispatch_sync(m_queue, ^{
+        dispatch_source_cancel(m_timer);
+    });
+    dispatch_release(m_timer);
+    m_timer = 0;
+}
+
+} // namespace JSC
</ins></span></pre></div>
<a id="branchesdfgFourthTierSourceJavaScriptCoreruntimeWatchdogNonecppfromrev148639trunkSourceJavaScriptCoreruntimeWatchdogNonecpp"></a>
<div class="copfile"><h4>Copied: branches/dfgFourthTier/Source/JavaScriptCore/runtime/WatchdogNone.cpp (from rev 148639, trunk/Source/JavaScriptCore/runtime/WatchdogNone.cpp) (0 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/JavaScriptCore/runtime/WatchdogNone.cpp                                (rev 0)
+++ branches/dfgFourthTier/Source/JavaScriptCore/runtime/WatchdogNone.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;Watchdog.h&quot;
+
+namespace JSC {
+
+// This is a stub for platforms that have not implemented this functionality.
+// In this case, the platform timer here never fires.
+
+void Watchdog::initTimer()
+{
+}
+
+void Watchdog::destroyTimer()
+{
+}
+
+void Watchdog::startTimer(double)
+{
+}
+
+void Watchdog::stopTimer()
+{
+}
+
+} // namespace JSC
</ins></span></pre></div>
<a id="branchesdfgFourthTierSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/WTF/ChangeLog (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/WTF/ChangeLog        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/WTF/ChangeLog        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -2,6 +2,16 @@
</span><span class="cx"> 
</span><span class="cx">         Merged from http://svn.webkit.org/repository/webkit/trunk
</span><span class="cx">         ------------------------------------------------------------------------
</span><ins>+        r148639 | mark.lam@apple.com | 2013-04-17 15:37:45 -0700 (Wed, 17 Apr 2013) | 127 lines
+        Added currentCPUTime() and currentCPUTimeMS().
+
+        https://bugs.webkit.org/show_bug.cgi?id=114577.
+        ------------------------------------------------------------------------
+
+2013-06-03  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Merged from http://svn.webkit.org/repository/webkit/trunk
+        ------------------------------------------------------------------------
</ins><span class="cx">         r146552 | mark.lam@apple.com | 2013-03-21 18:56:17 -0700 (Thu, 21 Mar 2013) | 50 lines
</span><span class="cx">         Introducing String::findNextLineStart().
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceWTFwtfCurrentTimecpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/WTF/wtf/CurrentTime.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/WTF/wtf/CurrentTime.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/WTF/wtf/CurrentTime.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -1,7 +1,8 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006, 2008, 2009, 2010 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008 Google Inc. All rights reserved.
</span><span class="cx">  * Copyright (C) 2007-2009 Torch Mobile, Inc.
</span><ins>+ * Copyright (C) 2008 Cameron Zwarich &lt;cwzwarich@uwaterloo.ca&gt;
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -34,6 +35,7 @@
</span><span class="cx"> #include &quot;CurrentTime.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><ins>+#include &lt;mach/mach.h&gt;
</ins><span class="cx"> #include &lt;mach/mach_time.h&gt;
</span><span class="cx"> #include &lt;sys/time.h&gt;
</span><span class="cx"> #elif OS(WINDOWS)
</span><span class="lines">@@ -333,6 +335,53 @@
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+double currentCPUTime()
+{
+#if OS(DARWIN)
+    mach_msg_type_number_t infoCount = THREAD_BASIC_INFO_COUNT;
+    thread_basic_info_data_t info;
+
+    // Get thread information
+    mach_port_t threadPort = mach_thread_self();
+    thread_info(threadPort, THREAD_BASIC_INFO, reinterpret_cast&lt;thread_info_t&gt;(&amp;info), &amp;infoCount);
+    mach_port_deallocate(mach_task_self(), threadPort);
+    
+    double time = info.user_time.seconds + info.user_time.microseconds / 1000000.;
+    time += info.system_time.seconds + info.system_time.microseconds / 1000000.;
+    
+    return time;
+#elif OS(WINDOWS)
+    union {
+        FILETIME fileTime;
+        unsigned long long fileTimeAsLong;
+    } userTime, kernelTime;
+    
+    // GetThreadTimes won't accept null arguments so we pass these even though
+    // they're not used.
+    FILETIME creationTime, exitTime;
+    
+    GetThreadTimes(GetCurrentThread(), &amp;creationTime, &amp;exitTime, &amp;kernelTime.fileTime, &amp;userTime.fileTime);
+    
+    return userTime.fileTimeAsLong / 10000000. + kernelTime.fileTimeAsLong / 10000000.;
+#elif OS(QNX)
+    struct timespec time;
+    if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &amp;time))
+        CRASH();
+    return time.tv_sec + time.tv_nsec / 1.0e9;
+#else
+    // FIXME: We should return the time the current thread has spent executing.
+
+    // use a relative time from first call in order to avoid an overflow
+    static double firstTime = currentTime();
+    return currentTime() - firstTime;
+#endif
+}
+
+double currentCPUTimeMS()
+{
+    return currentCPUTime() * 1000;
+}
+
</ins><span class="cx"> #endif // !PLATFORM(CHROMIUM)
</span><span class="cx"> 
</span><span class="cx"> } // namespace WTF
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceWTFwtfCurrentTimeh"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/WTF/wtf/CurrentTime.h (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/WTF/wtf/CurrentTime.h        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/WTF/wtf/CurrentTime.h        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -51,10 +51,19 @@
</span><span class="cx"> // On unsupported platforms, this function only guarantees the result will be non-decreasing.
</span><span class="cx"> WTF_EXPORT_PRIVATE double monotonicallyIncreasingTime();
</span><span class="cx"> 
</span><ins>+// Returns the current CPU time of the current thread in seconds.
+// Precision varies depending on platform but is usually as good or better
+// than a millisecond.
+WTF_EXPORT_PRIVATE double currentCPUTime();
+
+// Returns the current CPU time of the current thread in milliseconds.
+WTF_EXPORT_PRIVATE double currentCPUTimeMS();
+
</ins><span class="cx"> } // namespace WTF
</span><span class="cx"> 
</span><span class="cx"> using WTF::currentTime;
</span><span class="cx"> using WTF::currentTimeMS;
</span><span class="cx"> using WTF::monotonicallyIncreasingTime;
</span><ins>+using WTF::currentCPUTime;
</ins><span class="cx"> 
</span><span class="cx"> #endif // CurrentTime_h
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/WebCore/ChangeLog (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/WebCore/ChangeLog        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/WebCore/ChangeLog        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -2,6 +2,16 @@
</span><span class="cx"> 
</span><span class="cx">         Merged from http://svn.webkit.org/repository/webkit/trunk
</span><span class="cx">         ------------------------------------------------------------------------
</span><ins>+        r148639 | mark.lam@apple.com | 2013-04-17 15:37:45 -0700 (Wed, 17 Apr 2013) | 127 lines
+        Add LLINT and baseline JIT support for timing out scripts.
+
+        https://bugs.webkit.org/show_bug.cgi?id=114577.
+        ------------------------------------------------------------------------
+
+2013-06-03  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Merged from http://svn.webkit.org/repository/webkit/trunk
+        ------------------------------------------------------------------------
</ins><span class="cx">         r148119 | ggaren@apple.com | 2013-04-10 11:51:47 -0700 (Wed, 10 Apr 2013) | 106 lines
</span><span class="cx">         Removed bitrotted TimeoutChecker code
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceWebCorebindingsjsJSEventListenercpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/WebCore/bindings/js/JSEventListener.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/WebCore/bindings/js/JSEventListener.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/WebCore/bindings/js/JSEventListener.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx"> #if ENABLE(WORKERS)
</span><span class="cx">         if (scriptExecutionContext-&gt;isWorkerContext()) {
</span><span class="cx">             bool terminatorCausedException = (exec-&gt;hadException() &amp;&amp; isTerminatedExecutionException(exec-&gt;exception()));
</span><del>-            if (terminatorCausedException || vm.terminator.shouldTerminate())
</del><ins>+            if (terminatorCausedException || vm.watchdog.didFire())
</ins><span class="cx">                 static_cast&lt;WorkerContext*&gt;(scriptExecutionContext)-&gt;script()-&gt;forbidExecution();
</span><span class="cx">         }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceWebCorebindingsjsSerializedScriptValuecpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/WebCore/bindings/js/SerializedScriptValue.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/WebCore/bindings/js/SerializedScriptValue.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/WebCore/bindings/js/SerializedScriptValue.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -1902,9 +1902,6 @@
</span><span class="cx">     case StackOverflowError:
</span><span class="cx">         throwError(exec, createStackOverflowError(exec));
</span><span class="cx">         break;
</span><del>-    case InterruptedExecutionError:
-        throwError(exec, createInterruptedExecutionException(&amp;exec-&gt;vm()));
-        break;
</del><span class="cx">     case ValidationError:
</span><span class="cx">         throwError(exec, createTypeError(exec, &quot;Unable to deserialize data.&quot;));
</span><span class="cx">         break;
</span></span></pre></div>
<a id="branchesdfgFourthTierSourceWebCorebindingsjsWorkerScriptControllercpp"></a>
<div class="modfile"><h4>Modified: branches/dfgFourthTier/Source/WebCore/bindings/js/WorkerScriptController.cpp (151154 => 151155)</h4>
<pre class="diff"><span>
<span class="info">--- branches/dfgFourthTier/Source/WebCore/bindings/js/WorkerScriptController.cpp        2013-06-04 05:09:48 UTC (rev 151154)
+++ branches/dfgFourthTier/Source/WebCore/bindings/js/WorkerScriptController.cpp        2013-06-04 05:37:21 UTC (rev 151155)
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx">     JSValue evaluationException;
</span><span class="cx">     JSC::evaluate(exec, sourceCode.jsSourceCode(), m_workerContextWrapper.get(), &amp;evaluationException);
</span><span class="cx"> 
</span><del>-    if ((evaluationException &amp;&amp; isTerminatedExecutionException(evaluationException)) ||  m_workerContextWrapper-&gt;vm().terminator.shouldTerminate()) {
</del><ins>+    if ((evaluationException &amp;&amp; isTerminatedExecutionException(evaluationException)) ||  m_workerContextWrapper-&gt;vm().watchdog.didFire()) {
</ins><span class="cx">         forbidExecution();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -164,14 +164,14 @@
</span><span class="cx">     // termination is scheduled, isExecutionTerminating will
</span><span class="cx">     // accurately reflect that state when called from another thread.
</span><span class="cx">     MutexLocker locker(m_scheduledTerminationMutex);
</span><del>-    m_vm-&gt;terminator.terminateSoon();
</del><ins>+    m_vm-&gt;watchdog.fire();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool WorkerScriptController::isExecutionTerminating() const
</span><span class="cx"> {
</span><span class="cx">     // See comments in scheduleExecutionTermination regarding mutex usage.
</span><span class="cx">     MutexLocker locker(m_scheduledTerminationMutex);
</span><del>-    return m_vm-&gt;terminator.shouldTerminate();
</del><ins>+    return m_vm-&gt;watchdog.didFire();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WorkerScriptController::forbidExecution()
</span></span></pre>
</div>
</div>

</body>
</html>