<!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>[47304] trunk/JavaScriptCore</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/47304">47304</a></dd>
<dt>Author</dt> <dd>barraclough@apple.com</dd>
<dt>Date</dt> <dd>2009-08-14 18:14:00 -0700 (Fri, 14 Aug 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove AST nodes from use within the Runtime (outside of parsing), stage 1
https://bugs.webkit.org/show_bug.cgi?id=28330

Reviewed by Oliver Hunt.

Remove the EvalNode and ProgramNode from use in the runtime.  They still exist
after this patch, but are hidden behind EvalExecutable and FunctionExecutable,
and are also still reachable behind CodeBlock::m_ownerNode.

The next step will be to beat back FunctionBodyNode in the same fashion.
Then remove the usage via CodeBlock, then only construct these nodes only on
demand during bytecode generation.

* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.h:
(JSC::GlobalCodeBlock::GlobalCodeBlock):
(JSC::GlobalCodeBlock::~GlobalCodeBlock):
(JSC::ProgramCodeBlock::ProgramCodeBlock):
(JSC::EvalCodeBlock::EvalCodeBlock):
(JSC::FunctionCodeBlock::FunctionCodeBlock):
(JSC::NativeCodeBlock::NativeCodeBlock):
* bytecode/EvalCodeCache.h:
(JSC::EvalCodeCache::get):
* debugger/Debugger.cpp:
(JSC::evaluateInGlobalCallFrame):
* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::evaluate):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::callEval):
(JSC::Interpreter::execute):
* interpreter/Interpreter.h:
* parser/Nodes.cpp:
(JSC::FunctionBodyNode::createNativeThunk):
(JSC::FunctionBodyNode::generateBytecode):
(JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
* parser/Parser.h:
(JSC::Parser::parse):
(JSC::Parser::reparse):
(JSC::Parser::parseFunctionFromGlobalCode):
(JSC::::parse):
* runtime/Completion.cpp:
(JSC::checkSyntax):
(JSC::evaluate):
* runtime/Error.cpp:
(JSC::throwError):
* runtime/Error.h:
* runtime/Executable.h: Added.
(JSC::TemplateExecutable::TemplateExecutable):
(JSC::TemplateExecutable::markAggregate):
(JSC::TemplateExecutable::sourceURL):
(JSC::TemplateExecutable::lineNo):
(JSC::TemplateExecutable::bytecode):
(JSC::TemplateExecutable::jitCode):
(JSC::EvalExecutable::EvalExecutable):
(JSC::ProgramExecutable::ProgramExecutable):
* runtime/FunctionConstructor.cpp:
(JSC::constructFunction):
* runtime/FunctionConstructor.h:
* runtime/JSGlobalData.cpp:
(JSC::JSGlobalData::numericCompareFunction):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::~JSGlobalObject):
(JSC::JSGlobalObject::markChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::codeBlocks):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncEval):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkJavaScriptCoreChangeLog">trunk/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkJavaScriptCorebytecodeCodeBlockh">trunk/JavaScriptCore/bytecode/CodeBlock.h</a></li>
<li><a href="#trunkJavaScriptCorebytecodeEvalCodeCacheh">trunk/JavaScriptCore/bytecode/EvalCodeCache.h</a></li>
<li><a href="#trunkJavaScriptCoredebuggerDebuggercpp">trunk/JavaScriptCore/debugger/Debugger.cpp</a></li>
<li><a href="#trunkJavaScriptCoredebuggerDebuggerCallFramecpp">trunk/JavaScriptCore/debugger/DebuggerCallFrame.cpp</a></li>
<li><a href="#trunkJavaScriptCoreinterpreterInterpretercpp">trunk/JavaScriptCore/interpreter/Interpreter.cpp</a></li>
<li><a href="#trunkJavaScriptCoreinterpreterInterpreterh">trunk/JavaScriptCore/interpreter/Interpreter.h</a></li>
<li><a href="#trunkJavaScriptCoreparserNodescpp">trunk/JavaScriptCore/parser/Nodes.cpp</a></li>
<li><a href="#trunkJavaScriptCoreparserParserh">trunk/JavaScriptCore/parser/Parser.h</a></li>
<li><a href="#trunkJavaScriptCoreruntimeCompletioncpp">trunk/JavaScriptCore/runtime/Completion.cpp</a></li>
<li><a href="#trunkJavaScriptCoreruntimeErrorcpp">trunk/JavaScriptCore/runtime/Error.cpp</a></li>
<li><a href="#trunkJavaScriptCoreruntimeErrorh">trunk/JavaScriptCore/runtime/Error.h</a></li>
<li><a href="#trunkJavaScriptCoreruntimeFunctionConstructorcpp">trunk/JavaScriptCore/runtime/FunctionConstructor.cpp</a></li>
<li><a href="#trunkJavaScriptCoreruntimeFunctionConstructorh">trunk/JavaScriptCore/runtime/FunctionConstructor.h</a></li>
<li><a href="#trunkJavaScriptCoreruntimeJSGlobalDatacpp">trunk/JavaScriptCore/runtime/JSGlobalData.cpp</a></li>
<li><a href="#trunkJavaScriptCoreruntimeJSGlobalObjectcpp">trunk/JavaScriptCore/runtime/JSGlobalObject.cpp</a></li>
<li><a href="#trunkJavaScriptCoreruntimeJSGlobalObjecth">trunk/JavaScriptCore/runtime/JSGlobalObject.h</a></li>
<li><a href="#trunkJavaScriptCoreruntimeJSGlobalObjectFunctionscpp">trunk/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkJavaScriptCoreruntimeExecutableh">trunk/JavaScriptCore/runtime/Executable.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/ChangeLog (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/ChangeLog        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/ChangeLog        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -1,3 +1,73 @@
</span><ins>+2009-08-14  Gavin Barraclough  &lt;barraclough@apple.com&gt;
+
+        Reviewed by Oliver Hunt.
+
+        Remove AST nodes from use within the Runtime (outside of parsing), stage 1
+        https://bugs.webkit.org/show_bug.cgi?id=28330
+
+        Remove the EvalNode and ProgramNode from use in the runtime.  They still exist
+        after this patch, but are hidden behind EvalExecutable and FunctionExecutable,
+        and are also still reachable behind CodeBlock::m_ownerNode.
+
+        The next step will be to beat back FunctionBodyNode in the same fashion.
+        Then remove the usage via CodeBlock, then only construct these nodes only on
+        demand during bytecode generation.
+
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * bytecode/CodeBlock.h:
+        (JSC::GlobalCodeBlock::GlobalCodeBlock):
+        (JSC::GlobalCodeBlock::~GlobalCodeBlock):
+        (JSC::ProgramCodeBlock::ProgramCodeBlock):
+        (JSC::EvalCodeBlock::EvalCodeBlock):
+        (JSC::FunctionCodeBlock::FunctionCodeBlock):
+        (JSC::NativeCodeBlock::NativeCodeBlock):
+        * bytecode/EvalCodeCache.h:
+        (JSC::EvalCodeCache::get):
+        * debugger/Debugger.cpp:
+        (JSC::evaluateInGlobalCallFrame):
+        * debugger/DebuggerCallFrame.cpp:
+        (JSC::DebuggerCallFrame::evaluate):
+        * interpreter/Interpreter.cpp:
+        (JSC::Interpreter::callEval):
+        (JSC::Interpreter::execute):
+        * interpreter/Interpreter.h:
+        * parser/Nodes.cpp:
+        (JSC::FunctionBodyNode::createNativeThunk):
+        (JSC::FunctionBodyNode::generateBytecode):
+        (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
+        * parser/Parser.h:
+        (JSC::Parser::parse):
+        (JSC::Parser::reparse):
+        (JSC::Parser::parseFunctionFromGlobalCode):
+        (JSC::::parse):
+        * runtime/Completion.cpp:
+        (JSC::checkSyntax):
+        (JSC::evaluate):
+        * runtime/Error.cpp:
+        (JSC::throwError):
+        * runtime/Error.h:
+        * runtime/Executable.h: Added.
+        (JSC::TemplateExecutable::TemplateExecutable):
+        (JSC::TemplateExecutable::markAggregate):
+        (JSC::TemplateExecutable::sourceURL):
+        (JSC::TemplateExecutable::lineNo):
+        (JSC::TemplateExecutable::bytecode):
+        (JSC::TemplateExecutable::jitCode):
+        (JSC::EvalExecutable::EvalExecutable):
+        (JSC::ProgramExecutable::ProgramExecutable):
+        * runtime/FunctionConstructor.cpp:
+        (JSC::constructFunction):
+        * runtime/FunctionConstructor.h:
+        * runtime/JSGlobalData.cpp:
+        (JSC::JSGlobalData::numericCompareFunction):
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::~JSGlobalObject):
+        (JSC::JSGlobalObject::markChildren):
+        * runtime/JSGlobalObject.h:
+        (JSC::JSGlobalObject::codeBlocks):
+        * runtime/JSGlobalObjectFunctions.cpp:
+        (JSC::globalFuncEval):
+
</ins><span class="cx"> 2009-08-14  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Sam Weinig.
</span></span></pre></div>
<a id="trunkJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -132,6 +132,7 @@
</span><span class="cx">                 86ADD1450FDDEA980006EEC2 /* ARMv7Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ADD1430FDDEA980006EEC2 /* ARMv7Assembler.h */; };
</span><span class="cx">                 86ADD1460FDDEA980006EEC2 /* MacroAssemblerARMv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ADD1440FDDEA980006EEC2 /* MacroAssemblerARMv7.h */; };
</span><span class="cx">                 86C36EEA0EE1289D00B3DF59 /* MacroAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C36EE90EE1289D00B3DF59 /* MacroAssembler.h */; };
</span><ins>+                86CAFEE31035DDE60028A609 /* Executable.h in Headers */ = {isa = PBXBuildFile; fileRef = 86CAFEE21035DDE60028A609 /* Executable.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 86CC85A10EE79A4700288682 /* JITInlineMethods.h in Headers */ = {isa = PBXBuildFile; fileRef = 86CC85A00EE79A4700288682 /* JITInlineMethods.h */; };
</span><span class="cx">                 86CC85A30EE79B7400288682 /* JITCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86CC85A20EE79B7400288682 /* JITCall.cpp */; };
</span><span class="cx">                 86CC85C40EE7A89400288682 /* JITPropertyAccess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86CC85C30EE7A89400288682 /* JITPropertyAccess.cpp */; };
</span><span class="lines">@@ -646,6 +647,7 @@
</span><span class="cx">                 86ADD1430FDDEA980006EEC2 /* ARMv7Assembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMv7Assembler.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 86ADD1440FDDEA980006EEC2 /* MacroAssemblerARMv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerARMv7.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 86C36EE90EE1289D00B3DF59 /* MacroAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssembler.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                86CAFEE21035DDE60028A609 /* Executable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Executable.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 86CC85A00EE79A4700288682 /* JITInlineMethods.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITInlineMethods.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 86CC85A20EE79B7400288682 /* JITCall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITCall.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 86CC85C30EE7A89400288682 /* JITPropertyAccess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITPropertyAccess.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1377,6 +1379,7 @@
</span><span class="cx">                                 BC02E9070E1839DB000F9297 /* ErrorPrototype.h */,
</span><span class="cx">                                 1429D8770ED21ACD00B89619 /* ExceptionHelpers.cpp */,
</span><span class="cx">                                 A72701B30DADE94900E548D7 /* ExceptionHelpers.h */,
</span><ins>+                                86CAFEE21035DDE60028A609 /* Executable.h */,
</ins><span class="cx">                                 BC2680C00E16D4E900A06E92 /* FunctionConstructor.cpp */,
</span><span class="cx">                                 BC2680C10E16D4E900A06E92 /* FunctionConstructor.h */,
</span><span class="cx">                                 F692A85C0255597D01FF60F7 /* FunctionPrototype.cpp */,
</span><span class="lines">@@ -1904,6 +1907,7 @@
</span><span class="cx">                                 9688CB160ED12B4E001D649F /* X86Assembler.h in Headers */,
</span><span class="cx">                                 A7795590101A74D500114E55 /* MarkStack.h in Headers */,
</span><span class="cx">                                 A7D649AA1015224E009B2E1B /* PossiblyNull.h in Headers */,
</span><ins>+                                86CAFEE31035DDE60028A609 /* Executable.h in Headers */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span></span></pre></div>
<a id="trunkJavaScriptCorebytecodeCodeBlockh"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/bytecode/CodeBlock.h (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/bytecode/CodeBlock.h        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/bytecode/CodeBlock.h        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -250,9 +250,10 @@
</span><span class="cx"> 
</span><span class="cx">     class CodeBlock : public FastAllocBase {
</span><span class="cx">         friend class JIT;
</span><del>-    public:
</del><ins>+    protected:
</ins><span class="cx">         CodeBlock(ScopeNode* ownerNode);
</span><span class="cx">         CodeBlock(ScopeNode* ownerNode, CodeType, PassRefPtr&lt;SourceProvider&gt;, unsigned sourceOffset);
</span><ins>+    public:
</ins><span class="cx">         ~CodeBlock();
</span><span class="cx"> 
</span><span class="cx">         void markAggregate(MarkStack&amp;);
</span><span class="lines">@@ -550,16 +551,16 @@
</span><span class="cx">     // Program code is not marked by any function, so we make the global object
</span><span class="cx">     // responsible for marking it.
</span><span class="cx"> 
</span><del>-    class ProgramCodeBlock : public CodeBlock {
</del><ins>+    class GlobalCodeBlock : public CodeBlock {
</ins><span class="cx">     public:
</span><del>-        ProgramCodeBlock(ScopeNode* ownerNode, CodeType codeType, JSGlobalObject* globalObject, PassRefPtr&lt;SourceProvider&gt; sourceProvider)
-            : CodeBlock(ownerNode, codeType, sourceProvider, 0)
</del><ins>+        GlobalCodeBlock(ScopeNode* ownerNode, CodeType codeType, PassRefPtr&lt;SourceProvider&gt; sourceProvider, unsigned sourceOffset, JSGlobalObject* globalObject)
+            : CodeBlock(ownerNode, codeType, sourceProvider, sourceOffset)
</ins><span class="cx">             , m_globalObject(globalObject)
</span><span class="cx">         {
</span><span class="cx">             m_globalObject-&gt;codeBlocks().add(this);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        ~ProgramCodeBlock()
</del><ins>+        ~GlobalCodeBlock()
</ins><span class="cx">         {
</span><span class="cx">             if (m_globalObject)
</span><span class="cx">                 m_globalObject-&gt;codeBlocks().remove(this);
</span><span class="lines">@@ -571,10 +572,18 @@
</span><span class="cx">         JSGlobalObject* m_globalObject; // For program and eval nodes, the global object that marks the constant pool.
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    class EvalCodeBlock : public ProgramCodeBlock {
</del><ins>+    class ProgramCodeBlock : public GlobalCodeBlock {
</ins><span class="cx">     public:
</span><ins>+        ProgramCodeBlock(ScopeNode* ownerNode, CodeType codeType, JSGlobalObject* globalObject, PassRefPtr&lt;SourceProvider&gt; sourceProvider)
+            : GlobalCodeBlock(ownerNode, codeType, sourceProvider, 0, globalObject)
+        {
+        }
+    };
+
+    class EvalCodeBlock : public GlobalCodeBlock {
+    public:
</ins><span class="cx">         EvalCodeBlock(ScopeNode* ownerNode, JSGlobalObject* globalObject, PassRefPtr&lt;SourceProvider&gt; sourceProvider, int baseScopeDepth)
</span><del>-            : ProgramCodeBlock(ownerNode, EvalCode, globalObject, sourceProvider)
</del><ins>+            : GlobalCodeBlock(ownerNode, EvalCode, sourceProvider, 0, globalObject)
</ins><span class="cx">             , m_baseScopeDepth(baseScopeDepth)
</span><span class="cx">         {
</span><span class="cx">         }
</span><span class="lines">@@ -585,6 +594,22 @@
</span><span class="cx">         int m_baseScopeDepth;
</span><span class="cx">     };
</span><span class="cx"> 
</span><ins>+    class FunctionCodeBlock : public CodeBlock {
+    public:
+        FunctionCodeBlock(ScopeNode* ownerNode, CodeType codeType, PassRefPtr&lt;SourceProvider&gt; sourceProvider, unsigned sourceOffset)
+            : CodeBlock(ownerNode, codeType, sourceProvider, sourceOffset)
+        {
+        }
+    };
+
+    class NativeCodeBlock : public CodeBlock {
+    public:
+        NativeCodeBlock(ScopeNode* ownerNode)
+            : CodeBlock(ownerNode)
+        {
+        }
+    };
+
</ins><span class="cx">     inline Register&amp; ExecState::r(int index)
</span><span class="cx">     {
</span><span class="cx">         CodeBlock* codeBlock = this-&gt;codeBlock();
</span></span></pre></div>
<a id="trunkJavaScriptCorebytecodeEvalCodeCacheh"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/bytecode/EvalCodeCache.h (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/bytecode/EvalCodeCache.h        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/bytecode/EvalCodeCache.h        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #ifndef EvalCodeCache_h
</span><span class="cx"> #define EvalCodeCache_h
</span><span class="cx"> 
</span><ins>+#include &quot;Executable.h&quot;
</ins><span class="cx"> #include &quot;JSGlobalObject.h&quot;
</span><span class="cx"> #include &quot;Nodes.h&quot;
</span><span class="cx"> #include &quot;Parser.h&quot;
</span><span class="lines">@@ -41,29 +42,24 @@
</span><span class="cx"> 
</span><span class="cx">     class EvalCodeCache {
</span><span class="cx">     public:
</span><del>-        PassRefPtr&lt;EvalNode&gt; get(ExecState* exec, const UString&amp; evalSource, ScopeChainNode* scopeChain, JSValue&amp; exceptionValue)
</del><ins>+        PassRefPtr&lt;EvalExecutable&gt; get(ExecState* exec, const UString&amp; evalSource, ScopeChainNode* scopeChain, JSValue&amp; exceptionValue)
</ins><span class="cx">         {
</span><del>-            RefPtr&lt;EvalNode&gt; evalNode;
</del><ins>+            RefPtr&lt;EvalExecutable&gt; evalExecutable;
</ins><span class="cx"> 
</span><span class="cx">             if (evalSource.size() &lt; maxCacheableSourceLength &amp;&amp; (*scopeChain-&gt;begin())-&gt;isVariableObject())
</span><del>-                evalNode = m_cacheMap.get(evalSource.rep());
</del><ins>+                evalExecutable = m_cacheMap.get(evalSource.rep());
</ins><span class="cx"> 
</span><del>-            if (!evalNode) {
-                int errorLine;
-                UString errorMessage;
-                
-                SourceCode source = makeSource(evalSource);
-                evalNode = exec-&gt;globalData().parser-&gt;parse&lt;EvalNode&gt;(exec, exec-&gt;dynamicGlobalObject()-&gt;debugger(), source, &amp;errorLine, &amp;errorMessage);
-                if (evalNode) {
-                    if (evalSource.size() &lt; maxCacheableSourceLength &amp;&amp; (*scopeChain-&gt;begin())-&gt;isVariableObject() &amp;&amp; m_cacheMap.size() &lt; maxCacheEntries)
-                        m_cacheMap.set(evalSource.rep(), evalNode);
-                } else {
-                    exceptionValue = Error::create(exec, SyntaxError, errorMessage, errorLine, source.provider()-&gt;asID(), 0);
</del><ins>+            if (!evalExecutable) {
+                evalExecutable = new EvalExecutable(makeSource(evalSource));
+                exceptionValue = evalExecutable-&gt;parse(exec);
+                if (exceptionValue)
</ins><span class="cx">                     return 0;
</span><del>-                }
</del><ins>+
+                if (evalSource.size() &lt; maxCacheableSourceLength &amp;&amp; (*scopeChain-&gt;begin())-&gt;isVariableObject() &amp;&amp; m_cacheMap.size() &lt; maxCacheEntries)
+                    m_cacheMap.set(evalSource.rep(), evalExecutable);
</ins><span class="cx">             }
</span><span class="cx"> 
</span><del>-            return evalNode.release();
</del><ins>+            return evalExecutable.release();
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         bool isEmpty() const { return m_cacheMap.isEmpty(); }
</span><span class="lines">@@ -78,7 +74,7 @@
</span><span class="cx">         static const int maxCacheableSourceLength = 256;
</span><span class="cx">         static const int maxCacheEntries = 64;
</span><span class="cx"> 
</span><del>-        typedef HashMap&lt;RefPtr&lt;UString::Rep&gt;, RefPtr&lt;EvalNode&gt; &gt; EvalCacheMap;
</del><ins>+        typedef HashMap&lt;RefPtr&lt;UString::Rep&gt;, RefPtr&lt;EvalExecutable&gt; &gt; EvalCacheMap;
</ins><span class="cx">         EvalCacheMap m_cacheMap;
</span><span class="cx">     };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkJavaScriptCoredebuggerDebuggercpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/debugger/Debugger.cpp (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/debugger/Debugger.cpp        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/debugger/Debugger.cpp        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -113,14 +113,12 @@
</span><span class="cx"> {
</span><span class="cx">     CallFrame* globalCallFrame = globalObject-&gt;globalExec();
</span><span class="cx"> 
</span><del>-    int errLine;
-    UString errMsg;
-    SourceCode source = makeSource(script);
-    RefPtr&lt;EvalNode&gt; evalNode = globalObject-&gt;globalData()-&gt;parser-&gt;parse&lt;EvalNode&gt;(globalCallFrame, globalObject-&gt;debugger(), source, &amp;errLine, &amp;errMsg);
-    if (!evalNode)
-        return Error::create(globalCallFrame, SyntaxError, errMsg, errLine, source.provider()-&gt;asID(), source.provider()-&gt;url());
</del><ins>+    EvalExecutable eval(makeSource(script));
+    JSObject* error = eval.parse(globalCallFrame);
+    if (error)
+        return error;
</ins><span class="cx"> 
</span><del>-    return globalObject-&gt;globalData()-&gt;interpreter-&gt;execute(evalNode.get(), globalCallFrame, globalObject, globalCallFrame-&gt;scopeChain(), &amp;exception);
</del><ins>+    return globalObject-&gt;globalData()-&gt;interpreter-&gt;execute(&amp;eval, globalCallFrame, globalObject, globalCallFrame-&gt;scopeChain(), &amp;exception);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkJavaScriptCoredebuggerDebuggerCallFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/debugger/DebuggerCallFrame.cpp (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/debugger/DebuggerCallFrame.cpp        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/debugger/DebuggerCallFrame.cpp        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -79,14 +79,12 @@
</span><span class="cx">     if (!m_callFrame-&gt;codeBlock())
</span><span class="cx">         return JSValue();
</span><span class="cx"> 
</span><del>-    int errLine;
-    UString errMsg;
-    SourceCode source = makeSource(script);
-    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);
-    if (!evalNode)
-        return Error::create(m_callFrame, SyntaxError, errMsg, errLine, source.provider()-&gt;asID(), source.provider()-&gt;url());
</del><ins>+    EvalExecutable eval(makeSource(script));
+    JSObject* error = eval.parse(m_callFrame);
+    if (error)
+        return error;
</ins><span class="cx"> 
</span><del>-    return m_callFrame-&gt;scopeChain()-&gt;globalData-&gt;interpreter-&gt;execute(evalNode.get(), m_callFrame, thisObject(), m_callFrame-&gt;scopeChain(), &amp;exception);
</del><ins>+    return m_callFrame-&gt;scopeChain()-&gt;globalData-&gt;interpreter-&gt;execute(&amp;eval, m_callFrame, thisObject(), m_callFrame-&gt;scopeChain(), &amp;exception);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkJavaScriptCoreinterpreterInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/interpreter/Interpreter.cpp (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/interpreter/Interpreter.cpp        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/interpreter/Interpreter.cpp        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -354,11 +354,11 @@
</span><span class="cx">     
</span><span class="cx">     ScopeChainNode* scopeChain = callFrame-&gt;scopeChain();
</span><span class="cx">     CodeBlock* codeBlock = callFrame-&gt;codeBlock();
</span><del>-    RefPtr&lt;EvalNode&gt; evalNode = codeBlock-&gt;evalCodeCache().get(callFrame, programSource, scopeChain, exceptionValue);
</del><ins>+    RefPtr&lt;EvalExecutable&gt; eval = codeBlock-&gt;evalCodeCache().get(callFrame, programSource, scopeChain, exceptionValue);
</ins><span class="cx"> 
</span><span class="cx">     JSValue result = jsUndefined();
</span><del>-    if (evalNode)
-        result = callFrame-&gt;globalData().interpreter-&gt;execute(evalNode.get(), callFrame, callFrame-&gt;thisValue().toThisObject(callFrame), callFrame-&gt;registers() - registerFile-&gt;start() + registerOffset, scopeChain, &amp;exceptionValue);
</del><ins>+    if (eval)
+        result = callFrame-&gt;globalData().interpreter-&gt;execute(eval.get(), callFrame, callFrame-&gt;thisValue().toThisObject(callFrame), callFrame-&gt;registers() - registerFile-&gt;start() + registerOffset, scopeChain, &amp;exceptionValue);
</ins><span class="cx"> 
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="lines">@@ -610,7 +610,7 @@
</span><span class="cx">     return handler;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue Interpreter::execute(ProgramNode* programNode, CallFrame* callFrame, ScopeChainNode* scopeChain, JSObject* thisObj, JSValue* exception)
</del><ins>+JSValue Interpreter::execute(ProgramExecutable* program, CallFrame* callFrame, ScopeChainNode* scopeChain, JSObject* thisObj, JSValue* exception)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!scopeChain-&gt;globalData-&gt;exception);
</span><span class="cx"> 
</span><span class="lines">@@ -621,7 +621,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    CodeBlock* codeBlock = &amp;programNode-&gt;bytecode(scopeChain);
</del><ins>+    CodeBlock* codeBlock = &amp;program-&gt;bytecode(scopeChain);
</ins><span class="cx"> 
</span><span class="cx">     Register* oldEnd = m_registerFile.end();
</span><span class="cx">     Register* newEnd = oldEnd + codeBlock-&gt;m_numParameters + RegisterFile::CallFrameHeaderSize + codeBlock-&gt;m_numCalleeRegisters;
</span><span class="lines">@@ -645,7 +645,7 @@
</span><span class="cx"> 
</span><span class="cx">     Profiler** profiler = Profiler::enabledProfilerReference();
</span><span class="cx">     if (*profiler)
</span><del>-        (*profiler)-&gt;willExecute(newCallFrame, programNode-&gt;sourceURL(), programNode-&gt;lineNo());
</del><ins>+        (*profiler)-&gt;willExecute(newCallFrame, program-&gt;sourceURL(), program-&gt;lineNo());
</ins><span class="cx"> 
</span><span class="cx">     JSValue result;
</span><span class="cx">     {
</span><span class="lines">@@ -653,7 +653,7 @@
</span><span class="cx"> 
</span><span class="cx">         m_reentryDepth++;
</span><span class="cx"> #if ENABLE(JIT)
</span><del>-        result = programNode-&gt;jitCode(scopeChain).execute(&amp;m_registerFile, newCallFrame, scopeChain-&gt;globalData, exception);
</del><ins>+        result = program-&gt;jitCode(scopeChain).execute(&amp;m_registerFile, newCallFrame, scopeChain-&gt;globalData, exception);
</ins><span class="cx"> #else
</span><span class="cx">         result = privateExecute(Normal, &amp;m_registerFile, newCallFrame, exception);
</span><span class="cx"> #endif
</span><span class="lines">@@ -661,7 +661,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (*profiler)
</span><del>-        (*profiler)-&gt;didExecute(callFrame, programNode-&gt;sourceURL(), programNode-&gt;lineNo());
</del><ins>+        (*profiler)-&gt;didExecute(callFrame, program-&gt;sourceURL(), program-&gt;lineNo());
</ins><span class="cx"> 
</span><span class="cx">     if (m_reentryDepth &amp;&amp; lastGlobalObject &amp;&amp; globalObject != lastGlobalObject)
</span><span class="cx">         lastGlobalObject-&gt;copyGlobalsTo(m_registerFile);
</span><span class="lines">@@ -804,12 +804,12 @@
</span><span class="cx">     m_registerFile.shrink(closure.oldEnd);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue Interpreter::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue* exception)
</del><ins>+JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue* exception)
</ins><span class="cx"> {
</span><del>-    return execute(evalNode, callFrame, thisObj, m_registerFile.size() + evalNode-&gt;bytecode(scopeChain).m_numParameters + RegisterFile::CallFrameHeaderSize, scopeChain, exception);
</del><ins>+    return execute(eval, callFrame, thisObj, m_registerFile.size() + eval-&gt;bytecode(scopeChain).m_numParameters + RegisterFile::CallFrameHeaderSize, scopeChain, exception);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue Interpreter::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, int globalRegisterOffset, ScopeChainNode* scopeChain, JSValue* exception)
</del><ins>+JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSObject* thisObj, int globalRegisterOffset, ScopeChainNode* scopeChain, JSValue* exception)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!scopeChain-&gt;globalData-&gt;exception);
</span><span class="cx"> 
</span><span class="lines">@@ -822,7 +822,7 @@
</span><span class="cx"> 
</span><span class="cx">     DynamicGlobalObjectScope globalObjectScope(callFrame, callFrame-&gt;globalData().dynamicGlobalObject ? callFrame-&gt;globalData().dynamicGlobalObject : scopeChain-&gt;globalObject());
</span><span class="cx"> 
</span><del>-    EvalCodeBlock* codeBlock = &amp;evalNode-&gt;bytecode(scopeChain);
</del><ins>+    EvalCodeBlock* codeBlock = &amp;eval-&gt;bytecode(scopeChain);
</ins><span class="cx"> 
</span><span class="cx">     JSVariableObject* variableObject;
</span><span class="cx">     for (ScopeChainNode* node = scopeChain; ; node = node-&gt;next) {
</span><span class="lines">@@ -874,7 +874,7 @@
</span><span class="cx"> 
</span><span class="cx">     Profiler** profiler = Profiler::enabledProfilerReference();
</span><span class="cx">     if (*profiler)
</span><del>-        (*profiler)-&gt;willExecute(newCallFrame, evalNode-&gt;sourceURL(), evalNode-&gt;lineNo());
</del><ins>+        (*profiler)-&gt;willExecute(newCallFrame, eval-&gt;sourceURL(), eval-&gt;lineNo());
</ins><span class="cx"> 
</span><span class="cx">     JSValue result;
</span><span class="cx">     {
</span><span class="lines">@@ -882,7 +882,7 @@
</span><span class="cx"> 
</span><span class="cx">         m_reentryDepth++;
</span><span class="cx"> #if ENABLE(JIT)
</span><del>-        result = evalNode-&gt;jitCode(scopeChain).execute(&amp;m_registerFile, newCallFrame, scopeChain-&gt;globalData, exception);
</del><ins>+        result = eval-&gt;jitCode(scopeChain).execute(&amp;m_registerFile, newCallFrame, scopeChain-&gt;globalData, exception);
</ins><span class="cx"> #else
</span><span class="cx">         result = privateExecute(Normal, &amp;m_registerFile, newCallFrame, exception);
</span><span class="cx"> #endif
</span><span class="lines">@@ -890,7 +890,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (*profiler)
</span><del>-        (*profiler)-&gt;didExecute(callFrame, evalNode-&gt;sourceURL(), evalNode-&gt;lineNo());
</del><ins>+        (*profiler)-&gt;didExecute(callFrame, eval-&gt;sourceURL(), eval-&gt;lineNo());
</ins><span class="cx"> 
</span><span class="cx">     m_registerFile.shrink(oldEnd);
</span><span class="cx">     return result;
</span></span></pre></div>
<a id="trunkJavaScriptCoreinterpreterInterpreterh"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/interpreter/Interpreter.h (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/interpreter/Interpreter.h        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/interpreter/Interpreter.h        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -42,12 +42,12 @@
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="cx">     class CodeBlock;
</span><del>-    class EvalNode;
</del><ins>+    class EvalExecutable;
</ins><span class="cx">     class FunctionBodyNode;
</span><span class="cx">     class InternalFunction;
</span><span class="cx">     class JSFunction;
</span><span class="cx">     class JSGlobalObject;
</span><del>-    class ProgramNode;
</del><ins>+    class ProgramExecutable;
</ins><span class="cx">     class Register;
</span><span class="cx">     class ScopeChainNode;
</span><span class="cx">     class SamplingTool;
</span><span class="lines">@@ -95,9 +95,9 @@
</span><span class="cx"> 
</span><span class="cx">         bool isOpcode(Opcode);
</span><span class="cx">         
</span><del>-        JSValue execute(ProgramNode*, CallFrame*, ScopeChainNode*, JSObject* thisObj, JSValue* exception);
</del><ins>+        JSValue execute(ProgramExecutable*, CallFrame*, ScopeChainNode*, JSObject* thisObj, JSValue* exception);
</ins><span class="cx">         JSValue execute(FunctionBodyNode*, CallFrame*, JSFunction*, JSObject* thisObj, const ArgList&amp; args, ScopeChainNode*, JSValue* exception);
</span><del>-        JSValue execute(EvalNode* evalNode, CallFrame* exec, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue* exception);
</del><ins>+        JSValue execute(EvalExecutable* evalNode, CallFrame* exec, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue* exception);
</ins><span class="cx"> 
</span><span class="cx">         JSValue retrieveArguments(CallFrame*, JSFunction*) const;
</span><span class="cx">         JSValue retrieveCaller(CallFrame*, InternalFunction*) const;
</span><span class="lines">@@ -119,7 +119,7 @@
</span><span class="cx">         void endRepeatCall(CallFrameClosure&amp;);
</span><span class="cx">         JSValue execute(CallFrameClosure&amp;, JSValue* exception);
</span><span class="cx"> 
</span><del>-        JSValue execute(EvalNode*, CallFrame*, JSObject* thisObject, int globalRegisterOffset, ScopeChainNode*, JSValue* exception);
</del><ins>+        JSValue execute(EvalExecutable*, CallFrame*, JSObject* thisObject, int globalRegisterOffset, ScopeChainNode*, JSValue* exception);
</ins><span class="cx"> 
</span><span class="cx"> #if USE(INTERPRETER)
</span><span class="cx">         NEVER_INLINE bool resolve(CallFrame*, Instruction*, JSValue&amp; exceptionValue);
</span></span></pre></div>
<a id="trunkJavaScriptCoreparserNodescpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/parser/Nodes.cpp (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/parser/Nodes.cpp        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/parser/Nodes.cpp        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -2048,7 +2048,7 @@
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;FunctionBodyNode&gt; body = new FunctionBodyNode(globalData);
</span><span class="cx">     globalData-&gt;parser-&gt;arena().reset();
</span><del>-    body-&gt;m_code.set(new CodeBlock(body.get()));
</del><ins>+    body-&gt;m_code.set(new NativeCodeBlock(body.get()));
</ins><span class="cx">     body-&gt;m_jitCode = JITCode(JITCode::HostFunction(globalData-&gt;jitStubs.ctiNativeCallThunk()));
</span><span class="cx">     return body.release();
</span><span class="cx"> }
</span><span class="lines">@@ -2086,7 +2086,7 @@
</span><span class="cx">     ScopeChain scopeChain(scopeChainNode);
</span><span class="cx">     JSGlobalObject* globalObject = scopeChain.globalObject();
</span><span class="cx"> 
</span><del>-    m_code.set(new CodeBlock(this, FunctionCode, source().provider(), source().startOffset()));
</del><ins>+    m_code.set(new FunctionCodeBlock(this, FunctionCode, source().provider(), source().startOffset()));
</ins><span class="cx"> 
</span><span class="cx">     OwnPtr&lt;BytecodeGenerator&gt; generator(new BytecodeGenerator(this, globalObject-&gt;debugger(), scopeChain, &amp;m_code-&gt;symbolTable(), m_code.get()));
</span><span class="cx">     generator-&gt;generate();
</span><span class="lines">@@ -2112,7 +2112,7 @@
</span><span class="cx">     ScopeChain scopeChain(scopeChainNode);
</span><span class="cx">     JSGlobalObject* globalObject = scopeChain.globalObject();
</span><span class="cx"> 
</span><del>-    m_code.set(new CodeBlock(this, FunctionCode, source().provider(), source().startOffset()));
</del><ins>+    m_code.set(new FunctionCodeBlock(this, FunctionCode, source().provider(), source().startOffset()));
</ins><span class="cx"> 
</span><span class="cx">     OwnPtr&lt;BytecodeGenerator&gt; generator(new BytecodeGenerator(this, globalObject-&gt;debugger(), scopeChain, &amp;m_code-&gt;symbolTable(), m_code.get()));
</span><span class="cx">     generator-&gt;setRegeneratingForExceptionInfo(codeBlockBeingRegeneratedFrom);
</span></span></pre></div>
<a id="trunkJavaScriptCoreparserParserh"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/parser/Parser.h (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/parser/Parser.h        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/parser/Parser.h        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> #define Parser_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Debugger.h&quot;
</span><ins>+#include &quot;Executable.h&quot;
</ins><span class="cx"> #include &quot;Nodes.h&quot;
</span><span class="cx"> #include &quot;SourceProvider.h&quot;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="lines">@@ -41,9 +42,12 @@
</span><span class="cx"> 
</span><span class="cx">     class Parser : public Noncopyable {
</span><span class="cx">     public:
</span><del>-        template &lt;class ParsedNode&gt; PassRefPtr&lt;ParsedNode&gt; parse(ExecState*, Debugger*, const SourceCode&amp;, int* errLine = 0, UString* errMsg = 0);
-        template &lt;class ParsedNode&gt; PassRefPtr&lt;ParsedNode&gt; reparse(JSGlobalData*, ParsedNode*);
</del><ins>+        template &lt;class ParsedNode&gt;
+        PassRefPtr&lt;ParsedNode&gt; parse(ExecState*, Debugger*, const SourceCode&amp;, int* errLine = 0, UString* errMsg = 0);
+        template &lt;class ParsedNode&gt;
+        PassRefPtr&lt;ParsedNode&gt; reparse(JSGlobalData*, ParsedNode*);
</ins><span class="cx">         void reparseInPlace(JSGlobalData*, FunctionBodyNode*);
</span><ins>+        PassRefPtr&lt;FunctionBodyNode&gt; parseFunctionFromGlobalCode(ExecState*, Debugger*, const SourceCode&amp;, int* errLine = 0, UString* errMsg = 0);
</ins><span class="cx"> 
</span><span class="cx">         void didFinishParsing(SourceElements*, ParserArenaData&lt;DeclarationStacks::VarStack&gt;*, 
</span><span class="cx">                               ParserArenaData&lt;DeclarationStacks::FunctionStack&gt;*, CodeFeatures features, int lastLine, int numConstants);
</span><span class="lines">@@ -63,7 +67,8 @@
</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, Debugger* debugger, 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><span class="cx">         parse(&amp;exec-&gt;globalData(), errLine, errMsg);
</span><span class="lines">@@ -90,7 +95,8 @@
</span><span class="cx">         return result.release();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    template &lt;class ParsedNode&gt; PassRefPtr&lt;ParsedNode&gt; Parser::reparse(JSGlobalData* globalData, ParsedNode* oldParsedNode)
</del><ins>+    template &lt;class ParsedNode&gt;
+    PassRefPtr&lt;ParsedNode&gt; Parser::reparse(JSGlobalData* globalData, ParsedNode* oldParsedNode)
</ins><span class="cx">     {
</span><span class="cx">         m_source = &amp;oldParsedNode-&gt;source();
</span><span class="cx">         parse(globalData, 0, 0);
</span><span class="lines">@@ -115,6 +121,46 @@
</span><span class="cx">         return result.release();
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    inline PassRefPtr&lt;FunctionBodyNode&gt; Parser::parseFunctionFromGlobalCode(ExecState* exec, Debugger* debugger, const SourceCode&amp; source, int* errLine, UString* errMsg)
+    {
+        RefPtr&lt;ProgramNode&gt; program = parse&lt;ProgramNode&gt;(exec, debugger, source, errLine, errMsg);
+
+        if (!program)
+            return 0;
+
+        StatementVector&amp; children = program-&gt;children();
+        if (children.size() != 1)
+            return 0;
+
+        StatementNode* exprStatement = children[0];
+        ASSERT(exprStatement);
+        ASSERT(exprStatement-&gt;isExprStatement());
+        if (!exprStatement || !exprStatement-&gt;isExprStatement())
+            return 0;
+
+        ExpressionNode* funcExpr = static_cast&lt;ExprStatementNode*&gt;(exprStatement)-&gt;expr();
+        ASSERT(funcExpr);
+        ASSERT(funcExpr-&gt;isFuncExprNode());
+        if (!funcExpr || !funcExpr-&gt;isFuncExprNode())
+            return 0;
+
+        RefPtr&lt;FunctionBodyNode&gt; body = static_cast&lt;FuncExprNode*&gt;(funcExpr)-&gt;body();
+        ASSERT(body);
+        return body.release();
+    }
+
+    template&lt;class ASTNodeType, class CodeBlockType&gt;
+    inline JSObject* TemplateExecutable&lt;ASTNodeType, CodeBlockType&gt;::parse(ExecState* exec, bool allowDebug)
+    {
+        int errLine;
+        UString errMsg;
+        m_node = exec-&gt;globalData().parser-&gt;parse&lt;ASTNodeType&gt;(exec, allowDebug ? exec-&gt;dynamicGlobalObject()-&gt;debugger() : 0, m_source, &amp;errLine, &amp;errMsg);
+
+        if (!m_node)
+            return Error::create(exec, SyntaxError, errMsg, errLine, m_source.provider()-&gt;asID(), m_source.provider()-&gt;url());
+        return 0;
+    }
+
</ins><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span><span class="cx"> #endif // Parser_h
</span></span></pre></div>
<a id="trunkJavaScriptCoreruntimeCompletioncpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/runtime/Completion.cpp (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/runtime/Completion.cpp        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/runtime/Completion.cpp        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -41,30 +41,27 @@
</span><span class="cx"> {
</span><span class="cx">     JSLock lock(exec);
</span><span class="cx"> 
</span><del>-    int errLine;
-    UString errMsg;
</del><ins>+    ProgramExecutable program(source);
+    JSObject* error = program.parse(exec);
+    if (error)
+        return Completion(Throw, error);
</ins><span class="cx"> 
</span><del>-    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);
-    if (!progNode)
-        return Completion(Throw, Error::create(exec, SyntaxError, errMsg, errLine, source.provider()-&gt;asID(), source.provider()-&gt;url()));
</del><span class="cx">     return Completion(Normal);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Completion evaluate(ExecState* exec, ScopeChain&amp; scopeChain, const SourceCode&amp; source, JSValue thisValue)
</span><span class="cx"> {
</span><span class="cx">     JSLock lock(exec);
</span><del>-    
-    int errLine;
-    UString errMsg;
-    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);
</del><span class="cx"> 
</span><del>-    if (!programNode)
-        return Completion(Throw, Error::create(exec, SyntaxError, errMsg, errLine, source.provider()-&gt;asID(), source.provider()-&gt;url()));
</del><ins>+    ProgramExecutable program(source);
+    JSObject* error = program.parse(exec);
+    if (error)
+        return Completion(Throw, error);
</ins><span class="cx"> 
</span><span class="cx">     JSObject* thisObj = (!thisValue || thisValue.isUndefinedOrNull()) ? exec-&gt;dynamicGlobalObject() : thisValue.toObject(exec);
</span><span class="cx"> 
</span><span class="cx">     JSValue exception;
</span><del>-    JSValue result = exec-&gt;interpreter()-&gt;execute(programNode.get(), exec, scopeChain.node(), thisObj, &amp;exception);
</del><ins>+    JSValue result = exec-&gt;interpreter()-&gt;execute(&amp;program, exec, scopeChain.node(), thisObj, &amp;exception);
</ins><span class="cx"> 
</span><span class="cx">     if (exception) {
</span><span class="cx">         if (exception.isObject() &amp;&amp; asObject(exception)-&gt;isWatchdogException())
</span></span></pre></div>
<a id="trunkJavaScriptCoreruntimeErrorcpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/runtime/Error.cpp (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/runtime/Error.cpp        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/runtime/Error.cpp        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -97,6 +97,12 @@
</span><span class="cx">     return create(exec, type, message, -1, -1, NULL);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSObject* throwError(ExecState* exec, JSObject* error)
+{
+    exec-&gt;setException(error);
+    return error;
+}
+
</ins><span class="cx"> JSObject* throwError(ExecState* exec, ErrorType type)
</span><span class="cx"> {
</span><span class="cx">     JSObject* error = Error::create(exec, type, UString(), -1, -1, NULL);
</span></span></pre></div>
<a id="trunkJavaScriptCoreruntimeErrorh"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/runtime/Error.h (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/runtime/Error.h        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/runtime/Error.h        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -59,6 +59,7 @@
</span><span class="cx">     JSObject* throwError(ExecState*, ErrorType, const UString&amp; message);
</span><span class="cx">     JSObject* throwError(ExecState*, ErrorType, const char* message);
</span><span class="cx">     JSObject* throwError(ExecState*, ErrorType);
</span><ins>+    JSObject* throwError(ExecState*, JSObject*);
</ins><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkJavaScriptCoreruntimeExecutableh"></a>
<div class="addfile"><h4>Added: trunk/JavaScriptCore/runtime/Executable.h (0 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/runtime/Executable.h                                (rev 0)
+++ trunk/JavaScriptCore/runtime/Executable.h        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef Executable_h
+#define Executable_h
+
+#include &quot;Nodes.h&quot;
+
+namespace JSC {
+
+    template&lt;class ASTNodeType, class CodeBlockType&gt;
+    class TemplateExecutable {
+    public:
+        TemplateExecutable(const SourceCode&amp; source)
+            : m_source(source)
+        {
+        }
+
+        JSObject* parse(ExecState* exec, bool allowDebug = true);
+
+        void markAggregate(MarkStack&amp; markStack)
+        {
+            m_node-&gt;markAggregate(markStack);
+        }
+
+        const UString&amp; sourceURL() const { return m_node-&gt;sourceURL(); }
+        int lineNo() const { return m_node-&gt;lineNo(); }
+        CodeBlockType&amp; bytecode(ScopeChainNode* scopeChainNode) { return m_node-&gt;bytecode(scopeChainNode); }
+        JITCode&amp; jitCode(ScopeChainNode* scopeChainNode) { return m_node-&gt;jitCode(scopeChainNode); }
+
+    protected:
+        RefPtr&lt;ASTNodeType&gt; m_node;
+        SourceCode m_source;
+    };
+
+    class EvalExecutable : public TemplateExecutable&lt;EvalNode, EvalCodeBlock&gt;, public RefCounted&lt;EvalExecutable&gt; {
+    public:
+        EvalExecutable(const SourceCode&amp; source)
+            : TemplateExecutable&lt;EvalNode, EvalCodeBlock&gt;(source)
+        {
+        }
+    };
+
+    class ProgramExecutable : public TemplateExecutable&lt;ProgramNode, ProgramCodeBlock&gt; {
+    public:
+        ProgramExecutable(const SourceCode&amp; source)
+            : TemplateExecutable&lt;ProgramNode, ProgramCodeBlock&gt;(source)
+        {
+        }
+    };
+
+};
+
+#endif
</ins></span></pre></div>
<a id="trunkJavaScriptCoreruntimeFunctionConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/runtime/FunctionConstructor.cpp (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/runtime/FunctionConstructor.cpp        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/runtime/FunctionConstructor.cpp        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -66,32 +66,6 @@
</span><span class="cx">     return CallTypeHost;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-FunctionBodyNode* extractFunctionBody(ProgramNode* program)
-{
-    if (!program)
-        return 0;
-
-    StatementVector&amp; children = program-&gt;children();
-    if (children.size() != 1)
-        return 0;
-
-    StatementNode* exprStatement = children[0];
-    ASSERT(exprStatement);
-    ASSERT(exprStatement-&gt;isExprStatement());
-    if (!exprStatement || !exprStatement-&gt;isExprStatement())
-        return 0;
-
-    ExpressionNode* funcExpr = static_cast&lt;ExprStatementNode*&gt;(exprStatement)-&gt;expr();
-    ASSERT(funcExpr);
-    ASSERT(funcExpr-&gt;isFuncExprNode());
-    if (!funcExpr || !funcExpr-&gt;isFuncExprNode())
-        return 0;
-
-    FunctionBodyNode* body = static_cast&lt;FuncExprNode*&gt;(funcExpr)-&gt;body();
-    ASSERT(body);
-    return body;
-}
-
</del><span class="cx"> // ECMA 15.3.2 The Function Constructor
</span><span class="cx"> JSObject* constructFunction(ExecState* exec, const ArgList&amp; args, const Identifier&amp; functionName, const UString&amp; sourceURL, int lineNumber)
</span><span class="cx"> {
</span><span class="lines">@@ -113,15 +87,13 @@
</span><span class="cx">     int errLine;
</span><span class="cx">     UString errMsg;
</span><span class="cx">     SourceCode source = makeSource(program, sourceURL, lineNumber);
</span><del>-    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);
-
-    FunctionBodyNode* body = extractFunctionBody(programNode.get());
</del><ins>+    RefPtr&lt;FunctionBodyNode&gt; body = exec-&gt;globalData().parser-&gt;parseFunctionFromGlobalCode(exec, exec-&gt;dynamicGlobalObject()-&gt;debugger(), source, &amp;errLine, &amp;errMsg);
</ins><span class="cx">     if (!body)
</span><span class="cx">         return throwError(exec, SyntaxError, errMsg, errLine, source.provider()-&gt;asID(), source.provider()-&gt;url());
</span><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><del>-    return new (exec) JSFunction(exec, functionName, body, scopeChain.node());
</del><ins>+    return new (exec) JSFunction(exec, functionName, body.get(), scopeChain.node());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // ECMA 15.3.2 The Function Constructor
</span></span></pre></div>
<a id="trunkJavaScriptCoreruntimeFunctionConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/runtime/FunctionConstructor.h (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/runtime/FunctionConstructor.h        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/runtime/FunctionConstructor.h        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -26,8 +26,6 @@
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="cx">     class FunctionPrototype;
</span><del>-    class ProgramNode;
-    class FunctionBodyNode;
</del><span class="cx"> 
</span><span class="cx">     class FunctionConstructor : public InternalFunction {
</span><span class="cx">     public:
</span><span class="lines">@@ -41,8 +39,6 @@
</span><span class="cx">     JSObject* constructFunction(ExecState*, const ArgList&amp;, const Identifier&amp; functionName, const UString&amp; sourceURL, int lineNumber);
</span><span class="cx">     JSObject* constructFunction(ExecState*, const ArgList&amp;);
</span><span class="cx"> 
</span><del>-    FunctionBodyNode* extractFunctionBody(ProgramNode*);
-
</del><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span><span class="cx"> #endif // FunctionConstructor_h
</span></span></pre></div>
<a id="trunkJavaScriptCoreruntimeJSGlobalDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/runtime/JSGlobalData.cpp (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/runtime/JSGlobalData.cpp        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/runtime/JSGlobalData.cpp        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -236,8 +236,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (!lazyNumericCompareFunction.size() &amp;&amp; !initializingLazyNumericCompareFunction) {
</span><span class="cx">         initializingLazyNumericCompareFunction = true;
</span><del>-        RefPtr&lt;ProgramNode&gt; programNode = parser-&gt;parse&lt;ProgramNode&gt;(exec, 0, makeSource(UString(&quot;(function (v1, v2) { return v1 - v2; })&quot;)), 0, 0);
-        RefPtr&lt;FunctionBodyNode&gt; functionBody = extractFunctionBody(programNode.get());
</del><ins>+        RefPtr&lt;FunctionBodyNode&gt; functionBody = parser-&gt;parseFunctionFromGlobalCode(exec, 0, makeSource(UString(&quot;(function (v1, v2) { return v1 - v2; })&quot;)), 0, 0);
</ins><span class="cx">         lazyNumericCompareFunction = functionBody-&gt;bytecode(exec-&gt;scopeChain()).instructions();
</span><span class="cx">         initializingLazyNumericCompareFunction = false;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/runtime/JSGlobalObject.cpp (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/runtime/JSGlobalObject.cpp        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/runtime/JSGlobalObject.cpp        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -112,8 +112,8 @@
</span><span class="cx">     if (headObject == this)
</span><span class="cx">         headObject = 0;
</span><span class="cx"> 
</span><del>-    HashSet&lt;ProgramCodeBlock*&gt;::const_iterator end = codeBlocks().end();
-    for (HashSet&lt;ProgramCodeBlock*&gt;::const_iterator it = codeBlocks().begin(); it != end; ++it)
</del><ins>+    HashSet&lt;GlobalCodeBlock*&gt;::const_iterator end = codeBlocks().end();
+    for (HashSet&lt;GlobalCodeBlock*&gt;::const_iterator it = codeBlocks().begin(); it != end; ++it)
</ins><span class="cx">         (*it)-&gt;clearGlobalObject();
</span><span class="cx">         
</span><span class="cx">     RegisterFile&amp; registerFile = globalData()-&gt;interpreter-&gt;registerFile();
</span><span class="lines">@@ -366,8 +366,8 @@
</span><span class="cx"> {
</span><span class="cx">     JSVariableObject::markChildren(markStack);
</span><span class="cx">     
</span><del>-    HashSet&lt;ProgramCodeBlock*&gt;::const_iterator end = codeBlocks().end();
-    for (HashSet&lt;ProgramCodeBlock*&gt;::const_iterator it = codeBlocks().begin(); it != end; ++it)
</del><ins>+    HashSet&lt;GlobalCodeBlock*&gt;::const_iterator end = codeBlocks().end();
+    for (HashSet&lt;GlobalCodeBlock*&gt;::const_iterator it = codeBlocks().begin(); it != end; ++it)
</ins><span class="cx">         (*it)-&gt;markAggregate(markStack);
</span><span class="cx"> 
</span><span class="cx">     RegisterFile&amp; registerFile = globalData()-&gt;interpreter-&gt;registerFile();
</span></span></pre></div>
<a id="trunkJavaScriptCoreruntimeJSGlobalObjecth"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/runtime/JSGlobalObject.h (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/runtime/JSGlobalObject.h        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/runtime/JSGlobalObject.h        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -40,8 +40,8 @@
</span><span class="cx">     class FunctionPrototype;
</span><span class="cx">     class GlobalEvalFunction;
</span><span class="cx">     class NativeErrorConstructor;
</span><ins>+    class GlobalCodeBlock;
</ins><span class="cx">     class ObjectConstructor;
</span><del>-    class ProgramCodeBlock;
</del><span class="cx">     class PrototypeFunction;
</span><span class="cx">     class RegExpConstructor;
</span><span class="cx">     class RegExpPrototype;
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx"> 
</span><span class="cx">             RefPtr&lt;JSGlobalData&gt; globalData;
</span><span class="cx"> 
</span><del>-            HashSet&lt;ProgramCodeBlock*&gt; codeBlocks;
</del><ins>+            HashSet&lt;GlobalCodeBlock*&gt; codeBlocks;
</ins><span class="cx">         };
</span><span class="cx"> 
</span><span class="cx">     public:
</span><span class="lines">@@ -257,7 +257,7 @@
</span><span class="cx"> 
</span><span class="cx">         virtual bool isDynamicScope() const;
</span><span class="cx"> 
</span><del>-        HashSet&lt;ProgramCodeBlock*&gt;&amp; codeBlocks() { return d()-&gt;codeBlocks; }
</del><ins>+        HashSet&lt;GlobalCodeBlock*&gt;&amp; codeBlocks() { return d()-&gt;codeBlocks; }
</ins><span class="cx"> 
</span><span class="cx">         void copyGlobalsFrom(RegisterFile&amp;);
</span><span class="cx">         void copyGlobalsTo(RegisterFile&amp;);
</span></span></pre></div>
<a id="trunkJavaScriptCoreruntimeJSGlobalObjectFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp (47303 => 47304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp        2009-08-14 23:25:47 UTC (rev 47303)
+++ trunk/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp        2009-08-15 01:14:00 UTC (rev 47304)
</span><span class="lines">@@ -286,16 +286,12 @@
</span><span class="cx">     if (JSValue parsedObject = preparser.tryLiteralParse())
</span><span class="cx">         return parsedObject;
</span><span class="cx"> 
</span><del>-    int errLine;
-    UString errMsg;
</del><ins>+    EvalExecutable eval(makeSource(s));
+    JSObject* error = eval.parse(exec);
+    if (error)
+        return throwError(exec, error);
</ins><span class="cx"> 
</span><del>-    SourceCode source = makeSource(s);
-    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);
-
-    if (!evalNode)
-        return throwError(exec, SyntaxError, errMsg, errLine, source.provider()-&gt;asID(), NULL);
-
-    return exec-&gt;interpreter()-&gt;execute(evalNode.get(), exec, thisObject, static_cast&lt;JSGlobalObject*&gt;(unwrappedObject)-&gt;globalScopeChain().node(), exec-&gt;exceptionSlot());
</del><ins>+    return exec-&gt;interpreter()-&gt;execute(&amp;eval, exec, thisObject, static_cast&lt;JSGlobalObject*&gt;(unwrappedObject)-&gt;globalScopeChain().node(), exec-&gt;exceptionSlot());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSC_HOST_CALL globalFuncParseInt(ExecState* exec, JSObject*, JSValue, const ArgList&amp; args)
</span></span></pre>
</div>
</div>

</body>
</html>