Open github-actions[bot] opened 4 days ago
/js/src/frontend/CompilationStencil.h
/js/src/frontend/Stencil.cpp
--- 9aab46a883b2d9e3f0c807a9ec4ffe5ea05d19f0/js/src/frontend/CompilationStencil.h +++ 0f228f8c380c617e3dfb4b58a016837ef85d258c/js/src/frontend/CompilationStencil.h @@ -1267,23 +1267,16 @@ struct CompilationStencil { [[nodiscard]] JSFunction* instantiateSelfHostedLazyFunction( JSContext* cx, CompilationAtomCache& atomCache, ScriptIndex index, JS::Handle<JSAtom*> name); [[nodiscard]] bool delazifySelfHostedFunction(JSContext* cx, CompilationAtomCache& atomCache, ScriptIndexRange range, JS::Handle<JSFunction*> fun); - [[nodiscard]] bool serializeStencils(JSContext* cx, CompilationInput& input, - JS::TranscodeBuffer& buf, - bool* succeededOut = nullptr) const; - [[nodiscard]] bool deserializeStencils( - FrontendContext* fc, const JS::ReadOnlyCompileOptions& options, - 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; CompilationStencil& operator=(CompilationStencil&&) = delete; #ifdef DEBUG ~CompilationStencil() { // We can mix UniquePtr<..> and RefPtr<..>. This asserts that a UniquePtr
--- 15b1597c2c592b2320f7697ad8801815ab798dd2/js/src/frontend/Stencil.cpp +++ 0f228f8c380c617e3dfb4b58a016837ef85d258c/js/src/frontend/Stencil.cpp @@ -2952,69 +2952,16 @@ bool CompilationStencil::prepareForInsta /* static */ bool CompilationStencil::prepareForInstantiate( FrontendContext* fc, const CompilationStencil& stencil, PreallocatedCompilationGCOutput& gcOutput) { return gcOutput.allocate(fc, stencil.scriptData.size(), stencil.scopeData.size()); } -bool CompilationStencil::serializeStencils(JSContext* cx, - CompilationInput& input, - JS::TranscodeBuffer& buf, - bool* succeededOut) const { - if (succeededOut) { - *succeededOut = false; - } - AutoReportFrontendContext fc(cx); - 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); - - return false; - } - - if (succeededOut) { - *succeededOut = true; - } - return true; -} - -bool CompilationStencil::deserializeStencils( - FrontendContext* fc, const JS::ReadOnlyCompileOptions& compileOptions, - const JS::TranscodeRange& range, bool* succeededOut) { - if (succeededOut) { - *succeededOut = false; - } - MOZ_ASSERT(parserAtomData.empty()); - XDRStencilDecoder decoder(fc, range); - JS::DecodeOptions options(compileOptions); - - XDRResult res = decoder.codeStencil(options, *this); - if (res.isErr()) { - if (JS::IsTranscodeFailureResult(res.unwrapErr())) { - return true; - } - MOZ_ASSERT(res.unwrapErr() == JS::TranscodeResult::Throw); - - return false; - } - - if (succeededOut) { - *succeededOut = true; - } - return true; -} - ExtensibleCompilationStencil::ExtensibleCompilationStencil(ScriptSource* source) : alloc(CompilationStencil::LifoAllocChunkSize, js::BackgroundMallocArena), source(source), parserAtoms(alloc) {} ExtensibleCompilationStencil::ExtensibleCompilationStencil( CompilationInput& input) : canLazilyParse(CanLazilyParse(input.options)),
Files
/js/src/frontend/CompilationStencil.h
/js/src/frontend/Stencil.cpp
Changesets
Diffs
/js/src/frontend/CompilationStencil.h
/js/src/frontend/Stencil.cpp