Changeset 42842 in webkit for trunk/JavaScriptCore/interpreter/RegisterFile.h
- Timestamp:
- Apr 24, 2009, 2:53:46 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/interpreter/RegisterFile.h
r42705 r42842 115 115 static const size_t defaultMaxGlobals = 8192; 116 116 static const size_t commitSize = 1 << 14; 117 // Allow 8k of excess registers before we start trying to reap the registerfile 118 static const ptrdiff_t maxExcessCapacity = 8 * 1024; 117 119 118 120 RegisterFile(size_t capacity = defaultCapacity, size_t maxGlobals = defaultMaxGlobals); … … 139 141 140 142 private: 143 void releaseExcessCapacity(); 141 144 size_t m_numGlobals; 142 145 const size_t m_maxGlobals; … … 145 148 Register* m_max; 146 149 Register* m_buffer; 150 Register* m_maxUsed; 151 147 152 #if HAVE(VIRTUALALLOC) 148 153 Register* m_commitEnd; … … 186 191 m_start = m_buffer + maxGlobals; 187 192 m_end = m_start; 193 m_maxUsed = m_end; 188 194 m_max = m_start + capacity; 189 195 } … … 193 199 if (newEnd < m_end) 194 200 m_end = newEnd; 201 if (m_end == m_start && (m_maxUsed - m_start) > maxExcessCapacity) 202 releaseExcessCapacity(); 195 203 } 196 204 … … 214 222 #endif 215 223 224 if (newEnd > m_maxUsed) 225 m_maxUsed = newEnd; 226 216 227 m_end = newEnd; 217 228 return true;
Note:
See TracChangeset
for help on using the changeset viewer.