зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1693611 - Part 7: Move XDRCheckCompilationStencil to StencilXDR. r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D105918
This commit is contained in:
Родитель
da6009e4f3
Коммит
4e7ee70621
|
@ -656,30 +656,30 @@ template XDRResult XDRCompilationStencil(XDRState<XDR_ENCODE>* xdr,
|
|||
template XDRResult XDRCompilationStencil(XDRState<XDR_DECODE>* xdr,
|
||||
CompilationStencil& stencil);
|
||||
|
||||
template <XDRMode mode>
|
||||
XDRResult XDRCheckCompilationStencil(XDRState<mode>* xdr,
|
||||
CompilationStencil& stencil) {
|
||||
if (stencil.asmJS) {
|
||||
return xdr->fail(JS::TranscodeResult::Failure_AsmJSNotSupported);
|
||||
}
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
template XDRResult XDRCheckCompilationStencil(XDRState<XDR_ENCODE>* xdr,
|
||||
CompilationStencil& stencil);
|
||||
|
||||
template <XDRMode mode>
|
||||
XDRResult XDRCheckCompilationStencil(XDRState<mode>* xdr,
|
||||
ExtensibleCompilationStencil& stencil) {
|
||||
if (stencil.asmJS) {
|
||||
return xdr->fail(JS::TranscodeResult::Failure_AsmJSNotSupported);
|
||||
}
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
template XDRResult XDRCheckCompilationStencil(
|
||||
XDRState<XDR_ENCODE>* xdr, ExtensibleCompilationStencil& stencil);
|
||||
|
||||
} // namespace js
|
||||
|
||||
template <XDRMode mode>
|
||||
/* static */ XDRResult StencilXDR::checkCompilationStencil(
|
||||
XDRState<mode>* xdr, CompilationStencil& stencil) {
|
||||
if (stencil.asmJS) {
|
||||
return xdr->fail(JS::TranscodeResult::Failure_AsmJSNotSupported);
|
||||
}
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
template XDRResult StencilXDR::checkCompilationStencil(
|
||||
XDRState<XDR_ENCODE>* xdr, CompilationStencil& stencil);
|
||||
|
||||
template <XDRMode mode>
|
||||
/* static */ XDRResult StencilXDR::checkCompilationStencil(
|
||||
XDRState<mode>* xdr, ExtensibleCompilationStencil& stencil) {
|
||||
if (stencil.asmJS) {
|
||||
return xdr->fail(JS::TranscodeResult::Failure_AsmJSNotSupported);
|
||||
}
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
template XDRResult StencilXDR::checkCompilationStencil(
|
||||
XDRState<XDR_ENCODE>* xdr, ExtensibleCompilationStencil& stencil);
|
||||
|
|
|
@ -73,6 +73,14 @@ class StencilXDR {
|
|||
template <XDRMode mode>
|
||||
static XDRResult codeModuleMetadata(XDRState<mode>* xdr,
|
||||
StencilModuleMetadata& stencil);
|
||||
|
||||
template <XDRMode mode>
|
||||
static XDRResult checkCompilationStencil(XDRState<mode>* xdr,
|
||||
CompilationStencil& stencil);
|
||||
|
||||
template <XDRMode mode>
|
||||
static XDRResult checkCompilationStencil(
|
||||
XDRState<mode>* xdr, ExtensibleCompilationStencil& stencil);
|
||||
};
|
||||
|
||||
} /* namespace frontend */
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "builtin/ModuleObject.h"
|
||||
#include "debugger/DebugAPI.h"
|
||||
#include "frontend/CompilationStencil.h" // frontend::{CompilationStencil, ExtensibleCompilationStencil, CompilationStencilMerger, BorrowingCompilationStencil}
|
||||
#include "frontend/StencilXdr.h" // frontend::StencilXDR
|
||||
#include "js/BuildId.h" // JS::BuildIdCharVector
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/JSScript.h"
|
||||
|
@ -346,7 +347,7 @@ XDRResult XDRStencilEncoder::codeStencil(
|
|||
return fail(JS::TranscodeResult::Failure);
|
||||
}
|
||||
|
||||
MOZ_TRY(XDRCheckCompilationStencil(this, stencil));
|
||||
MOZ_TRY(frontend::StencilXDR::checkCompilationStencil(this, stencil));
|
||||
|
||||
MOZ_TRY(XDRStencilHeader(this, &input.options, stencil.source));
|
||||
MOZ_TRY(XDRCompilationStencil(this, stencil));
|
||||
|
@ -372,7 +373,7 @@ XDRResult XDRIncrementalStencilEncoder::setInitial(
|
|||
return fail(JS::TranscodeResult::Failure);
|
||||
}
|
||||
|
||||
MOZ_TRY(XDRCheckCompilationStencil(this, *initial));
|
||||
MOZ_TRY(frontend::StencilXDR::checkCompilationStencil(this, *initial));
|
||||
|
||||
merger_ = cx()->new_<frontend::CompilationStencilMerger>();
|
||||
if (!merger_) {
|
||||
|
|
|
@ -643,14 +643,6 @@ template <XDRMode mode>
|
|||
XDRResult XDRCompilationStencil(XDRState<mode>* xdr,
|
||||
frontend::CompilationStencil& stencil);
|
||||
|
||||
template <XDRMode mode>
|
||||
XDRResult XDRCheckCompilationStencil(XDRState<mode>* xdr,
|
||||
frontend::CompilationStencil& stencil);
|
||||
|
||||
template <XDRMode mode>
|
||||
XDRResult XDRCheckCompilationStencil(
|
||||
XDRState<mode>* xdr, frontend::ExtensibleCompilationStencil& stencil);
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
#endif /* vm_Xdr_h */
|
||||
|
|
Загрузка…
Ссылка в новой задаче