Bug 1465292 Part 3 - Track parsed content from loaded script files, r=smaug.
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 23 Jul 2018 21:42:20 +0000
changeset 428110 46db17f25557bcc5acbb712b4ceb048d85c2e325
parent 428109 1bbbc2375abc599cb0feb2c2fef242ec996b4498
child 428111 7d63e1235defe4c6a80d246658140470fc25c98a
push id34327
push userarchaeopteryx@coole-files.de
push dateWed, 25 Jul 2018 14:18:02 +0000
treeherdermozilla-central@fa78cd1a6880 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1465292
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1465292 Part 3 - Track parsed content from loaded script files, r=smaug.
dom/script/ScriptLoader.cpp
--- a/dom/script/ScriptLoader.cpp
+++ b/dom/script/ScriptLoader.cpp
@@ -2355,16 +2355,24 @@ ScriptLoader::EvaluateScript(ScriptLoadR
                 rv = exec.DecodeBinASTAndExec(options,
                                               aRequest->ScriptBinASTData().begin(),
                                               aRequest->ScriptBinASTData().length(),
                                               &script);
               } else {
                 MOZ_ASSERT(aRequest->IsTextSource());
                 nsAutoString inlineData;
                 SourceBufferHolder srcBuf = GetScriptSource(aRequest, inlineData);
+
+                if (recordreplay::IsRecordingOrReplaying()) {
+                  JS::BeginContentParseForRecordReplay(this, options.filename(), "application/javascript",
+                                                       JS::SmallestEncoding::UTF16);
+                  JS::AddContentParseDataForRecordReplay(this, srcBuf.get(), srcBuf.length() * sizeof(char16_t));
+                  JS::EndContentParseForRecordReplay(this);
+                }
+
                 rv = exec.CompileAndExec(options, srcBuf, &script);
               }
             }
           }
 
           // Queue the current script load request to later save the bytecode.
           if (script && encodeBytecode) {
             aRequest->mScript = script;