Changeset 56370 in webkit for trunk/JavaScriptCore/runtime/Collector.cpp
- Timestamp:
- Mar 22, 2010, 5:28:28 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/Collector.cpp
r55453 r56370 54 54 #include <mach/vm_map.h> 55 55 56 #elif OS(SYMBIAN)57 #include <e32std.h>58 #include <e32cmn.h>59 #include <unistd.h>60 61 56 #elif OS(WINDOWS) 62 57 … … 109 104 // a PIC branch in Mach-O binaries, see <rdar://problem/5971391>. 110 105 #define MIN_ARRAY_SIZE (static_cast<size_t>(14)) 111 112 #if OS(SYMBIAN)113 const size_t MAX_NUM_BLOCKS = 256; // Max size of collector heap set to 16 MB114 static RHeap* userChunk = 0;115 #endif116 106 117 107 #if ENABLE(JSC_MULTIPLE_THREADS) … … 147 137 #endif 148 138 , m_globalData(globalData) 139 #if OS(SYMBIAN) 140 , m_blockallocator(JSCCOLLECTOR_VIRTUALMEM_RESERVATION, BLOCK_SIZE) 141 #endif 149 142 { 150 143 ASSERT(globalData); 151 152 #if OS(SYMBIAN)153 // Symbian OpenC supports mmap but currently not the MAP_ANON flag.154 // Using fastMalloc() does not properly align blocks on 64k boundaries155 // and previous implementation was flawed/incomplete.156 // UserHeap::ChunkHeap allows allocation of continuous memory and specification157 // of alignment value for (symbian) cells within that heap.158 //159 // Clarification and mapping of terminology:160 // RHeap (created by UserHeap::ChunkHeap below) is continuos memory chunk,161 // which can dynamically grow up to 8 MB,162 // that holds all CollectorBlocks of this session (static).163 // Each symbian cell within RHeap maps to a 64kb aligned CollectorBlock.164 // JSCell objects are maintained as usual within CollectorBlocks.165 if (!userChunk) {166 userChunk = UserHeap::ChunkHeap(0, 0, MAX_NUM_BLOCKS * BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE);167 if (!userChunk)168 CRASH();169 }170 #endif // OS(SYMBIAN)171 172 144 memset(&m_heap, 0, sizeof(CollectorHeap)); 173 145 allocateBlock(); … … 212 184 } 213 185 #endif 214 186 #if OS(SYMBIAN) 187 m_blockallocator.destroy(); 188 #endif 215 189 m_globalData = 0; 216 190 } … … 222 196 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); 223 197 #elif OS(SYMBIAN) 224 // Allocate a 64 kb aligned CollectorBlock 225 unsigned char* mask = reinterpret_cast<unsigned char*>(userChunk->Alloc(BLOCK_SIZE)); 226 if (!mask) 198 void* address = m_blockallocator.alloc(); 199 if (!address) 227 200 CRASH(); 228 uintptr_t address = reinterpret_cast<uintptr_t>(mask);229 201 #elif OS(WINCE) 230 202 void* address = VirtualAlloc(NULL, BLOCK_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); … … 317 289 vm_deallocate(current_task(), reinterpret_cast<vm_address_t>(block), BLOCK_SIZE); 318 290 #elif OS(SYMBIAN) 319 userChunk->Free(reinterpret_cast<TAny*>(block));291 m_blockallocator.free(reinterpret_cast<void*>(block)); 320 292 #elif OS(WINCE) 321 293 VirtualFree(block, 0, MEM_RELEASE);
Note:
See TracChangeset
for help on using the changeset viewer.