<!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>[199939] 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/199939">199939</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-04-22 17:40:43 -0700 (Fri, 22 Apr 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: Source directives lost when using Function constructor repeatedly
https://bugs.webkit.org/show_bug.cgi?id=156863
<rdar://problem/25861064>
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-04-22
Reviewed by Geoffrey Garen.
Source/JavaScriptCore:
Source directives (sourceURL and sourceMappingURL) are normally accessed through
the SourceProvider and normally set when the script is parsed. However, when a
CodeCache lookup skips parsing, the new SourceProvider never gets the directives
(sourceURL/sourceMappingURL). This patch stores the directives on the UnlinkedCodeBlock
and UnlinkedFunctionExecutable when entering the cache, and copies to the new providers
when the cache is used.
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::sourceURLDirective):
(JSC::UnlinkedCodeBlock::sourceMappingURLDirective):
(JSC::UnlinkedCodeBlock::setSourceURLDirective):
(JSC::UnlinkedCodeBlock::setSourceMappingURLDirective):
* bytecode/UnlinkedFunctionExecutable.h:
* parser/SourceProvider.h:
* runtime/CodeCache.cpp:
(JSC::CodeCache::getGlobalCodeBlock):
(JSC::CodeCache::getFunctionExecutableFromGlobalCode):
* runtime/CodeCache.h:
Store directives on the unlinked code block / executable when adding
to the cache, so they can be used to update new providers when the
cache gets used.
* runtime/JSGlobalObject.cpp:
Add needed header after CodeCache header cleanup.
LayoutTests:
* inspector/debugger/sourceURL-repeated-identical-executions-expected.txt: Added.
* inspector/debugger/sourceURL-repeated-identical-executions.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeUnlinkedCodeBlockh">trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeUnlinkedFunctionExecutableh">trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserSourceProviderh">trunk/Source/JavaScriptCore/parser/SourceProvider.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCodeCachecpp">trunk/Source/JavaScriptCore/runtime/CodeCache.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCodeCacheh">trunk/Source/JavaScriptCore/runtime/CodeCache.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectordebuggersourceURLrepeatedidenticalexecutionsexpectedtxt">trunk/LayoutTests/inspector/debugger/sourceURL-repeated-identical-executions-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggersourceURLrepeatedidenticalexecutionshtml">trunk/LayoutTests/inspector/debugger/sourceURL-repeated-identical-executions.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (199938 => 199939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-23 00:07:44 UTC (rev 199938)
+++ trunk/LayoutTests/ChangeLog        2016-04-23 00:40:43 UTC (rev 199939)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-04-22 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Source directives lost when using Function constructor repeatedly
+ https://bugs.webkit.org/show_bug.cgi?id=156863
+ <rdar://problem/25861064>
+
+ Reviewed by Geoffrey Garen.
+
+ * inspector/debugger/sourceURL-repeated-identical-executions-expected.txt: Added.
+ * inspector/debugger/sourceURL-repeated-identical-executions.html: Added.
+
</ins><span class="cx"> 2016-04-22 Mark Lam <mark.lam@apple.com>
</span><span class="cx">
</span><span class="cx"> javascript jit bug affecting Google Maps.
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggersourceURLrepeatedidenticalexecutionsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/sourceURL-repeated-identical-executions-expected.txt (0 => 199939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/sourceURL-repeated-identical-executions-expected.txt         (rev 0)
+++ trunk/LayoutTests/inspector/debugger/sourceURL-repeated-identical-executions-expected.txt        2016-04-23 00:40:43 UTC (rev 199939)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Tests for the Debugger.scriptParsed messages for identical content should have source directives each time.
+
+
+== Running test suite: Debugger.scriptParsed.sourceURLRepeatedIdenticalExecutions
+-- Running test case: CheckFunctionConstructorMultipleTimes
+PASS: Should see 3 Scripts with sourceURL
+
+-- Running test case: CheckProgramMultipleTimes
+PASS: Should see 3 Scripts with sourceURL
+
+-- Running test case: CheckEvalMultipleTimes
+PASS: Should see 3 Scripts with sourceURL
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggersourceURLrepeatedidenticalexecutionshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/sourceURL-repeated-identical-executions.html (0 => 199939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/sourceURL-repeated-identical-executions.html         (rev 0)
+++ trunk/LayoutTests/inspector/debugger/sourceURL-repeated-identical-executions.html        2016-04-23 00:40:43 UTC (rev 199939)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script>
+function triggerFunctionConstructorMultipleTimes() {
+ let sum = 0;
+ sum += Function("\n//# sourceURL=test-Function-constructor.js\nreturn 1+1")();
+ sum += Function("\n//# sourceURL=test-Function-constructor.js\nreturn 1+1")();
+ sum += Function("\n//# sourceURL=test-Function-constructor.js\nreturn 1+1")();
+ return sum;
+}
+
+function triggerProgramMultipleTimes() {
+ for (let i = 0; i < 3; ++i) {
+ let script = document.createElement("script");
+ script.text = "\n//# sourceURL=test-program.js\n1+1";
+ document.head.appendChild(script);
+ }
+}
+
+function triggerEvalMultipleTimes() {
+ let sum = 0;
+ sum += eval("\n//# sourceURL=test-eval.js\n1+1");
+ sum += eval("\n//# sourceURL=test-eval.js\n1+1");
+ sum += eval("\n//# sourceURL=test-eval.js\n1+1");
+ return sum;
+}
+
+function test()
+{
+ let suite = InspectorTest.createAsyncSuite("Debugger.scriptParsed.sourceURLRepeatedIdenticalExecutions");
+
+ // Disable breakpoints to ensure we do not avoid the CodeCache.
+ DebuggerAgent.setBreakpointsActive(false);
+
+ suite.addTestCase({
+ name: "CheckFunctionConstructorMultipleTimes",
+ description: "Trigger multiple Function constructor calls with the same source and expect multiple Scripts added with sourceURLs.",
+ test: (resolve, reject) => {
+ let seen = 0;
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, (event) => {
+ if (event.data.script.sourceURL === "test-Function-constructor.js")
+ seen++;
+ });
+ InspectorTest.evaluateInPage("triggerFunctionConstructorMultipleTimes()", () => {
+ InspectorTest.expectThat(seen === 3, "Should see 3 Scripts with sourceURL");
+ resolve();
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "CheckProgramMultipleTimes",
+ description: "Trigger multiple program executions with the same source and expect multiple Scripts added with sourceURLs.",
+ test: (resolve, reject) => {
+ let seen = 0;
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, (event) => {
+ if (event.data.script.sourceURL === "test-program.js")
+ seen++;
+ });
+ InspectorTest.evaluateInPage("triggerProgramMultipleTimes()", () => {
+ InspectorTest.expectThat(seen === 3, "Should see 3 Scripts with sourceURL");
+ resolve();
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "CheckEvalMultipleTimes",
+ description: "Trigger eval with the same source and expect multiple Scripts added with sourceURLs.",
+ test: (resolve, reject) => {
+ let seen = 0;
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, (event) => {
+ if (event.data.script.sourceURL === "test-eval.js")
+ seen++;
+ });
+ InspectorTest.evaluateInPage("triggerEvalMultipleTimes()", () => {
+ InspectorTest.expectThat(seen === 3, "Should see 3 Scripts with sourceURL");
+ resolve();
+ });
+ }
+ });
+
+ suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Tests for the Debugger.scriptParsed messages for identical content should have source directives each time.</p>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (199938 => 199939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-04-23 00:07:44 UTC (rev 199938)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-04-23 00:40:43 UTC (rev 199939)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2016-04-22 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Source directives lost when using Function constructor repeatedly
+ https://bugs.webkit.org/show_bug.cgi?id=156863
+ <rdar://problem/25861064>
+
+ Reviewed by Geoffrey Garen.
+
+ Source directives (sourceURL and sourceMappingURL) are normally accessed through
+ the SourceProvider and normally set when the script is parsed. However, when a
+ CodeCache lookup skips parsing, the new SourceProvider never gets the directives
+ (sourceURL/sourceMappingURL). This patch stores the directives on the UnlinkedCodeBlock
+ and UnlinkedFunctionExecutable when entering the cache, and copies to the new providers
+ when the cache is used.
+
+ * bytecode/UnlinkedCodeBlock.h:
+ (JSC::UnlinkedCodeBlock::sourceURLDirective):
+ (JSC::UnlinkedCodeBlock::sourceMappingURLDirective):
+ (JSC::UnlinkedCodeBlock::setSourceURLDirective):
+ (JSC::UnlinkedCodeBlock::setSourceMappingURLDirective):
+ * bytecode/UnlinkedFunctionExecutable.h:
+ * parser/SourceProvider.h:
+ * runtime/CodeCache.cpp:
+ (JSC::CodeCache::getGlobalCodeBlock):
+ (JSC::CodeCache::getFunctionExecutableFromGlobalCode):
+ * runtime/CodeCache.h:
+ Store directives on the unlinked code block / executable when adding
+ to the cache, so they can be used to update new providers when the
+ cache gets used.
+
+ * runtime/JSGlobalObject.cpp:
+ Add needed header after CodeCache header cleanup.
+
</ins><span class="cx"> 2016-04-22 Mark Lam <mark.lam@apple.com>
</span><span class="cx">
</span><span class="cx"> javascript jit bug affecting Google Maps.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeUnlinkedCodeBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h (199938 => 199939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h        2016-04-23 00:07:44 UTC (rev 199938)
+++ trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h        2016-04-23 00:40:43 UTC (rev 199939)
</span><span class="lines">@@ -339,6 +339,11 @@
</span><span class="cx"> m_endColumn = endColumn;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ const String& sourceURLDirective() const { return m_sourceURLDirective; }
+ const String& sourceMappingURLDirective() const { return m_sourceMappingURLDirective; }
+ void setSourceURLDirective(const String& sourceURL) { m_sourceURLDirective = sourceURL; }
+ void setSourceMappingURLDirective(const String& sourceMappingURL) { m_sourceMappingURLDirective = sourceMappingURL; }
+
</ins><span class="cx"> CodeFeatures codeFeatures() const { return m_features; }
</span><span class="cx"> bool hasCapturedVariables() const { return m_hasCapturedVariables; }
</span><span class="cx"> unsigned firstLine() const { return m_firstLine; }
</span><span class="lines">@@ -390,6 +395,9 @@
</span><span class="cx"> VirtualRegister m_scopeRegister;
</span><span class="cx"> VirtualRegister m_globalObjectRegister;
</span><span class="cx">
</span><ins>+ String m_sourceURLDirective;
+ String m_sourceMappingURLDirective;
+
</ins><span class="cx"> unsigned m_usesEval : 1;
</span><span class="cx"> unsigned m_isStrictMode : 1;
</span><span class="cx"> unsigned m_isConstructor : 1;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeUnlinkedFunctionExecutableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h (199938 => 199939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h        2016-04-23 00:07:44 UTC (rev 199938)
+++ trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h        2016-04-23 00:40:43 UTC (rev 199939)
</span><span class="lines">@@ -136,7 +136,12 @@
</span><span class="cx"> bool isArrowFunction() const { return parseMode() == SourceParseMode::ArrowFunctionMode; }
</span><span class="cx">
</span><span class="cx"> JSC::DerivedContextType derivedContextType() const {return static_cast<JSC::DerivedContextType>(m_derivedContextType); }
</span><del>-
</del><ins>+
+ const String& sourceURLDirective() const { return m_sourceURLDirective; }
+ const String& sourceMappingURLDirective() const { return m_sourceMappingURLDirective; }
+ void setSourceURLDirective(const String& sourceURL) { m_sourceURLDirective = sourceURL; }
+ void setSourceMappingURLDirective(const String& sourceMappingURL) { m_sourceMappingURLDirective = sourceMappingURL; }
+
</ins><span class="cx"> private:
</span><span class="cx"> UnlinkedFunctionExecutable(VM*, Structure*, const SourceCode&, RefPtr<SourceProvider>&& sourceOverride, FunctionMetadataNode*, UnlinkedFunctionKind, ConstructAbility, VariableEnvironment&, JSC::DerivedContextType);
</span><span class="cx">
</span><span class="lines">@@ -171,6 +176,9 @@
</span><span class="cx"> RefPtr<SourceProvider> m_sourceOverride;
</span><span class="cx"> SourceCode m_classSource;
</span><span class="cx">
</span><ins>+ String m_sourceURLDirective;
+ String m_sourceMappingURLDirective;
+
</ins><span class="cx"> VariableEnvironment m_parentScopeTDZVariables;
</span><span class="cx">
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserSourceProviderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/SourceProvider.h (199938 => 199939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/SourceProvider.h        2016-04-23 00:07:44 UTC (rev 199938)
+++ trunk/Source/JavaScriptCore/parser/SourceProvider.h        2016-04-23 00:40:43 UTC (rev 199939)
</span><span class="lines">@@ -65,12 +65,10 @@
</span><span class="cx"> bool isValid() const { return m_validated; }
</span><span class="cx"> void setValid() { m_validated = true; }
</span><span class="cx">
</span><del>- private:
- template <typename T> friend class Parser;
-
</del><span class="cx"> void setSourceURLDirective(const String& sourceURL) { m_sourceURLDirective = sourceURL; }
</span><span class="cx"> void setSourceMappingURLDirective(const String& sourceMappingURL) { m_sourceMappingURLDirective = sourceMappingURL; }
</span><span class="cx">
</span><ins>+ private:
</ins><span class="cx"> JS_EXPORT_PRIVATE void getID();
</span><span class="cx">
</span><span class="cx"> String m_url;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCodeCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CodeCache.cpp (199938 => 199939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CodeCache.cpp        2016-04-23 00:07:44 UTC (rev 199938)
+++ trunk/Source/JavaScriptCore/runtime/CodeCache.cpp        2016-04-23 00:40:43 UTC (rev 199939)
</span><span class="lines">@@ -24,12 +24,9 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #include "config.h"
</span><del>-
</del><span class="cx"> #include "CodeCache.h"
</span><span class="cx">
</span><span class="cx"> #include "BytecodeGenerator.h"
</span><del>-#include "CodeSpecializationKind.h"
-#include "ExecutableInfo.h"
</del><span class="cx"> #include "JSCInlines.h"
</span><span class="cx"> #include "Parser.h"
</span><span class="cx"> #include "StrongInlines.h"
</span><span class="lines">@@ -99,6 +96,8 @@
</span><span class="cx"> bool endColumnIsOnStartLine = !lineCount;
</span><span class="cx"> unsigned endColumn = unlinkedCodeBlock->endColumn() + (endColumnIsOnStartLine ? startColumn : 1);
</span><span class="cx"> executable->recordParse(unlinkedCodeBlock->codeFeatures(), unlinkedCodeBlock->hasCapturedVariables(), firstLine, firstLine + lineCount, startColumn, endColumn);
</span><ins>+ source.provider()->setSourceURLDirective(unlinkedCodeBlock->sourceURLDirective());
+ source.provider()->setSourceMappingURLDirective(unlinkedCodeBlock->sourceMappingURLDirective());
</ins><span class="cx"> return unlinkedCodeBlock;
</span><span class="cx"> }
</span><span class="cx"> typedef typename CacheTypes<UnlinkedCodeBlockType>::RootNode RootNode;
</span><span class="lines">@@ -118,6 +117,8 @@
</span><span class="cx">
</span><span class="cx"> UnlinkedCodeBlockType* unlinkedCodeBlock = UnlinkedCodeBlockType::create(&vm, executable->executableInfo());
</span><span class="cx"> unlinkedCodeBlock->recordParse(rootNode->features(), rootNode->hasCapturedVariables(), rootNode->firstLine() - source.firstLine(), lineCount, unlinkedEndColumn);
</span><ins>+ unlinkedCodeBlock->setSourceURLDirective(source.provider()->sourceURL());
+ unlinkedCodeBlock->setSourceMappingURLDirective(source.provider()->sourceMappingURL());
</ins><span class="cx">
</span><span class="cx"> error = BytecodeGenerator::generate(vm, rootNode.get(), unlinkedCodeBlock, debuggerMode, profilerMode, variablesUnderTDZ);
</span><span class="cx">
</span><span class="lines">@@ -156,8 +157,12 @@
</span><span class="cx"> JSParserBuiltinMode::NotBuiltin,
</span><span class="cx"> JSParserStrictMode::NotStrict);
</span><span class="cx"> SourceCodeValue* cache = m_sourceCode.findCacheAndUpdateAge(key);
</span><del>- if (cache)
- return jsCast<UnlinkedFunctionExecutable*>(cache->cell.get());
</del><ins>+ if (cache) {
+ UnlinkedFunctionExecutable* executable = jsCast<UnlinkedFunctionExecutable*>(cache->cell.get());
+ source.provider()->setSourceURLDirective(executable->sourceURLDirective());
+ source.provider()->setSourceMappingURLDirective(executable->sourceMappingURLDirective());
+ return executable;
+ }
</ins><span class="cx">
</span><span class="cx"> JSTextPosition positionBeforeLastNewline;
</span><span class="cx"> std::unique_ptr<ProgramNode> program = parse<ProgramNode>(
</span><span class="lines">@@ -193,6 +198,9 @@
</span><span class="cx"> VariableEnvironment emptyTDZVariables;
</span><span class="cx"> UnlinkedFunctionExecutable* functionExecutable = UnlinkedFunctionExecutable::create(&vm, source, metadata, UnlinkedNormalFunction, ConstructAbility::CanConstruct, emptyTDZVariables, DerivedContextType::None);
</span><span class="cx">
</span><ins>+ functionExecutable->setSourceURLDirective(source.provider()->sourceURL());
+ functionExecutable->setSourceMappingURLDirective(source.provider()->sourceMappingURL());
+
</ins><span class="cx"> m_sourceCode.addCache(key, SourceCodeValue(vm, functionExecutable, m_sourceCode.age()));
</span><span class="cx"> return functionExecutable;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCodeCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CodeCache.h (199938 => 199939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CodeCache.h        2016-04-23 00:07:44 UTC (rev 199938)
+++ trunk/Source/JavaScriptCore/runtime/CodeCache.h        2016-04-23 00:40:43 UTC (rev 199939)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #ifndef CodeCache_h
</span><span class="cx"> #define CodeCache_h
</span><span class="cx">
</span><del>-#include "CodeSpecializationKind.h"
</del><span class="cx"> #include "ExecutableInfo.h"
</span><span class="cx"> #include "ParserModes.h"
</span><span class="cx"> #include "SourceCode.h"
</span><span class="lines">@@ -34,28 +33,22 @@
</span><span class="cx"> #include "Strong.h"
</span><span class="cx"> #include <wtf/CurrentTime.h>
</span><span class="cx"> #include <wtf/Forward.h>
</span><del>-#include <wtf/RandomNumber.h>
-#include <wtf/WeakRandom.h>
</del><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> namespace JSC {
</span><span class="cx">
</span><span class="cx"> class EvalExecutable;
</span><del>-class FunctionMetadataNode;
</del><span class="cx"> class Identifier;
</span><del>-class JSScope;
</del><ins>+class ModuleProgramExecutable;
</ins><span class="cx"> class ParserError;
</span><span class="cx"> class ProgramExecutable;
</span><del>-class ModuleProgramExecutable;
</del><ins>+class SourceCode;
</ins><span class="cx"> class UnlinkedCodeBlock;
</span><span class="cx"> class UnlinkedEvalCodeBlock;
</span><del>-class UnlinkedModuleProgramCodeBlock;
-class UnlinkedFunctionCodeBlock;
</del><span class="cx"> class UnlinkedFunctionExecutable;
</span><ins>+class UnlinkedModuleProgramCodeBlock;
</ins><span class="cx"> class UnlinkedProgramCodeBlock;
</span><span class="cx"> class VM;
</span><del>-class SourceCode;
-class SourceProvider;
</del><span class="cx"> class VariableEnvironment;
</span><span class="cx">
</span><span class="cx"> struct SourceCodeValue {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (199938 => 199939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-04-23 00:07:44 UTC (rev 199938)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-04-23 00:40:43 UTC (rev 199939)
</span><span class="lines">@@ -154,6 +154,7 @@
</span><span class="cx"> #include "WeakMapPrototype.h"
</span><span class="cx"> #include "WeakSetConstructor.h"
</span><span class="cx"> #include "WeakSetPrototype.h"
</span><ins>+#include <wtf/RandomNumber.h>
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(INTL)
</span><span class="cx"> #include "IntlObject.h"
</span></span></pre>
</div>
</div>
</body>
</html>