|
Lines 35-44
Source/JavaScriptCore/interpreter/JSStack.h_sec1
|
| 35 |
#include <wtf/PageReservation.h> |
35 |
#include <wtf/PageReservation.h> |
| 36 |
#include <wtf/VMTags.h> |
36 |
#include <wtf/VMTags.h> |
| 37 |
|
37 |
|
|
|
38 |
#if ENABLE(LLINT_C_LOOP) |
| 38 |
#define ENABLE_DEBUG_JSSTACK 0 |
39 |
#define ENABLE_DEBUG_JSSTACK 0 |
| 39 |
#if !defined(NDEBUG) && !defined(ENABLE_DEBUG_JSSTACK) |
40 |
#if !defined(NDEBUG) && !defined(ENABLE_DEBUG_JSSTACK) |
| 40 |
#define ENABLE_DEBUG_JSSTACK 1 |
41 |
#define ENABLE_DEBUG_JSSTACK 1 |
| 41 |
#endif |
42 |
#endif |
|
|
43 |
#endif // ENABLE(LLINT_C_LOOP) |
| 42 |
|
44 |
|
| 43 |
namespace JSC { |
45 |
namespace JSC { |
| 44 |
|
46 |
|
|
Lines 78-85
namespace JSC {
Source/JavaScriptCore/interpreter/JSStack.h_sec2
|
| 78 |
// Allow 8k of excess registers before we start trying to reap the stack |
80 |
// Allow 8k of excess registers before we start trying to reap the stack |
| 79 |
static const ptrdiff_t maxExcessCapacity = 8 * 1024; |
81 |
static const ptrdiff_t maxExcessCapacity = 8 * 1024; |
| 80 |
|
82 |
|
| 81 |
JSStack(VM&, size_t capacity = defaultCapacity); |
83 |
JSStack(VM&); |
| 82 |
~JSStack(); |
|
|
| 83 |
|
84 |
|
| 84 |
bool ensureCapacityFor(Register* newTopOfStack); |
85 |
bool ensureCapacityFor(Register* newTopOfStack); |
| 85 |
|
86 |
|
|
Lines 88-93
namespace JSC {
Source/JavaScriptCore/interpreter/JSStack.h_sec3
|
| 88 |
bool containsAddress(Register* address) { return (lowAddress() <= address && address < highAddress()); } |
89 |
bool containsAddress(Register* address) { return (lowAddress() <= address && address < highAddress()); } |
| 89 |
static size_t committedByteCount(); |
90 |
static size_t committedByteCount(); |
| 90 |
|
91 |
|
|
|
92 |
#if !ENABLE(LLINT_C_LOOP) |
| 93 |
void gatherConservativeRoots(ConservativeRoots&) { } |
| 94 |
void gatherConservativeRoots(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&) { } |
| 95 |
void sanitizeStack() { } |
| 96 |
static void initializeThreading() { } |
| 97 |
#else |
| 98 |
~JSStack(); |
| 99 |
|
| 91 |
void gatherConservativeRoots(ConservativeRoots&); |
100 |
void gatherConservativeRoots(ConservativeRoots&); |
| 92 |
void gatherConservativeRoots(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&); |
101 |
void gatherConservativeRoots(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&); |
| 93 |
void sanitizeStack(); |
102 |
void sanitizeStack(); |
|
Lines 101-108
namespace JSC {
Source/JavaScriptCore/interpreter/JSStack.h_sec4
|
| 101 |
|
110 |
|
| 102 |
static void initializeThreading(); |
111 |
static void initializeThreading(); |
| 103 |
|
112 |
|
| 104 |
Register* startOfFrameFor(CallFrame*); |
|
|
| 105 |
|
| 106 |
CallFrame* pushFrame(class CodeBlock*, JSScope*, int argsCount, JSObject* callee); |
113 |
CallFrame* pushFrame(class CodeBlock*, JSScope*, int argsCount, JSObject* callee); |
| 107 |
|
114 |
|
| 108 |
void popFrame(CallFrame*); |
115 |
void popFrame(CallFrame*); |
|
Lines 115-120
namespace JSC {
Source/JavaScriptCore/interpreter/JSStack.h_sec5
|
| 115 |
void installFence(CallFrame*, const char* = "", int = 0) { } |
122 |
void installFence(CallFrame*, const char* = "", int = 0) { } |
| 116 |
void validateFence(CallFrame*, const char* = "", int = 0) { } |
123 |
void validateFence(CallFrame*, const char* = "", int = 0) { } |
| 117 |
#endif // !ENABLE(DEBUG_JSSTACK) |
124 |
#endif // !ENABLE(DEBUG_JSSTACK) |
|
|
125 |
#endif // ENABLE(LLINT_C_LOOP) |
| 118 |
|
126 |
|
| 119 |
private: |
127 |
private: |
| 120 |
|
128 |
|
|
Lines 137-142
namespace JSC {
Source/JavaScriptCore/interpreter/JSStack.h_sec6
|
| 137 |
Register* highAddress() const; |
145 |
Register* highAddress() const; |
| 138 |
#endif // ENABLE(LLINT_C_LOOP) |
146 |
#endif // ENABLE(LLINT_C_LOOP) |
| 139 |
|
147 |
|
|
|
148 |
#if ENABLE(LLINT_C_LOOP) |
| 140 |
Register* reservationEnd() const |
149 |
Register* reservationEnd() const |
| 141 |
{ |
150 |
{ |
| 142 |
char* reservationEnd = static_cast<char*>(m_reservation.base()); |
151 |
char* reservationEnd = static_cast<char*>(m_reservation.base()); |
|
Lines 146-151
namespace JSC {
Source/JavaScriptCore/interpreter/JSStack.h_sec7
|
| 146 |
#if ENABLE(DEBUG_JSSTACK) |
155 |
#if ENABLE(DEBUG_JSSTACK) |
| 147 |
static JSValue generateFenceValue(size_t argIndex); |
156 |
static JSValue generateFenceValue(size_t argIndex); |
| 148 |
void installTrapsAfterFrame(CallFrame*); |
157 |
void installTrapsAfterFrame(CallFrame*); |
|
|
158 |
Register* startOfFrameFor(CallFrame*); |
| 149 |
#else |
159 |
#else |
| 150 |
void installTrapsAfterFrame(CallFrame*) { } |
160 |
void installTrapsAfterFrame(CallFrame*) { } |
| 151 |
#endif |
161 |
#endif |
|
Lines 157-173
namespace JSC {
Source/JavaScriptCore/interpreter/JSStack.h_sec8
|
| 157 |
void addToCommittedByteCount(long); |
167 |
void addToCommittedByteCount(long); |
| 158 |
|
168 |
|
| 159 |
void setStackLimit(Register* newEnd); |
169 |
void setStackLimit(Register* newEnd); |
|
|
170 |
#endif // ENABLE(LLINT_C_LOOP) |
| 160 |
|
171 |
|
| 161 |
void enableErrorStackReserve(); |
172 |
void enableErrorStackReserve(); |
| 162 |
void disableErrorStackReserve(); |
173 |
void disableErrorStackReserve(); |
| 163 |
|
174 |
|
| 164 |
VM& m_vm; |
175 |
VM& m_vm; |
|
|
176 |
CallFrame*& m_topCallFrame; |
| 177 |
#if ENABLE(LLINT_C_LOOP) |
| 165 |
Register* m_end; |
178 |
Register* m_end; |
| 166 |
Register* m_commitEnd; |
179 |
Register* m_commitEnd; |
| 167 |
Register* m_useableEnd; |
180 |
Register* m_useableEnd; |
| 168 |
PageReservation m_reservation; |
181 |
PageReservation m_reservation; |
| 169 |
CallFrame*& m_topCallFrame; |
|
|
| 170 |
Register* m_lastStackTop; |
182 |
Register* m_lastStackTop; |
|
|
183 |
#endif // ENABLE(LLINT_C_LOOP) |
| 171 |
|
184 |
|
| 172 |
friend class LLIntOffsetsExtractor; |
185 |
friend class LLIntOffsetsExtractor; |
| 173 |
}; |
186 |
}; |