Bug 1505935 Part 4 - Inform the record/replay system about all script compilations, r=jorendorff.

--HG--
extra : rebase_source : cc0d08d1133be5b99c863e6ba5879010b8de084f
This commit is contained in:
Brian Hackett 2018-11-17 10:55:06 -10:00
parent 478325b15f
commit 733258b327
3 changed files with 19 additions and 12 deletions

View File

@ -443,6 +443,13 @@ frontend::SourceAwareCompiler<Unit>::createSourceAndParser(BytecodeCompiler& inf
return false;
}
// Note the contents of any compiled scripts when recording/replaying.
if (mozilla::recordreplay::IsRecordingOrReplaying()) {
mozilla::recordreplay::NoteContentParse(this, info.options.filename(),
"application/javascript",
sourceBuffer_.units(), sourceBuffer_.length());
}
info.createUsedNames();
if (info.canLazilyParse()) {

View File

@ -2634,16 +2634,16 @@ ScriptSource::performXDR(XDRState<mode>* xdr)
if (!units.get()) {
return xdr->fail(JS::TranscodeResult_Throw);
}
mozilla::recordreplay::NoteContentParse8(this, filename(), "application/javascript",
units.get(), length());
mozilla::recordreplay::NoteContentParse(this, filename(), "application/javascript",
units.get(), length());
} else {
// UTF-16 source text.
ScriptSource::PinnedUnits<char16_t> units(xdr->cx(), this, holder, 0, length());
if (!units.get()) {
return xdr->fail(JS::TranscodeResult_Throw);
}
mozilla::recordreplay::NoteContentParse16(this, filename(), "application/javascript",
units.get(), length());
mozilla::recordreplay::NoteContentParse(this, filename(), "application/javascript",
units.get(), length());
}
}
}

View File

@ -344,22 +344,22 @@ MFBT_API void AddContentParseData16(const void* aToken,
// Mark a content parse as having completed.
MFBT_API void EndContentParse(const void* aToken);
// Perform an entire content parse, when the entire URL is available at once.
// Perform an entire content parse of UTF-8 data.
static inline void
NoteContentParse8(const void* aToken,
const char* aURL, const char* aContentType,
const mozilla::Utf8Unit* aUtf8Buffer, size_t aLength)
NoteContentParse(const void* aToken,
const char* aURL, const char* aContentType,
const Utf8Unit* aUtf8Buffer, size_t aLength)
{
BeginContentParse(aToken, aURL, aContentType);
AddContentParseData8(aToken, aUtf8Buffer, aLength);
EndContentParse(aToken);
}
// Perform an entire content parse, when the entire URL is available at once.
// Perform an entire content parse of UTF-16 data.
static inline void
NoteContentParse16(const void* aToken,
const char* aURL, const char* aContentType,
const char16_t* aBuffer, size_t aLength)
NoteContentParse(const void* aToken,
const char* aURL, const char* aContentType,
const char16_t* aBuffer, size_t aLength)
{
BeginContentParse(aToken, aURL, aContentType);
AddContentParseData16(aToken, aBuffer, aLength);