Diff
Modified: trunk/Source/_javascript_Core/API/APIShims.h (164666 => 164667)
--- trunk/Source/_javascript_Core/API/APIShims.h 2014-02-25 21:10:14 UTC (rev 164666)
+++ trunk/Source/_javascript_Core/API/APIShims.h 2014-02-25 21:18:39 UTC (rev 164667)
@@ -58,13 +58,13 @@
public:
APIEntryShim(ExecState* exec, bool registerThread = true)
: APIEntryShimWithoutLock(&exec->vm(), registerThread)
- , m_lockHolder(&exec->vm())
+ , m_lockHolder(exec->vm().exclusiveThread ? 0 : exec)
{
}
APIEntryShim(VM* vm, bool registerThread = true)
: APIEntryShimWithoutLock(vm, registerThread)
- , m_lockHolder(vm)
+ , m_lockHolder(vm->exclusiveThread ? 0 : vm)
{
}
@@ -102,6 +102,9 @@
private:
static bool shouldDropAllLocks(VM& vm)
{
+ if (vm.exclusiveThread)
+ return false;
+
// If the VM is in the middle of being destroyed then we don't want to resurrect it
// by allowing DropAllLocks to ref it. By this point the APILock has already been
// released anyways, so it doesn't matter that DropAllLocks is a no-op.
Modified: trunk/Source/_javascript_Core/ChangeLog (164666 => 164667)
--- trunk/Source/_javascript_Core/ChangeLog 2014-02-25 21:10:14 UTC (rev 164666)
+++ trunk/Source/_javascript_Core/ChangeLog 2014-02-25 21:18:39 UTC (rev 164667)
@@ -1,3 +1,32 @@
+2014-02-25 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r164627.
+ http://trac.webkit.org/changeset/164627
+ https://bugs.webkit.org/show_bug.cgi?id=129325
+
+ Broke SubtleCrypto tests (Requested by ap on #webkit).
+
+ * API/APIShims.h:
+ (JSC::APIEntryShim::APIEntryShim):
+ (JSC::APICallbackShim::shouldDropAllLocks):
+ * heap/MachineStackMarker.cpp:
+ (JSC::MachineThreads::addCurrentThread):
+ * runtime/JSLock.cpp:
+ (JSC::JSLockHolder::JSLockHolder):
+ (JSC::JSLockHolder::init):
+ (JSC::JSLockHolder::~JSLockHolder):
+ (JSC::JSLock::JSLock):
+ (JSC::JSLock::lock):
+ (JSC::JSLock::unlock):
+ (JSC::JSLock::currentThreadIsHoldingLock):
+ (JSC::JSLock::dropAllLocks):
+ (JSC::JSLock::grabAllLocks):
+ * runtime/JSLock.h:
+ * runtime/VM.cpp:
+ (JSC::VM::VM):
+ * runtime/VM.h:
+ (JSC::VM::currentThreadIsHoldingAPILock):
+
2014-02-25 Filip Pizlo <[email protected]>
ARM64 rshift64 should be an arithmetic shift
Modified: trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp (164666 => 164667)
--- trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp 2014-02-25 21:10:14 UTC (rev 164666)
+++ trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp 2014-02-25 21:18:39 UTC (rev 164667)
@@ -182,7 +182,7 @@
void MachineThreads::addCurrentThread()
{
- ASSERT(!m_heap->vm()->hasExclusiveThread() || m_heap->vm()->exclusiveThread() == std::this_thread::get_id());
+ ASSERT(!m_heap->vm()->exclusiveThread || m_heap->vm()->exclusiveThread == currentThread());
if (!m_threadSpecific || threadSpecificGet(m_threadSpecific))
return;
Modified: trunk/Source/_javascript_Core/runtime/JSLock.cpp (164666 => 164667)
--- trunk/Source/_javascript_Core/runtime/JSLock.cpp 2014-02-25 21:10:14 UTC (rev 164666)
+++ trunk/Source/_javascript_Core/runtime/JSLock.cpp 2014-02-25 21:18:39 UTC (rev 164667)
@@ -50,7 +50,7 @@
}
JSLockHolder::JSLockHolder(ExecState* exec)
- : m_vm(&exec->vm())
+ : m_vm(exec ? &exec->vm() : 0)
{
init();
}
@@ -69,21 +69,23 @@
void JSLockHolder::init()
{
- m_vm->apiLock().lock();
+ if (m_vm)
+ m_vm->apiLock().lock();
}
JSLockHolder::~JSLockHolder()
{
+ if (!m_vm)
+ return;
+
RefPtr<JSLock> apiLock(&m_vm->apiLock());
m_vm.clear();
apiLock->unlock();
}
JSLock::JSLock(VM* vm)
- : m_ownerThreadID(std::thread::id())
- , m_lockCount(0)
+ : m_lockCount(0)
, m_lockDropDepth(0)
- , m_hasExclusiveThread(false)
, m_vm(vm)
{
}
@@ -98,13 +100,6 @@
m_vm = 0;
}
-void JSLock::setExclusiveThread(std::thread::id threadId)
-{
- RELEASE_ASSERT(!m_lockCount && m_ownerThreadID == std::thread::id());
- m_hasExclusiveThread = (threadId != std::thread::id());
- m_ownerThreadID = threadId;
-}
-
void JSLock::lock()
{
lock(1);
@@ -118,21 +113,21 @@
return;
}
- if (!m_hasExclusiveThread) {
- m_lock.lock();
- m_ownerThreadID = std::this_thread::get_id();
- }
+ m_lock.lock();
+
+ m_ownerThreadID = std::this_thread::get_id();
ASSERT(!m_lockCount);
m_lockCount = lockCount;
if (!m_vm)
return;
+ WTFThreadData& threadData = wtfThreadData();
+
RELEASE_ASSERT(!m_vm->stackPointerAtVMEntry());
void* p = &p; // A proxy for the current stack pointer.
m_vm->setStackPointerAtVMEntry(p);
- WTFThreadData& threadData = wtfThreadData();
m_vm->setLastStackTop(threadData.savedLastStackTop());
}
@@ -151,11 +146,8 @@
if (!m_lockCount) {
if (m_vm)
m_vm->setStackPointerAtVMEntry(nullptr);
-
- if (!m_hasExclusiveThread) {
- m_ownerThreadID = std::thread::id();
- m_lock.unlock();
- }
+ m_ownerThreadID = std::thread::id();
+ m_lock.unlock();
}
}
@@ -171,20 +163,12 @@
bool JSLock::currentThreadIsHoldingLock()
{
- ASSERT(!m_hasExclusiveThread || (exclusiveThread() == std::this_thread::get_id()));
- if (m_hasExclusiveThread)
- return !!m_lockCount;
return m_ownerThreadID == std::this_thread::get_id();
}
// This function returns the number of locks that were dropped.
unsigned JSLock::dropAllLocks(DropAllLocks* dropper)
{
- if (m_hasExclusiveThread) {
- ASSERT(exclusiveThread() == std::this_thread::get_id());
- return 0;
- }
-
// Check if this thread is currently holding the lock.
// FIXME: Maybe we want to require this, guard with an ASSERT?
if (!currentThreadIsHoldingLock())
@@ -209,8 +193,6 @@
void JSLock::grabAllLocks(DropAllLocks* dropper, unsigned droppedLockCount)
{
- ASSERT(!m_hasExclusiveThread || !droppedLockCount);
-
// If no locks were dropped, nothing to do!
if (!droppedLockCount)
return;
Modified: trunk/Source/_javascript_Core/runtime/JSLock.h (164666 => 164667)
--- trunk/Source/_javascript_Core/runtime/JSLock.h 2014-02-25 21:10:14 UTC (rev 164666)
+++ trunk/Source/_javascript_Core/runtime/JSLock.h 2014-02-25 21:18:39 UTC (rev 164667)
@@ -94,13 +94,6 @@
VM* vm() { return m_vm; }
- bool hasExclusiveThread() const { return m_hasExclusiveThread; }
- std::thread::id exclusiveThread() const
- {
- ASSERT(m_hasExclusiveThread);
- return m_ownerThreadID;
- }
- JS_EXPORT_PRIVATE void setExclusiveThread(std::thread::id);
JS_EXPORT_PRIVATE bool currentThreadIsHoldingLock();
void willDestroyVM(VM*);
@@ -136,7 +129,6 @@
std::thread::id m_ownerThreadID;
intptr_t m_lockCount;
unsigned m_lockDropDepth;
- bool m_hasExclusiveThread;
VM* m_vm;
};
Modified: trunk/Source/_javascript_Core/runtime/VM.cpp (164666 => 164667)
--- trunk/Source/_javascript_Core/runtime/VM.cpp 2014-02-25 21:10:14 UTC (rev 164666)
+++ trunk/Source/_javascript_Core/runtime/VM.cpp 2014-02-25 21:18:39 UTC (rev 164667)
@@ -208,6 +208,7 @@
#if ENABLE(REGEXP_TRACING)
, m_rtTraceList(new RTTraceList())
#endif
+ , exclusiveThread(0)
, m_newStringsSinceLastHashCons(0)
#if ENABLE(ASSEMBLER)
, m_canUseAssembler(enableAssembler(executableAllocator))
Modified: trunk/Source/_javascript_Core/runtime/VM.h (164666 => 164667)
--- trunk/Source/_javascript_Core/runtime/VM.h 2014-02-25 21:10:14 UTC (rev 164666)
+++ trunk/Source/_javascript_Core/runtime/VM.h 2014-02-25 21:18:39 UTC (rev 164667)
@@ -463,9 +463,7 @@
RTTraceList* m_rtTraceList;
#endif
- bool hasExclusiveThread() const { return m_apiLock->hasExclusiveThread(); }
- std::thread::id exclusiveThread() const { return m_apiLock->exclusiveThread(); }
- void setExclusiveThread(std::thread::id threadId) { m_apiLock->setExclusiveThread(threadId); }
+ ThreadIdentifier exclusiveThread;
JS_EXPORT_PRIVATE void resetDateCache();
@@ -493,7 +491,10 @@
bool haveEnoughNewStringsToHashCons() { return m_newStringsSinceLastHashCons > s_minNumberOfNewStringsToHashCons; }
void resetNewStringsSinceLastHashCons() { m_newStringsSinceLastHashCons = 0; }
- bool currentThreadIsHoldingAPILock() const { return m_apiLock->currentThreadIsHoldingLock(); }
+ bool currentThreadIsHoldingAPILock() const
+ {
+ return m_apiLock->currentThreadIsHoldingLock() || exclusiveThread == currentThread();
+ }
JSLock& apiLock() { return *m_apiLock; }
CodeCache* codeCache() { return m_codeCache.get(); }
Modified: trunk/Source/WebCore/ChangeLog (164666 => 164667)
--- trunk/Source/WebCore/ChangeLog 2014-02-25 21:10:14 UTC (rev 164666)
+++ trunk/Source/WebCore/ChangeLog 2014-02-25 21:18:39 UTC (rev 164667)
@@ -1,3 +1,16 @@
+2014-02-25 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r164627.
+ http://trac.webkit.org/changeset/164627
+ https://bugs.webkit.org/show_bug.cgi?id=129325
+
+ Broke SubtleCrypto tests (Requested by ap on #webkit).
+
+ * bindings/js/JSDOMBinding.cpp:
+ (WebCore::reportException):
+ * bindings/js/JSDOMWindowBase.cpp:
+ (WebCore::JSDOMWindowBase::commonVM):
+
2014-02-25 Anders Carlsson <[email protected]>
DefaultVisitedLinkProvider can just call into the page group directly
Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp (164666 => 164667)
--- trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp 2014-02-25 21:10:14 UTC (rev 164666)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp 2014-02-25 21:18:39 UTC (rev 164667)
@@ -153,7 +153,6 @@
void reportException(ExecState* exec, JSValue exception, CachedScript* cachedScript)
{
- RELEASE_ASSERT(exec->vm().currentThreadIsHoldingAPILock());
if (isTerminatedExecutionException(exception))
return;
Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp (164666 => 164667)
--- trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp 2014-02-25 21:10:14 UTC (rev 164666)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp 2014-02-25 21:18:39 UTC (rev 164667)
@@ -224,7 +224,7 @@
vm->makeUsableFromMultipleThreads();
vm->heap.machineThreads().addCurrentThread();
#else
- vm->setExclusiveThread(std::this_thread::get_id());
+ vm->exclusiveThread = currentThread();
#endif // !PLATFORM(IOS)
initNormalWorldClientData(vm);
}