namespace js { class JitFrameIter; namespace jit { class AutoMarkJitCodeWritableForThread; struct ResumeFromException;
} // namespace jit namespace wasm {
class WasmFrameIter; class CodeRange; class FuncType;
// A wasm::SymbolicAddress represents a pointer to a well-known function/global // that is embedded in wasm code. Since wasm code is serialized and later // deserialized into a different address space, symbolic addresses must be used // for *all* pointers into the address space. The MacroAssembler records a list // of all SymbolicAddresses and the offsets of their use in the code for later // patching during static linking.
// The FailureMode indicates whether, immediately after a call to a builtin // returns, the return value should be checked against an error condition // (and if so, which one) which signals that the C++ calle has already // reported an error and thus wasm needs to wasmTrap(Trap::ThrowReported).
// SymbolicAddressSignature carries type information for a function referred // to by a SymbolicAddress. In order that |argTypes| can be written out as a // static initialiser, it has to have fixed length. At present // SymbolicAddressType is used to describe functions with at most 14 arguments, // so |argTypes| has 15 entries in order to allow the last value to be // MIRType::None, in the hope of catching any accidental overruns of the // defined section of the array.
struct SymbolicAddressSignature { // The SymbolicAddress that is described. const SymbolicAddress identity; // The return type, or MIRType::None to denote 'void'. const jit::MIRType retType; // The failure mode, which is checked by masm.wasmCallBuiltinInstanceMethod. const FailureMode failureMode; // The trap to execute if the builtin fails. const Trap failureTrap; // The number of arguments, 0 .. SymbolicAddressSignatureMaxArgs only. const uint8_t numArgs; // The argument types; SymbolicAddressSignatureMaxArgs + 1 guard, which // should be MIRType::None. const jit::MIRType argTypes[SymbolicAddressSignatureMaxArgs + 1];
};
// The 32 in this assertion is derived as follows: SymbolicAddress is probably // size-4 aligned-4, but it's at the start of the struct, so there's no // alignment hole before it. All other components (MIRType and uint8_t) are // size-1 aligned-1, and there are 18 in total, so it is reasonable to assume // that they also don't create any alignment holes. Hence it is also // reasonable to assume that the actual size is 1 * 4 + 18 * 1 == 22. The // worst-plausible-case rounding will take that up to 32. Hence, the // assertion uses 32.
// These provide argument type information for a subset of the SymbolicAddress // targets, for which type info is needed to generate correct stackmaps.
// A SymbolicAddress that NeedsBuiltinThunk() will call through a thunk to the // C++ function. This will be true for all normal calls from normal wasm // function code. Only calls to C++ from other exits/thunks do not need a thunk. // See "The Wasm-builtin ABIs in WasmFrame.h".
bool NeedsBuiltinThunk(SymbolicAddress sym);
// Returns the ABI that needs to be used to call a builtin. inline jit::ABIKind ABIForBuiltin(SymbolicAddress sym) { // Builtin thunks use the WebAssembly ABI. See GenerateBuiltinThunk for more // information. if (NeedsBuiltinThunk(sym)) { return jit::ABIKind::Wasm;
}
// Otherwise non-thunked builtins use the System ABI directly. return jit::ABIKind::System;
}
// This function queries whether pc is in one of the process's builtin thunks // and, if so, returns the CodeRange and pointer to the code segment that the // CodeRange is relative to.
// EnsureBuiltinThunksInitialized() must be called, and must succeed, before // SymbolicAddressTarget() or MaybeGetBuiltinThunk(). This function creates all // thunks for the process. ReleaseBuiltinThunks() should be called before // ReleaseProcessExecutableMemory() so that the latter can assert that all // executable code has been released.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.