Bug 1800641 - Part 3: Add ScriptLoadRequest::SRIAndBytecode. r=nbp

Depends on D197840

Differential Revision: https://phabricator.services.mozilla.com/D197841
This commit is contained in:
Tooru Fujisawa
2024-01-08 14:57:36 +00:00
parent 59f39b43f5
commit 929368a3f4
3 changed files with 40 additions and 31 deletions

View File

@@ -243,6 +243,14 @@ class ScriptLoadRequest
void SetBytecode();
JS::TranscodeBuffer& SRIAndBytecode() {
// Note: SRIAndBytecode might be called even if the IsSource() returns true,
// as we want to be able to save the bytecode content when we are loading
// from source.
MOZ_ASSERT(IsBytecode() || IsSource());
return mScriptBytecode;
}
JS::TranscodeRange Bytecode() const {
MOZ_ASSERT(IsBytecode());
const auto& bytecode = mScriptBytecode;