Changeset 51624 in webkit for trunk/JavaScriptCore/runtime
- Timestamp:
- Dec 2, 2009, 10:25:58 PM (15 years ago)
- Location:
- trunk/JavaScriptCore/runtime
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/ArgList.h
r48067 r51624 105 105 { 106 106 ASSERT(!m_isReadOnly); 107 107 108 #if ENABLE(JSC_ZOMBIES) 109 ASSERT(!v.isZombie()); 110 #endif 111 108 112 if (m_isUsingInlineBuffer && m_size < inlineCapacity) { 109 113 m_vector.uncheckedAppend(v); … … 188 192 , m_argCount(argCount) 189 193 { 194 #if ENABLE(JSC_ZOMBIES) 195 for (size_t i = 0; i < argCount; i++) 196 ASSERT(!m_args[i].isZombie()); 197 #endif 190 198 } 191 199 -
trunk/JavaScriptCore/runtime/Collector.cpp
r50833 r51624 33 33 #include "JSString.h" 34 34 #include "JSValue.h" 35 #include "JSZombie.h" 35 36 #include "MarkStack.h" 36 37 #include "Nodes.h" … … 195 196 sweep<PrimaryHeap>(); 196 197 // No need to sweep number heap, because the JSNumber destructor doesn't do anything. 197 198 #if ENABLE(JSC_ZOMBIES) 199 ASSERT(primaryHeap.numLiveObjects == primaryHeap.numZombies); 200 #else 198 201 ASSERT(!primaryHeap.numLiveObjects); 199 202 #endif 200 203 freeBlocks(&primaryHeap); 201 204 freeBlocks(&numberHeap); … … 1037 1040 if (cell->u.freeCell.zeroIfFree == 0) 1038 1041 continue; 1039 1042 #if ENABLE(JSC_ZOMBIES) 1043 if (!imp->isZombie()) { 1044 const ClassInfo* info = imp->classInfo(); 1045 imp->~JSCell(); 1046 new (imp) JSZombie(info, JSZombie::leakedZombieStructure()); 1047 heap.numZombies++; 1048 } 1049 #else 1040 1050 imp->~JSCell(); 1051 #endif 1041 1052 } 1042 1053 --numLiveObjects; 1054 #if !ENABLE(JSC_ZOMBIES) 1043 1055 --usedCells; 1044 --numLiveObjects;1045 1056 1046 1057 // put cell on the free list … … 1048 1059 cell->u.freeCell.next = freeList - (cell + 1); 1049 1060 freeList = cell; 1061 #endif 1050 1062 } 1051 1063 } … … 1060 1072 if (heapType != NumberHeap) { 1061 1073 JSCell* imp = reinterpret_cast<JSCell*>(cell); 1074 #if ENABLE(JSC_ZOMBIES) 1075 if (!imp->isZombie()) { 1076 const ClassInfo* info = imp->classInfo(); 1077 imp->~JSCell(); 1078 new (imp) JSZombie(info, JSZombie::leakedZombieStructure()); 1079 heap.numZombies++; 1080 } 1081 #else 1062 1082 imp->~JSCell(); 1083 #endif 1063 1084 } 1085 #if !ENABLE(JSC_ZOMBIES) 1064 1086 --usedCells; 1065 1087 --numLiveObjects; … … 1069 1091 cell->u.freeCell.next = freeList - (cell + 1); 1070 1092 freeList = cell; 1093 #endif 1071 1094 } 1072 1095 } -
trunk/JavaScriptCore/runtime/Collector.h
r49365 r51624 61 61 size_t numLiveObjectsAtLastCollect; 62 62 size_t extraCost; 63 #if ENABLE(JSC_ZOMBIES) 64 size_t numZombies; 65 #endif 63 66 64 67 OperationInProgress operationInProgress; -
trunk/JavaScriptCore/runtime/JSCell.h
r49955 r51624 43 43 friend class JSValue; 44 44 friend class JSAPIValueWrapper; 45 friend class JSZombie; 45 46 friend struct VPtrSet; 46 47 … … 91 92 92 93 virtual void markChildren(MarkStack&); 94 #if ENABLE(JSC_ZOMBIES) 95 virtual bool isZombie() const { return false; } 96 #endif 93 97 94 98 // Object operations, with the toObject operation included. … … 343 347 return cellBlock(c)->heap; 344 348 } 345 349 350 #if ENABLE(JSC_ZOMBIES) 351 inline bool JSValue::isZombie() const 352 { 353 return isCell() && asCell() && asCell()->isZombie(); 354 } 355 #endif 346 356 } // namespace JSC 347 357 -
trunk/JavaScriptCore/runtime/JSValue.h
r51334 r51624 169 169 uint32_t toUInt32(ExecState*, bool& ok) const; 170 170 171 #if ENABLE(JSC_ZOMBIES) 172 bool isZombie() const; 173 #endif 174 171 175 // Floating point conversions (this is a convenience method for webcore; 172 176 // signle precision float is not a representation used in JS or JSC). … … 439 443 JSValue v; 440 444 v.u.asEncodedJSValue = encodedJSValue; 445 #if ENABLE(JSC_ZOMBIES) 446 ASSERT(!v.isZombie()); 447 #endif 441 448 return v; 442 449 } … … 485 492 u.asBits.tag = EmptyValueTag; 486 493 u.asBits.payload = reinterpret_cast<int32_t>(ptr); 494 #if ENABLE(JSC_ZOMBIES) 495 ASSERT(!isZombie()); 496 #endif 487 497 } 488 498 … … 494 504 u.asBits.tag = EmptyValueTag; 495 505 u.asBits.payload = reinterpret_cast<int32_t>(const_cast<JSCell*>(ptr)); 506 #if ENABLE(JSC_ZOMBIES) 507 ASSERT(!isZombie()); 508 #endif 496 509 } 497 510 … … 794 807 : m_ptr(ptr) 795 808 { 809 #if ENABLE(JSC_ZOMBIES) 810 ASSERT(!isZombie()); 811 #endif 796 812 } 797 813 … … 799 815 : m_ptr(const_cast<JSCell*>(ptr)) 800 816 { 817 #if ENABLE(JSC_ZOMBIES) 818 ASSERT(!isZombie()); 819 #endif 801 820 } 802 821
Note:
See TracChangeset
for help on using the changeset viewer.