// A DebugFrame is a Frame with additional fields that are added after the // normal function prologue by the baseline compiler. If a Module is compiled // with debugging enabled, then all its code creates DebugFrames on the stack // instead of just Frames. These extra fields are used by the Debugger API.
class DebugFrame { // The register results field. Initialized only during the baseline // compiler's return sequence to allow the debugger to inspect and // modify the return values of a frame being debugged. union SpilledRegisterResult { private:
int32_t i32_;
int64_t i64_; float f32_; double f64_; #ifdef ENABLE_WASM_SIMD
V128 v128_; #endif
AnyRef anyref_;
#ifdef DEBUG // Should we add a new value representation, this will remind us to update // SpilledRegisterResult. staticinlinevoid assertAllValueTypesHandled(ValType type) { switch (type.kind()) { case ValType::I32: case ValType::I64: case ValType::F32: case ValType::F64: case ValType::V128: case ValType::Ref: return;
}
} #endif
};
SpilledRegisterResult registerResults_[MaxRegisterResults];
// The returnValue() method returns a HandleValue pointing to this field.
JS::Value cachedReturnJSValue_;
// If the function returns multiple results, this field is initialized // to a pointer to the stack results. void* stackResultsPointer_;
// The function index of this frame. Technically, this could be derived // given a PC into this frame (which could lookup the CodeRange which has // the function index), but this isn't always readily available.
uint32_t funcIndex_;
// Avoid -Wunused-private-field warnings. protected: #ifdefined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_X86) || defined(__wasi__) // See alignmentStaticAsserts(). For ARM32 and X86 DebugFrame is only // 4-byte aligned, so we add another word to get up to 8-byte // alignment.
uint32_t padding_; #endif #ifdefined(ENABLE_WASM_SIMD) && defined(JS_CODEGEN_ARM64)
uint64_t padding_; #endif
private: // The Frame goes at the end since the stack grows down.
Frame frame_;
// The return value must be written from the unboxed representation in the // results union into cachedReturnJSValue_ by updateReturnJSValue() before // returnValue() can return a Handle to it.
// Once the debugger observes a frame, it must be notified via // onLeaveFrame() before the frame is popped. Calling observe() ensures the // leave frame traps are enabled. Both methods are idempotent so the caller // doesn't have to worry about calling them more than once.
// The 'isDebugge' bit is initialized to false and set by the WebAssembly // runtime right before a frame is exposed to the debugger, as required by // the Debugger API. The bit is then used for Debugger-internal purposes // afterwards.
// These are opaque boolean flags used by the debugger to implement // AbstractFramePtr. They are initialized to false and not otherwise read or // written by wasm code or runtime.
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.