Open github-actions[bot] opened 1 year ago
/js/src/frontend/CompilationStencil.h
/js/src/frontend/Stencil.cpp
/js/src/vm/SharedStencil.h
--- 1ab9e2b34325c370052e6da937a5d29e500d354e/js/src/frontend/CompilationStencil.h +++ f9723f5a6d0d47c7c30e9ec5bf2406f9b31b6230/js/src/frontend/CompilationStencil.h @@ -1169,17 +1169,17 @@ struct CompilationStencil { [[nodiscard]] bool delazifySelfHostedFunction(JSContext* cx, CompilationAtomCache& atomCache, ScriptIndexRange range, HandleFunction fun); [[nodiscard]] bool serializeStencils(JSContext* cx, CompilationInput& input, JS::TranscodeBuffer& buf, bool* succeededOut = nullptr) const; - [[nodiscard]] bool deserializeStencils(JSContext* cx, FrontendContext* fc, + [[nodiscard]] bool deserializeStencils(FrontendContext* fc, CompilationInput& input, const JS::TranscodeRange& range, bool* succeededOut = nullptr); // To avoid any misuses, make sure this is neither copyable or assignable. CompilationStencil(const CompilationStencil&) = delete; CompilationStencil(CompilationStencil&&) = delete; CompilationStencil& operator=(const CompilationStencil&) = delete;
--- e43fcb55f3726f20fa32326cf1ba9b5e0cd8b05c/js/src/frontend/Stencil.cpp +++ f9723f5a6d0d47c7c30e9ec5bf2406f9b31b6230/js/src/frontend/Stencil.cpp @@ -2715,17 +2715,17 @@ bool CompilationStencil::prepareForInsta bool CompilationStencil::serializeStencils(JSContext* cx, CompilationInput& input, JS::TranscodeBuffer& buf, bool* succeededOut) const { if (succeededOut) { *succeededOut = false; } AutoReportFrontendContext fc(cx); - XDRStencilEncoder encoder(cx, &fc, buf); + XDRStencilEncoder encoder(&fc, buf); XDRResult res = encoder.codeStencil(*this); if (res.isErr()) { if (JS::IsTranscodeFailureResult(res.unwrapErr())) { buf.clear(); return true; } MOZ_ASSERT(res.unwrapErr() == JS::TranscodeResult::Throw); @@ -2734,25 +2734,25 @@ bool CompilationStencil::serializeStenci } if (succeededOut) { *succeededOut = true; } return true; } -bool CompilationStencil::deserializeStencils(JSContext* cx, FrontendContext* fc, +bool CompilationStencil::deserializeStencils(FrontendContext* fc, CompilationInput& input, const JS::TranscodeRange& range, bool* succeededOut) { if (succeededOut) { *succeededOut = false; } MOZ_ASSERT(parserAtomData.empty()); - XDRStencilDecoder decoder(cx, fc, range); + XDRStencilDecoder decoder(fc, range); JS::DecodeOptions options(input.options); XDRResult res = decoder.codeStencil(options, *this); if (res.isErr()) { if (JS::IsTranscodeFailureResult(res.unwrapErr())) { return true; } MOZ_ASSERT(res.unwrapErr() == JS::TranscodeResult::Throw); @@ -5309,17 +5309,17 @@ JS_PUBLIC_API JSObject* JS::InstantiateM return nullptr; } return output.module; } JS::TranscodeResult JS::EncodeStencil(JSContext* cx, JS::Stencil* stencil, TranscodeBuffer& buffer) { AutoReportFrontendContext fc(cx); - XDRStencilEncoder encoder(cx, &fc, buffer); + XDRStencilEncoder encoder(&fc, buffer); XDRResult res = encoder.codeStencil(*stencil); if (res.isErr()) { return res.unwrapErr(); } return TranscodeResult::Ok; } JS::TranscodeResult JS::DecodeStencil(JSContext* cx, @@ -5331,17 +5331,17 @@ JS::TranscodeResult JS::DecodeStencil(JS if (!source) { return TranscodeResult::Throw; } RefPtr<JS::Stencil> stencil( fc.getAllocator()->new_<CompilationStencil>(source)); if (!stencil) { return TranscodeResult::Throw; } - XDRStencilDecoder decoder(cx, &fc, range); + XDRStencilDecoder decoder(&fc, range); XDRResult res = decoder.codeStencil(options, *stencil); if (res.isErr()) { return res.unwrapErr(); } *stencilOut = stencil.forget().take(); return TranscodeResult::Ok; }
--- 706595d4c5cb29a5ba62ea88b5e0e78182ea2a25/js/src/vm/SharedStencil.h +++ 56d694dcd452b925944ade5e7492cf56aeb12daa/js/src/vm/SharedStencil.h @@ -528,17 +528,17 @@ class alignas(uint32_t) ImmutableScriptD mozilla::Span<const uint32_t> resumeOffsets, mozilla::Span<const ScopeNote> scopeNotes, mozilla::Span<const TryNote> tryNotes); static js::UniquePtr<ImmutableScriptData> new_( FrontendContext* fc, uint32_t codeLength, uint32_t noteLength, uint32_t numResumeOffsets, uint32_t numScopeNotes, uint32_t numTryNotes); - static js::UniquePtr<ImmutableScriptData> new_(JSContext* cx, + static js::UniquePtr<ImmutableScriptData> new_(FrontendContext* fc, uint32_t totalSize); // Validate internal offsets of the data structure seems reasonable. This is // for diagnositic purposes only to detect severe corruption. This is not a // security boundary! bool validateLayout(uint32_t expectedSize); private:
Files
/js/src/frontend/CompilationStencil.h
/js/src/frontend/Stencil.cpp
/js/src/vm/SharedStencil.h
Changesets
Diffs
/js/src/frontend/CompilationStencil.h
/js/src/frontend/Stencil.cpp
/js/src/vm/SharedStencil.h