bool SavedFrame::parentMoved() { const Value &v = getReservedSlot(JSSLOT_PRIVATE_PARENT); JSObject *p = static_cast<JSObject *>(v.toPrivate()); return p == getParent(); }
JSAtom * SavedFrame::getSource() { const Value &v = getReservedSlot(JSSLOT_SOURCE); JSString *s = v.toString(); return &s->asAtom(); }
JSPrincipals * SavedFrame::getPrincipals() { const Value &v = getReservedSlot(JSSLOT_PRINCIPALS); if (v.isUndefined()) return nullptr; return static_cast<JSPrincipals *>(v.toPrivate()); }
JSAtom * SavedFrame::getFunctionDisplayName() { const Value &v = getReservedSlot(JSSLOT_FUNCTIONDISPLAYNAME); if (v.isNull()) return nullptr; JSString *s = v.toString(); return &s->asAtom(); }
GlobalObject::DebuggerVector * GlobalObject::getDebuggers() { Value debuggers = getReservedSlot(DEBUGGERS); if (debuggers.isUndefined()) return NULL; JS_ASSERT(debuggers.toObject().getClass() == &GlobalDebuggees_class); return (DebuggerVector *) debuggers.toObject().getPrivate(); }
void SavedFrame::initFromLookup(Lookup &lookup) { JS_ASSERT(lookup.source); JS_ASSERT(getReservedSlot(JSSLOT_SOURCE).isUndefined()); setReservedSlot(JSSLOT_SOURCE, StringValue(lookup.source)); setReservedSlot(JSSLOT_LINE, NumberValue(lookup.line)); setReservedSlot(JSSLOT_COLUMN, NumberValue(lookup.column)); setReservedSlot(JSSLOT_FUNCTIONDISPLAYNAME, lookup.functionDisplayName ? StringValue(lookup.functionDisplayName) : NullValue()); setReservedSlot(JSSLOT_PARENT, ObjectOrNullValue(lookup.parent)); setReservedSlot(JSSLOT_PRIVATE_PARENT, PrivateValue(lookup.parent)); JS_ASSERT(getReservedSlot(JSSLOT_PRINCIPALS).isUndefined()); if (lookup.principals) JS_HoldPrincipals(lookup.principals); setReservedSlot(JSSLOT_PRINCIPALS, PrivateValue(lookup.principals)); }
SavedFrame * SavedFrame::getParent() { const Value &v = getReservedSlot(JSSLOT_PARENT); return v.isObject() ? &v.toObject().as<SavedFrame>() : nullptr; }
size_t SavedFrame::getColumn() { const Value &v = getReservedSlot(JSSLOT_COLUMN); return v.toInt32(); }
size_t SavedFrame::getLine() { const Value &v = getReservedSlot(JSSLOT_LINE); return v.toInt32(); }
Debugger * DebuggerMemory::getDebugger() { return Debugger::fromJSObject(&getReservedSlot(JSSLOT_DEBUGGER).toObject()); }