Changeset 95507 in webkit
- Timestamp:
- Sep 19, 2011 6:53:00 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 3 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r95493 r95507 46 46 bytecompiler/NodesCodegen.cpp 47 47 48 heap/AllocationSpace.cpp49 48 heap/Heap.cpp 50 49 heap/HandleHeap.cpp -
trunk/Source/JavaScriptCore/ChangeLog
r95505 r95507 1 2011-09-19 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r95493 and r95496. 4 http://trac.webkit.org/changeset/95493 5 http://trac.webkit.org/changeset/95496 6 https://bugs.webkit.org/show_bug.cgi?id=68418 7 8 Broke Windows build (Requested by rniwa on #webkit). 9 10 * CMakeLists.txt: 11 * GNUmakefile.list.am: 12 * JavaScriptCore.exp: 13 * JavaScriptCore.gypi: 14 * JavaScriptCore.pro: 15 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 16 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 17 * JavaScriptCore.xcodeproj/project.pbxproj: 18 * debugger/Debugger.cpp: 19 (JSC::Debugger::recompileAllJSFunctions): 20 * heap/AllocationSpace.cpp: Removed. 21 * heap/AllocationSpace.h: Removed. 22 * heap/Heap.cpp: 23 (JSC::CountFunctor::TakeIfEmpty::TakeIfEmpty): 24 (JSC::CountFunctor::TakeIfEmpty::operator()): 25 (JSC::CountFunctor::TakeIfEmpty::returnValue): 26 (JSC::Heap::Heap): 27 (JSC::Heap::reportExtraMemoryCostSlowCase): 28 (JSC::Heap::tryAllocate): 29 (JSC::Heap::allocateSlowCase): 30 (JSC::Heap::getConservativeRegisterRoots): 31 (JSC::Heap::markRoots): 32 (JSC::Heap::clearMarks): 33 (JSC::Heap::sweep): 34 (JSC::Heap::objectCount): 35 (JSC::Heap::size): 36 (JSC::Heap::capacity): 37 (JSC::Heap::globalObjectCount): 38 (JSC::Heap::objectTypeCounts): 39 (JSC::Heap::collect): 40 (JSC::Heap::canonicalizeBlocks): 41 (JSC::Heap::resetAllocator): 42 (JSC::Heap::allocateBlock): 43 (JSC::Heap::freeBlocks): 44 (JSC::Heap::shrink): 45 * heap/Heap.h: 46 (JSC::Heap::markedSpace): 47 (JSC::Heap::forEachCell): 48 (JSC::Heap::forEachBlock): 49 (JSC::Heap::sizeClassFor): 50 (JSC::Heap::allocate): 51 * jit/JITInlineMethods.h: 52 (JSC::JIT::emitAllocateBasicJSObject): 53 * runtime/JSGlobalData.cpp: 54 (JSC::JSGlobalData::recompileAllJSFunctions): 55 (JSC::JSGlobalData::releaseExecutableMemory): 56 1 57 2011-09-19 Gavin Barraclough <barraclough@apple.com> 2 58 -
trunk/Source/JavaScriptCore/GNUmakefile.list.am
r95493 r95507 134 134 Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp \ 135 135 Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h \ 136 Source/JavaScriptCore/heap/AllocationSpace.cpp \137 Source/JavaScriptCore/heap/AllocationSpace.h \138 136 Source/JavaScriptCore/heap/ConservativeRoots.cpp \ 139 137 Source/JavaScriptCore/heap/ConservativeRoots.h \ -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r95493 r95507 119 119 __ZN3JSC11JSByteArray15createStructureERNS_12JSGlobalDataEPNS_14JSGlobalObjectENS_7JSValueEPKNS_9ClassInfoE 120 120 __ZN3JSC11JSByteArrayC1EPNS_9ExecStateEPNS_9StructureEPN3WTF9ByteArrayE 121 __ZN3JSC15AllocationSpace16allocateSlowCaseERNS_11MarkedSpace9SizeClassE122 121 __ZN3JSC11ParserArena5resetEv 123 122 __ZN3JSC11checkSyntaxEPNS_9ExecStateERKNS_10SourceCodeEPNS_7JSValueE … … 235 234 __ZN3JSC4Heap11objectCountEv 236 235 __ZN3JSC4Heap16activityCallbackEv 236 __ZN3JSC4Heap16allocateSlowCaseERNS_11MarkedSpace9SizeClassE 237 237 __ZN3JSC4Heap16objectTypeCountsEv 238 238 __ZN3JSC4Heap17collectAllGarbageEv -
trunk/Source/JavaScriptCore/JavaScriptCore.gypi
r95493 r95507 28 28 'assembler/MacroAssemblerCodeRef.h', 29 29 'bytecode/Opcode.h', 30 'heap/AllocationSpace.h',31 30 'heap/ConservativeRoots.h', 32 31 'heap/Handle.h', … … 326 325 'bytecompiler/NodesCodegen.cpp', 327 326 'bytecompiler/RegisterID.h', 328 'heap/AllocationSpace.cpp',329 327 'heap/ConservativeRoots.cpp', 330 328 'heap/HandleHeap.cpp', -
trunk/Source/JavaScriptCore/JavaScriptCore.pro
r95493 r95507 73 73 bytecompiler/BytecodeGenerator.cpp \ 74 74 bytecompiler/NodesCodegen.cpp \ 75 heap/AllocationSpace.cpp \76 75 heap/ConservativeRoots.cpp \ 77 76 heap/HandleHeap.cpp \ -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
r95496 r95507 60 60 ?addSlowCase@Identifier@JSC@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@WTF@@PAVExecState@2@PAVStringImpl@4@@Z 61 61 ?addStaticGlobals@JSGlobalObject@JSC@@IAEXPAUGlobalPropertyInfo@12@H@Z 62 ?allocate@ AllocationSpace@JSC@@QAEPAXAAUSizeClass@MarkedSpace@2@@Z62 ?allocate@Heap@JSC@@QAEPAXAAUSizeClass@MarkedSpace@2@@Z 63 63 ?allocatePropertyStorage@JSObject@JSC@@QAEXAAVJSGlobalData@2@II@Z 64 ?allocateSlowCase@ AllocationSpace@JSC@@AAEPAXAAUSizeClass@MarkedSpace@2@@Z64 ?allocateSlowCase@Heap@JSC@@AAEPAXAAUSizeClass@MarkedSpace@2@@Z 65 65 ?append@StringBuilder@WTF@@QAEXPBDI@Z 66 66 ?append@StringBuilder@WTF@@QAEXPB_WI@Z -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
r95493 r95507 1891 1891 > 1892 1892 <File 1893 RelativePath="..\..\heap\AllocationSpace.cpp"1894 >1895 </File>1896 <File1897 RelativePath="..\..\heap\AllocationSpace.h"1898 >1899 </File>1900 <File1901 1893 RelativePath="..\..\heap\ConservativeRoots.cpp" 1902 1894 > -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r95493 r95507 407 407 A1712B4111C7B235007A5315 /* RegExpKey.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B4011C7B235007A5315 /* RegExpKey.h */; settings = {ATTRIBUTES = (Private, ); }; }; 408 408 A1D764521354448B00C5C7C0 /* Alignment.h in Headers */ = {isa = PBXBuildFile; fileRef = A1D764511354448B00C5C7C0 /* Alignment.h */; settings = {ATTRIBUTES = (Private, ); }; }; 409 A70456B01427FB910037DA68 /* AllocationSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = A70456AF1427FB150037DA68 /* AllocationSpace.h */; settings = {ATTRIBUTES = (Private, ); }; };410 A70456B11427FB950037DA68 /* AllocationSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A70456AE1427FB030037DA68 /* AllocationSpace.cpp */; };411 409 A71236E51195F33C00BD2174 /* JITOpcodes32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A71236E41195F33C00BD2174 /* JITOpcodes32_64.cpp */; }; 412 410 A72700900DAC6BBC00E548D7 /* JSNotAnObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A72700780DAC605600E548D7 /* JSNotAnObject.cpp */; }; … … 1185 1183 A1712B4011C7B235007A5315 /* RegExpKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpKey.h; sourceTree = "<group>"; }; 1186 1184 A1D764511354448B00C5C7C0 /* Alignment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Alignment.h; sourceTree = "<group>"; }; 1187 A70456AE1427FB030037DA68 /* AllocationSpace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AllocationSpace.cpp; sourceTree = "<group>"; };1188 A70456AF1427FB150037DA68 /* AllocationSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AllocationSpace.h; sourceTree = "<group>"; };1189 1185 A71236E41195F33C00BD2174 /* JITOpcodes32_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITOpcodes32_64.cpp; sourceTree = "<group>"; }; 1190 1186 A718F61A11754A21002465A7 /* RegExpJitTables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpJitTables.h; sourceTree = "<group>"; }; … … 1622 1618 isa = PBXGroup; 1623 1619 children = ( 1624 A70456AF1427FB150037DA68 /* AllocationSpace.h */,1625 A70456AE1427FB030037DA68 /* AllocationSpace.cpp */,1626 1620 0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */, 1627 1621 0FC815141405118D00CFA603 /* VTableSpectrum.h */, … … 2800 2794 A781E359141970C700094D90 /* StorageBarrier.h in Headers */, 2801 2795 1A08277A142168D70090CCAC /* BinarySemaphore.h in Headers */, 2802 A70456B01427FB910037DA68 /* AllocationSpace.h in Headers */,2803 2796 ); 2804 2797 runOnlyForDeploymentPostprocessing = 0; … … 3306 3299 C22C531313FAF6EF00B7DC0D /* strtod.cc in Sources */, 3307 3300 1A082779142168D70090CCAC /* BinarySemaphore.cpp in Sources */, 3308 A70456B11427FB950037DA68 /* AllocationSpace.cpp in Sources */,3309 3301 ); 3310 3302 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/JavaScriptCore/debugger/Debugger.cpp
r95493 r95507 119 119 120 120 Recompiler recompiler(this); 121 globalData->heap. objectSpace().forEachCell(recompiler);121 globalData->heap.forEachCell(recompiler); 122 122 } 123 123 -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r95493 r95507 34 34 #include <algorithm> 35 35 36 #define COLLECT_ON_EVERY_ALLOCATION 0 36 37 37 38 using namespace std; … … 175 176 } 176 177 178 class TakeIfEmpty { 179 public: 180 typedef MarkedBlock* ReturnType; 181 182 TakeIfEmpty(MarkedSpace*); 183 void operator()(MarkedBlock*); 184 ReturnType returnValue(); 185 186 private: 187 MarkedSpace* m_markedSpace; 188 DoublyLinkedList<MarkedBlock> m_empties; 189 }; 190 191 inline TakeIfEmpty::TakeIfEmpty(MarkedSpace* newSpace) 192 : m_markedSpace(newSpace) 193 { 194 } 195 196 inline void TakeIfEmpty::operator()(MarkedBlock* block) 197 { 198 if (!block->isEmpty()) 199 return; 200 201 m_markedSpace->removeBlock(block); 202 m_empties.append(block); 203 } 204 205 inline TakeIfEmpty::ReturnType TakeIfEmpty::returnValue() 206 { 207 return m_empties.head(); 208 } 209 177 210 class RecordType { 178 211 public: … … 217 250 , m_minBytesPerCycle(heapSizeForHint(heapSize)) 218 251 , m_operationInProgress(NoOperation) 219 , m_ objectSpace(this)252 , m_markedSpace(this) 220 253 , m_extraCost(0) 221 254 , m_markListSet(0) … … 227 260 , m_globalData(globalData) 228 261 { 229 m_ objectSpace.setHighWaterMark(m_minBytesPerCycle);262 m_markedSpace.setHighWaterMark(m_minBytesPerCycle); 230 263 (*m_activityCallback)(); 231 264 #if ENABLE(LAZY_BLOCK_FREEING) … … 369 402 // collecting more frequently as long as it stays alive. 370 403 371 if (m_extraCost > maxExtraCost && m_extraCost > m_ objectSpace.highWaterMark() / 2)404 if (m_extraCost > maxExtraCost && m_extraCost > m_markedSpace.highWaterMark() / 2) 372 405 collectAllGarbage(); 373 406 m_extraCost += cost; 407 } 408 409 inline void* Heap::tryAllocate(MarkedSpace::SizeClass& sizeClass) 410 { 411 m_operationInProgress = Allocation; 412 void* result = m_markedSpace.allocate(sizeClass); 413 m_operationInProgress = NoOperation; 414 return result; 415 } 416 417 void* Heap::allocateSlowCase(MarkedSpace::SizeClass& sizeClass) 418 { 419 #if COLLECT_ON_EVERY_ALLOCATION 420 collectAllGarbage(); 421 ASSERT(m_operationInProgress == NoOperation); 422 #endif 423 424 void* result = tryAllocate(sizeClass); 425 426 if (LIKELY(result != 0)) 427 return result; 428 429 AllocationEffort allocationEffort; 430 431 if (m_markedSpace.waterMark() < m_markedSpace.highWaterMark() || !m_isSafeToCollect) 432 allocationEffort = AllocationMustSucceed; 433 else 434 allocationEffort = AllocationCanFail; 435 436 MarkedBlock* block = allocateBlock(sizeClass.cellSize, allocationEffort); 437 if (block) { 438 m_markedSpace.addBlock(sizeClass, block); 439 void* result = tryAllocate(sizeClass); 440 ASSERT(result); 441 return result; 442 } 443 444 collect(DoNotSweep); 445 446 result = tryAllocate(sizeClass); 447 448 if (result) 449 return result; 450 451 ASSERT(m_markedSpace.waterMark() < m_markedSpace.highWaterMark()); 452 453 m_markedSpace.addBlock(sizeClass, allocateBlock(sizeClass.cellSize, AllocationMustSucceed)); 454 455 result = tryAllocate(sizeClass); 456 ASSERT(result); 457 return result; 374 458 } 375 459 … … 446 530 CRASH(); 447 531 m_operationInProgress = Collection; 448 ConservativeRoots registerFileRoots(&m_ objectSpace.blocks());532 ConservativeRoots registerFileRoots(&m_blocks); 449 533 registerFile().gatherConservativeRoots(registerFileRoots); 450 534 size_t registerFileRootCount = registerFileRoots.size(); … … 468 552 // We gather conservative roots before clearing mark bits because conservative 469 553 // gathering uses the mark bits to determine whether a reference is valid. 470 ConservativeRoots machineThreadRoots(&m_ objectSpace.blocks());554 ConservativeRoots machineThreadRoots(&m_blocks); 471 555 m_machineThreads.gatherConservativeRoots(machineThreadRoots, &dummy); 472 556 473 ConservativeRoots registerFileRoots(&m_ objectSpace.blocks());557 ConservativeRoots registerFileRoots(&m_blocks); 474 558 registerFile().gatherConservativeRoots(registerFileRoots); 475 559 … … 524 608 void Heap::clearMarks() 525 609 { 526 m_objectSpace.forEachBlock<ClearMarks>();610 forEachBlock<ClearMarks>(); 527 611 } 528 612 529 613 void Heap::sweep() 530 614 { 531 m_objectSpace.forEachBlock<Sweep>();615 forEachBlock<Sweep>(); 532 616 } 533 617 534 618 size_t Heap::objectCount() 535 619 { 536 return m_objectSpace.forEachBlock<MarkCount>();620 return forEachBlock<MarkCount>(); 537 621 } 538 622 539 623 size_t Heap::size() 540 624 { 541 return m_objectSpace.forEachBlock<Size>();625 return forEachBlock<Size>(); 542 626 } 543 627 544 628 size_t Heap::capacity() 545 629 { 546 return m_objectSpace.forEachBlock<Capacity>();630 return forEachBlock<Capacity>(); 547 631 } 548 632 … … 554 638 size_t Heap::globalObjectCount() 555 639 { 556 return m_objectSpace.forEachCell<CountIfGlobalObject>();640 return forEachCell<CountIfGlobalObject>(); 557 641 } 558 642 … … 569 653 PassOwnPtr<TypeCountSet> Heap::objectTypeCounts() 570 654 { 571 return m_objectSpace.forEachCell<RecordType>();655 return forEachCell<RecordType>(); 572 656 } 573 657 … … 608 692 // new bytes allocated) proportion, and seems to work well in benchmarks. 609 693 size_t proportionalBytes = 2 * size(); 610 m_ objectSpace.setHighWaterMark(max(proportionalBytes, m_minBytesPerCycle));694 m_markedSpace.setHighWaterMark(max(proportionalBytes, m_minBytesPerCycle)); 611 695 JAVASCRIPTCORE_GC_END(); 612 696 … … 616 700 void Heap::canonicalizeBlocks() 617 701 { 618 m_ objectSpace.canonicalizeBlocks();702 m_markedSpace.canonicalizeBlocks(); 619 703 } 620 704 … … 622 706 { 623 707 m_extraCost = 0; 624 m_ objectSpace.resetAllocator();708 m_markedSpace.resetAllocator(); 625 709 } 626 710 … … 649 733 } 650 734 735 MarkedBlock* Heap::allocateBlock(size_t cellSize, Heap::AllocationEffort allocationEffort) 736 { 737 MarkedBlock* block; 738 739 #if !ENABLE(LAZY_BLOCK_FREEING) 740 if (allocationEffort == AllocationCanFail) 741 return 0; 742 743 block = MarkedBlock::create(this, cellSize); 744 #else 745 { 746 MutexLocker locker(m_freeBlockLock); 747 if (m_numberOfFreeBlocks) { 748 block = m_freeBlocks.removeHead(); 749 ASSERT(block); 750 m_numberOfFreeBlocks--; 751 } else 752 block = 0; 753 } 754 if (block) 755 block->initForCellSize(cellSize); 756 else if (allocationEffort == AllocationCanFail) 757 return 0; 758 else 759 block = MarkedBlock::create(this, cellSize); 760 #endif 761 762 m_blocks.add(block); 763 764 return block; 765 } 766 651 767 void Heap::freeBlocks(MarkedBlock* head) 652 768 { 653 m_objectSpace.freeBlocks(head); 769 MarkedBlock* next; 770 for (MarkedBlock* block = head; block; block = next) { 771 next = block->next(); 772 773 m_blocks.remove(block); 774 block->reset(); 775 #if !ENABLE(LAZY_BLOCK_FREEING) 776 MarkedBlock::destroy(block); 777 #else 778 MutexLocker locker(m_freeBlockLock); 779 m_freeBlocks.append(block); 780 m_numberOfFreeBlocks++; 781 #endif 782 } 654 783 } 655 784 656 785 void Heap::shrink() 657 786 { 658 m_objectSpace.shrink(); 787 // We record a temporary list of empties to avoid modifying m_blocks while iterating it. 788 TakeIfEmpty takeIfEmpty(&m_markedSpace); 789 freeBlocks(forEachBlock(takeIfEmpty)); 659 790 } 660 791 -
trunk/Source/JavaScriptCore/heap/Heap.h
r95493 r95507 23 23 #define Heap_h 24 24 25 #include "AllocationSpace.h"26 25 #include "HandleHeap.h" 27 26 #include "HandleStack.h" … … 39 38 class GCActivityCallback; 40 39 class GlobalCodeBlock; 41 class Heap;42 40 class HeapRootVisitor; 43 41 class JSCell; … … 59 57 // Heap size hint. 60 58 enum HeapSize { SmallHeap, LargeHeap }; 61 59 62 60 class Heap { 63 61 WTF_MAKE_NONCOPYABLE(Heap); 64 62 public: 65 friend class JIT;66 63 static Heap* heap(JSValue); // 0 for immediate values 67 64 static Heap* heap(JSCell*); … … 80 77 81 78 JSGlobalData* globalData() const { return m_globalData; } 82 AllocationSpace& objectSpace() { return m_objectSpace; }79 MarkedSpace& markedSpace() { return m_markedSpace; } 83 80 MachineThreads& machineThreads() { return m_machineThreads; } 84 81 … … 88 85 // true if an allocation or collection is in progress 89 86 inline bool isBusy(); 90 91 MarkedSpace::SizeClass& sizeClassForObject(size_t bytes) { return m_objectSpace.sizeClassFor(bytes); } 87 92 88 void* allocate(size_t); 93 89 MarkedSpace::SizeClass& sizeClassFor(size_t); 90 void* allocate(MarkedSpace::SizeClass&); 94 91 void notifyIsSafeToCollect() { m_isSafeToCollect = true; } 95 92 void collectAllGarbage(); … … 116 113 template<typename Functor> typename Functor::ReturnType forEachProtectedCell(Functor&); 117 114 template<typename Functor> typename Functor::ReturnType forEachProtectedCell(); 115 template<typename Functor> typename Functor::ReturnType forEachCell(Functor&); 116 template<typename Functor> typename Functor::ReturnType forEachCell(); 117 template<typename Functor> typename Functor::ReturnType forEachBlock(Functor&); 118 template<typename Functor> typename Functor::ReturnType forEachBlock(); 118 119 119 120 HandleSlot allocateGlobalHandle() { return m_handleHeap.allocate(); } … … 125 126 private: 126 127 friend class MarkedBlock; 127 friend class AllocationSpace; 128 129 typedef HashSet<MarkedBlock*>::iterator BlockIterator; 128 130 129 131 static const size_t minExtraCost = 256; 130 132 static const size_t maxExtraCost = 1024 * 1024; 133 134 enum AllocationEffort { AllocationMustSucceed, AllocationCanFail }; 131 135 132 136 #if ENABLE(GGC) … … 139 143 void resetAllocator(); 140 144 145 MarkedBlock* allocateBlock(size_t cellSize, AllocationEffort); 141 146 void freeBlocks(MarkedBlock*); 142 147 … … 146 151 void markTempSortVectors(HeapRootVisitor&); 147 152 void harvestWeakReferences(); 153 154 void* tryAllocate(MarkedSpace::SizeClass&); 155 void* allocateSlowCase(MarkedSpace::SizeClass&); 148 156 149 157 enum SweepToggle { DoNotSweep, DoSweep }; … … 168 176 169 177 OperationInProgress m_operationInProgress; 170 AllocationSpace m_objectSpace; 178 MarkedSpace m_markedSpace; 179 MarkedBlockSet m_blocks; 171 180 172 181 #if ENABLE(LAZY_BLOCK_FREEING) … … 298 307 } 299 308 309 template<typename Functor> inline typename Functor::ReturnType Heap::forEachCell(Functor& functor) 310 { 311 canonicalizeBlocks(); 312 BlockIterator end = m_blocks.set().end(); 313 for (BlockIterator it = m_blocks.set().begin(); it != end; ++it) 314 (*it)->forEachCell(functor); 315 return functor.returnValue(); 316 } 317 318 template<typename Functor> inline typename Functor::ReturnType Heap::forEachCell() 319 { 320 Functor functor; 321 return forEachCell(functor); 322 } 323 324 template<typename Functor> inline typename Functor::ReturnType Heap::forEachBlock(Functor& functor) 325 { 326 canonicalizeBlocks(); 327 BlockIterator end = m_blocks.set().end(); 328 for (BlockIterator it = m_blocks.set().begin(); it != end; ++it) 329 functor(*it); 330 return functor.returnValue(); 331 } 332 333 template<typename Functor> inline typename Functor::ReturnType Heap::forEachBlock() 334 { 335 Functor functor; 336 return forEachBlock(functor); 337 } 338 339 inline MarkedSpace::SizeClass& Heap::sizeClassFor(size_t bytes) 340 { 341 return m_markedSpace.sizeClassFor(bytes); 342 } 343 344 inline void* Heap::allocate(MarkedSpace::SizeClass& sizeClass) 345 { 346 // This is a light-weight fast path to cover the most common case. 347 MarkedBlock::FreeCell* firstFreeCell = sizeClass.firstFreeCell; 348 if (UNLIKELY(!firstFreeCell)) 349 return allocateSlowCase(sizeClass); 350 351 sizeClass.firstFreeCell = firstFreeCell->next; 352 return firstFreeCell; 353 } 354 300 355 inline void* Heap::allocate(size_t bytes) 301 356 { 302 357 ASSERT(isValidAllocation(bytes)); 303 return m_objectSpace.allocate(bytes); 358 MarkedSpace::SizeClass& sizeClass = sizeClassFor(bytes); 359 return allocate(sizeClass); 304 360 } 305 361 -
trunk/Source/JavaScriptCore/jit/JITInlineMethods.h
r95493 r95507 395 395 template <typename ClassType, typename StructureType> inline void JIT::emitAllocateBasicJSObject(StructureType structure, void* vtable, RegisterID result, RegisterID storagePtr) 396 396 { 397 MarkedSpace::SizeClass* sizeClass = &m_globalData->heap.sizeClassFor Object(sizeof(ClassType));397 MarkedSpace::SizeClass* sizeClass = &m_globalData->heap.sizeClassFor(sizeof(ClassType)); 398 398 loadPtr(&sizeClass->firstFreeCell, result); 399 399 addSlowCase(branchTestPtr(Zero, result)); -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp
r95493 r95507 455 455 ASSERT(!dynamicGlobalObject); 456 456 457 heap. objectSpace().forEachCell<Recompiler>();457 heap.forEachCell<Recompiler>(); 458 458 } 459 459 … … 496 496 497 497 } 498 heap. objectSpace().forEachCell<StackPreservingRecompiler>(recompiler);498 heap.forEachCell<StackPreservingRecompiler>(recompiler); 499 499 } 500 500 m_regExpCache->invalidateCode(); -
trunk/Source/WebCore/ChangeLog
r95506 r95507 1 2011-09-19 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r95493 and r95496. 4 http://trac.webkit.org/changeset/95493 5 http://trac.webkit.org/changeset/95496 6 https://bugs.webkit.org/show_bug.cgi?id=68418 7 8 Broke Windows build (Requested by rniwa on #webkit). 9 10 * ForwardingHeaders/heap/AllocationSpace.h: Removed. 11 1 12 2011-09-19 James Robinson <jamesr@chromium.org> 2 13
Note: See TracChangeset
for help on using the changeset viewer.