summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/debugger/DebuggerCallFrame.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/debugger/DebuggerCallFrame.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/JavaScriptCore/debugger/DebuggerCallFrame.h')
-rw-r--r--Source/JavaScriptCore/debugger/DebuggerCallFrame.h46
1 files changed, 25 insertions, 21 deletions
diff --git a/Source/JavaScriptCore/debugger/DebuggerCallFrame.h b/Source/JavaScriptCore/debugger/DebuggerCallFrame.h
index 09c3fb9d8..462465854 100644
--- a/Source/JavaScriptCore/debugger/DebuggerCallFrame.h
+++ b/Source/JavaScriptCore/debugger/DebuggerCallFrame.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2013, 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -10,7 +10,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
@@ -26,30 +26,29 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef DebuggerCallFrame_h
-#define DebuggerCallFrame_h
+#pragma once
#include "CallFrame.h"
#include "DebuggerPrimitives.h"
-#include <wtf/PassRefPtr.h>
+#include "ShadowChicken.h"
+#include "Strong.h"
+#include <wtf/NakedPtr.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 PassRefPtr<DebuggerCallFrame> create(CallFrame* callFrame)
- {
- return adoptRef(new DebuggerCallFrame(callFrame));
- }
-
- JS_EXPORT_PRIVATE explicit DebuggerCallFrame(CallFrame*);
+ static Ref<DebuggerCallFrame> create(CallFrame*);
- JS_EXPORT_PRIVATE PassRefPtr<DebuggerCallFrame> callerFrame();
- ExecState* exec() const { return m_callFrame; }
+ JS_EXPORT_PRIVATE RefPtr<DebuggerCallFrame> callerFrame();
+ ExecState* globalExec();
JS_EXPORT_PRIVATE SourceID sourceID() const;
// line and column are in base 0 e.g. the first line is line 0.
@@ -58,29 +57,34 @@ public:
JS_EXPORT_PRIVATE const TextPosition& position() const { return m_position; }
JS_EXPORT_PRIVATE JSGlobalObject* vmEntryGlobalObject() const;
- JS_EXPORT_PRIVATE JSScope* scope() const;
+ JS_EXPORT_PRIVATE DebuggerScope* scope();
JS_EXPORT_PRIVATE String functionName() const;
JS_EXPORT_PRIVATE Type type() const;
JS_EXPORT_PRIVATE JSValue thisValue() const;
- JS_EXPORT_PRIVATE JSValue evaluate(const String&, JSValue& exception) const;
+ JSValue evaluateWithScopeExtension(const String&, JSObject* scopeExtensionObject, NakedPtr<Exception>&);
- bool isValid() const { return !!m_callFrame; }
+ bool isValid() const { return !!m_validMachineFrame || isTailDeleted(); }
JS_EXPORT_PRIVATE void invalidate();
// The following are only public for the Debugger's use only. They will be
// made private soon. Other clients should not use these.
- JS_EXPORT_PRIVATE static JSValue evaluateWithCallFrame(CallFrame*, const String& script, JSValue& exception);
+ JS_EXPORT_PRIVATE TextPosition currentPosition();
JS_EXPORT_PRIVATE static TextPosition positionForCallFrame(CallFrame*);
JS_EXPORT_PRIVATE static SourceID sourceIDForCallFrame(CallFrame*);
- static JSValue thisValueForCallFrame(CallFrame*);
+
+ bool isTailDeleted() const { return m_shadowChickenFrame.isTailDeleted; }
private:
- CallFrame* m_callFrame;
+ DebuggerCallFrame(CallFrame*, const ShadowChicken::Frame&);
+
+ CallFrame* m_validMachineFrame;
RefPtr<DebuggerCallFrame> m_caller;
TextPosition m_position;
+ // The DebuggerPausedScope is responsible for calling invalidate() which,
+ // in turn, will clear this strong ref.
+ Strong<DebuggerScope> m_scope;
+ ShadowChicken::Frame m_shadowChickenFrame;
};
} // namespace JSC
-
-#endif // DebuggerCallFrame_h