зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1428453 - Baldr: remove WasmFrameIter::debugTrapCallsite() (r=yury)
MozReview-Commit-ID: AHjWPINanvF
This commit is contained in:
Родитель
d99d8b74c3
Коммит
c4c25d2fb0
|
@ -96,17 +96,24 @@ static bool
|
|||
WasmHandleDebugTrap()
|
||||
{
|
||||
JitActivation* activation = CallingActivation();
|
||||
MOZ_ASSERT(activation);
|
||||
JSContext* cx = activation->cx();
|
||||
Frame* fp = activation->wasmExitFP();
|
||||
Instance* instance = fp->tls->instance;
|
||||
const Code& code = instance->code();
|
||||
MOZ_ASSERT(code.metadata().debugEnabled);
|
||||
|
||||
WasmFrameIter frame(activation);
|
||||
MOZ_ASSERT(frame.debugEnabled());
|
||||
const CallSite* site = frame.debugTrapCallsite();
|
||||
// The debug trap stub is the innermost frame. It's return address is the
|
||||
// actual trap site.
|
||||
const CallSite* site = code.lookupCallSite(fp->returnAddress);
|
||||
MOZ_ASSERT(site);
|
||||
|
||||
// Advance to the actual trapping frame.
|
||||
fp = fp->callerFP;
|
||||
DebugFrame* debugFrame = DebugFrame::from(fp);
|
||||
|
||||
if (site->kind() == CallSite::EnterFrame) {
|
||||
if (!frame.instance()->enterFrameTrapsEnabled())
|
||||
if (!instance->enterFrameTrapsEnabled())
|
||||
return true;
|
||||
DebugFrame* debugFrame = frame.debugFrame();
|
||||
debugFrame->setIsDebuggee();
|
||||
debugFrame->observe(cx);
|
||||
// TODO call onEnterFrame
|
||||
|
@ -121,15 +128,13 @@ WasmHandleDebugTrap()
|
|||
return status == JSTRAP_CONTINUE;
|
||||
}
|
||||
if (site->kind() == CallSite::LeaveFrame) {
|
||||
DebugFrame* debugFrame = frame.debugFrame();
|
||||
debugFrame->updateReturnJSValue();
|
||||
bool ok = Debugger::onLeaveFrame(cx, debugFrame, nullptr, true);
|
||||
debugFrame->leave(cx);
|
||||
return ok;
|
||||
}
|
||||
|
||||
DebugFrame* debugFrame = frame.debugFrame();
|
||||
DebugState& debug = frame.instance()->debug();
|
||||
DebugState& debug = instance->debug();
|
||||
MOZ_ASSERT(debug.hasBreakpointTrapAtOffset(site->lineOrBytecode()));
|
||||
if (debug.stepModeEnabled(debugFrame->funcIndex())) {
|
||||
RootedValue result(cx, UndefinedValue());
|
||||
|
|
|
@ -216,20 +216,7 @@ DebugFrame*
|
|||
WasmFrameIter::debugFrame() const
|
||||
{
|
||||
MOZ_ASSERT(!done());
|
||||
MOZ_ASSERT(debugEnabled());
|
||||
return reinterpret_cast<DebugFrame*>((uint8_t*)fp_ - DebugFrame::offsetOfFrame());
|
||||
}
|
||||
|
||||
const CallSite*
|
||||
WasmFrameIter::debugTrapCallsite() const
|
||||
{
|
||||
MOZ_ASSERT(!done());
|
||||
MOZ_ASSERT(callsite_);
|
||||
MOZ_ASSERT(debugEnabled());
|
||||
MOZ_ASSERT(callsite_->kind() == CallSite::EnterFrame ||
|
||||
callsite_->kind() == CallSite::LeaveFrame ||
|
||||
callsite_->kind() == CallSite::Breakpoint);
|
||||
return callsite_;
|
||||
return DebugFrame::from(fp_);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -91,7 +91,6 @@ class WasmFrameIter
|
|||
void** unwoundAddressOfReturnAddress() const;
|
||||
bool debugEnabled() const;
|
||||
DebugFrame* debugFrame() const;
|
||||
const CallSite* debugTrapCallsite() const;
|
||||
};
|
||||
|
||||
enum class SymbolicAddress;
|
||||
|
|
|
@ -562,6 +562,15 @@ wasm::ComputeMappedSize(uint32_t maxSize)
|
|||
|
||||
#endif // WASM_HUGE_MEMORY
|
||||
|
||||
/* static */ DebugFrame*
|
||||
DebugFrame::from(Frame* fp)
|
||||
{
|
||||
MOZ_ASSERT(fp->tls->instance->code().metadata().debugEnabled);
|
||||
auto* df = reinterpret_cast<DebugFrame*>((uint8_t*)fp - DebugFrame::offsetOfFrame());
|
||||
MOZ_ASSERT(fp->instance() == df->instance());
|
||||
return df;
|
||||
}
|
||||
|
||||
void
|
||||
DebugFrame::alignmentStaticAsserts()
|
||||
{
|
||||
|
|
|
@ -1879,6 +1879,7 @@ class DebugFrame
|
|||
Frame frame_;
|
||||
|
||||
public:
|
||||
static DebugFrame* from(Frame* fp);
|
||||
Frame& frame() { return frame_; }
|
||||
uint32_t funcIndex() const { return funcIndex_; }
|
||||
Instance* instance() const { return frame_.instance(); }
|
||||
|
|
Загрузка…
Ссылка в новой задаче