Changeset 160982 in webkit
- Timestamp:
- Dec 22, 2013, 4:02:40 PM (11 years ago)
- Location:
- branches/jsCStack/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/jsCStack/Source/JavaScriptCore/ChangeLog ¶
r160981 r160982 1 2013-12-22 Mark Lam <mark.lam@apple.com> 2 3 CStack: Add #if ENABLE(LLINT_C_LOOP) to C loop LLINT only parts of JSStack. 4 https://bugs.webkit.org/show_bug.cgi?id=126140. 5 6 Not yet reviewed. 7 8 Also moved startOfFrameFor() to the ENABLE(DEBUG_JSSTACK) section because 9 it's only needed there. 10 11 * interpreter/JSStack.cpp: 12 (JSC::JSStack::JSStack): 13 (JSC::JSStack::gatherConservativeRoots): 14 (JSC::JSStack::sanitizeStack): 15 * interpreter/JSStack.h: 16 (JSC::JSStack::gatherConservativeRoots): 17 (JSC::JSStack::sanitizeStack): 18 (JSC::JSStack::initializeThreading): 19 * interpreter/JSStackInlines.h: 20 (JSC::JSStack::topOfFrameFor): 21 1 22 2013-12-22 Mark Lam <mark.lam@apple.com> 2 23 -
TabularUnified branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.cpp ¶
r160981 r160982 36 36 namespace JSC { 37 37 38 #if ENABLE(LLINT_C_LOOP) 38 39 static size_t committedBytesCount = 0; 39 40 … … 43 44 return staticMutex; 44 45 } 45 46 JSStack::JSStack(VM& vm, size_t capacity) 46 #endif // ENABLE(LLINT_C_LOOP) 47 48 JSStack::JSStack(VM& vm) 47 49 : m_vm(vm) 50 , m_topCallFrame(vm.topCallFrame) 51 #if ENABLE(LLINT_C_LOOP) 48 52 , m_end(0) 49 , m_topCallFrame(vm.topCallFrame) 50 { 53 #endif 54 { 55 #if ENABLE(LLINT_C_LOOP) 56 size_t capacity = defaultCapacity; 51 57 ASSERT(capacity && isPageAligned(capacity)); 52 58 … … 58 64 59 65 disableErrorStackReserve(); 66 #endif // ENABLE(LLINT_C_LOOP) 60 67 61 68 m_topCallFrame = 0; 62 69 } 63 70 71 #if ENABLE(LLINT_C_LOOP) 64 72 JSStack::~JSStack() 65 73 { … … 97 105 void JSStack::gatherConservativeRoots(ConservativeRoots& conservativeRoots) 98 106 { 99 #if ENABLE(LLINT_CLOOP)100 107 conservativeRoots.add(baseOfStack(), topOfStack()); 101 #else102 UNUSED_PARAM(conservativeRoots);103 #endif104 108 } 105 109 106 110 void JSStack::gatherConservativeRoots(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, CodeBlockSet& codeBlocks) 107 111 { 108 #if ENABLE(LLINT_CLOOP)109 112 conservativeRoots.add(baseOfStack(), topOfStack(), jitStubRoutines, codeBlocks); 110 #else111 UNUSED_PARAM(conservativeRoots);112 UNUSED_PARAM(jitStubRoutines);113 UNUSED_PARAM(codeBlocks);114 #endif115 113 } 116 114 117 115 void JSStack::sanitizeStack() 118 116 { 119 #if ENABLE(LLINT_CLOOP)120 117 ASSERT(topOfStack() <= baseOfStack()); 121 118 … … 127 124 128 125 m_lastStackTop = topOfStack(); 129 #endif130 126 } 131 127 … … 170 166 } 171 167 } 168 #endif // ENABLE(LLINT_C_LOOP) 172 169 173 170 #if !ENABLE(LLINT_C_LOOP) -
TabularUnified branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.h ¶
r160981 r160982 36 36 #include <wtf/VMTags.h> 37 37 38 #if ENABLE(LLINT_C_LOOP) 38 39 #define ENABLE_DEBUG_JSSTACK 0 39 40 #if !defined(NDEBUG) && !defined(ENABLE_DEBUG_JSSTACK) 40 41 #define ENABLE_DEBUG_JSSTACK 1 41 42 #endif 43 #endif // ENABLE(LLINT_C_LOOP) 42 44 43 45 namespace JSC { … … 79 81 static const ptrdiff_t maxExcessCapacity = 8 * 1024; 80 82 81 JSStack(VM&, size_t capacity = defaultCapacity); 82 ~JSStack(); 83 JSStack(VM&); 83 84 84 85 bool ensureCapacityFor(Register* newTopOfStack); … … 88 89 bool containsAddress(Register* address) { return (lowAddress() <= address && address < highAddress()); } 89 90 static size_t committedByteCount(); 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(); 90 99 91 100 void gatherConservativeRoots(ConservativeRoots&); … … 102 111 static void initializeThreading(); 103 112 104 Register* startOfFrameFor(CallFrame*);105 106 113 CallFrame* pushFrame(class CodeBlock*, JSScope*, int argsCount, JSObject* callee); 107 114 … … 116 123 void validateFence(CallFrame*, const char* = "", int = 0) { } 117 124 #endif // !ENABLE(DEBUG_JSSTACK) 125 #endif // ENABLE(LLINT_C_LOOP) 118 126 119 127 private: … … 138 146 #endif // ENABLE(LLINT_C_LOOP) 139 147 148 #if ENABLE(LLINT_C_LOOP) 140 149 Register* reservationEnd() const 141 150 { … … 147 156 static JSValue generateFenceValue(size_t argIndex); 148 157 void installTrapsAfterFrame(CallFrame*); 158 Register* startOfFrameFor(CallFrame*); 149 159 #else 150 160 void installTrapsAfterFrame(CallFrame*) { } … … 158 168 159 169 void setStackLimit(Register* newEnd); 170 #endif // ENABLE(LLINT_C_LOOP) 160 171 161 172 void enableErrorStackReserve(); … … 163 174 164 175 VM& m_vm; 176 CallFrame*& m_topCallFrame; 177 #if ENABLE(LLINT_C_LOOP) 165 178 Register* m_end; 166 179 Register* m_commitEnd; 167 180 Register* m_useableEnd; 168 181 PageReservation m_reservation; 169 CallFrame*& m_topCallFrame;170 182 Register* m_lastStackTop; 183 #endif // ENABLE(LLINT_C_LOOP) 171 184 172 185 friend class LLIntOffsetsExtractor; -
TabularUnified branches/jsCStack/Source/JavaScriptCore/interpreter/JSStackInlines.h ¶
r160967 r160982 66 66 inline Register* JSStack::topOfFrameFor(CallFrame* frame) 67 67 { 68 #if ENABLE(LLINT_C_LOOP) 68 69 if (UNLIKELY(!frame)) 69 70 return baseOfStack(); 71 #endif 70 72 return frame->topOfFrame() - 1; 71 73 } … … 76 78 } 77 79 80 #if ENABLE(LLINT_C_LOOP) 81 82 #if ENABLE(DEBUG_JSSTACK) 78 83 inline Register* JSStack::startOfFrameFor(CallFrame* frame) 79 84 { … … 81 86 return topOfFrameFor(callerFrame); 82 87 } 88 #endif // ENABLE(DEBUG_JSSTACK) 83 89 84 90 inline CallFrame* JSStack::pushFrame(class CodeBlock* codeBlock, JSScope* scope, int argsCount, JSObject* callee) … … 292 298 } 293 299 #endif // ENABLE(DEBUG_JSSTACK) 300 #endif // ENABLE(LLINT_C_LOOP) 294 301 295 302 } // namespace JSC
Note:
See TracChangeset
for help on using the changeset viewer.