<!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>[37622] trunk</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/37622">37622</a></dd>
<dt>Author</dt> <dd>ggaren@apple.com</dd>
<dt>Date</dt> <dd>2008-10-15 16:33:07 -0700 (Wed, 15 Oct 2008)</dd>
</dl>

<h3>Log Message</h3>
<pre>JavaScriptCore:

2008-10-15  Geoffrey Garen  &lt;ggaren@apple.com&gt;

        Reviewed by Cameron Zwarich.

        Fixed https://bugs.webkit.org/show_bug.cgi?id=21345
        Start the debugger without reloading the inspected page

        * JavaScriptCore.exp: New symbols.
        * JavaScriptCore.xcodeproj/project.pbxproj: New files.

        * VM/CodeBlock.h:
        (JSC::EvalCodeCache::get): Updated for tweak to parsing API.

        * kjs/CollectorHeapIterator.h: Added. An iterator for the object heap,
        which we use to find all the live functions and recompile them.

        * kjs/DebuggerCallFrame.cpp:
        (JSC::DebuggerCallFrame::evaluate): Updated for tweak to parsing API.

        * kjs/FunctionConstructor.cpp:
        (JSC::constructFunction): Updated for tweak to parsing API.

        * kjs/JSFunction.cpp:
        (JSC::JSFunction::JSFunction): Try to validate our SourceCode in debug
        builds by ASSERTing that it's syntactically valid. This doesn't catch
        all SourceCode bugs, but it catches a lot of them.

        * kjs/JSGlobalObjectFunctions.cpp:
        (JSC::globalFuncEval): Updated for tweak to parsing API.

        * kjs/Parser.cpp:
        (JSC::Parser::parse):
        * kjs/Parser.h:
        (JSC::Parser::parse): Tweaked the parser to make it possible to parse
        without an ExecState, and to allow the client to specify a debugger to
        notify (or not) about the source we parse. This allows the inspector
        to recompile even though no JavaScript is executing, then notify the
        debugger about all source code when it's done.

        * kjs/Shell.cpp:
        (prettyPrintScript): Updated for tweak to parsing API.

        * kjs/SourceRange.h:
        (JSC::SourceCode::isNull): Added to help with ASSERTs.

        * kjs/collector.cpp:
        (JSC::Heap::heapAllocate):
        (JSC::Heap::sweep):
        (JSC::Heap::primaryHeapBegin):
        (JSC::Heap::primaryHeapEnd):
        * kjs/collector.h:
        (JSC::): Moved a bunch of declarations around to enable compilation of
        CollectorHeapIterator.

        * kjs/interpreter.cpp:
        (JSC::Interpreter::checkSyntax):
        (JSC::Interpreter::evaluate): Updated for tweak to parsing API.

        * kjs/lexer.h:
        (JSC::Lexer::sourceCode): BUG FIX: Calculate SourceCode ranges relative
        to the SourceCode range in which we're lexing, otherwise nested functions
        that are compiled individually get SourceCode ranges that don't reflect
        their nesting.

        * kjs/nodes.cpp:
        (JSC::FunctionBodyNode::FunctionBodyNode):
        (JSC::FunctionBodyNode::finishParsing):
        (JSC::FunctionBodyNode::create):
        (JSC::FunctionBodyNode::copyParameters):
        * kjs/nodes.h:
        (JSC::ScopeNode::setSource):
        (JSC::FunctionBodyNode::parameterCount): Added some helper functions for
        copying one FunctionBodyNode's parameters to another. The recompiler uses
        these when calling &quot;finishParsing&quot;.

WebCore:

2008-10-15  Geoffrey Garen  &lt;ggaren@apple.com&gt;

        Reviewed by Cameron Zwarich.

        Fixed https://bugs.webkit.org/show_bug.cgi?id=21345
        Start the debugger without reloading the inspected page

        * WebCore.base.exp: New symbols.

        * ForwardingHeaders/kjs/CollectorHeapIterator.h: Copied from ForwardingHeaders/kjs/ustring.h.
        * ForwardingHeaders/kjs/Parser.h: Copied from ForwardingHeaders/kjs/ustring.h.
        * WebCore.xcodeproj/project.pbxproj: New forwarding headers.

        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::setWindowVisible):
        (WebCore::InspectorController::windowScriptObjectAvailable):
        (WebCore::InspectorController::startDebugging):
        * inspector/InspectorController.h: Renamed startDebuggingAndReloadInspectedPage
        to startDebugging, and changed its behavior to match.

        * inspector/JavaScriptDebugListener.h:
        * inspector/JavaScriptDebugServer.cpp:
        (WebCore::JavaScriptDebugServer::JavaScriptDebugServer):
        (WebCore::JavaScriptDebugServer::addListener):
        (WebCore::JavaScriptDebugServer::removeListener):
        (WebCore::JavaScriptDebugServer::recompileAllJSFunctions):
        (WebCore::JavaScriptDebugServer::willAddFirstListener):
        (WebCore::JavaScriptDebugServer::didRemoveLastListener):
        * inspector/JavaScriptDebugServer.h: Refactored the
        JavaScriptDebugServer to centralize handling of adding the first listener
        and removing the last. Then, added a feature to recompile all JS functions
        in these cases. This allows us to dynamically add and remove hooks like
        the debugger hooks without reloading the page.

        * inspector/front-end/ScriptsPanel.js:
        * English.lproj/localizedStrings.js: Updated for startDebuggingAndReloadInspectedPage =&gt;
        startDebugging rename. Removed all UI that claimed that starting the
        debugger would reload the page.

WebKit/mac:

2008-10-15  Geoffrey Garen  &lt;ggaren@apple.com&gt;

        Reviewed by Cameron Zwarich.

        Fixed https://bugs.webkit.org/show_bug.cgi?id=21345
        Start the debugger without reloading the inspected page

        * WebInspector/WebInspector.mm:
        (-[WebInspector startDebuggingJavaScript:]): Updated for rename.

WebKit/win:

2008-10-15  Geoffrey Garen  &lt;ggaren@apple.com&gt;

        Reviewed by Cameron Zwarich.

        Fixed https://bugs.webkit.org/show_bug.cgi?id=21345
        Start the debugger without reloading the inspected page

        * WebInspector.cpp:
        (WebInspector::toggleDebuggingJavaScript): Updated for rename.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkJavaScriptCoreChangeLog">trunk/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkJavaScriptCoreJavaScriptCoreexp">trunk/JavaScriptCore/JavaScriptCore.exp</a></li>
