summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/JSSet.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/runtime/JSSet.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSSet.h')
-rw-r--r--Source/JavaScriptCore/runtime/JSSet.h39
1 files changed, 15 insertions, 24 deletions
diff --git a/Source/JavaScriptCore/runtime/JSSet.h b/Source/JavaScriptCore/runtime/JSSet.h
index 22c5d860b..e356a7af7 100644
--- a/Source/JavaScriptCore/runtime/JSSet.h
+++ b/Source/JavaScriptCore/runtime/JSSet.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013, 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,56 +23,47 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef JSSet_h
-#define JSSet_h
+#pragma once
#include "JSObject.h"
+#include "MapBase.h"
namespace JSC {
-class MapData;
+class JSSetIterator;
-class JSSet : public JSNonFinalObject {
+class JSSet : public MapBase<HashMapBucket<HashMapBucketDataKey>> {
+ typedef MapBase<HashMapBucket<HashMapBucketDataKey>> Base;
public:
- typedef JSNonFinalObject Base;
+
+ friend class JSSetIterator;
DECLARE_EXPORT_INFO;
static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
{
- return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+ return Structure::create(vm, globalObject, prototype, TypeInfo(JSSetType, StructureFlags), info());
}
- static JSSet* create(VM& vm, Structure* structure)
+ static JSSet* create(ExecState* exec, VM& vm, Structure* structure)
{
JSSet* instance = new (NotNull, allocateCell<JSSet>(vm.heap)) JSSet(vm, structure);
- instance->finishCreation(vm);
+ instance->finishCreation(exec, vm);
return instance;
}
- static JSSet* create(ExecState* exec, Structure* structure)
+ ALWAYS_INLINE void add(ExecState* exec, JSValue key)
{
- return create(exec->vm(), structure);
+ m_map->add(exec, key);
}
- MapData* mapData() { return m_mapData.get(); }
-
private:
-
- static const unsigned StructureFlags = OverridesVisitChildren | Base::StructureFlags;
-
JSSet(VM& vm, Structure* structure)
: Base(vm, structure)
{
}
- JS_EXPORT_PRIVATE void finishCreation(VM&);
-
- static void visitChildren(JSCell*, SlotVisitor&);
-
- WriteBarrier<MapData> m_mapData;
+ static String toStringName(const JSObject*, ExecState*);
};
-}
-
-#endif // !defined(JSSet_h)
+} // namespace JSC