commit 2520b3066af5faa25f815197ababc883a2547078
parent da2d987339663c20b4512fe7387f7fb060f4380d
Author: Tooru Fujisawa <arai_a@mac.com>
Date: Wed, 26 Nov 2025 04:10:51 +0000
Bug 1907011 - Part 4: Rename LoadedScript::Bytecode to LoadedScript::SerializedStencil. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D273957
Diffstat:
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/dom/script/ModuleLoader.cpp b/dom/script/ModuleLoader.cpp
@@ -304,7 +304,7 @@ nsresult ModuleLoader::CompileJavaScriptModule(
JS::DecodeOptions decodeOptions(aOptions);
decodeOptions.borrowBuffer = true;
- JS::TranscodeRange range = aRequest->Bytecode();
+ JS::TranscodeRange range = aRequest->SerializedStencil();
JS::TranscodeResult tr =
JS::DecodeStencil(aCx, decodeOptions, range, getter_AddRefs(stencil));
if (tr != JS::TranscodeResult::Ok) {
diff --git a/dom/script/ScriptLoader.cpp b/dom/script/ScriptLoader.cpp
@@ -2082,9 +2082,9 @@ nsresult ScriptLoader::AttemptOffThreadScriptCompile(
} else {
MOZ_ASSERT(aRequest->IsSerializedStencil());
- JS::TranscodeRange bytecode = aRequest->Bytecode();
+ JS::TranscodeRange range = aRequest->SerializedStencil();
if (!StaticPrefs::javascript_options_parallel_parsing() ||
- bytecode.length() < OffThreadMinimumBytecodeLength) {
+ range.length() < OffThreadMinimumBytecodeLength) {
return NS_OK;
}
}
@@ -2337,9 +2337,9 @@ nsresult ScriptLoader::CreateOffThreadTask(
JSContext* aCx, ScriptLoadRequest* aRequest, JS::CompileOptions& aOptions,
CompileOrDecodeTask** aCompileOrDecodeTask) {
if (aRequest->IsSerializedStencil()) {
- JS::TranscodeRange bytecode = aRequest->Bytecode();
+ JS::TranscodeRange range = aRequest->SerializedStencil();
JS::DecodeOptions decodeOptions(aOptions);
- RefPtr<ScriptDecodeTask> decodeTask = new ScriptDecodeTask(bytecode);
+ RefPtr<ScriptDecodeTask> decodeTask = new ScriptDecodeTask(range);
nsresult rv = decodeTask->Init(decodeOptions);
NS_ENSURE_SUCCESS(rv, rv);
decodeTask.forget(aCompileOrDecodeTask);
@@ -3154,7 +3154,7 @@ void ScriptLoader::InstantiateClassicScriptFromMaybeEncodedSource(
profilerLabelString);
RefPtr<JS::Stencil> stencil;
- Decode(aCx, aCompileOptions, aRequest->Bytecode(), stencil, aRv);
+ Decode(aCx, aCompileOptions, aRequest->SerializedStencil(), stencil, aRv);
if (stencil) {
aRequest->SetStencil(stencil);
diff --git a/js/loader/LoadedScript.h b/js/loader/LoadedScript.h
@@ -258,7 +258,7 @@ class LoadedScript : public nsIMemoryReporter {
MOZ_ASSERT(CanHaveSRIAndSerializedStencil());
return mSRIAndBytecode;
}
- TranscodeRange Bytecode() const {
+ TranscodeRange SerializedStencil() const {
MOZ_ASSERT(CanHaveSRIAndSerializedStencil());
const auto& bytecode = mSRIAndBytecode;
auto offset = mBytecodeOffset;
@@ -558,7 +558,9 @@ class LoadedScriptDelegate {
TranscodeBuffer& SRIAndSerializedStencil() {
return GetLoadedScript()->SRIAndSerializedStencil();
}
- TranscodeRange Bytecode() const { return GetLoadedScript()->Bytecode(); }
+ TranscodeRange SerializedStencil() const {
+ return GetLoadedScript()->SerializedStencil();
+ }
size_t GetSRILength() const { return GetLoadedScript()->GetSRILength(); }
void SetSRILength(size_t sriLength) {