From a4e969f4965059196ca948db781e52f7cfebf19e Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 24 May 2016 08:28:08 +0000 Subject: webkitgtk-2.12.3 --- Source/JavaScriptCore/runtime/WeakMapData.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'Source/JavaScriptCore/runtime/WeakMapData.cpp') diff --git a/Source/JavaScriptCore/runtime/WeakMapData.cpp b/Source/JavaScriptCore/runtime/WeakMapData.cpp index 224be8a46..1332e8e06 100644 --- a/Source/JavaScriptCore/runtime/WeakMapData.cpp +++ b/Source/JavaScriptCore/runtime/WeakMapData.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2013, 2015 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -36,7 +36,7 @@ namespace JSC { -const ClassInfo WeakMapData::s_info = { "WeakMapData", 0, 0, 0, CREATE_METHOD_TABLE(WeakMapData) }; +const ClassInfo WeakMapData::s_info = { "WeakMapData", 0, 0, CREATE_METHOD_TABLE(WeakMapData) }; WeakMapData::WeakMapData(VM& vm) : Base(vm, vm.weakMapDataStructure.get()) @@ -54,6 +54,12 @@ void WeakMapData::destroy(JSCell* cell) static_cast(cell)->~WeakMapData(); } +size_t WeakMapData::estimatedSize(JSCell* cell) +{ + WeakMapData* thisObj = jsCast(cell); + return Base::estimatedSize(cell) + (thisObj->m_map.capacity() * (sizeof(JSObject*) + sizeof(WriteBarrier))); +} + void WeakMapData::visitChildren(JSCell* cell, SlotVisitor& visitor) { Base::visitChildren(cell, visitor); @@ -63,8 +69,8 @@ void WeakMapData::visitChildren(JSCell* cell, SlotVisitor& visitor) // Rough approximation of the external storage needed for the hashtable. // This isn't exact, but it is close enough, and proportional to the actual - // external mermory usage. - visitor.reportExtraMemoryUsage(thisObj, thisObj->m_map.capacity() * (sizeof(JSObject*) + sizeof(WriteBarrier))); + // external memory usage. + visitor.reportExtraMemoryVisited(thisObj->m_map.capacity() * (sizeof(JSObject*) + sizeof(WriteBarrier))); } void WeakMapData::set(VM& vm, JSObject* key, JSValue value) -- cgit v1.2.1