#define APIShims_h
#include "CallFrame.h"
+#include "GCActivityCallback.h"
#include "JSLock.h"
+#include <wtf/WTFThreadData.h>
namespace JSC {
protected:
APIEntryShimWithoutLock(JSGlobalData* globalData, bool registerThread)
: m_globalData(globalData)
- , m_entryIdentifierTable(setCurrentIdentifierTable(globalData->identifierTable))
+ , m_entryIdentifierTable(wtfThreadData().setCurrentIdentifierTable(globalData->identifierTable))
{
+ UNUSED_PARAM(registerThread);
+#if ENABLE(JSC_MULTIPLE_THREADS)
if (registerThread)
- globalData->heap.registerThread();
+ globalData->heap.machineThreads().addCurrentThread();
+#endif
+ m_globalData->heap.activityCallback()->synchronize();
m_globalData->timeoutChecker.start();
}
~APIEntryShimWithoutLock()
{
m_globalData->timeoutChecker.stop();
- setCurrentIdentifierTable(m_entryIdentifierTable);
+ wtfThreadData().setCurrentIdentifierTable(m_entryIdentifierTable);
}
private:
// JSPropertyNameAccumulator only has a globalData.
APIEntryShim(JSGlobalData* globalData, bool registerThread = true)
: APIEntryShimWithoutLock(globalData, registerThread)
- , m_lock(globalData->isSharedInstance ? LockForReal : SilenceAssertionsOnly)
+ , m_lock(globalData->isSharedInstance() ? LockForReal : SilenceAssertionsOnly)
{
}
: m_dropAllLocks(exec)
, m_globalData(&exec->globalData())
{
- resetCurrentIdentifierTable();
- m_globalData->timeoutChecker.start();
+ wtfThreadData().resetCurrentIdentifierTable();
}
~APICallbackShim()
{
- m_globalData->timeoutChecker.stop();
- setCurrentIdentifierTable(m_globalData->identifierTable);
+ m_globalData->heap.activityCallback()->synchronize();
+ wtfThreadData().setCurrentIdentifierTable(m_globalData->identifierTable);
}
private: