Changeset 205507 in webkit for trunk/Source/JavaScriptCore/runtime/JSSet.cpp
- Timestamp:
- Sep 6, 2016, 2:35:24 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSSet.cpp
r205504 r205507 1 1 /* 2 * Copyright (C) 2013 , 2016Apple Inc. All rights reserved.2 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 27 27 #include "JSSet.h" 28 28 29 #include "JSCInlines.h" 29 #include "CopiedBlockInlines.h" 30 #include "JSCJSValueInlines.h" 31 #include "JSSetIterator.h" 32 #include "MapDataInlines.h" 33 #include "SlotVisitorInlines.h" 34 #include "StructureInlines.h" 30 35 31 36 namespace JSC { 32 37 33 38 const ClassInfo JSSet::s_info = { "Set", &Base::s_info, 0, CREATE_METHOD_TABLE(JSSet) }; 39 40 void JSSet::destroy(JSCell* cell) 41 { 42 JSSet* thisObject = jsCast<JSSet*>(cell); 43 thisObject->JSSet::~JSSet(); 44 } 34 45 35 46 String JSSet::toStringName(const JSObject*, ExecState*) … … 38 49 } 39 50 51 size_t JSSet::estimatedSize(JSCell* cell) 52 { 53 JSSet* thisObject = jsCast<JSSet*>(cell); 54 size_t setDataSize = thisObject->m_setData.capacityInBytes(); 55 return Base::estimatedSize(cell) + setDataSize; 40 56 } 57 58 void JSSet::visitChildren(JSCell* cell, SlotVisitor& visitor) 59 { 60 Base::visitChildren(cell, visitor); 61 jsCast<JSSet*>(cell)->m_setData.visitChildren(cell, visitor); 62 } 63 64 void JSSet::copyBackingStore(JSCell* cell, CopyVisitor& visitor, CopyToken token) 65 { 66 Base::copyBackingStore(cell, visitor, token); 67 jsCast<JSSet*>(cell)->m_setData.copyBackingStore(visitor, token); 68 } 69 70 bool JSSet::has(ExecState* exec, JSValue value) 71 { 72 return m_setData.contains(exec, value); 73 } 74 75 size_t JSSet::size(ExecState* exec) 76 { 77 return m_setData.size(exec); 78 } 79 80 void JSSet::add(ExecState* exec, JSValue value) 81 { 82 m_setData.set(exec, this, value, value); 83 } 84 85 void JSSet::clear(ExecState*) 86 { 87 m_setData.clear(); 88 } 89 90 bool JSSet::remove(ExecState* exec, JSValue value) 91 { 92 return m_setData.remove(exec, value); 93 } 94 95 }
Note:
See TracChangeset
for help on using the changeset viewer.