diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-05-24 08:28:08 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-05-24 08:28:08 +0000 |
commit | a4e969f4965059196ca948db781e52f7cfebf19e (patch) | |
tree | 6ca352808c8fdc52006a0f33f6ae3c593b23867d /Source/JavaScriptCore/interpreter/StackVisitor.h | |
parent | 41386e9cb918eed93b3f13648cbef387e371e451 (diff) | |
download | WebKitGtk-tarball-a4e969f4965059196ca948db781e52f7cfebf19e.tar.gz |
webkitgtk-2.12.3webkitgtk-2.12.3
Diffstat (limited to 'Source/JavaScriptCore/interpreter/StackVisitor.h')
-rw-r--r-- | Source/JavaScriptCore/interpreter/StackVisitor.h | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/Source/JavaScriptCore/interpreter/StackVisitor.h b/Source/JavaScriptCore/interpreter/StackVisitor.h index 990a226b3..bbf37fe9c 100644 --- a/Source/JavaScriptCore/interpreter/StackVisitor.h +++ b/Source/JavaScriptCore/interpreter/StackVisitor.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2013, 2015 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,7 @@ #ifndef StackVisitor_h #define StackVisitor_h +#include "VMEntryRecord.h" #include <wtf/text/WTFString.h> namespace JSC { @@ -33,12 +34,12 @@ namespace JSC { struct CodeOrigin; struct InlineCallFrame; -class Arguments; class CodeBlock; class ExecState; class JSFunction; class JSObject; class JSScope; +class ClonedArguments; class Register; typedef ExecState CallFrame; @@ -51,14 +52,15 @@ public: Global, Eval, Function, + Module, Native }; size_t index() const { return m_index; } size_t argumentCountIncludingThis() const { return m_argumentCountIncludingThis; } + bool callerIsVMEntryFrame() const { return m_callerIsVMEntryFrame; } CallFrame* callerFrame() const { return m_callerFrame; } JSObject* callee() const { return m_callee; } - JSScope* scope() const { return m_scope; } CodeBlock* codeBlock() const { return m_codeBlock; } unsigned bytecodeOffset() const { return m_bytecodeOffset; } #if ENABLE(DFG_JIT) @@ -77,13 +79,11 @@ public: CodeType codeType() const; JS_EXPORT_PRIVATE void computeLineAndColumn(unsigned& line, unsigned& column); - Arguments* createArguments(); - Arguments* existingArguments(); + ClonedArguments* createArguments(); + VMEntryFrame* vmEntryFrame() const { return m_VMEntryFrame; } CallFrame* callFrame() const { return m_callFrame; } -#ifndef NDEBUG JS_EXPORT_PRIVATE void print(int indentLevel); -#endif private: Frame() { } @@ -94,11 +94,13 @@ public: size_t m_index; size_t m_argumentCountIncludingThis; + VMEntryFrame* m_VMEntryFrame; + VMEntryFrame* m_CallerVMEntryFrame; CallFrame* m_callerFrame; JSObject* m_callee; - JSScope* m_scope; CodeBlock* m_codeBlock; unsigned m_bytecodeOffset; + bool m_callerIsVMEntryFrame; #if ENABLE(DFG_JIT) InlineCallFrame* m_inlineCallFrame; #endif @@ -129,6 +131,7 @@ public: Frame& operator*() { return m_frame; } ALWAYS_INLINE Frame* operator->() { return &m_frame; } + void unwindToMachineCodeBlockFrame(); private: JS_EXPORT_PRIVATE StackVisitor(CallFrame* startFrame); @@ -144,6 +147,32 @@ private: Frame m_frame; }; +class CallerFunctor { +public: + CallerFunctor() + : m_hasSkippedFirstFrame(false) + , m_callerFrame(0) + { + } + + CallFrame* callerFrame() const { return m_callerFrame; } + + StackVisitor::Status operator()(StackVisitor& visitor) + { + if (!m_hasSkippedFirstFrame) { + m_hasSkippedFirstFrame = true; + return StackVisitor::Continue; + } + + m_callerFrame = visitor->callFrame(); + return StackVisitor::Done; + } + +private: + bool m_hasSkippedFirstFrame; + CallFrame* m_callerFrame; +}; + } // namespace JSC #endif // StackVisitor_h |