Title: [153357] trunk/Source/_javascript_Core
- Revision
- 153357
- Author
- [email protected]
- Date
- 2013-07-25 17:13:13 -0700 (Thu, 25 Jul 2013)
Log Message
ASSERT(m_vm->apiLock().currentThreadIsHoldingLock()); fails for Safari on current ToT
https://bugs.webkit.org/show_bug.cgi?id=119108
Reviewed by Mark Hahnenberg.
Add a currentThreadIsHoldingAPILock() function to VM that checks if the current thread is the exclusive API thread.
* heap/CopiedSpace.cpp:
(JSC::CopiedSpace::tryAllocateSlowCase):
* heap/Heap.cpp:
(JSC::Heap::protect):
(JSC::Heap::unprotect):
(JSC::Heap::collect):
* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::allocateSlowCase):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/VM.h:
(JSC::VM::currentThreadIsHoldingAPILock):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (153356 => 153357)
--- trunk/Source/_javascript_Core/ChangeLog 2013-07-25 23:57:40 UTC (rev 153356)
+++ trunk/Source/_javascript_Core/ChangeLog 2013-07-26 00:13:13 UTC (rev 153357)
@@ -1,3 +1,25 @@
+2013-07-25 Anders Carlsson <[email protected]>
+
+ ASSERT(m_vm->apiLock().currentThreadIsHoldingLock()); fails for Safari on current ToT
+ https://bugs.webkit.org/show_bug.cgi?id=119108
+
+ Reviewed by Mark Hahnenberg.
+
+ Add a currentThreadIsHoldingAPILock() function to VM that checks if the current thread is the exclusive API thread.
+
+ * heap/CopiedSpace.cpp:
+ (JSC::CopiedSpace::tryAllocateSlowCase):
+ * heap/Heap.cpp:
+ (JSC::Heap::protect):
+ (JSC::Heap::unprotect):
+ (JSC::Heap::collect):
+ * heap/MarkedAllocator.cpp:
+ (JSC::MarkedAllocator::allocateSlowCase):
+ * runtime/JSGlobalObject.cpp:
+ (JSC::JSGlobalObject::init):
+ * runtime/VM.h:
+ (JSC::VM::currentThreadIsHoldingAPILock):
+
2013-07-25 Zan Dobersek <[email protected]>
REGRESSION(FTL): Most layout tests crashes
Modified: trunk/Source/_javascript_Core/heap/CopiedSpace.cpp (153356 => 153357)
--- trunk/Source/_javascript_Core/heap/CopiedSpace.cpp 2013-07-25 23:57:40 UTC (rev 153356)
+++ trunk/Source/_javascript_Core/heap/CopiedSpace.cpp 2013-07-26 00:13:13 UTC (rev 153357)
@@ -69,7 +69,7 @@
if (isOversize(bytes))
return tryAllocateOversize(bytes, outPtr);
- ASSERT(m_heap->vm()->apiLock().currentThreadIsHoldingLock());
+ ASSERT(m_heap->vm()->currentThreadIsHoldingAPILock());
m_heap->didAllocate(m_allocator.currentCapacity());
allocateBlock();
Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (153356 => 153357)
--- trunk/Source/_javascript_Core/heap/Heap.cpp 2013-07-25 23:57:40 UTC (rev 153356)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp 2013-07-26 00:13:13 UTC (rev 153357)
@@ -167,7 +167,7 @@
static inline bool isValidSharedInstanceThreadState(VM* vm)
{
- return vm->apiLock().currentThreadIsHoldingLock();
+ return vm->currentThreadIsHoldingAPILock();
}
static inline bool isValidThreadState(VM* vm)
@@ -334,7 +334,7 @@
void Heap::protect(JSValue k)
{
ASSERT(k);
- ASSERT(m_vm->apiLock().currentThreadIsHoldingLock());
+ ASSERT(m_vm->currentThreadIsHoldingAPILock());
if (!k.isCell())
return;
@@ -345,7 +345,7 @@
bool Heap::unprotect(JSValue k)
{
ASSERT(k);
- ASSERT(m_vm->apiLock().currentThreadIsHoldingLock());
+ ASSERT(m_vm->currentThreadIsHoldingAPILock());
if (!k.isCell())
return false;
@@ -711,7 +711,7 @@
RELEASE_ASSERT(!m_deferralDepth);
GCPHASE(Collect);
- ASSERT(vm()->apiLock().currentThreadIsHoldingLock());
+ ASSERT(vm()->currentThreadIsHoldingAPILock());
RELEASE_ASSERT(vm()->identifierTable == wtfThreadData().currentIdentifierTable());
ASSERT(m_isSafeToCollect);
_javascript_CORE_GC_BEGIN();
Modified: trunk/Source/_javascript_Core/heap/MarkedAllocator.cpp (153356 => 153357)
--- trunk/Source/_javascript_Core/heap/MarkedAllocator.cpp 2013-07-25 23:57:40 UTC (rev 153356)
+++ trunk/Source/_javascript_Core/heap/MarkedAllocator.cpp 2013-07-26 00:13:13 UTC (rev 153357)
@@ -70,7 +70,7 @@
void* MarkedAllocator::allocateSlowCase(size_t bytes)
{
- ASSERT(m_heap->vm()->apiLock().currentThreadIsHoldingLock());
+ ASSERT(m_heap->vm()->currentThreadIsHoldingAPILock());
#if COLLECT_ON_EVERY_ALLOCATION
m_heap->collectAllGarbage();
ASSERT(m_heap->m_operationInProgress == NoOperation);
Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp (153356 => 153357)
--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp 2013-07-25 23:57:40 UTC (rev 153356)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp 2013-07-26 00:13:13 UTC (rev 153357)
@@ -137,7 +137,7 @@
void JSGlobalObject::init(JSObject* thisValue)
{
- ASSERT(vm().apiLock().currentThreadIsHoldingLock());
+ ASSERT(vm().currentThreadIsHoldingAPILock());
setGlobalThis(vm(), thisValue);
JSGlobalObject::globalExec()->init(0, 0, this, CallFrame::noCaller(), 0, 0);
Modified: trunk/Source/_javascript_Core/runtime/VM.h (153356 => 153357)
--- trunk/Source/_javascript_Core/runtime/VM.h 2013-07-25 23:57:40 UTC (rev 153356)
+++ trunk/Source/_javascript_Core/runtime/VM.h 2013-07-26 00:13:13 UTC (rev 153357)
@@ -468,6 +468,11 @@
}
}
+ bool currentThreadIsHoldingAPILock() const
+ {
+ return m_apiLock->currentThreadIsHoldingLock() || exclusiveThread == currentThread();
+ }
+
JSLock& apiLock() { return *m_apiLock; }
CodeCache* codeCache() { return m_codeCache.get(); }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes