DebuggerCallFrame.h [plain text]
#ifndef DebuggerCallFrame_h
#define DebuggerCallFrame_h
#include "CallFrame.h"
#include "DebuggerPrimitives.h"
#include "ShadowChicken.h"
#include "Strong.h"
#include <wtf/NakedPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/text/TextPosition.h>
namespace JSC {
class DebuggerScope;
class Exception;
class DebuggerCallFrame : public RefCounted<DebuggerCallFrame> {
public:
enum Type { ProgramType, FunctionType };
static Ref<DebuggerCallFrame> create(CallFrame*);
JS_EXPORT_PRIVATE RefPtr<DebuggerCallFrame> callerFrame();
ExecState* globalExec();
JS_EXPORT_PRIVATE SourceID sourceID() const;
int line() const { return m_position.m_line.zeroBasedInt(); }
int column() const { return m_position.m_column.zeroBasedInt(); }
JS_EXPORT_PRIVATE const TextPosition& position() const { return m_position; }
JS_EXPORT_PRIVATE JSGlobalObject* vmEntryGlobalObject() const;
JS_EXPORT_PRIVATE DebuggerScope* scope();
JS_EXPORT_PRIVATE String functionName() const;
JS_EXPORT_PRIVATE Type type() const;
JS_EXPORT_PRIVATE JSValue thisValue() const;
JSValue evaluateWithScopeExtension(const String&, JSObject* scopeExtensionObject, NakedPtr<Exception>&);
bool isValid() const { return !!m_validMachineFrame || isTailDeleted(); }
JS_EXPORT_PRIVATE void invalidate();
JS_EXPORT_PRIVATE TextPosition currentPosition();
JS_EXPORT_PRIVATE static TextPosition positionForCallFrame(CallFrame*);
JS_EXPORT_PRIVATE static SourceID sourceIDForCallFrame(CallFrame*);
bool isTailDeleted() const { return m_shadowChickenFrame.isTailDeleted; }
private:
DebuggerCallFrame(CallFrame*, const ShadowChicken::Frame&);
CallFrame* m_validMachineFrame;
RefPtr<DebuggerCallFrame> m_caller;
TextPosition m_position;
Strong<DebuggerScope> m_scope;
ShadowChicken::Frame m_shadowChickenFrame;
};
}
#endif // DebuggerCallFrame_h