Changeset 160981 in webkit
- Timestamp:
- Dec 22, 2013, 2:26:23 PM (11 years ago)
- Location:
- branches/jsCStack/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/jsCStack/Source/JavaScriptCore/ChangeLog
r160980 r160981 1 2013-12-22 Mark Lam <mark.lam@apple.com> 2 3 CStack: Fixed some JSStack on C Stack boundary computations. 4 https://bugs.webkit.org/show_bug.cgi?id=126139. 5 6 Not yet reviewed. 7 8 1. Implement committedByteCount() for JSStack on the C stack using the 9 current stack usage as an estimate of committed stack memory. 10 2. Implement lowAddress() and highAddress() for JSStack on the C stack 11 for containsAddress(). lowAddress() will be the top of the JS stack. 12 highAddress() will be 1 past the end of the JS stack. 13 3. Moved some functions around in preparation for an upcoming patch to 14 #if out code which is only used when ENABLE(LLINT_C_LOOP) 15 16 * interpreter/JSStack.cpp: 17 (JSC::JSStack::lowAddress): 18 (JSC::JSStack::highAddress): 19 (JSC::JSStack::committedByteCount): 20 * interpreter/JSStack.h: 21 (JSC::JSStack::containsAddress): 22 (JSC::JSStack::lowAddress): 23 1 24 2013-12-22 Filip Pizlo <fpizlo@apple.com> 2 25 -
branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.cpp
r160967 r160981 143 143 } 144 144 145 size_t JSStack::committedByteCount()146 {147 MutexLocker locker(stackStatisticsMutex());148 return committedBytesCount;149 }150 151 145 void JSStack::addToCommittedByteCount(long byteCount) 152 146 { … … 177 171 } 178 172 173 #if !ENABLE(LLINT_C_LOOP) 174 Register* JSStack::lowAddress() const 175 { 176 ASSERT(wtfThreadData().stack().isGrowingDownward()); 177 return reinterpret_cast<Register*>(m_vm.jsStackLimit()); 178 } 179 180 Register* JSStack::highAddress() const 181 { 182 ASSERT(wtfThreadData().stack().isGrowingDownward()); 183 return reinterpret_cast<Register*>(wtfThreadData().stack().origin()); 184 } 185 #endif // !ENABLE(LLINT_C_LOOP) 186 187 size_t JSStack::committedByteCount() 188 { 189 #if ENABLE(LLINT_C_LOOP) 190 MutexLocker locker(stackStatisticsMutex()); 191 return committedBytesCount; 192 #else 193 // When using the C stack, we don't know how many stack pages are actually 194 // committed. So, we use the current stack usage as an estimate. 195 ASSERT(wtfThreadData().stack().isGrowingDownward()); 196 int8_t* current = reinterpret_cast<int8_t*>(¤t); 197 int8_t* high = reinterpret_cast<int8_t*>(wtfThreadData().stack().origin()); 198 return high - current; 199 #endif 200 } 201 179 202 void JSStack::updateStackLimit() 180 203 { -
branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.h
r160967 r160981 86 86 void updateStackLimit(); 87 87 88 bool containsAddress(Register* address) { return (lowAddress() <= address && address < highAddress()); } 89 static size_t committedByteCount(); 90 88 91 void gatherConservativeRoots(ConservativeRoots&); 89 92 void gatherConservativeRoots(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&); … … 97 100 size_t size() const { return highAddress() - lowAddress(); } 98 101 99 static size_t committedByteCount();100 102 static void initializeThreading(); 101 103 … … 105 107 106 108 void popFrame(CallFrame*); 107 108 bool containsAddress(Register* address) { return (lowAddress() <= address && address <= highAddress()); }109 109 110 110 #if ENABLE(DEBUG_JSSTACK) … … 123 123 inline Register* topOfStackForCapacityCheck(); 124 124 125 #if ENABLE(LLINT_C_LOOP) 125 126 Register* lowAddress() const 126 127 { 127 return m_end ;128 return m_end + 1; 128 129 } 129 130 … … 132 133 return reinterpret_cast_ptr<Register*>(static_cast<char*>(m_reservation.base()) + m_reservation.size()); 133 134 } 135 #else 136 Register* lowAddress() const; 137 Register* highAddress() const; 138 #endif // ENABLE(LLINT_C_LOOP) 134 139 135 140 Register* reservationEnd() const
Note:
See TracChangeset
for help on using the changeset viewer.