Changeset 36251 in webkit for trunk/JavaScriptCore/kjs/collector.cpp
- Timestamp:
- Sep 7, 2008, 1:39:38 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/collector.cpp
r36006 r36251 317 317 size_t targetBlockUsedCells; 318 318 if (i != usedBlocks) { 319 targetBlock = (Block*)heap.blocks[i];319 targetBlock = reinterpret_cast<Block*>(heap.blocks[i]); 320 320 targetBlockUsedCells = targetBlock->usedCells; 321 321 ASSERT(targetBlockUsedCells <= HeapConstants<heapType>::cellsPerBlock); … … 323 323 if (++i == usedBlocks) 324 324 goto collect; 325 targetBlock = (Block*)heap.blocks[i];325 targetBlock = reinterpret_cast<Block*>(heap.blocks[i]); 326 326 targetBlockUsedCells = targetBlock->usedCells; 327 327 ASSERT(targetBlockUsedCells <= HeapConstants<heapType>::cellsPerBlock); … … 359 359 } 360 360 361 targetBlock = (Block*)allocateBlock<heapType>();361 targetBlock = reinterpret_cast<Block*>(allocateBlock<heapType>()); 362 362 targetBlock->freeList = targetBlock->cells; 363 363 targetBlock->heap = this; 364 364 targetBlockUsedCells = 0; 365 heap.blocks[usedBlocks] = (CollectorBlock*)targetBlock;365 heap.blocks[usedBlocks] = reinterpret_cast<CollectorBlock*>(targetBlock); 366 366 heap.usedBlocks = usedBlocks + 1; 367 367 heap.firstBlockWithPossibleSpace = usedBlocks; … … 408 408 MOV pTib, EAX 409 409 } 410 return (void*)pTib->StackBase;410 return static_cast<void*>(pTib->StackBase); 411 411 #elif PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC) 412 412 PNT_TIB64 pTib = reinterpret_cast<PNT_TIB64>(NtCurrentTeb()); 413 return (void*)pTib->StackBase;413 return static_cast<void*>(pTib->StackBase); 414 414 #elif PLATFORM(WIN_OS) && PLATFORM(X86) && COMPILER(GCC) 415 415 // offset 0x18 from the FS segment register gives a pointer to … … 419 419 : "=r" (pTib) 420 420 ); 421 return (void*)pTib->StackBase;421 return static_cast<void*>(pTib->StackBase); 422 422 #elif PLATFORM(SOLARIS) 423 423 stack_t s; … … 534 534 } 535 535 536 ASSERT(( (char*)end - (char*)start) < 0x1000000);536 ASSERT((static_cast<char*>(end) - static_cast<char*>(start)) < 0x1000000); 537 537 ASSERT(IS_POINTER_ALIGNED(start)); 538 538 ASSERT(IS_POINTER_ALIGNED(end)); 539 539 540 char** p = (char**)start;541 char** e = (char**)end;540 char** p = static_cast<char**>(start); 541 char** e = static_cast<char**>(end); 542 542 543 543 size_t usedPrimaryBlocks = primaryHeap.usedBlocks; … … 566 566 for (size_t block = 0; block < usedPrimaryBlocks; block++) { 567 567 if ((primaryBlocks[block] == blockAddr) & (offset <= lastCellOffset)) { 568 if ( ((CollectorCell*)xAsBits)->u.freeCell.zeroIfFree != 0) {568 if (reinterpret_cast<CollectorCell*>(xAsBits)->u.freeCell.zeroIfFree != 0) { 569 569 JSCell* imp = reinterpret_cast<JSCell*>(xAsBits); 570 570 if (!imp->marked()) … … 700 700 701 701 #if PLATFORM(X86) 702 return (void*)regs.__esp;702 return reinterpret_cast<void*>(regs.__esp); 703 703 #elif PLATFORM(X86_64) 704 return (void*)regs.__rsp;704 return reinterpret_cast<void*>(regs.__rsp); 705 705 #elif PLATFORM(PPC) || PLATFORM(PPC64) 706 return (void*)regs.__r1;706 return reinterpret_cast<void*>(regs.__r1); 707 707 #elif PLATFORM(ARM) 708 return (void*)regs.__sp;708 return reinterpret_cast<void*>(regs.__sp); 709 709 #else 710 710 #error Unknown Architecture … … 714 714 715 715 #if PLATFORM(X86) 716 return (void*)regs.esp;716 return reinterpret_cast<void*>(regs.esp); 717 717 #elif PLATFORM(X86_64) 718 return (void*)regs.rsp;718 return reinterpret_cast<void*>(regs.rsp); 719 719 #elif (PLATFORM(PPC) || PLATFORM(PPC64)) 720 return (void*)regs.r1;720 return reinterpret_cast<void*>(regs.r1); 721 721 #else 722 722 #error Unknown Architecture … … 727 727 // end PLATFORM(DARWIN) 728 728 #elif PLATFORM(X86) && PLATFORM(WIN_OS) 729 return (void*)(uintptr_t)regs.Esp;729 return reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(regs.Esp)); 730 730 #else 731 731 #error Need a way to get the stack pointer for another thread on this platform … … 741 741 742 742 // mark the thread's registers 743 markConservatively( (void*)®s, (void*)((char*)®s+ regSize));743 markConservatively(static_cast<void*>(®s), static_cast<void*>(reinterpret_cast<char*>(®s) + regSize)); 744 744 745 745 void* stackPointer = otherThreadStackPointer(regs); … … 859 859 860 860 for (size_t block = 0; block < heap.usedBlocks; block++) { 861 Block* curBlock = (Block*)heap.blocks[block];861 Block* curBlock = reinterpret_cast<Block*>(heap.blocks[block]); 862 862 863 863 size_t usedCells = curBlock->usedCells; … … 922 922 if (emptyBlocks > SPARE_EMPTY_BLOCKS) { 923 923 #if !DEBUG_COLLECTOR 924 freeBlock( (CollectorBlock*)curBlock);924 freeBlock(reinterpret_cast<CollectorBlock*>(curBlock)); 925 925 #endif 926 926 // swap with the last block so we compact as we go … … 931 931 if (heap.numBlocks > MIN_ARRAY_SIZE && heap.usedBlocks < heap.numBlocks / LOW_WATER_FACTOR) { 932 932 heap.numBlocks = heap.numBlocks / GROWTH_FACTOR; 933 heap.blocks = (CollectorBlock**)fastRealloc(heap.blocks, heap.numBlocks * sizeof(CollectorBlock*));933 heap.blocks = static_cast<CollectorBlock**>(fastRealloc(heap.blocks, heap.numBlocks * sizeof(CollectorBlock*))); 934 934 } 935 935 }
Note:
See TracChangeset
for help on using the changeset viewer.