Ignore:
Timestamp:
Mar 30, 2017, 12:29:02 AM (8 years ago)
Author:
[email protected]
Message:

WebAssembly: pass Wasm::Context* to vmEntryToWasm when not using fast TLS
https://bugs.webkit.org/show_bug.cgi?id=170182

Reviewed by Mark Lam.

This is one more step in the direction of PIC-ified Wasm.
I'm removing assumptions that a wasm callee is a cell. We used to use
the callee to get the WasmContext off the callee's VM. Instead,
this patch makes it so that we pass in the context as a parameter
to the JS entrypoint.

  • heap/MarkedBlock.h:

(JSC::MarkedBlock::offsetOfVM): Deleted.

  • jit/AssemblyHelpers.cpp:

(JSC::AssemblyHelpers::loadWasmContext):
(JSC::AssemblyHelpers::storeWasmContext):
(JSC::AssemblyHelpers::loadWasmContextNeedsMacroScratchRegister):
(JSC::AssemblyHelpers::storeWasmContextNeedsMacroScratchRegister):

  • jsc.cpp:

(functionTestWasmModuleFunctions):

  • runtime/VM.h:

(JSC::VM::wasmContextOffset): Deleted.

  • wasm/WasmB3IRGenerator.cpp:

(JSC::Wasm::B3IRGenerator::materializeWasmContext):
(JSC::Wasm::B3IRGenerator::restoreWasmContext):
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::createJSToWasmWrapper):

  • wasm/WasmContext.cpp:

(JSC::Wasm::loadContext):
(JSC::Wasm::storeContext):
(JSC::loadWasmContext): Deleted.
(JSC::storeWasmContext): Deleted.

  • wasm/WasmContext.h:

(JSC::Wasm::useFastTLS):
(JSC::Wasm::useFastTLSForContext):

  • wasm/WasmMemoryInformation.cpp:

(JSC::Wasm::PinnedRegisterInfo::get):

  • wasm/WasmMemoryInformation.h:

(JSC::Wasm::useFastTLS): Deleted.
(JSC::Wasm::useFastTLSForWasmContext): Deleted.

  • wasm/js/WebAssemblyFunction.cpp:

(JSC::callWebAssemblyFunction):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/VM.h

    r214571 r214602  
    484484    }
    485485
    486     static ptrdiff_t wasmContextOffset()
    487     {
    488         return OBJECT_OFFSETOF(VM, wasmContext);
    489     }
    490 
    491486    void restorePreviousException(Exception* exception) { setException(exception); }
    492487
Note: See TracChangeset for help on using the changeset viewer.