Bug 1800641 - Part 2: Add ScriptLoadRequest::Bytecode and let JSExecutionContext::Decode receive JS::TranscodeRange. r=nbp

Depends on D197839

Differential Revision: https://phabricator.services.mozilla.com/D197840
This commit is contained in:
Tooru Fujisawa
2024-01-08 14:57:36 +00:00
parent cac32b6d4d
commit 59f39b43f5
5 changed files with 18 additions and 23 deletions

View File

@@ -237,12 +237,7 @@ nsresult ModuleLoader::CompileFetchedModule(
JS::DecodeOptions decodeOptions(aOptions);
decodeOptions.borrowBuffer = true;
auto& bytecode = aRequest->mScriptBytecode;
auto& offset = aRequest->mBytecodeOffset;
JS::TranscodeRange range(bytecode.begin() + offset,
bytecode.length() - offset);
JS::TranscodeRange range = aRequest->Bytecode();
JS::TranscodeResult tr =
JS::DecodeStencil(aCx, decodeOptions, range, getter_AddRefs(stencil));
if (tr != JS::TranscodeResult::Ok) {