diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
commit | 32761a6cee1d0dee366b885b7b9c777e67885688 (patch) | |
tree | d6bec92bebfb216f4126356e55518842c2f476a1 /Source/JavaScriptCore/runtime/JSMap.cpp | |
parent | a4e969f4965059196ca948db781e52f7cfebf19e (diff) | |
download | WebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz |
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSMap.cpp')
-rw-r--r-- | Source/JavaScriptCore/runtime/JSMap.cpp | 63 |
1 files changed, 8 insertions, 55 deletions
diff --git a/Source/JavaScriptCore/runtime/JSMap.cpp b/Source/JavaScriptCore/runtime/JSMap.cpp index 0f4e69941..048641441 100644 --- a/Source/JavaScriptCore/runtime/JSMap.cpp +++ b/Source/JavaScriptCore/runtime/JSMap.cpp @@ -26,73 +26,26 @@ #include "config.h" #include "JSMap.h" -#include "CopiedBlockInlines.h" #include "JSCJSValueInlines.h" -#include "JSMapIterator.h" -#include "MapDataInlines.h" +#include "MapData.h" #include "SlotVisitorInlines.h" -#include "StructureInlines.h" namespace JSC { - -const ClassInfo JSMap::s_info = { "Map", &Base::s_info, 0, CREATE_METHOD_TABLE(JSMap) }; - -void JSMap::destroy(JSCell* cell) -{ - JSMap* thisObject = jsCast<JSMap*>(cell); - thisObject->JSMap::~JSMap(); -} - -size_t JSMap::estimatedSize(JSCell* cell) -{ - JSMap* thisObject = jsCast<JSMap*>(cell); - size_t mapDataSize = thisObject->m_mapData.capacityInBytes(); - return Base::estimatedSize(cell) + mapDataSize; -} + +const ClassInfo JSMap::s_info = { "Map", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSMap) }; void JSMap::visitChildren(JSCell* cell, SlotVisitor& visitor) { Base::visitChildren(cell, visitor); - jsCast<JSMap*>(cell)->m_mapData.visitChildren(cell, visitor); -} - -void JSMap::copyBackingStore(JSCell* cell, CopyVisitor& visitor, CopyToken token) -{ - Base::copyBackingStore(cell, visitor, token); - jsCast<JSMap*>(cell)->m_mapData.copyBackingStore(visitor, token); -} - -bool JSMap::has(ExecState* exec, JSValue key) -{ - return m_mapData.contains(exec, key); -} - -size_t JSMap::size(ExecState* exec) -{ - return m_mapData.size(exec); -} - -JSValue JSMap::get(ExecState* exec, JSValue key) -{ - JSValue result = m_mapData.get(exec, key); - if (!result) - return jsUndefined(); - return result; -} - -void JSMap::set(ExecState* exec, JSValue key, JSValue value) -{ - m_mapData.set(exec, this, key, value); + JSMap* thisObject = jsCast<JSMap*>(cell); + visitor.append(&thisObject->m_mapData); } -void JSMap::clear(ExecState*) +void JSMap::finishCreation(VM& vm) { - m_mapData.clear(); + Base::finishCreation(vm); + m_mapData.set(vm, this, MapData::create(vm)); } -bool JSMap::remove(ExecState* exec, JSValue key) -{ - return m_mapData.remove(exec, key); -} } |