Changeset 62367 in webkit for trunk/JavaScriptCore/runtime
- Timestamp:
- Jul 1, 2010, 11:31:27 PM (15 years ago)
- Location:
- trunk/JavaScriptCore/runtime
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/Collector.cpp
r62254 r62367 246 246 Structure* dummyMarkableCellStructure = m_globalData->dummyMarkableCellStructure.get(); 247 247 for (size_t i = 0; i < HeapConstants::cellsPerBlock; ++i) 248 new ( block->cells + i) JSCell(dummyMarkableCellStructure);248 new (&block->cells[i]) JSCell(dummyMarkableCellStructure); 249 249 250 250 // Add block to blocks vector. … … 385 385 ASSERT(m_heap.nextCell < HeapConstants::cellsPerBlock); 386 386 if (!block->marked.get(m_heap.nextCell)) { // Always false for the last cell in the block 387 Cell* cell = block->cells + m_heap.nextCell;387 Cell* cell = &block->cells[m_heap.nextCell]; 388 388 389 389 m_heap.operationInProgress = Allocation; -
trunk/JavaScriptCore/runtime/Collector.h
r60323 r62367 25 25 #include <stddef.h> 26 26 #include <string.h> 27 #include <wtf/FixedArray.h> 27 28 #include <wtf/HashCountedSet.h> 28 29 #include <wtf/HashSet.h> … … 216 217 217 218 struct CollectorBitmap { 218 uint32_t bits[BITMAP_WORDS];219 FixedArray<uint32_t, BITMAP_WORDS> bits; 219 220 bool get(size_t n) const { return !!(bits[n >> 5] & (1 << (n & 0x1F))); } 220 221 void set(size_t n) { bits[n >> 5] |= (1 << (n & 0x1F)); } 221 222 void clear(size_t n) { bits[n >> 5] &= ~(1 << (n & 0x1F)); } 222 void clearAll() { memset(bits , 0, sizeof(bits)); }223 void clearAll() { memset(bits.data(), 0, sizeof(bits)); } 223 224 ALWAYS_INLINE void advanceToNextPossibleFreeCell(size_t& startCell) 224 225 { … … 249 250 250 251 struct CollectorCell { 251 double memory[CELL_ARRAY_LENGTH];252 FixedArray<double, CELL_ARRAY_LENGTH> memory; 252 253 }; 253 254 254 255 class CollectorBlock { 255 256 public: 256 CollectorCell cells[CELLS_PER_BLOCK];257 FixedArray<CollectorCell, CELLS_PER_BLOCK> cells; 257 258 CollectorBitmap marked; 258 259 Heap* heap; -
trunk/JavaScriptCore/runtime/CollectorHeapIterator.h
r54672 r62367 78 78 inline JSCell* CollectorHeapIterator::operator*() const 79 79 { 80 return reinterpret_cast<JSCell*>( m_heap.blocks[m_block]->cells + m_cell);80 return reinterpret_cast<JSCell*>(&m_heap.blocks[m_block]->cells[m_cell]); 81 81 } 82 82 -
trunk/JavaScriptCore/runtime/DateInstanceCache.h
r50709 r62367 87 87 CacheEntry& lookup(double d) { return m_cache[WTF::FloatHash<double>::hash(d) & (cacheSize - 1)]; } 88 88 89 CacheEntry m_cache[cacheSize];89 FixedArray<CacheEntry, cacheSize> m_cache; 90 90 }; 91 91 -
trunk/JavaScriptCore/runtime/JSString.cpp
r61750 r62367 121 121 UStringImpl* matchString = 0; 122 122 int matchPosition = -1; 123 for (RopeIterator it(m_other.m_fibers , m_fiberCount); it != end; ++it) {123 for (RopeIterator it(m_other.m_fibers.data(), m_fiberCount); it != end; ++it) { 124 124 ++fiberCount; 125 125 if (matchString) … … 140 140 return throwOutOfMemoryError(exec); 141 141 142 for (RopeIterator it(m_other.m_fibers , m_fiberCount); it != end; ++it) {142 for (RopeIterator it(m_other.m_fibers.data(), m_fiberCount); it != end; ++it) { 143 143 UStringImpl* string = *it; 144 144 if (string != matchString) { -
trunk/JavaScriptCore/runtime/JSString.h
r60392 r62367 418 418 JSStringFinalizerStruct() : m_finalizerCallback(0) {} 419 419 union { 420 mutable RopeImpl::Fiber m_fibers[s_maxInternalRopeLength];420 mutable FixedArray<RopeImpl::Fiber, s_maxInternalRopeLength> m_fibers; 421 421 struct { 422 422 JSStringFinalizerCallback m_finalizerCallback; -
trunk/JavaScriptCore/runtime/NumericStrings.h
r55599 r62367 28 28 29 29 #include "UString.h" 30 #include <wtf/FixedArray.h> 30 31 #include <wtf/HashFunctions.h> 31 32 … … 87 88 } 88 89 89 CacheEntry<double> doubleCache[cacheSize];90 CacheEntry<int> intCache[cacheSize];91 CacheEntry<unsigned> unsignedCache[cacheSize];92 UString smallIntCache[cacheSize];90 FixedArray<CacheEntry<double>, cacheSize> doubleCache; 91 FixedArray<CacheEntry<int>, cacheSize> intCache; 92 FixedArray<CacheEntry<unsigned>, cacheSize> unsignedCache; 93 FixedArray<UString, cacheSize> smallIntCache; 93 94 }; 94 95 -
trunk/JavaScriptCore/runtime/RegExpCache.h
r61927 r62367 46 46 47 47 typedef HashMap<RegExpKey, RefPtr<RegExp> > RegExpCacheMap; 48 RegExpKey patternKeyArray[maxCacheableEntries];48 FixedArray<RegExpKey, maxCacheableEntries> patternKeyArray; 49 49 RegExpCacheMap m_cacheMap; 50 50 JSGlobalData* m_globalData; -
trunk/JavaScriptCore/runtime/SmallStrings.h
r58317 r62367 28 28 29 29 #include "UString.h" 30 #include <wtf/FixedArray.h> 30 31 #include <wtf/OwnPtr.h> 31 32 … … 62 63 unsigned count() const; 63 64 #if ENABLE(JIT) 64 JSString** singleCharacterStrings() { return m_singleCharacterStrings ; }65 JSString** singleCharacterStrings() { return m_singleCharacterStrings.data(); } 65 66 #endif 66 67 private: … … 69 70 70 71 JSString* m_emptyString; 71 JSString* m_singleCharacterStrings[0x100];72 FixedArray<JSString*, 0x100> m_singleCharacterStrings; 72 73 OwnPtr<SmallStringsStorage> m_storage; 73 74 };
Note:
See TracChangeset
for help on using the changeset viewer.