diff options
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSMap.cpp')
| -rw-r--r-- | Source/JavaScriptCore/runtime/JSMap.cpp | 55 |
1 files changed, 8 insertions, 47 deletions
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<JSMap*>(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<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); -} } |
