From 41386e9cb918eed93b3f13648cbef387e371e451 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Wed, 20 May 2015 09:56:07 +0000 Subject: webkitgtk-2.4.9 --- Source/JavaScriptCore/runtime/JSMap.cpp | 55 +++++---------------------------- 1 file changed, 8 insertions(+), 47 deletions(-) (limited to 'Source/JavaScriptCore/runtime/JSMap.cpp') diff --git a/Source/JavaScriptCore/runtime/JSMap.cpp b/Source/JavaScriptCore/runtime/JSMap.cpp index 352648b5e..048641441 100644 --- a/Source/JavaScriptCore/runtime/JSMap.cpp +++ b/Source/JavaScriptCore/runtime/JSMap.cpp @@ -27,64 +27,25 @@ #include "JSMap.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(cell); - thisObject->JSMap::~JSMap(); -} + +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(cell)->m_mapData.visitChildren(cell, visitor); -} - -void JSMap::copyBackingStore(JSCell* cell, CopyVisitor& visitor, CopyToken token) -{ - Base::copyBackingStore(cell, visitor, token); - jsCast(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(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); -} } -- cgit v1.2.1