Changeset 46266 in webkit for trunk/JavaScriptCore/runtime
- Timestamp:
- Jul 23, 2009, 7:28:47 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/Collector.cpp
r44993 r46266 49 49 #include <mach/vm_map.h> 50 50 51 #elif PLATFORM(SYMBIAN) 52 #include <e32std.h> 53 #include <e32cmn.h> 54 #include <unistd.h> 55 51 56 #elif PLATFORM(WIN_OS) 52 57 … … 87 92 // a PIC branch in Mach-O binaries, see <rdar://problem/5971391>. 88 93 #define MIN_ARRAY_SIZE (static_cast<size_t>(14)) 94 95 #if PLATFORM(SYMBIAN) 96 const size_t MAX_NUM_BLOCKS = 256; // Max size of collector heap set to 16 MB 97 static RHeap* userChunk = 0; 98 #endif 89 99 90 100 static void freeHeap(CollectorHeap*); … … 129 139 ASSERT(globalData); 130 140 141 #if PLATFORM(SYMBIAN) 142 // Symbian OpenC supports mmap but currently not the MAP_ANON flag. 143 // Using fastMalloc() does not properly align blocks on 64k boundaries 144 // and previous implementation was flawed/incomplete. 145 // UserHeap::ChunkHeap allows allocation of continuous memory and specification 146 // of alignment value for (symbian) cells within that heap. 147 // 148 // Clarification and mapping of terminology: 149 // RHeap (created by UserHeap::ChunkHeap below) is continuos memory chunk, 150 // which can dynamically grow up to 8 MB, 151 // that holds all CollectorBlocks of this session (static). 152 // Each symbian cell within RHeap maps to a 64kb aligned CollectorBlock. 153 // JSCell objects are maintained as usual within CollectorBlocks. 154 if (!userChunk) { 155 userChunk = UserHeap::ChunkHeap(0, 0, MAX_NUM_BLOCKS * BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE); 156 if (!userChunk) 157 CRASH(); 158 } 159 #endif // PLATFORM(SYMBIAN) 160 131 161 memset(&primaryHeap, 0, sizeof(CollectorHeap)); 132 162 memset(&numberHeap, 0, sizeof(CollectorHeap)); … … 186 216 vm_map(current_task(), &address, BLOCK_SIZE, BLOCK_OFFSET_MASK, VM_FLAGS_ANYWHERE | VM_TAG_FOR_COLLECTOR_MEMORY, MEMORY_OBJECT_NULL, 0, FALSE, VM_PROT_DEFAULT, VM_PROT_DEFAULT, VM_INHERIT_DEFAULT); 187 217 #elif PLATFORM(SYMBIAN) 188 // no memory map in symbian, need to hack with fastMalloc 189 void* address = fastMalloc(BLOCK_SIZE); 218 // Allocate a 64 kb aligned CollectorBlock 219 unsigned char* mask = reinterpret_cast<unsigned char*>(userChunk->Alloc(BLOCK_SIZE)); 220 if (!mask) 221 CRASH(); 222 uintptr_t address = reinterpret_cast<uintptr_t>(mask); 223 190 224 memset(reinterpret_cast<void*>(address), 0, BLOCK_SIZE); 191 225 #elif PLATFORM(WIN_OS) … … 232 266 vm_deallocate(current_task(), reinterpret_cast<vm_address_t>(block), BLOCK_SIZE); 233 267 #elif PLATFORM(SYMBIAN) 234 fastFree(block);268 userChunk->Free(reinterpret_cast<TAny*>(block)); 235 269 #elif PLATFORM(WIN_OS) 236 270 VirtualFree(block, 0, MEM_RELEASE);
Note:
See TracChangeset
for help on using the changeset viewer.