зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1721686 - wasm: Allow requiring shared memory for an intrinsics module. r=yury
Differential Revision: https://phabricator.services.mozilla.com/D120661
This commit is contained in:
Родитель
263f9ad9e6
Коммит
99aa145400
|
@ -1957,7 +1957,7 @@ static bool WasmIntrinsicI8VecMul(JSContext* cx, unsigned argc, Value* vp) {
|
|||
|
||||
wasm::IntrinsicOp ops[] = {wasm::IntrinsicOp::I8VecMul};
|
||||
RootedWasmModuleObject module(cx);
|
||||
if (!wasm::CompileIntrinsicModule(cx, ops, &module)) {
|
||||
if (!wasm::CompileIntrinsicModule(cx, ops, wasm::Shareable::False, &module)) {
|
||||
ReportOutOfMemory(cx);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ bool wasm::CompileIntrinsicModule(JSContext* cx,
|
|||
DefinitionKind::Memory))) {
|
||||
return false;
|
||||
}
|
||||
moduleEnv.memory = Some(MemoryDesc(Limits(0)));
|
||||
moduleEnv.memory = Some(MemoryDesc(Limits(0, Nothing(), sharedMemory)));
|
||||
|
||||
// Add (type (func (params ...))) for each intrinsic. The function types will
|
||||
// be deduplicated by the runtime
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "mozilla/Span.h"
|
||||
|
||||
#include "wasm/WasmBuiltins.h"
|
||||
#include "wasm/WasmCompileArgs.h"
|
||||
#include "wasm/WasmConstants.h"
|
||||
#include "wasm/WasmTypeDecls.h"
|
||||
#include "wasm/WasmTypeDef.h"
|
||||
|
@ -50,6 +51,7 @@ struct Intrinsic {
|
|||
|
||||
// Compile and return the intrinsic module for a given set of intrinsic ops.
|
||||
bool CompileIntrinsicModule(JSContext* cx, const mozilla::Span<IntrinsicOp> ops,
|
||||
Shareable sharedMemory,
|
||||
MutableHandleWasmModuleObject result);
|
||||
|
||||
} // namespace wasm
|
||||
|
|
Загрузка…
Ссылка в новой задаче