Loading js/src/wasm/WasmModule.cpp +15 −6 Original line number Diff line number Diff line Loading @@ -26,8 +26,10 @@ #include "js/BuildId.h" // JS::BuildIdCharVector #include "threading/LockGuard.h" #include "util/NSPR.h" #include "wasm/WasmBaselineCompile.h" #include "wasm/WasmCompile.h" #include "wasm/WasmInstance.h" #include "wasm/WasmIonCompile.h" #include "wasm/WasmJS.h" #include "wasm/WasmSerialize.h" Loading Loading @@ -386,6 +388,12 @@ static UniqueMapping MapFile(PRFileDesc* file, PRFileInfo* info) { RefPtr<JS::WasmModule> wasm::DeserializeModule(PRFileDesc* bytecodeFile, UniqueChars filename, unsigned line) { // We have to compile new code here so if we're fundamentally unable to // compile, we have to fail. if (!BaselineCanCompile() && !IonCanCompile()) { return nullptr; } PRFileInfo bytecodeInfo; UniqueMapping bytecodeMapping = MapFile(bytecodeFile, &bytecodeInfo); if (!bytecodeMapping) { Loading @@ -409,17 +417,18 @@ RefPtr<JS::WasmModule> wasm::DeserializeModule(PRFileDesc* bytecodeFile, return nullptr; } // The true answer to whether shared memory is enabled is provided by // cx->realm()->creationOptions().getSharedMemoryAndAtomicsEnabled() // where cx is the context that originated the call that caused this // deserialization attempt to happen. We don't have that context here, so // we assume that shared memory is enabled; we will catch a wrong assumption // later, during instantiation. // The true answer to whether various flags are enabled is provided by // the JSContext that originated the call that caused this deserialization // attempt to happen. We don't have that context here, so we assume that // shared memory is enabled; we will catch a wrong assumption later, during // instantiation. // // (We would prefer to store this value with the Assumptions when // serializing, and for the caller of the deserialization machinery to // provide the value from the originating context.) args->ionEnabled = true; args->baselineEnabled = true; args->sharedMemoryEnabled = true; UniqueChars error; Loading Loading
js/src/wasm/WasmModule.cpp +15 −6 Original line number Diff line number Diff line Loading @@ -26,8 +26,10 @@ #include "js/BuildId.h" // JS::BuildIdCharVector #include "threading/LockGuard.h" #include "util/NSPR.h" #include "wasm/WasmBaselineCompile.h" #include "wasm/WasmCompile.h" #include "wasm/WasmInstance.h" #include "wasm/WasmIonCompile.h" #include "wasm/WasmJS.h" #include "wasm/WasmSerialize.h" Loading Loading @@ -386,6 +388,12 @@ static UniqueMapping MapFile(PRFileDesc* file, PRFileInfo* info) { RefPtr<JS::WasmModule> wasm::DeserializeModule(PRFileDesc* bytecodeFile, UniqueChars filename, unsigned line) { // We have to compile new code here so if we're fundamentally unable to // compile, we have to fail. if (!BaselineCanCompile() && !IonCanCompile()) { return nullptr; } PRFileInfo bytecodeInfo; UniqueMapping bytecodeMapping = MapFile(bytecodeFile, &bytecodeInfo); if (!bytecodeMapping) { Loading @@ -409,17 +417,18 @@ RefPtr<JS::WasmModule> wasm::DeserializeModule(PRFileDesc* bytecodeFile, return nullptr; } // The true answer to whether shared memory is enabled is provided by // cx->realm()->creationOptions().getSharedMemoryAndAtomicsEnabled() // where cx is the context that originated the call that caused this // deserialization attempt to happen. We don't have that context here, so // we assume that shared memory is enabled; we will catch a wrong assumption // later, during instantiation. // The true answer to whether various flags are enabled is provided by // the JSContext that originated the call that caused this deserialization // attempt to happen. We don't have that context here, so we assume that // shared memory is enabled; we will catch a wrong assumption later, during // instantiation. // // (We would prefer to store this value with the Assumptions when // serializing, and for the caller of the deserialization machinery to // provide the value from the originating context.) args->ionEnabled = true; args->baselineEnabled = true; args->sharedMemoryEnabled = true; UniqueChars error; Loading