<li><a href="#trunkJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkJavaScriptCoreVMCodeBlockh">trunk/JavaScriptCore/VM/CodeBlock.h</a></li>
<li><a href="#trunkJavaScriptCorekjsDebuggerCallFramecpp">trunk/JavaScriptCore/kjs/DebuggerCallFrame.cpp</a></li>
<li><a href="#trunkJavaScriptCorekjsFunctionConstructorcpp">trunk/JavaScriptCore/kjs/FunctionConstructor.cpp</a></li>
<li><a href="#trunkJavaScriptCorekjsJSFunctioncpp">trunk/JavaScriptCore/kjs/JSFunction.cpp</a></li>
<li><a href="#trunkJavaScriptCorekjsJSGlobalObjectFunctionscpp">trunk/JavaScriptCore/kjs/JSGlobalObjectFunctions.cpp</a></li>
<li><a href="#trunkJavaScriptCorekjsParsercpp">trunk/JavaScriptCore/kjs/Parser.cpp</a></li>
<li><a href="#trunkJavaScriptCorekjsParserh">trunk/JavaScriptCore/kjs/Parser.h</a></li>
<li><a href="#trunkJavaScriptCorekjsShellcpp">trunk/JavaScriptCore/kjs/Shell.cpp</a></li>
<li><a href="#trunkJavaScriptCorekjsSourceRangeh">trunk/JavaScriptCore/kjs/SourceRange.h</a></li>
<li><a href="#trunkJavaScriptCorekjscollectorcpp">trunk/JavaScriptCore/kjs/collector.cpp</a></li>
<li><a href="#trunkJavaScriptCorekjscollectorh">trunk/JavaScriptCore/kjs/collector.h</a></li>
<li><a href="#trunkJavaScriptCorekjsinterpretercpp">trunk/JavaScriptCore/kjs/interpreter.cpp</a></li>
<li><a href="#trunkJavaScriptCorekjslexerh">trunk/JavaScriptCore/kjs/lexer.h</a></li>
<li><a href="#trunkJavaScriptCorekjsnodescpp">trunk/JavaScriptCore/kjs/nodes.cpp</a></li>
<li><a href="#trunkJavaScriptCorekjsnodesh">trunk/JavaScriptCore/kjs/nodes.h</a></li>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreEnglishlprojlocalizedStringsjs">trunk/WebCore/English.lproj/localizedStrings.js</a></li>
<li><a href="#trunkWebCoreWebCorebaseexp">trunk/WebCore/WebCore.base.exp</a></li>
<li><a href="#trunkWebCoreWebCorexcodeprojprojectpbxproj">trunk/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkWebCoreinspectorInspectorControllercpp">trunk/WebCore/inspector/InspectorController.cpp</a></li>
<li><a href="#trunkWebCoreinspectorInspectorControllerh">trunk/WebCore/inspector/InspectorController.h</a></li>
<li><a href="#trunkWebCoreinspectorJavaScriptDebugListenerh">trunk/WebCore/inspector/JavaScriptDebugListener.h</a></li>
<li><a href="#trunkWebCoreinspectorJavaScriptDebugServercpp">trunk/WebCore/inspector/JavaScriptDebugServer.cpp</a></li>
<li><a href="#trunkWebCoreinspectorJavaScriptDebugServerh">trunk/WebCore/inspector/JavaScriptDebugServer.h</a></li>
<li><a href="#trunkWebCoreinspectorfrontendScriptsPaneljs">trunk/WebCore/inspector/front-end/ScriptsPanel.js</a></li>
<li><a href="#trunkWebKitmacChangeLog">trunk/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkWebKitmacWebInspectorWebInspectormm">trunk/WebKit/mac/WebInspector/WebInspector.mm</a></li>
<li><a href="#trunkWebKitwinChangeLog">trunk/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkWebKitwinWebInspectorcpp">trunk/WebKit/win/WebInspector.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkJavaScriptCorekjsCollectorHeapIteratorh">trunk/JavaScriptCore/kjs/CollectorHeapIterator.h</a></li>
<li><a href="#trunkWebCoreForwardingHeaderskjsCollectorHeapIteratorh">trunk/WebCore/ForwardingHeaders/kjs/CollectorHeapIterator.h</a></li>
<li><a href="#trunkWebCoreForwardingHeaderskjsParserh">trunk/WebCore/ForwardingHeaders/kjs/Parser.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/ChangeLog (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/ChangeLog        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/ChangeLog        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -1,3 +1,78 @@
</span><ins>+2008-10-15  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
+        Reviewed by Cameron Zwarich.
+
+        Fixed https://bugs.webkit.org/show_bug.cgi?id=21345
+        Start the debugger without reloading the inspected page
+
+        * JavaScriptCore.exp: New symbols.
+        * JavaScriptCore.xcodeproj/project.pbxproj: New files.
+
+        * VM/CodeBlock.h:
+        (JSC::EvalCodeCache::get): Updated for tweak to parsing API.
+
+        * kjs/CollectorHeapIterator.h: Added. An iterator for the object heap,
+        which we use to find all the live functions and recompile them.
+
+        * kjs/DebuggerCallFrame.cpp:
+        (JSC::DebuggerCallFrame::evaluate): Updated for tweak to parsing API.
+
+        * kjs/FunctionConstructor.cpp:
+        (JSC::constructFunction): Updated for tweak to parsing API.
+
+        * kjs/JSFunction.cpp:
+        (JSC::JSFunction::JSFunction): Try to validate our SourceCode in debug
+        builds by ASSERTing that it's syntactically valid. This doesn't catch
+        all SourceCode bugs, but it catches a lot of them.
+
+        * kjs/JSGlobalObjectFunctions.cpp:
+        (JSC::globalFuncEval): Updated for tweak to parsing API.
+
+        * kjs/Parser.cpp:
+        (JSC::Parser::parse):
+        * kjs/Parser.h:
+        (JSC::Parser::parse): Tweaked the parser to make it possible to parse
+        without an ExecState, and to allow the client to specify a debugger to
+        notify (or not) about the source we parse. This allows the inspector
+        to recompile even though no JavaScript is executing, then notify the
+        debugger about all source code when it's done.
+
+        * kjs/Shell.cpp:
+        (prettyPrintScript): Updated for tweak to parsing API.
+
+        * kjs/SourceRange.h:
+        (JSC::SourceCode::isNull): Added to help with ASSERTs.
+
+        * kjs/collector.cpp:
+        (JSC::Heap::heapAllocate):
+        (JSC::Heap::sweep):
+        (JSC::Heap::primaryHeapBegin):
+        (JSC::Heap::primaryHeapEnd):
+        * kjs/collector.h:
+        (JSC::): Moved a bunch of declarations around to enable compilation of
+        CollectorHeapIterator.
+
+        * kjs/interpreter.cpp:
+        (JSC::Interpreter::checkSyntax):
+        (JSC::Interpreter::evaluate): Updated for tweak to parsing API.
+
+        * kjs/lexer.h:
+        (JSC::Lexer::sourceCode): BUG FIX: Calculate SourceCode ranges relative
+        to the SourceCode range in which we're lexing, otherwise nested functions
+        that are compiled individually get SourceCode ranges that don't reflect
+        their nesting.
+
+        * kjs/nodes.cpp:
+        (JSC::FunctionBodyNode::FunctionBodyNode):
+        (JSC::FunctionBodyNode::finishParsing):
+        (JSC::FunctionBodyNode::create):
+        (JSC::FunctionBodyNode::copyParameters):
+        * kjs/nodes.h:
+        (JSC::ScopeNode::setSource):
+        (JSC::FunctionBodyNode::parameterCount): Added some helper functions for
+        copying one FunctionBodyNode's parameters to another. The recompiler uses
+        these when calling &quot;finishParsing&quot;.
+
</ins><span class="cx"> 2008-10-15  Joerg Bornemann  &lt;joerg.bornemann@trolltech.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin Adler.
</span></span></pre></div>
<a id="trunkJavaScriptCoreJavaScriptCoreexp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/JavaScriptCore.exp (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/JavaScriptCore.exp        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/JavaScriptCore.exp        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -95,6 +95,7 @@
</span><span class="cx"> __ZN3JSC10Identifier24checkSameIdentifierTableEPNS_9ExecStateEPNS_7UString3RepE 
</span><span class="cx"> __ZN3JSC10Identifier3addEPNS_9ExecStateEPKc
</span><span class="cx"> __ZN3JSC10Identifier5equalEPKNS_7UString3RepEPKc
</span><ins>+__ZN3JSC10JSFunction4infoE
</ins><span class="cx"> __ZN3JSC10throwErrorEPNS_9ExecStateENS_9ErrorTypeE
</span><span class="cx"> __ZN3JSC10throwErrorEPNS_9ExecStateENS_9ErrorTypeEPKc
</span><span class="cx"> __ZN3JSC10throwErrorEPNS_9ExecStateENS_9ErrorTypeERKNS_7UStringE
</span><span class="lines">@@ -153,6 +154,9 @@
</span><span class="cx"> __ZN3JSC14JSGlobalObjectnwEmPNS_12JSGlobalDataE
</span><span class="cx"> __ZN3JSC14constructArrayEPNS_9ExecStateERKNS_7ArgListE
</span><span class="cx"> __ZN3JSC15JSWrapperObject4markEv
</span><ins>+__ZN3JSC16FunctionBodyNode13finishParsingEPNS_10IdentifierEm
+__ZN3JSC16FunctionBodyNode14copyParametersEv
+__ZN3JSC16FunctionBodyNode6createEPNS_12JSGlobalDataEPNS_14SourceElementsEPN3WTF6VectorISt4pairINS_10IdentifierEjELm16EEEPNS6_INS5_6RefPtrINS_12FuncDeclNodeEEELm16EEERKNS_10SourceCodeEji
</ins><span class="cx"> __ZN3JSC16InternalFunction4infoE
</span><span class="cx"> __ZN3JSC16InternalFunctionC2EPNS_12JSGlobalDataEN3WTF10PassRefPtrINS_11StructureIDEEERKNS_10IdentifierE
</span><span class="cx"> __ZN3JSC16JSVariableObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE
</span><span class="lines">@@ -169,7 +173,9 @@
</span><span class="cx"> __ZN3JSC23objectProtoFuncToStringEPNS_9ExecStateEPNS_8JSObjectEPNS_7JSValueERKNS_7ArgListE
</span><span class="cx"> __ZN3JSC23setUpStaticFunctionSlotEPNS_9ExecStateEPKNS_9HashEntryEPNS_8JSObjectERKNS_10IdentifierERNS_12PropertySlotE
</span><span class="cx"> __ZN3JSC4Heap14allocateNumberEm
</span><ins>+__ZN3JSC4Heap14primaryHeapEndEv
</ins><span class="cx"> __ZN3JSC4Heap15recordExtraCostEm
</span><ins>+__ZN3JSC4Heap16primaryHeapBeginEv
</ins><span class="cx"> __ZN3JSC4Heap17globalObjectCountEv
</span><span class="cx"> __ZN3JSC4Heap20protectedObjectCountEv
</span><span class="cx"> __ZN3JSC4Heap24setGCProtectNeedsLockingEv
</span><span class="lines">@@ -202,7 +208,7 @@
</span><span class="cx"> __ZN3JSC6JSLock6unlockEb
</span><span class="cx"> __ZN3JSC6JSLock9lockCountEv
</span><span class="cx"> __ZN3JSC6JSLockC1EPNS_9ExecStateE
</span><del>-__ZN3JSC6Parser5parseEPNS_9ExecStateEPiPNS_7UStringE
</del><ins>+__ZN3JSC6Parser5parseEPNS_12JSGlobalDataEPiPNS_7UStringE
</ins><span class="cx"> __ZN3JSC6strtodEPKcPPc
</span><span class="cx"> __ZN3JSC7ArgList10slowAppendEPNS_7JSValueE
</span><span class="cx"> __ZN3JSC7CStringD1Ev
</span></span></pre></div>
<a id="trunkJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -69,6 +69,7 @@
</span><span class="cx">                 14BD5A300A3E91F600BAF59C /* JSContextRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14BD5A290A3E91F600BAF59C /* JSContextRef.cpp */; };
</span><span class="cx">                 14BD5A320A3E91F600BAF59C /* JSValueRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14BD5A2B0A3E91F600BAF59C /* JSValueRef.cpp */; };
</span><span class="cx">                 14E0FF120DBAAED00007C0AB /* Machine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 149B15E70D81F986009CB8C7 /* Machine.cpp */; settings = {COMPILER_FLAGS = &quot;-fno-tree-pre&quot;; }; };
</span><ins>+                14F3488F0E95EF8A003648BC /* CollectorHeapIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F3488E0E95EF8A003648BC /* CollectorHeapIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 5D53726F0E1C54880021E549 /* Tracing.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D53726E0E1C54880021E549 /* Tracing.h */; };
</span><span class="cx">                 5D5D8AB60E0D0A7200F9C692 /* jsc in Copy Into Framework */ = {isa = PBXBuildFile; fileRef = 932F5BE10822A1C700736975 /* jsc */; };
</span><span class="cx">                 5D5D8AD10E0D0EBE00F9C692 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */; };
</span><span class="lines">@@ -515,6 +516,7 @@
</span><span class="cx">                 14DA818F0D99FD2000B0A4FB /* JSActivation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSActivation.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 14DE0D680D02431400AACCA2 /* JSGlobalObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGlobalObject.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 14F252560D08DD8D004ECFFF /* JSVariableObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVariableObject.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                14F3488E0E95EF8A003648BC /* CollectorHeapIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollectorHeapIterator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1C9051420BA9E8A70081E9D0 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = JavaScriptCore.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1C9051440BA9E8A70081E9D0 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1296,6 +1298,7 @@
</span><span class="cx">                                 F692A8860255597D01FF60F7 /* ustring.h */,
</span><span class="cx">                                 147B83AA0E6DB8C9004775A4 /* BatchedTransitionOptimizer.h */,
</span><span class="cx">                                 147B84620E6DE6B1004775A4 /* PutPropertySlot.h */,
</span><ins>+                                14F3488E0E95EF8A003648BC /* CollectorHeapIterator.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = kjs;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -1600,6 +1603,7 @@
</span><span class="cx">                                 7E2ADD8E0E79AAD500D50C51 /* CharacterClassConstructor.h in Headers */,
</span><span class="cx">                                 140D17D70E8AD4A9000CD17D /* JSBasePrivate.h in Headers */,
</span><span class="cx">                                 869EBCB70E8C6D4A008722CC /* ResultType.h in Headers */,
</span><ins>+                                14F3488F0E95EF8A003648BC /* CollectorHeapIterator.h in Headers */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span></span></pre></div>
<a id="trunkJavaScriptCoreVMCodeBlockh"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/VM/CodeBlock.h (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/VM/CodeBlock.h        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/VM/CodeBlock.h        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx">                 UString errMsg;
</span><span class="cx">                 
</span><span class="cx">                 SourceCode source = makeSource(evalSource);
</span><del>-                evalNode = exec-&gt;globalData().parser-&gt;parse&lt;EvalNode&gt;(exec, source, &amp;errLine, &amp;errMsg);
</del><ins>+                evalNode = exec-&gt;globalData().parser-&gt;parse&lt;EvalNode&gt;(exec, exec-&gt;dynamicGlobalObject()-&gt;debugger(), source, &amp;errLine, &amp;errMsg);
</ins><span class="cx">                 if (evalNode) {
</span><span class="cx">                     if (evalSource.size() &lt; maxCacheableSourceLength &amp;&amp; (*scopeChain-&gt;begin())-&gt;isVariableObject() &amp;&amp; cacheMap.size() &lt; maxCacheEntries)
</span><span class="cx">                         cacheMap.set(evalSource.rep(), evalNode);
</span></span></pre></div>
<a id="trunkJavaScriptCorekjsCollectorHeapIteratorh"></a>
<div class="addfile"><h4>Added: trunk/JavaScriptCore/kjs/CollectorHeapIterator.h (0 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/CollectorHeapIterator.h                                (rev 0)
+++ trunk/JavaScriptCore/kjs/CollectorHeapIterator.h        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+/*
+ * Copyright (C) 2008 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;collector.h&quot;
+
+namespace JSC {
+
+    template &lt;HeapType heapType&gt; class CollectorHeapIterator {
+    public:
+        CollectorHeapIterator(CollectorBlock** block, CollectorBlock** endBlock);
+
+        bool operator!=(const CollectorHeapIterator&lt;heapType&gt;&amp; other) { return m_block != other.m_block || m_cell != other.m_cell; }
+        CollectorHeapIterator&lt;heapType&gt;&amp; operator++();
+        JSCell* operator*() const;
+    
+    private:
+        typedef typename HeapConstants&lt;heapType&gt;::Block Block;
+        typedef typename HeapConstants&lt;heapType&gt;::Cell Cell;
+
+        Block** m_block;
+        Block** m_endBlock;
+        Cell* m_cell;
+        Cell* m_endCell;
+    };
+
+    template &lt;HeapType heapType&gt; 
+    CollectorHeapIterator&lt;heapType&gt;::CollectorHeapIterator(CollectorBlock** block, CollectorBlock** endBlock)
+        : m_block(reinterpret_cast&lt;Block**&gt;(block))
+        , m_endBlock(reinterpret_cast&lt;Block**&gt;(endBlock))
+        , m_cell(m_block == m_endBlock ? 0 : (*m_block)-&gt;cells)
+        , m_endCell(m_block == m_endBlock ? 0 : (*m_block)-&gt;cells + HeapConstants&lt;heapType&gt;::cellsPerBlock)
+    {
+        if (m_cell &amp;&amp; m_cell-&gt;u.freeCell.zeroIfFree == 0)
+            ++*this;
+    }
+
+    template &lt;HeapType heapType&gt; 
+    CollectorHeapIterator&lt;heapType&gt;&amp; CollectorHeapIterator&lt;heapType&gt;::operator++()
+    {
+        do {
+            for (++m_cell; m_cell != m_endCell; ++m_cell)
+                if (m_cell-&gt;u.freeCell.zeroIfFree != 0) {
+                    return *this;
+                }
+
+            if (++m_block != m_endBlock) {
+                m_cell = (*m_block)-&gt;cells;
+                m_endCell = (*m_block)-&gt;cells + HeapConstants&lt;heapType&gt;::cellsPerBlock;
+            }
+        } while(m_block != m_endBlock);
+
+        m_cell = 0;
+        return *this;
+    }
+
+    template &lt;HeapType heapType&gt; 
+    JSCell* CollectorHeapIterator&lt;heapType&gt;::operator*() const
+    {
+        return reinterpret_cast&lt;JSCell*&gt;(m_cell);
+    }
+
+} // namespace JSC
</ins></span></pre></div>
<a id="trunkJavaScriptCorekjsDebuggerCallFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/kjs/DebuggerCallFrame.cpp (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/DebuggerCallFrame.cpp        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/kjs/DebuggerCallFrame.cpp        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">     int errLine;
</span><span class="cx">     UString errMsg;
</span><span class="cx">     SourceCode source = makeSource(script);
</span><del>-    RefPtr&lt;EvalNode&gt; evalNode = m_callFrame-&gt;scopeChain()-&gt;globalData-&gt;parser-&gt;parse&lt;EvalNode&gt;(m_callFrame, source, &amp;errLine, &amp;errMsg);
</del><ins>+    RefPtr&lt;EvalNode&gt; evalNode = m_callFrame-&gt;scopeChain()-&gt;globalData-&gt;parser-&gt;parse&lt;EvalNode&gt;(m_callFrame, m_callFrame-&gt;dynamicGlobalObject()-&gt;debugger(), source, &amp;errLine, &amp;errMsg);
</ins><span class="cx">     if (!evalNode)
</span><span class="cx">         return Error::create(m_callFrame, SyntaxError, errMsg, errLine, source.provider()-&gt;asID(), source.provider()-&gt;url());
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkJavaScriptCorekjsFunctionConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/kjs/FunctionConstructor.cpp (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/FunctionConstructor.cpp        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/kjs/FunctionConstructor.cpp        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx">     int errLine;
</span><span class="cx">     UString errMsg;
</span><span class="cx">     SourceCode source = makeSource(body, sourceURL, lineNumber);
</span><del>-    RefPtr&lt;FunctionBodyNode&gt; functionBody = exec-&gt;globalData().parser-&gt;parse&lt;FunctionBodyNode&gt;(exec, source, &amp;errLine, &amp;errMsg);
</del><ins>+    RefPtr&lt;FunctionBodyNode&gt; functionBody = exec-&gt;globalData().parser-&gt;parse&lt;FunctionBodyNode&gt;(exec, exec-&gt;dynamicGlobalObject()-&gt;debugger(), source, &amp;errLine, &amp;errMsg);
</ins><span class="cx"> 
</span><span class="cx">     // No program node == syntax error - throw a syntax error
</span><span class="cx">     if (!functionBody)
</span><span class="lines">@@ -125,7 +125,7 @@
</span><span class="cx">         return throwError(exec, SyntaxError, &quot;Syntax error in parameter list&quot;);
</span><span class="cx">     }
</span><span class="cx">     size_t count = parameters.size();
</span><del>-    functionBody-&gt;finishParsing(source, parameters.releaseBuffer(), count);
</del><ins>+    functionBody-&gt;finishParsing(parameters.releaseBuffer(), count);
</ins><span class="cx"> 
</span><span class="cx">     JSGlobalObject* globalObject = exec-&gt;lexicalGlobalObject();
</span><span class="cx">     ScopeChain scopeChain(globalObject, globalObject-&gt;globalData(), exec-&gt;globalThisValue());
</span></span></pre></div>
<a id="trunkJavaScriptCorekjsJSFunctioncpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/kjs/JSFunction.cpp (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/JSFunction.cpp        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/kjs/JSFunction.cpp        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx">     , m_body(body)
</span><span class="cx">     , m_scopeChain(scopeChainNode)
</span><span class="cx"> {
</span><ins>+    ASSERT(exec-&gt;globalData().parser-&gt;parse&lt;FunctionBodyNode&gt;(exec, 0, body-&gt;source()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JSFunction::mark()
</span></span></pre></div>
<a id="trunkJavaScriptCorekjsJSGlobalObjectFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/kjs/JSGlobalObjectFunctions.cpp (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/JSGlobalObjectFunctions.cpp        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/kjs/JSGlobalObjectFunctions.cpp        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -286,7 +286,7 @@
</span><span class="cx">     UString errMsg;
</span><span class="cx"> 
</span><span class="cx">     SourceCode source = makeSource(s);
</span><del>-    RefPtr&lt;EvalNode&gt; evalNode = exec-&gt;globalData().parser-&gt;parse&lt;EvalNode&gt;(exec, source, &amp;errLine, &amp;errMsg);
</del><ins>+    RefPtr&lt;EvalNode&gt; evalNode = exec-&gt;globalData().parser-&gt;parse&lt;EvalNode&gt;(exec, exec-&gt;dynamicGlobalObject()-&gt;debugger(), source, &amp;errLine, &amp;errMsg);
</ins><span class="cx"> 
</span><span class="cx">     if (!evalNode)
</span><span class="cx">         return throwError(exec, SyntaxError, errMsg, errLine, source.provider()-&gt;asID(), NULL);
</span></span></pre></div>
<a id="trunkJavaScriptCorekjsParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/kjs/Parser.cpp (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/Parser.cpp        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/kjs/Parser.cpp        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-void Parser::parse(ExecState* exec, int* errLine, UString* errMsg)
</del><ins>+void Parser::parse(JSGlobalData* globalData, int* errLine, UString* errMsg)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!m_sourceElements);
</span><span class="cx"> 
</span><span class="lines">@@ -47,23 +47,20 @@
</span><span class="cx">     *errLine = -1;
</span><span class="cx">     *errMsg = 0;
</span><span class="cx"> 
</span><del>-    Lexer&amp; lexer = *exec-&gt;globalData().lexer;
</del><ins>+    Lexer&amp; lexer = *globalData-&gt;lexer;
</ins><span class="cx">     lexer.setCode(*m_source);
</span><span class="cx"> 
</span><del>-    int parseError = kjsyyparse(&amp;exec-&gt;globalData());
</del><ins>+    int parseError = kjsyyparse(globalData);
</ins><span class="cx">     bool lexError = lexer.sawError();
</span><span class="cx">     lexer.clear();
</span><span class="cx"> 
</span><del>-    ParserRefCounted::deleteNewObjects(&amp;exec-&gt;globalData());
</del><ins>+    ParserRefCounted::deleteNewObjects(globalData);
</ins><span class="cx"> 
</span><span class="cx">     if (parseError || lexError) {
</span><span class="cx">         *errLine = lexer.lineNo();
</span><span class="cx">         *errMsg = &quot;Parse error&quot;;
</span><span class="cx">         m_sourceElements.clear();
</span><span class="cx">     }
</span><del>-
-    if (Debugger* debugger = exec-&gt;dynamicGlobalObject()-&gt;debugger())
-        debugger-&gt;sourceParsed(exec, *m_source, *errLine, *errMsg);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Parser::didFinishParsing(SourceElements* sourceElements, ParserRefCountedData&lt;DeclarationStacks::VarStack&gt;* varStack, 
</span></span></pre></div>
<a id="trunkJavaScriptCorekjsParserh"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/kjs/Parser.h (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/Parser.h        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/kjs/Parser.h        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx"> #ifndef Parser_h
</span><span class="cx"> #define Parser_h
</span><span class="cx"> 
</span><ins>+#include &quot;debugger.h&quot;
</ins><span class="cx"> #include &quot;SourceProvider.h&quot;
</span><span class="cx"> #include &quot;nodes.h&quot;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="lines">@@ -48,17 +49,14 @@
</span><span class="cx"> 
</span><span class="cx">     class Parser : Noncopyable {
</span><span class="cx">     public:
</span><del>-        template &lt;class ParsedNode&gt; PassRefPtr&lt;ParsedNode&gt; parse(ExecState*, PassRefPtr&lt;SourceProvider&gt;, int* errLine = 0, UString* errMsg = 0);
-        template &lt;class ParsedNode&gt; PassRefPtr&lt;ParsedNode&gt; parse(ExecState*, const SourceCode&amp;, int* errLine = 0, UString* errMsg = 0);
</del><ins>+        template &lt;class ParsedNode&gt; PassRefPtr&lt;ParsedNode&gt; parse(ExecState*, Debugger*, const SourceCode&amp;, int* errLine = 0, UString* errMsg = 0);
</ins><span class="cx"> 
</span><span class="cx">         void didFinishParsing(SourceElements*, ParserRefCountedData&lt;DeclarationStacks::VarStack&gt;*, 
</span><span class="cx">                               ParserRefCountedData&lt;DeclarationStacks::FunctionStack&gt;*, CodeFeatures features, int lastLine, int numConstants);
</span><span class="cx"> 
</span><span class="cx">     private:
</span><del>-        friend class JSGlobalData;
</del><ins>+        void parse(JSGlobalData*, int* errLine, UString* errMsg);
</ins><span class="cx"> 
</span><del>-        void parse(ExecState*, int* errLine, UString* errMsg);
-
</del><span class="cx">         const SourceCode* m_source;
</span><span class="cx">         RefPtr&lt;SourceElements&gt; m_sourceElements;
</span><span class="cx">         RefPtr&lt;ParserRefCountedData&lt;DeclarationStacks::VarStack&gt; &gt; m_varDeclarations;
</span><span class="lines">@@ -68,10 +66,10 @@
</span><span class="cx">         int m_numConstants;
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    template &lt;class ParsedNode&gt; PassRefPtr&lt;ParsedNode&gt; Parser::parse(ExecState* exec, const SourceCode&amp; source, int* errLine, UString* errMsg)
</del><ins>+    template &lt;class ParsedNode&gt; PassRefPtr&lt;ParsedNode&gt; Parser::parse(ExecState* exec, Debugger* debugger, const SourceCode&amp; source, int* errLine, UString* errMsg)
</ins><span class="cx">     {
</span><span class="cx">         m_source = &amp;source;
</span><del>-        parse(exec, errLine, errMsg);
</del><ins>+        parse(&amp;exec-&gt;globalData(), errLine, errMsg);
</ins><span class="cx">         RefPtr&lt;ParsedNode&gt; result;
</span><span class="cx">         if (m_sourceElements) {
</span><span class="cx">             result = ParsedNode::create(&amp;exec-&gt;globalData(),
</span><span class="lines">@@ -88,6 +86,9 @@
</span><span class="cx">         m_sourceElements = 0;
</span><span class="cx">         m_varDeclarations = 0;
</span><span class="cx">         m_funcDeclarations = 0;
</span><ins>+
+        if (debugger)
+            debugger-&gt;sourceParsed(exec, source, *errLine, *errMsg);
</ins><span class="cx">         return result.release();
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkJavaScriptCorekjsShellcpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/kjs/Shell.cpp (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/Shell.cpp        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/kjs/Shell.cpp        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -305,7 +305,7 @@
</span><span class="cx"> {
</span><span class="cx">     int errLine = 0;
</span><span class="cx">     UString errMsg;
</span><del>-    RefPtr&lt;ProgramNode&gt; programNode = exec-&gt;globalData().parser-&gt;parse&lt;ProgramNode&gt;(exec, makeSource(script.data(), fileName), &amp;errLine, &amp;errMsg);
</del><ins>+    RefPtr&lt;ProgramNode&gt; programNode = exec-&gt;globalData().parser-&gt;parse&lt;ProgramNode&gt;(exec, exec-&gt;dynamicGlobalObject()-&gt;debugger(), makeSource(script.data(), fileName), &amp;errLine, &amp;errMsg);
</ins><span class="cx">     if (!programNode) {
</span><span class="cx">         fprintf(stderr, &quot;%s:%d: %s.\n&quot;, fileName.UTF8String().c_str(), errLine, errMsg.UTF8String().c_str());
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkJavaScriptCorekjsSourceRangeh"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/kjs/SourceRange.h (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/SourceRange.h        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/kjs/SourceRange.h        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx">             return m_provider-&gt;getRange(m_startChar, m_endChar);
</span><span class="cx">         }
</span><span class="cx">         
</span><ins>+        bool isNull() const { return !m_provider; }
</ins><span class="cx">         SourceProvider* provider() const { return m_provider.get(); }
</span><span class="cx">         int firstLine() const { return m_firstLine; }
</span><span class="cx">         int startOffset() const { return m_startChar; }
</span></span></pre></div>
<a id="trunkJavaScriptCorekjscollectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/kjs/collector.cpp (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/collector.cpp        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/kjs/collector.cpp        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx"> #include &quot;collector.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ArgList.h&quot;
</span><ins>+#include &quot;CollectorHeapIterator.h&quot;
</ins><span class="cx"> #include &quot;ExecState.h&quot;
</span><span class="cx"> #include &quot;JSGlobalObject.h&quot;
</span><span class="cx"> #include &quot;JSLock.h&quot;
</span><span class="lines">@@ -181,7 +182,7 @@
</span><span class="cx">     m_globalData = 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template &lt;Heap::HeapType heapType&gt;
</del><ins>+template &lt;HeapType heapType&gt;
</ins><span class="cx"> static NEVER_INLINE CollectorBlock* allocateBlock()
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(DARWIN)
</span><span class="lines">@@ -265,25 +266,7 @@
</span><span class="cx">     primaryHeap.extraCost += cost;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template &lt;Heap::HeapType heapType&gt; struct HeapConstants;
-
-template &lt;&gt; struct HeapConstants&lt;Heap::PrimaryHeap&gt; {
-    static const size_t cellSize = CELL_SIZE;
-    static const size_t cellsPerBlock = CELLS_PER_BLOCK;
-    static const size_t bitmapShift = 0;
-    typedef CollectorCell Cell;
-    typedef CollectorBlock Block;
-};
-
-template &lt;&gt; struct HeapConstants&lt;Heap::NumberHeap&gt; {
-    static const size_t cellSize = SMALL_CELL_SIZE;
-    static const size_t cellsPerBlock = SMALL_CELLS_PER_BLOCK;
-    static const size_t bitmapShift = 1;
-    typedef SmallCollectorCell Cell;
-    typedef SmallCellCollectorBlock Block;
-};
-
-template &lt;Heap::HeapType heapType&gt; ALWAYS_INLINE void* Heap::heapAllocate(size_t s)
</del><ins>+template &lt;HeapType heapType&gt; ALWAYS_INLINE void* Heap::heapAllocate(size_t s)
</ins><span class="cx"> {
</span><span class="cx">     typedef typename HeapConstants&lt;heapType&gt;::Block Block;
</span><span class="cx">     typedef typename HeapConstants&lt;heapType&gt;::Cell Cell;
</span><span class="lines">@@ -859,13 +842,13 @@
</span><span class="cx">         m_protectedValuesMutex-&gt;unlock();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template &lt;Heap::HeapType heapType&gt; size_t Heap::sweep()
</del><ins>+template &lt;HeapType heapType&gt; size_t Heap::sweep()
</ins><span class="cx"> {
</span><span class="cx">     typedef typename HeapConstants&lt;heapType&gt;::Block Block;
</span><span class="cx">     typedef typename HeapConstants&lt;heapType&gt;::Cell Cell;
</span><span class="cx"> 
</span><span class="cx">     // SWEEP: delete everything with a zero refcount (garbage) and unmark everything else
</span><del>-    CollectorHeap&amp; heap = heapType == Heap::PrimaryHeap ? primaryHeap : numberHeap;
</del><ins>+    CollectorHeap&amp; heap = heapType == PrimaryHeap ? primaryHeap : numberHeap;
</ins><span class="cx">     
</span><span class="cx">     size_t emptyBlocks = 0;
</span><span class="cx">     size_t numLiveObjects = heap.numLiveObjects;
</span><span class="lines">@@ -882,7 +865,7 @@
</span><span class="cx">                 if (!curBlock-&gt;marked.get(i &gt;&gt; HeapConstants&lt;heapType&gt;::bitmapShift)) {
</span><span class="cx">                     Cell* cell = curBlock-&gt;cells + i;
</span><span class="cx">                     
</span><del>-                    if (heapType != Heap::NumberHeap) {
</del><ins>+                    if (heapType != NumberHeap) {
</ins><span class="cx">                         JSCell* imp = reinterpret_cast&lt;JSCell*&gt;(cell);
</span><span class="cx">                         // special case for allocated but uninitialized object
</span><span class="cx">                         // (We don't need this check earlier because nothing prior this point 
</span><span class="lines">@@ -910,7 +893,7 @@
</span><span class="cx">                     ++minimumCellsToProcess;
</span><span class="cx">                 } else {
</span><span class="cx">                     if (!curBlock-&gt;marked.get(i &gt;&gt; HeapConstants&lt;heapType&gt;::bitmapShift)) {
</span><del>-                        if (heapType != Heap::NumberHeap) {
</del><ins>+                        if (heapType != NumberHeap) {
</ins><span class="cx">                             JSCell* imp = reinterpret_cast&lt;JSCell*&gt;(cell);
</span><span class="cx">                             imp-&gt;~JSCell();
</span><span class="cx">                         }
</span><span class="lines">@@ -1086,4 +1069,14 @@
</span><span class="cx">     return (primaryHeap.operationInProgress != NoOperation) | (numberHeap.operationInProgress != NoOperation);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Heap::iterator Heap::primaryHeapBegin()
+{
+    return iterator(primaryHeap.blocks, primaryHeap.blocks + primaryHeap.usedBlocks);
+}
+
+Heap::iterator Heap::primaryHeapEnd()
+{
+    return iterator(primaryHeap.blocks + primaryHeap.usedBlocks, primaryHeap.blocks + primaryHeap.usedBlocks);
+}
+
</ins><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkJavaScriptCorekjscollectorh"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/kjs/collector.h (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/collector.h        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/kjs/collector.h        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -45,7 +45,10 @@
</span><span class="cx">     class JSValue;
</span><span class="cx"> 
</span><span class="cx">     enum OperationInProgress { NoOperation, Allocation, Collection };
</span><ins>+    enum HeapType { PrimaryHeap, NumberHeap };
</ins><span class="cx"> 
</span><ins>+    template &lt;HeapType&gt; class CollectorHeapIterator;
+
</ins><span class="cx">     struct CollectorHeap {
</span><span class="cx">         CollectorBlock** blocks;
</span><span class="cx">         size_t numBlocks;
</span><span class="lines">@@ -62,7 +65,7 @@
</span><span class="cx">     class Heap : Noncopyable {
</span><span class="cx">     public:
</span><span class="cx">         class Thread;
</span><del>-        enum HeapType { PrimaryHeap, NumberHeap };
</del><ins>+        typedef CollectorHeapIterator&lt;PrimaryHeap&gt; iterator;
</ins><span class="cx"> 
</span><span class="cx">         void destroy();
</span><span class="cx"> 
</span><span class="lines">@@ -108,10 +111,14 @@
</span><span class="cx"> 
</span><span class="cx">         JSGlobalData* globalData() const { return m_globalData; }
</span><span class="cx">         static bool isNumber(JSCell*);
</span><ins>+        
+        // Iterators for the object heap.
+        iterator primaryHeapBegin();
+        iterator primaryHeapEnd();
</ins><span class="cx"> 
</span><span class="cx">     private:
</span><del>-        template &lt;Heap::HeapType heapType&gt; void* heapAllocate(size_t);
-        template &lt;Heap::HeapType heapType&gt; size_t sweep();
</del><ins>+        template &lt;HeapType heapType&gt; void* heapAllocate(size_t);
+        template &lt;HeapType heapType&gt; size_t sweep();
</ins><span class="cx">         static const CollectorBlock* cellBlock(const JSCell*);
</span><span class="cx">         static CollectorBlock* cellBlock(JSCell*);
</span><span class="cx">         static size_t cellOffset(const JSCell*);
</span><span class="lines">@@ -206,7 +213,7 @@
</span><span class="cx">         CollectorCell* freeList;
</span><span class="cx">         CollectorBitmap marked;
</span><span class="cx">         Heap* heap;
</span><del>-        Heap::HeapType type;
</del><ins>+        HeapType type;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     class SmallCellCollectorBlock {
</span><span class="lines">@@ -216,9 +223,27 @@
</span><span class="cx">         SmallCollectorCell* freeList;
</span><span class="cx">         CollectorBitmap marked;
</span><span class="cx">         Heap* heap;
</span><del>-        Heap::HeapType type;
</del><ins>+        HeapType type;
</ins><span class="cx">     };
</span><span class="cx">     
</span><ins>+    template &lt;HeapType heapType&gt; struct HeapConstants;
+
+    template &lt;&gt; struct HeapConstants&lt;PrimaryHeap&gt; {
+        static const size_t cellSize = CELL_SIZE;
+        static const size_t cellsPerBlock = CELLS_PER_BLOCK;
+        static const size_t bitmapShift = 0;
+        typedef CollectorCell Cell;
+        typedef CollectorBlock Block;
+    };
+
+    template &lt;&gt; struct HeapConstants&lt;NumberHeap&gt; {
+        static const size_t cellSize = SMALL_CELL_SIZE;
+        static const size_t cellsPerBlock = SMALL_CELLS_PER_BLOCK;
+        static const size_t bitmapShift = 1;
+        typedef SmallCollectorCell Cell;
+        typedef SmallCellCollectorBlock Block;
+    };
+
</ins><span class="cx">     inline bool Heap::isNumber(JSCell* cell)
</span><span class="cx">     {
</span><span class="cx">         CollectorBlock* block = Heap::cellBlock(cell);
</span></span></pre></div>
<a id="trunkJavaScriptCorekjsinterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/kjs/interpreter.cpp (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/interpreter.cpp        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/kjs/interpreter.cpp        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx">     int errLine;
</span><span class="cx">     UString errMsg;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;ProgramNode&gt; progNode = exec-&gt;globalData().parser-&gt;parse&lt;ProgramNode&gt;(exec, source, &amp;errLine, &amp;errMsg);
</del><ins>+    RefPtr&lt;ProgramNode&gt; progNode = exec-&gt;globalData().parser-&gt;parse&lt;ProgramNode&gt;(exec, exec-&gt;dynamicGlobalObject()-&gt;debugger(), source, &amp;errLine, &amp;errMsg);
</ins><span class="cx">     if (!progNode)
</span><span class="cx">         return Completion(Throw, Error::create(exec, SyntaxError, errMsg, errLine, source.provider()-&gt;asID(), source.provider()-&gt;url()));
</span><span class="cx">     return Completion(Normal);
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx">     
</span><span class="cx">     int errLine;
</span><span class="cx">     UString errMsg;
</span><del>-    RefPtr&lt;ProgramNode&gt; programNode = exec-&gt;globalData().parser-&gt;parse&lt;ProgramNode&gt;(exec, source, &amp;errLine, &amp;errMsg);
</del><ins>+    RefPtr&lt;ProgramNode&gt; programNode = exec-&gt;globalData().parser-&gt;parse&lt;ProgramNode&gt;(exec, exec-&gt;dynamicGlobalObject()-&gt;debugger(), source, &amp;errLine, &amp;errMsg);
</ins><span class="cx"> 
</span><span class="cx">     if (!programNode)
</span><span class="cx">         return Completion(Throw, Error::create(exec, SyntaxError, errMsg, errLine, source.provider()-&gt;asID(), source.provider()-&gt;url()));
</span></span></pre></div>
<a id="trunkJavaScriptCorekjslexerh"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/kjs/lexer.h (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/lexer.h        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/kjs/lexer.h        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">         bool sawError() const { return m_error; }
</span><span class="cx"> 
</span><span class="cx">         void clear();
</span><del>-        SourceCode sourceCode(int openBrace, int closeBrace, int firstLine) { return SourceCode(m_source-&gt;provider(), openBrace + 1, closeBrace, firstLine); }
</del><ins>+        SourceCode sourceCode(int openBrace, int closeBrace, int firstLine) { return SourceCode(m_source-&gt;provider(), m_source-&gt;startOffset() + openBrace + 1, m_source-&gt;startOffset() + closeBrace, firstLine); }
</ins><span class="cx"> 
</span><span class="cx">     private:
</span><span class="cx">         friend class JSGlobalData;
</span></span></pre></div>
<a id="trunkJavaScriptCorekjsnodescpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/kjs/nodes.cpp (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/nodes.cpp        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/kjs/nodes.cpp        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -1746,9 +1746,10 @@
</span><span class="cx"> 
</span><span class="cx"> // ------------------------------ FunctionBodyNode -----------------------------
</span><span class="cx"> 
</span><del>-FunctionBodyNode::FunctionBodyNode(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, CodeFeatures features, int numConstants)
-    : ScopeNode(globalData, SourceCode(), children, varStack, funcStack, features, numConstants)
</del><ins>+FunctionBodyNode::FunctionBodyNode(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode&amp; sourceCode, CodeFeatures features, int numConstants)
+    : ScopeNode(globalData, sourceCode, children, varStack, funcStack, features, numConstants)
</ins><span class="cx">     , m_parameters(0)
</span><ins>+    , m_parameterCount(0)
</ins><span class="cx">     , m_refCount(0)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -1765,12 +1766,14 @@
</span><span class="cx">     for (ParameterNode* parameter = firstParameter; parameter; parameter = parameter-&gt;nextParam())
</span><span class="cx">         parameters.append(parameter-&gt;ident());
</span><span class="cx">     size_t count = parameters.size();
</span><del>-    finishParsing(source, parameters.releaseBuffer(), count);
</del><ins>+
+    setSource(source);
+    finishParsing(parameters.releaseBuffer(), count);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FunctionBodyNode::finishParsing(const SourceCode&amp; source, Identifier* parameters, size_t parameterCount)
</del><ins>+void FunctionBodyNode::finishParsing(Identifier* parameters, size_t parameterCount)
</ins><span class="cx"> {
</span><del>-    setSource(source);
</del><ins>+    ASSERT(!source().isNull());
</ins><span class="cx">     m_parameters = parameters;
</span><span class="cx">     m_parameterCount = parameterCount;
</span><span class="cx"> }
</span><span class="lines">@@ -1783,12 +1786,12 @@
</span><span class="cx"> 
</span><span class="cx"> FunctionBodyNode* FunctionBodyNode::create(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, CodeFeatures features, int numConstants)
</span><span class="cx"> {
</span><del>-    return new FunctionBodyNode(globalData, children, varStack, funcStack, features, numConstants);
</del><ins>+    return new FunctionBodyNode(globalData, children, varStack, funcStack, SourceCode(), features, numConstants);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-FunctionBodyNode* FunctionBodyNode::create(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode&amp;, CodeFeatures features, int numConstants)
</del><ins>+FunctionBodyNode* FunctionBodyNode::create(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode&amp; sourceCode, CodeFeatures features, int numConstants)
</ins><span class="cx"> {
</span><del>-    return new FunctionBodyNode(globalData, children, varStack, funcStack, features, numConstants);
</del><ins>+    return new FunctionBodyNode(globalData, children, varStack, funcStack, sourceCode, features, numConstants);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FunctionBodyNode::generateCode(ScopeChainNode* scopeChainNode)
</span><span class="lines">@@ -1850,6 +1853,13 @@
</span><span class="cx">     return s;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Identifier* FunctionBodyNode::copyParameters()
+{
+    Identifier* parameters = static_cast&lt;Identifier*&gt;(fastMalloc(m_parameterCount * sizeof(Identifier)));
+    VectorCopier&lt;false, Identifier&gt;::uninitializedCopy(m_parameters, m_parameters + m_parameterCount, parameters);
+    return parameters;
+}
+
</ins><span class="cx"> // ------------------------------ FuncDeclNode ---------------------------------
</span><span class="cx"> 
</span><span class="cx"> JSFunction* FuncDeclNode::makeFunction(ExecState* exec, ScopeChainNode* scopeChain)
</span></span></pre></div>
<a id="trunkJavaScriptCorekjsnodesh"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/kjs/nodes.h (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/nodes.h        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/JavaScriptCore/kjs/nodes.h        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -2174,7 +2174,6 @@
</span><span class="cx"> 
</span><span class="cx">         virtual void streamTo(SourceStream&amp;) const JSC_FAST_CALL;
</span><span class="cx">         
</span><del>-        void setSource(const SourceCode&amp; source) { m_source = source; }
</del><span class="cx">         const SourceCode&amp; source() const { return m_source; }
</span><span class="cx">         const UString&amp; sourceURL() const JSC_FAST_CALL { return m_source.provider()-&gt;url(); }
</span><span class="cx">         intptr_t sourceID() const { return m_source.provider()-&gt;asID(); }
</span><span class="lines">@@ -2196,6 +2195,8 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">     protected:
</span><ins>+        void setSource(const SourceCode&amp; source) { m_source = source; }
+
</ins><span class="cx">         VarStack m_varStack;
</span><span class="cx">         FunctionStack m_functionStack;
</span><span class="cx"> 
</span><span class="lines">@@ -2255,8 +2256,9 @@
</span><span class="cx">         ~FunctionBodyNode();
</span><span class="cx"> 
</span><span class="cx">         const Identifier* parameters() const JSC_FAST_CALL { return m_parameters; }
</span><del>-        size_t parameterCount() { return m_parameterCount; }
</del><ins>+        size_t parameterCount() const { return m_parameterCount; }
</ins><span class="cx">         UString paramString() const JSC_FAST_CALL;
</span><ins>+        Identifier* copyParameters();
</ins><span class="cx"> 
</span><span class="cx">         virtual RegisterID* emitCode(CodeGenerator&amp;, RegisterID* = 0) JSC_FAST_CALL;
</span><span class="cx">         
</span><span class="lines">@@ -2279,7 +2281,7 @@
</span><span class="cx">         void mark();
</span><span class="cx"> 
</span><span class="cx">         void finishParsing(const SourceCode&amp;, ParameterNode*);
</span><del>-        void finishParsing(const SourceCode&amp;, Identifier* parameters, size_t parameterCount);
</del><ins>+        void finishParsing(Identifier* parameters, size_t parameterCount);
</ins><span class="cx">         
</span><span class="cx">         UString toSourceString() const JSC_FAST_CALL { return UString(&quot;{&quot;) + source().toString() + UString(&quot;}&quot;); }
</span><span class="cx"> 
</span><span class="lines">@@ -2298,7 +2300,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">     protected:
</span><del>-        FunctionBodyNode(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, CodeFeatures, int numConstants) JSC_FAST_CALL;
</del><ins>+        FunctionBodyNode(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&amp;, CodeFeatures, int numConstants) JSC_FAST_CALL;
</ins><span class="cx"> 
</span><span class="cx">     private:
</span><span class="cx">         void generateCode(ScopeChainNode*) JSC_FAST_CALL;
</span></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/WebCore/ChangeLog        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2008-10-15  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
+        Reviewed by Cameron Zwarich.
+
+        Fixed https://bugs.webkit.org/show_bug.cgi?id=21345
+        Start the debugger without reloading the inspected page
+
+        * WebCore.base.exp: New symbols.
+
+        * ForwardingHeaders/kjs/CollectorHeapIterator.h: Copied from ForwardingHeaders/kjs/ustring.h.
+        * ForwardingHeaders/kjs/Parser.h: Copied from ForwardingHeaders/kjs/ustring.h.
+        * WebCore.xcodeproj/project.pbxproj: New forwarding headers.
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::setWindowVisible):
+        (WebCore::InspectorController::windowScriptObjectAvailable):
+        (WebCore::InspectorController::startDebugging):
+        * inspector/InspectorController.h: Renamed startDebuggingAndReloadInspectedPage
+        to startDebugging, and changed its behavior to match.
+
+        * inspector/JavaScriptDebugListener.h:
+        * inspector/JavaScriptDebugServer.cpp:
+        (WebCore::JavaScriptDebugServer::JavaScriptDebugServer):
+        (WebCore::JavaScriptDebugServer::addListener):
+        (WebCore::JavaScriptDebugServer::removeListener):
+        (WebCore::JavaScriptDebugServer::recompileAllJSFunctions):
+        (WebCore::JavaScriptDebugServer::willAddFirstListener):
+        (WebCore::JavaScriptDebugServer::didRemoveLastListener):
+        * inspector/JavaScriptDebugServer.h: Refactored the
+        JavaScriptDebugServer to centralize handling of adding the first listener
+        and removing the last. Then, added a feature to recompile all JS functions
+        in these cases. This allows us to dynamically add and remove hooks like
+        the debugger hooks without reloading the page.
+
+        * inspector/front-end/ScriptsPanel.js:
+        * English.lproj/localizedStrings.js: Updated for startDebuggingAndReloadInspectedPage =&gt;
+        startDebugging rename. Removed all UI that claimed that starting the
+        debugger would reload the page.
+
</ins><span class="cx"> 2008-10-15  Adele Peterson  &lt;adele@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Attempt to fix the Tiger build.
</span></span></pre></div>
<a id="trunkWebCoreEnglishlprojlocalizedStringsjs"></a>
<div class="binary"><h4>Modified: trunk/WebCore/English.lproj/localizedStrings.js</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkWebCoreForwardingHeaderskjsCollectorHeapIteratorhfromrev37586trunkWebCoreForwardingHeaderskjsustringh"></a>
<div class="copfile"><h4>Copied: trunk/WebCore/ForwardingHeaders/kjs/CollectorHeapIterator.h (from rev 37586, trunk/WebCore/ForwardingHeaders/kjs/ustring.h) (0 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ForwardingHeaders/kjs/CollectorHeapIterator.h                                (rev 0)
+++ trunk/WebCore/ForwardingHeaders/kjs/CollectorHeapIterator.h        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+#include &lt;JavaScriptCore/CollectorHeapIterator.h&gt;
</ins></span></pre></div>
<a id="trunkWebCoreForwardingHeaderskjsParserhfromrev37586trunkWebCoreForwardingHeaderskjsustringh"></a>
<div class="copfile"><h4>Copied: trunk/WebCore/ForwardingHeaders/kjs/Parser.h (from rev 37586, trunk/WebCore/ForwardingHeaders/kjs/ustring.h) (0 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ForwardingHeaders/kjs/Parser.h                                (rev 0)
+++ trunk/WebCore/ForwardingHeaders/kjs/Parser.h        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+#include &lt;JavaScriptCore/Parser.h&gt;
</ins></span></pre></div>
<a id="trunkWebCoreWebCorebaseexp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.base.exp (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.base.exp        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/WebCore/WebCore.base.exp        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -379,10 +379,10 @@
</span><span class="cx"> __ZN7WebCore19InspectorController12attachWindowEv
</span><span class="cx"> __ZN7WebCore19InspectorController12detachWindowEv
</span><span class="cx"> __ZN7WebCore19InspectorController13stopDebuggingEv
</span><ins>+__ZN7WebCore19InspectorController14startDebuggingEv
</ins><span class="cx"> __ZN7WebCore19InspectorController16setWindowVisibleEbb
</span><span class="cx"> __ZN7WebCore19InspectorController26stopUserInitiatedProfilingEv
</span><span class="cx"> __ZN7WebCore19InspectorController27startUserInitiatedProfilingEv
</span><del>-__ZN7WebCore19InspectorController36startDebuggingAndReloadInspectedPageEv
</del><span class="cx"> __ZN7WebCore19InspectorController4showEv
</span><span class="cx"> __ZN7WebCore19InspectorController5closeEv
</span><span class="cx"> __ZN7WebCore19InspectorController7inspectEPNS_4NodeE
</span><span class="lines">@@ -400,6 +400,8 @@
</span><span class="cx"> __ZN7WebCore19TextResourceDecoderD1Ev
</span><span class="cx"> __ZN7WebCore20ResourceResponseBase24setExpectedContentLengthEx
</span><span class="cx"> __ZN7WebCore21ContextMenuController16clearContextMenuEv
</span><ins>+__ZN7WebCore21JavaScriptDebugServer23recompileAllJSFunctionsEPNS_5TimerIS0_EE
+__ZN7WebCore21JavaScriptDebugServer6sharedEv
</ins><span class="cx"> __ZN7WebCore21PlatformKeyboardEvent24disambiguateKeyDownEventENS0_4TypeEb
</span><span class="cx"> __ZN7WebCore21PlatformKeyboardEventC1EP7NSEvent
</span><span class="cx"> __ZN7WebCore21WindowsLatin1EncodingEv
</span></span></pre></div>
<a id="trunkWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.xcodeproj/project.pbxproj (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.xcodeproj/project.pbxproj        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/WebCore/WebCore.xcodeproj/project.pbxproj        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -364,7 +364,7 @@
</span><span class="cx">                 1C81BA0A0E97348300266E07 /* JavaScriptCallFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C81BA040E97348300266E07 /* JavaScriptCallFrame.h */; };
</span><span class="cx">                 1C81BA0C0E97348300266E07 /* JavaScriptDebugListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C81BA060E97348300266E07 /* JavaScriptDebugListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1C81BA0D0E97348300266E07 /* JavaScriptDebugServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C81BA070E97348300266E07 /* JavaScriptDebugServer.cpp */; };
</span><del>-                1C81BA0E0E97348300266E07 /* JavaScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C81BA080E97348300266E07 /* JavaScriptDebugServer.h */; };
</del><ins>+                1C81BA0E0E97348300266E07 /* JavaScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C81BA080E97348300266E07 /* JavaScriptDebugServer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 1CA19E050DC255950065A994 /* EventLoopMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1CA19E030DC255950065A994 /* EventLoopMac.mm */; };
</span><span class="cx">                 1CA19E160DC255CA0065A994 /* EventLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CA19E150DC255CA0065A994 /* EventLoop.h */; };
</span><span class="cx">                 1CAF34810A6C405200ABE06E /* WebScriptObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAF347E0A6C405200ABE06E /* WebScriptObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InspectorController.cpp (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorController.cpp        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/WebCore/inspector/InspectorController.cpp        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -73,6 +73,7 @@
</span><span class="cx"> #include &lt;JavaScriptCore/OpaqueJSString.h&gt;
</span><span class="cx"> #include &lt;kjs/JSLock.h&gt;
</span><span class="cx"> #include &lt;kjs/ustring.h&gt;
</span><ins>+#include &lt;kjs/CollectorHeapIterator.h&gt;
</ins><span class="cx"> #include &lt;profiler/Profile.h&gt;
</span><span class="cx"> #include &lt;profiler/Profiler.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="lines">@@ -430,7 +431,7 @@
</span><span class="cx"> SIMPLE_INSPECTOR_CALLBACK(unloading, close);
</span><span class="cx"> SIMPLE_INSPECTOR_CALLBACK(attach, attachWindow);
</span><span class="cx"> SIMPLE_INSPECTOR_CALLBACK(detach, detachWindow);
</span><del>-SIMPLE_INSPECTOR_CALLBACK(startDebuggingAndReloadInspectedPage, startDebuggingAndReloadInspectedPage);
</del><ins>+SIMPLE_INSPECTOR_CALLBACK(startDebugging, startDebugging);
</ins><span class="cx"> SIMPLE_INSPECTOR_CALLBACK(stopDebugging, stopDebugging);
</span><span class="cx"> SIMPLE_INSPECTOR_CALLBACK(pauseInDebugger, pauseInDebugger);
</span><span class="cx"> SIMPLE_INSPECTOR_CALLBACK(resumeDebugger, resumeDebugger);
</span><span class="lines">@@ -1114,7 +1115,7 @@
</span><span class="cx">         if (m_nodeToFocus)
</span><span class="cx">             focusNode();
</span><span class="cx">         if (m_attachDebuggerWhenShown)
</span><del>-            startDebuggingAndReloadInspectedPage();
</del><ins>+            startDebugging();
</ins><span class="cx">         if (m_showAfterVisible != CurrentPanel)
</span><span class="cx">             showPanel(m_showAfterVisible);
</span><span class="cx">     } else {
</span><span class="lines">@@ -1321,7 +1322,7 @@
</span><span class="cx">         { &quot;windowUnloading&quot;, WebCore::unloading, kJSPropertyAttributeNone },
</span><span class="cx">         { &quot;attach&quot;, WebCore::attach, kJSPropertyAttributeNone },
</span><span class="cx">         { &quot;detach&quot;, WebCore::detach, kJSPropertyAttributeNone },
</span><del>-        { &quot;startDebuggingAndReloadInspectedPage&quot;, WebCore::startDebuggingAndReloadInspectedPage, kJSPropertyAttributeNone },
</del><ins>+        { &quot;startDebugging&quot;, WebCore::startDebugging, kJSPropertyAttributeNone },
</ins><span class="cx">         { &quot;stopDebugging&quot;, WebCore::stopDebugging, kJSPropertyAttributeNone },
</span><span class="cx">         { &quot;pauseInDebugger&quot;, WebCore::pauseInDebugger, kJSPropertyAttributeNone },
</span><span class="cx">         { &quot;resumeDebugger&quot;, WebCore::resumeDebugger, kJSPropertyAttributeNone },
</span><span class="lines">@@ -2312,7 +2313,7 @@
</span><span class="cx">     m_page-&gt;chrome()-&gt;setWindowRect(frameRect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorController::startDebuggingAndReloadInspectedPage()
</del><ins>+void InspectorController::startDebugging()
</ins><span class="cx"> {
</span><span class="cx">     if (!enabled())
</span><span class="cx">         return;
</span><span class="lines">@@ -2331,8 +2332,6 @@
</span><span class="cx">     m_attachDebuggerWhenShown = false;
</span><span class="cx"> 
</span><span class="cx">     callSimpleFunction(m_scriptContext, m_scriptObject, &quot;debuggerAttached&quot;);
</span><del>-
-    m_inspectedPage-&gt;mainFrame()-&gt;loader()-&gt;reload();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorController::stopDebugging()
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorControllerh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InspectorController.h (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorController.h        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/WebCore/inspector/InspectorController.h        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -160,7 +160,7 @@
</span><span class="cx">     void moveWindowBy(float x, float y) const;
</span><span class="cx">     void closeWindow();
</span><span class="cx"> 
</span><del>-    void startDebuggingAndReloadInspectedPage();
</del><ins>+    void startDebugging();
</ins><span class="cx">     void stopDebugging();
</span><span class="cx">     bool debuggerAttached() const { return m_debuggerAttached; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCoreinspectorJavaScriptDebugListenerh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/JavaScriptDebugListener.h (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/JavaScriptDebugListener.h        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/WebCore/inspector/JavaScriptDebugListener.h        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> #define JavaScriptDebugListener_h
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><del>-    class DebuggerCallFrame;
</del><span class="cx">     class ExecState;
</span><span class="cx">     class SourceCode;
</span><span class="cx">     class UString;
</span></span></pre></div>
<a id="trunkWebCoreinspectorJavaScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/JavaScriptDebugServer.cpp (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/JavaScriptDebugServer.cpp        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/WebCore/inspector/JavaScriptDebugServer.cpp        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -44,7 +44,10 @@
</span><span class="cx"> #include &quot;ScrollView.h&quot;
</span><span class="cx"> #include &quot;Widget.h&quot;
</span><span class="cx"> #include &quot;ScriptController.h&quot;
</span><ins>+#include &lt;kjs/CollectorHeapIterator.h&gt;
</ins><span class="cx"> #include &lt;kjs/DebuggerCallFrame.h&gt;
</span><ins>+#include &lt;kjs/JSLock.h&gt;
+#include &lt;kjs/Parser.h&gt;
</ins><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/UnusedParam.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -67,6 +70,7 @@
</span><span class="cx">     , m_paused(false)
</span><span class="cx">     , m_doneProcessingDebuggerEvents(true)
</span><span class="cx">     , m_pauseOnCallFrame(0)
</span><ins>+    , m_recompileTimer(this, &amp;JavaScriptDebugServer::recompileAllJSFunctions)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -80,7 +84,7 @@
</span><span class="cx"> void JavaScriptDebugServer::addListener(JavaScriptDebugListener* listener)
</span><span class="cx"> {
</span><span class="cx">     if (!hasListeners())
</span><del>-        Page::setDebuggerForAllPages(this);
</del><ins>+        willAddFirstListener();
</ins><span class="cx"> 
</span><span class="cx">     m_listeners.add(listener);
</span><span class="cx"> }
</span><span class="lines">@@ -88,10 +92,8 @@
</span><span class="cx"> void JavaScriptDebugServer::removeListener(JavaScriptDebugListener* listener)
</span><span class="cx"> {
</span><span class="cx">     m_listeners.remove(listener);
</span><del>-    if (!hasListeners()) {
-        Page::setDebuggerForAllPages(0);
-        m_doneProcessingDebuggerEvents = true;
-    }
</del><ins>+    if (!hasListeners())
+        didRemoveLastListener();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JavaScriptDebugServer::addListener(JavaScriptDebugListener* listener, Page* page)
</span><span class="lines">@@ -99,7 +101,7 @@
</span><span class="cx">     ASSERT_ARG(page, page);
</span><span class="cx"> 
</span><span class="cx">     if (!hasListeners())
</span><del>-        Page::setDebuggerForAllPages(this);
</del><ins>+        willAddFirstListener();
</ins><span class="cx"> 
</span><span class="cx">     pair&lt;PageListenersMap::iterator, bool&gt; result = m_pageListenersMap.add(page, 0);
</span><span class="cx">     if (result.second)
</span><span class="lines">@@ -118,18 +120,14 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ListenerSet* listeners = it-&gt;second;
</span><del>-
</del><span class="cx">     listeners-&gt;remove(listener);
</span><del>-
</del><span class="cx">     if (listeners-&gt;isEmpty()) {
</span><span class="cx">         m_pageListenersMap.remove(it);
</span><span class="cx">         delete listeners;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!hasListeners()) {
-        Page::setDebuggerForAllPages(0);
-        m_doneProcessingDebuggerEvents = true;
-    }
</del><ins>+    if (!hasListeners())
+        didRemoveLastListener();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JavaScriptDebugServer::pageCreated(Page* page)
</span><span class="lines">@@ -521,4 +519,70 @@
</span><span class="cx">     pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void JavaScriptDebugServer::recompileAllJSFunctions(Timer&lt;JavaScriptDebugServer&gt;*)
+{
+    JSLock lock(false);
+    JSGlobalData* globalData = JSDOMWindow::commonJSGlobalData();
+    
+    // If JavaScript is running, it's not safe to recompile, since we'll end
+    // up throwing away code that is live on the stack.
+    ASSERT(!globalData-&gt;dynamicGlobalObject);
+    if (globalData-&gt;dynamicGlobalObject)
+        return;
+
+    Vector&lt;ProtectedPtr&lt;JSFunction&gt; &gt; functions;
+    Heap::iterator heapEnd = globalData-&gt;heap.primaryHeapEnd();
+    for (Heap::iterator it = globalData-&gt;heap.primaryHeapBegin(); it != heapEnd; ++it) {
+        if ((*it)-&gt;isObject(&amp;JSFunction::info))
+            functions.append(static_cast&lt;JSFunction*&gt;(*it));
+    }
+
+    typedef HashMap&lt;RefPtr&lt;FunctionBodyNode&gt;, RefPtr&lt;FunctionBodyNode&gt; &gt; FunctionBodyMap;
+    typedef HashSet&lt;SourceProvider*&gt; SourceProviderSet;
+
+    FunctionBodyMap functionBodies;
+    SourceProviderSet sourceProviders;
+    
+    size_t size = functions.size();
+    for (size_t i = 0; i &lt; size; ++i) {
+        JSFunction* function = functions[i];
+        
+        FunctionBodyNode* oldBody = function-&gt;m_body.get();
+        pair&lt;FunctionBodyMap::iterator, bool&gt; result = functionBodies.add(oldBody, 0);
+        if (!result.second) {
+            function-&gt;m_body = result.first-&gt;second;
+            continue;
+        }
+
+        ExecState* exec = function-&gt;scope().globalObject()-&gt;JSGlobalObject::globalExec();
+        const SourceCode&amp; sourceCode = oldBody-&gt;source();
+
+        RefPtr&lt;FunctionBodyNode&gt; newBody = globalData-&gt;parser-&gt;parse&lt;FunctionBodyNode&gt;(exec, 0, sourceCode);
+        ASSERT(newBody);
+        newBody-&gt;finishParsing(oldBody-&gt;copyParameters(), oldBody-&gt;parameterCount());
+        
+        result.first-&gt;second = newBody;
+        function-&gt;m_body = newBody.release();
+
+        if (hasListeners()) {
+            SourceProvider* provider = sourceCode.provider();
+            if (sourceProviders.add(provider).second)
+                sourceParsed(exec, SourceCode(provider), -1, 0);
+        }
+    }
+}
+
+void JavaScriptDebugServer::willAddFirstListener()
+{
+    Page::setDebuggerForAllPages(this);
+    m_recompileTimer.startOneShot(0);
+}
+
+void JavaScriptDebugServer::didRemoveLastListener()
+{
+    Page::setDebuggerForAllPages(0);
+    m_doneProcessingDebuggerEvents = true;
+    m_recompileTimer.startOneShot(0);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkWebCoreinspectorJavaScriptDebugServerh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/JavaScriptDebugServer.h (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/JavaScriptDebugServer.h        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/WebCore/inspector/JavaScriptDebugServer.h        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -29,8 +29,8 @@
</span><span class="cx"> #ifndef JavaScriptDebugServer_h
</span><span class="cx"> #define JavaScriptDebugServer_h
</span><span class="cx"> 
</span><ins>+#include &quot;Timer.h&quot;
</ins><span class="cx"> #include &lt;kjs/debugger.h&gt;
</span><del>-
</del><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="lines">@@ -73,6 +73,8 @@
</span><span class="cx">         void stepOverStatement();
</span><span class="cx">         void stepOutOfFunction();
</span><span class="cx"> 
</span><ins>+        void recompileAllJSFunctions(Timer&lt;JavaScriptDebugServer&gt;*);
+
</ins><span class="cx">         JavaScriptCallFrame* currentCallFrame();
</span><span class="cx"> 
</span><span class="cx">         void pageCreated(Page*);
</span><span class="lines">@@ -103,6 +105,9 @@
</span><span class="cx">         virtual void willExecuteProgram(const JSC::DebuggerCallFrame&amp;, intptr_t sourceID, int lineno);
</span><span class="cx">         virtual void didExecuteProgram(const JSC::DebuggerCallFrame&amp;, intptr_t sourceID, int lineno);
</span><span class="cx">         virtual void didReachBreakpoint(const JSC::DebuggerCallFrame&amp;, intptr_t sourceID, int lineno);
</span><ins>+        
+        void willAddFirstListener();
+        void didRemoveLastListener();
</ins><span class="cx"> 
</span><span class="cx">         typedef HashMap&lt;Page*, ListenerSet*&gt; PageListenersMap;
</span><span class="cx">         PageListenersMap m_pageListenersMap;
</span><span class="lines">@@ -116,6 +121,7 @@
</span><span class="cx">         RefPtr&lt;JavaScriptCallFrame&gt; m_currentCallFrame;
</span><span class="cx">         HashMap&lt;RefPtr&lt;Frame&gt;, PausedTimeouts*&gt; m_pausedTimeouts;
</span><span class="cx">         HashMap&lt;intptr_t, HashSet&lt;unsigned&gt;*&gt; m_breakpoints;
</span><ins>+        Timer&lt;JavaScriptDebugServer&gt; m_recompileTimer;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkWebCoreinspectorfrontendScriptsPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/front-end/ScriptsPanel.js (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/front-end/ScriptsPanel.js        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/WebCore/inspector/front-end/ScriptsPanel.js        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -143,12 +143,6 @@
</span><span class="cx">     this.attachOverlayElement = document.createElement(&quot;div&quot;);
</span><span class="cx">     this.attachOverlayElement.id = &quot;scripts-attach-overlay&quot;;
</span><span class="cx"> 
</span><del>-    var headerElement = document.createElement(&quot;h1&quot;);
-    headerElement.textContent = WebInspector.UIString(&quot;Starting debugging will reload the inspected page.&quot;);
-    this.attachOverlayElement.appendChild(headerElement);
-
-    this.attachOverlayElement.appendChild(document.createElement(&quot;br&quot;));
-
</del><span class="cx">     var attachButton = document.createElement(&quot;button&quot;);
</span><span class="cx">     attachButton.textContent = WebInspector.UIString(&quot;Start Debugging&quot;);
</span><span class="cx">     attachButton.addEventListener(&quot;click&quot;, this._toggleDebugging.bind(this), false);
</span><span class="lines">@@ -667,7 +661,7 @@
</span><span class="cx">             if (this.attachOverlayElement.parentNode)
</span><span class="cx">                 this.attachOverlayElement.parentNode.removeChild(this.attachOverlayElement);
</span><span class="cx">         } else {
</span><del>-            this.debuggingButton.title = WebInspector.UIString(&quot;Start debugging and reload inspected page.&quot;);
</del><ins>+            this.debuggingButton.title = WebInspector.UIString(&quot;Start debugging.&quot;);
</ins><span class="cx">             this.debuggingButton.removeStyleClass(&quot;toggled-on&quot;);
</span><span class="cx">             this.pauseButton.disabled = true;
</span><span class="cx"> 
</span><span class="lines">@@ -748,7 +742,7 @@
</span><span class="cx">         if (InspectorController.debuggerAttached())
</span><span class="cx">             InspectorController.stopDebugging();
</span><span class="cx">         else
</span><del>-            InspectorController.startDebuggingAndReloadInspectedPage();
</del><ins>+            InspectorController.startDebugging();
</ins><span class="cx"> 
</span><span class="cx">         this._clearInterface();
</span><span class="cx">     },
</span></span></pre></div>
<a id="trunkWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/ChangeLog (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/ChangeLog        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/WebKit/mac/ChangeLog        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2008-10-15  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
+        Reviewed by Cameron Zwarich.
+
+        Fixed https://bugs.webkit.org/show_bug.cgi?id=21345
+        Start the debugger without reloading the inspected page
+
+        * WebInspector/WebInspector.mm:
+        (-[WebInspector startDebuggingJavaScript:]): Updated for rename.
+
</ins><span class="cx"> 2008-10-14  Maxime Britto  &lt;britto@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin Adler.
</span></span></pre></div>
<a id="trunkWebKitmacWebInspectorWebInspectormm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebInspector/WebInspector.mm (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebInspector/WebInspector.mm        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/WebKit/mac/WebInspector/WebInspector.mm        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">     if (!page)
</span><span class="cx">         return;
</span><span class="cx">     page-&gt;inspectorController()-&gt;showPanel(InspectorController::ScriptsPanel);
</span><del>-    page-&gt;inspectorController()-&gt;startDebuggingAndReloadInspectedPage();
</del><ins>+    page-&gt;inspectorController()-&gt;startDebugging();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)stopDebuggingJavaScript:(id)sender
</span></span></pre></div>
<a id="trunkWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/ChangeLog (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/ChangeLog        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/WebKit/win/ChangeLog        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2008-10-15  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
+        Reviewed by Cameron Zwarich.
+
+        Fixed https://bugs.webkit.org/show_bug.cgi?id=21345
+        Start the debugger without reloading the inspected page
+
+        * WebInspector.cpp:
+        (WebInspector::toggleDebuggingJavaScript): Updated for rename.
+
</ins><span class="cx"> 2008-10-15  Adam Roben  &lt;aroben@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Export WTF::Mutex::tryLock
</span></span></pre></div>
<a id="trunkWebKitwinWebInspectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/WebInspector.cpp (37621 => 37622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/WebInspector.cpp        2008-10-15 22:22:38 UTC (rev 37621)
+++ trunk/WebKit/win/WebInspector.cpp        2008-10-15 23:33:07 UTC (rev 37622)
</span><span class="lines">@@ -178,7 +178,7 @@
</span><span class="cx">         inspector-&gt;stopDebugging();
</span><span class="cx">     else {
</span><span class="cx">         inspector-&gt;showPanel(InspectorController::ScriptsPanel);
</span><del>-        inspector-&gt;startDebuggingAndReloadInspectedPage();
</del><ins>+        inspector-&gt;startDebugging();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return S_OK;
</span></span></pre>
</div>
</div>

</body>
</html>