Changeset 197379 in webkit for trunk/Source/JavaScriptCore/runtime
- Timestamp:
- Feb 29, 2016, 6:07:12 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore/runtime
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/ClassInfo.h
r194175 r197379 106 106 typedef void (*DumpToStreamFunctionPtr)(const JSCell*, PrintStream&); 107 107 DumpToStreamFunctionPtr dumpToStream; 108 109 typedef size_t (*EstimatedSizeFunctionPtr)(JSCell*); 110 EstimatedSizeFunctionPtr estimatedSize; 108 111 }; 109 112 … … 152 155 &ClassName::slowDownAndWasteMemory, \ 153 156 &ClassName::getTypedArrayImpl, \ 154 &ClassName::dumpToStream \ 157 &ClassName::dumpToStream, \ 158 &ClassName::estimatedSize \ 155 159 }, \ 156 160 ClassName::TypedArrayStorageType -
trunk/Source/JavaScriptCore/runtime/DirectArguments.cpp
r190896 r197379 84 84 85 85 return result; 86 } 87 88 size_t DirectArguments::estimatedSize(JSCell* cell) 89 { 90 DirectArguments* thisObject = jsCast<DirectArguments*>(cell); 91 size_t overridesSize = thisObject->m_overrides ? thisObject->overridesSize() : 0; 92 return Base::estimatedSize(cell) + overridesSize; 86 93 } 87 94 -
trunk/Source/JavaScriptCore/runtime/DirectArguments.h
r190896 r197379 56 56 // Creates an arguments object by copying the argumnets from the stack. 57 57 static DirectArguments* createByCopying(ExecState*); 58 58 59 static size_t estimatedSize(JSCell*); 59 60 static void visitChildren(JSCell*, SlotVisitor&); 60 61 static void copyBackingStore(JSCell*, CopyVisitor&, CopyToken); -
trunk/Source/JavaScriptCore/runtime/JSCell.cpp
r179429 r197379 52 52 } 53 53 54 size_t JSCell::estimatedSizeInBytes() const 55 { 56 return methodTable()->estimatedSize(const_cast<JSCell*>(this)); 57 } 58 59 size_t JSCell::estimatedSize(JSCell* cell) 60 { 61 return MarkedBlock::blockFor(cell)->cellSize(); 62 } 63 54 64 void JSCell::copyBackingStore(JSCell*, CopyVisitor&, CopyToken) 55 65 { -
trunk/Source/JavaScriptCore/runtime/JSCell.h
r190569 r197379 135 135 void dump(PrintStream&) const; 136 136 JS_EXPORT_PRIVATE static void dumpToStream(const JSCell*, PrintStream&); 137 138 size_t estimatedSizeInBytes() const; 139 JS_EXPORT_PRIVATE static size_t estimatedSize(JSCell*); 140 137 141 static void visitChildren(JSCell*, SlotVisitor&); 138 142 JS_EXPORT_PRIVATE static void copyBackingStore(JSCell*, CopyVisitor&, CopyToken); -
trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h
r197192 r197379 284 284 285 285 static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); 286 286 287 static size_t estimatedSize(JSCell*); 287 288 static void visitChildren(JSCell*, SlotVisitor&); 288 289 static void copyBackingStore(JSCell*, CopyVisitor&, CopyToken); -
trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h
r197192 r197379 407 407 408 408 template<typename Adaptor> 409 size_t JSGenericTypedArrayView<Adaptor>::estimatedSize(JSCell* cell) 410 { 411 JSGenericTypedArrayView* thisObject = jsCast<JSGenericTypedArrayView*>(cell); 412 413 if (thisObject->m_mode == OversizeTypedArray) 414 return Base::estimatedSize(thisObject) + thisObject->byteSize(); 415 if (thisObject->m_mode == FastTypedArray && thisObject->m_vector) 416 return Base::estimatedSize(thisObject) + thisObject->byteSize(); 417 418 return Base::estimatedSize(thisObject); 419 } 420 421 template<typename Adaptor> 409 422 void JSGenericTypedArrayView<Adaptor>::visitChildren(JSCell* cell, SlotVisitor& visitor) 410 423 { -
trunk/Source/JavaScriptCore/runtime/JSMap.cpp
r190563 r197379 42 42 JSMap* thisObject = jsCast<JSMap*>(cell); 43 43 thisObject->JSMap::~JSMap(); 44 } 45 46 size_t JSMap::estimatedSize(JSCell* cell) 47 { 48 JSMap* thisObject = jsCast<JSMap*>(cell); 49 size_t mapDataSize = thisObject->m_mapData.capacityInBytes(); 50 return Base::estimatedSize(cell) + mapDataSize; 44 51 } 45 52 -
trunk/Source/JavaScriptCore/runtime/JSMap.h
r190896 r197379 123 123 124 124 static void destroy(JSCell*); 125 static size_t estimatedSize(JSCell*); 125 126 static void visitChildren(JSCell*, SlotVisitor&); 126 127 static void copyBackingStore(JSCell*, CopyVisitor&, CopyToken); -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r197144 r197379 196 196 break; 197 197 } 198 } 199 200 size_t JSObject::estimatedSize(JSCell* cell) 201 { 202 JSObject* thisObject = jsCast<JSObject*>(cell); 203 size_t butterflyOutOfLineSize = thisObject->m_butterfly ? thisObject->structure()->outOfLineSize() : 0; 204 return Base::estimatedSize(cell) + butterflyOutOfLineSize; 198 205 } 199 206 -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r197144 r197379 95 95 public: 96 96 typedef JSCell Base; 97 97 98 JS_EXPORT_PRIVATE static size_t estimatedSize(JSCell*); 98 99 JS_EXPORT_PRIVATE static void visitChildren(JSCell*, SlotVisitor&); 99 100 JS_EXPORT_PRIVATE static void copyBackingStore(JSCell*, CopyVisitor&, CopyToken); -
trunk/Source/JavaScriptCore/runtime/JSSet.cpp
r190563 r197379 44 44 } 45 45 46 size_t JSSet::estimatedSize(JSCell* cell) 47 { 48 JSSet* thisObject = jsCast<JSSet*>(cell); 49 size_t setDataSize = thisObject->m_setData.capacityInBytes(); 50 return Base::estimatedSize(cell) + setDataSize; 51 } 52 46 53 void JSSet::visitChildren(JSCell* cell, SlotVisitor& visitor) 47 54 { -
trunk/Source/JavaScriptCore/runtime/JSSet.h
r190896 r197379 118 118 119 119 static void destroy(JSCell*); 120 static size_t estimatedSize(JSCell*); 120 121 static void visitChildren(JSCell*, SlotVisitor&); 121 122 static void copyBackingStore(JSCell*, CopyVisitor&, CopyToken); -
trunk/Source/JavaScriptCore/runtime/JSString.cpp
r196761 r197379 73 73 } 74 74 75 size_t JSString::estimatedSize(JSCell* cell) 76 { 77 JSString* thisObject = jsCast<JSString*>(cell); 78 if (thisObject->isRope()) 79 return Base::estimatedSize(cell); 80 return Base::estimatedSize(cell) + thisObject->m_value.impl()->costDuringGC(); 81 } 82 75 83 void JSString::visitChildren(JSCell* cell, SlotVisitor& visitor) 76 84 { -
trunk/Source/JavaScriptCore/runtime/JSString.h
r196810 r197379 182 182 183 183 static void dumpToStream(const JSCell*, PrintStream&); 184 static size_t estimatedSize(JSCell*); 184 185 static void visitChildren(JSCell*, SlotVisitor&); 185 186 -
trunk/Source/JavaScriptCore/runtime/MapData.h
r196108 r197379 112 112 void copyBackingStore(CopyVisitor&, CopyToken); 113 113 114 size_t capacityInBytes() const { return m_capacity * sizeof(Entry); } 115 114 116 private: 115 117 typedef WTF::UnsignedWithZeroKeyHashTraits<int32_t> IndexTraits; … … 119 121 typedef HashMap<StringImpl*, int32_t, typename WTF::DefaultHash<StringImpl*>::Hash, WTF::HashTraits<StringImpl*>, IndexTraits> StringKeyedMap; 120 122 typedef HashMap<SymbolImpl*, int32_t, typename WTF::PtrHash<SymbolImpl*>, WTF::HashTraits<SymbolImpl*>, IndexTraits> SymbolKeyedMap; 121 122 size_t capacityInBytes() { return m_capacity * sizeof(Entry); }123 123 124 124 ALWAYS_INLINE Entry* find(ExecState*, KeyType); -
trunk/Source/JavaScriptCore/runtime/RegExp.cpp
r188394 r197379 257 257 } 258 258 259 size_t RegExp::estimatedSize(JSCell* cell) 260 { 261 RegExp* thisObject = static_cast<RegExp*>(cell); 262 size_t regexDataSize = thisObject->m_regExpBytecode ? thisObject->m_regExpBytecode->estimatedSizeInBytes() : 0; 263 #if ENABLE(YARR_JIT) 264 regexDataSize += thisObject->m_regExpJITCode.size(); 265 #endif 266 return Base::estimatedSize(cell) + regexDataSize; 267 } 268 259 269 RegExp* RegExp::createWithoutCaching(VM& vm, const String& patternString, RegExpFlags flags) 260 270 { -
trunk/Source/JavaScriptCore/runtime/RegExp.h
r188394 r197379 51 51 static const bool needsDestruction = true; 52 52 static void destroy(JSCell*); 53 static size_t estimatedSize(JSCell*); 53 54 54 55 bool global() const { return m_flags & FlagGlobal; } -
trunk/Source/JavaScriptCore/runtime/WeakMapData.cpp
r190569 r197379 55 55 } 56 56 57 size_t WeakMapData::estimatedSize(JSCell* cell) 58 { 59 WeakMapData* thisObj = jsCast<WeakMapData*>(cell); 60 return Base::estimatedSize(cell) + (thisObj->m_map.capacity() * (sizeof(JSObject*) + sizeof(WriteBarrier<Unknown>))); 61 } 62 57 63 void WeakMapData::visitChildren(JSCell* cell, SlotVisitor& visitor) 58 64 { … … 64 70 // Rough approximation of the external storage needed for the hashtable. 65 71 // This isn't exact, but it is close enough, and proportional to the actual 66 // external me rmory usage.72 // external memory usage. 67 73 visitor.reportExtraMemoryVisited(thisObj->m_map.capacity() * (sizeof(JSObject*) + sizeof(WriteBarrier<Unknown>))); 68 74 } -
trunk/Source/JavaScriptCore/runtime/WeakMapData.h
r182747 r197379 71 71 WeakMapData(VM&); 72 72 static void destroy(JSCell*); 73 static size_t estimatedSize(JSCell*); 73 74 static void visitChildren(JSCell*, SlotVisitor&); 74 75 void finishCreation(VM&);
Note:
See TracChangeset
for help on using the changeset viewer.