Changeset 43885 in webkit for trunk/JavaScriptCore/interpreter/RegisterFile.h
- Timestamp:
- May 19, 2009, 8:25:47 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/interpreter/RegisterFile.h
r42842 r43885 157 157 }; 158 158 159 // FIXME: Add a generic getpagesize() to WTF, then move this function to WTF as well. 160 inline bool isPageAligned(size_t size) { return size != 0 && size % (8 * 1024) == 0; } 161 159 162 inline RegisterFile::RegisterFile(size_t capacity, size_t maxGlobals) 160 163 : m_numGlobals(0) … … 166 169 , m_globalObject(0) 167 170 { 171 // Verify that our values will play nice with mmap and VirtualAlloc. 172 ASSERT(isPageAligned(maxGlobals)); 173 ASSERT(isPageAligned(capacity)); 174 168 175 size_t bufferLength = (capacity + maxGlobals) * sizeof(Register); 169 176 #if HAVE(MMAP) … … 197 204 inline void RegisterFile::shrink(Register* newEnd) 198 205 { 199 if (newEnd < m_end) 200 m_end = newEnd; 201 if (m_end == m_start && (m_maxUsed - m_start) > maxExcessCapacity) 206 if (newEnd >= m_end) 207 return; 208 m_end = newEnd; 209 if (m_end == m_start && (m_maxUsed - m_start) > maxExcessCapacity) 202 210 releaseExcessCapacity(); 203 211 }
Note:
See TracChangeset
for help on using the changeset viewer.