summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2016-08-25 19:20:41 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2017-02-02 12:30:55 +0000
commit6882a04fb36642862b11efe514251d32070c3d65 (patch)
treeb7959826000b061fd5ccc7512035c7478742f7b0 /Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
parentab6df191029eeeb0b0f16f127d553265659f739e (diff)
downloadqtwebkit-6882a04fb36642862b11efe514251d32070c3d65.tar.gz
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp')
-rw-r--r--Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp b/Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
index 8cbe263a7..925c00f0b 100644
--- a/Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
+++ b/Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
@@ -27,12 +27,12 @@
#include "JSWeakObjectMapRefPrivate.h"
#include "APICast.h"
-#include "APIShims.h"
#include "JSCJSValue.h"
#include "JSCallbackObject.h"
#include "JSWeakObjectMapRefInternal.h"
-#include "Operations.h"
+#include "JSCInlines.h"
#include "Weak.h"
+#include "WeakGCMapInlines.h"
#include <wtf/HashMap.h>
#include <wtf/text/StringHash.h>
@@ -46,8 +46,8 @@ extern "C" {
JSWeakObjectMapRef JSWeakObjectMapCreate(JSContextRef context, void* privateData, JSWeakMapDestroyedCallback callback)
{
ExecState* exec = toJS(context);
- APIEntryShim entryShim(exec);
- RefPtr<OpaqueJSWeakObjectMap> map = OpaqueJSWeakObjectMap::create(privateData, callback);
+ JSLockHolder locker(exec);
+ RefPtr<OpaqueJSWeakObjectMap> map = OpaqueJSWeakObjectMap::create(exec->vm(), privateData, callback);
exec->lexicalGlobalObject()->registerWeakMap(map.get());
return map.get();
}
@@ -59,11 +59,13 @@ void JSWeakObjectMapSet(JSContextRef ctx, JSWeakObjectMapRef map, void* key, JSO
return;
}
ExecState* exec = toJS(ctx);
- APIEntryShim entryShim(exec);
+ JSLockHolder locker(exec);
JSObject* obj = toJS(object);
if (!obj)
return;
- ASSERT(obj->inherits(&JSCallbackObject<JSGlobalObject>::s_info) || obj->inherits(&JSCallbackObject<JSDestructibleObject>::s_info));
+ ASSERT(obj->inherits(JSProxy::info())
+ || obj->inherits(JSCallbackObject<JSGlobalObject>::info())
+ || obj->inherits(JSCallbackObject<JSDestructibleObject>::info()));
map->map().set(key, obj);
}
@@ -74,7 +76,7 @@ JSObjectRef JSWeakObjectMapGet(JSContextRef ctx, JSWeakObjectMapRef map, void* k
return 0;
}
ExecState* exec = toJS(ctx);
- APIEntryShim entryShim(exec);
+ JSLockHolder locker(exec);
return toRef(jsCast<JSObject*>(map->map().get(key)));
}
@@ -85,7 +87,7 @@ void JSWeakObjectMapRemove(JSContextRef ctx, JSWeakObjectMapRef map, void* key)
return;
}
ExecState* exec = toJS(ctx);
- APIEntryShim entryShim(exec);
+ JSLockHolder locker(exec);
map->map().remove(key);
}