зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1693611 - Part 11: Remove XDRStencilDecoder::{hasOptions,options}. r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D105922
This commit is contained in:
Родитель
4bb3f669ea
Коммит
e6416b3f50
|
@ -1387,7 +1387,7 @@ bool CompilationStencil::deserializeStencils(JSContext* cx,
|
|||
*succeededOut = false;
|
||||
}
|
||||
MOZ_ASSERT(parserAtomData.empty());
|
||||
XDRStencilDecoder decoder(cx, &input.options, range);
|
||||
XDRStencilDecoder decoder(cx, range);
|
||||
|
||||
XDRResult res = decoder.codeStencil(input, *this);
|
||||
if (res.isErr()) {
|
||||
|
@ -3502,7 +3502,7 @@ JS::TranscodeResult JS::DecodeStencil(JSContext* cx,
|
|||
if (!stencil) {
|
||||
return TranscodeResult::Throw;
|
||||
}
|
||||
XDRStencilDecoder decoder(cx, &options, range);
|
||||
XDRStencilDecoder decoder(cx, range);
|
||||
XDRResult res = decoder.codeStencil(input.get(), *stencil);
|
||||
if (res.isErr()) {
|
||||
return res.unwrapErr();
|
||||
|
|
|
@ -5726,7 +5726,7 @@ static JS::TranscodeResult DecodeStencil(JSContext* cx,
|
|||
frontend::CompilationInput& input,
|
||||
frontend::CompilationStencil& stencil,
|
||||
size_t cursorIndex) {
|
||||
XDRStencilDecoder decoder(cx, &input.options, buffer, cursorIndex);
|
||||
XDRStencilDecoder decoder(cx, buffer, cursorIndex);
|
||||
|
||||
if (!input.initForGlobal(cx)) {
|
||||
return JS::TranscodeResult::Throw;
|
||||
|
|
|
@ -820,7 +820,7 @@ void ScriptDecodeTask::parse(JSContext* cx) {
|
|||
return;
|
||||
}
|
||||
|
||||
XDRStencilDecoder decoder(cx, &options, range);
|
||||
XDRStencilDecoder decoder(cx, range);
|
||||
XDRResult res = decoder.codeStencil(*stencilInput_, *stencil_);
|
||||
if (!res.isOk()) {
|
||||
stencil_.reset();
|
||||
|
|
|
@ -552,7 +552,7 @@ class XDROffThreadDecoder : public XDRDecoder {
|
|||
*/
|
||||
|
||||
/*
|
||||
* The stencil decoder accepts `options` and `range` as input.
|
||||
* The stencil decoder accepts `range` as input.
|
||||
*
|
||||
* The decoded stencils are outputted to the default-initialized
|
||||
* `stencil` parameter of `codeStencil` method.
|
||||
|
@ -562,29 +562,19 @@ class XDROffThreadDecoder : public XDRDecoder {
|
|||
*/
|
||||
class XDRStencilDecoder : public XDRDecoderBase {
|
||||
public:
|
||||
XDRStencilDecoder(JSContext* cx, const JS::ReadOnlyCompileOptions* options,
|
||||
JS::TranscodeBuffer& buffer, size_t cursor)
|
||||
: XDRDecoderBase(cx, buffer, cursor), options_(options) {
|
||||
XDRStencilDecoder(JSContext* cx, JS::TranscodeBuffer& buffer, size_t cursor)
|
||||
: XDRDecoderBase(cx, buffer, cursor) {
|
||||
MOZ_ASSERT(JS::IsTranscodingBytecodeAligned(buffer.begin()));
|
||||
MOZ_ASSERT(JS::IsTranscodingBytecodeOffsetAligned(cursor));
|
||||
MOZ_ASSERT(options_);
|
||||
}
|
||||
|
||||
XDRStencilDecoder(JSContext* cx, const JS::ReadOnlyCompileOptions* options,
|
||||
const JS::TranscodeRange& range)
|
||||
: XDRDecoderBase(cx, range), options_(options) {
|
||||
XDRStencilDecoder(JSContext* cx, const JS::TranscodeRange& range)
|
||||
: XDRDecoderBase(cx, range) {
|
||||
MOZ_ASSERT(JS::IsTranscodingBytecodeAligned(range.begin().get()));
|
||||
MOZ_ASSERT(options_);
|
||||
}
|
||||
|
||||
bool hasOptions() const override { return true; }
|
||||
const JS::ReadOnlyCompileOptions& options() override { return *options_; }
|
||||
|
||||
XDRResult codeStencil(frontend::CompilationInput& input,
|
||||
frontend::CompilationStencil& stencil);
|
||||
|
||||
private:
|
||||
const JS::ReadOnlyCompileOptions* options_;
|
||||
};
|
||||
|
||||
class XDRStencilEncoder : public XDREncoder {
|
||||
|
|
Загрузка…
Ссылка в новой задаче