Title: [109268] trunk/Source/_javascript_Core
- Revision
- 109268
- Author
- [email protected]
- Date
- 2012-02-29 14:47:31 -0800 (Wed, 29 Feb 2012)
Log Message
RefCounted::deprecatedTurnOffVerifier() should not be deprecated
https://bugs.webkit.org/show_bug.cgi?id=79864
Reviewed by Oliver Hunt.
Removed the word "deprecated" from the name of this method, since this method
should not be deprecated. It works just fine as it is, and there is simply no
alternative to calling this method for many interesting JSC classes.
* parser/SourceProvider.h:
(JSC::SourceProvider::SourceProvider):
* runtime/SymbolTable.h:
(JSC::SharedSymbolTable::SharedSymbolTable):
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocatorHandle::MetaAllocatorHandle):
(WTF::MetaAllocator::allocate):
* wtf/RefCounted.h:
(RefCountedBase):
(WTF::RefCountedBase::turnOffVerifier):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (109267 => 109268)
--- trunk/Source/_javascript_Core/ChangeLog 2012-02-29 22:44:33 UTC (rev 109267)
+++ trunk/Source/_javascript_Core/ChangeLog 2012-02-29 22:47:31 UTC (rev 109268)
@@ -1,3 +1,25 @@
+2012-02-28 Filip Pizlo <[email protected]>
+
+ RefCounted::deprecatedTurnOffVerifier() should not be deprecated
+ https://bugs.webkit.org/show_bug.cgi?id=79864
+
+ Reviewed by Oliver Hunt.
+
+ Removed the word "deprecated" from the name of this method, since this method
+ should not be deprecated. It works just fine as it is, and there is simply no
+ alternative to calling this method for many interesting JSC classes.
+
+ * parser/SourceProvider.h:
+ (JSC::SourceProvider::SourceProvider):
+ * runtime/SymbolTable.h:
+ (JSC::SharedSymbolTable::SharedSymbolTable):
+ * wtf/MetaAllocator.cpp:
+ (WTF::MetaAllocatorHandle::MetaAllocatorHandle):
+ (WTF::MetaAllocator::allocate):
+ * wtf/RefCounted.h:
+ (RefCountedBase):
+ (WTF::RefCountedBase::turnOffVerifier):
+
2012-02-29 Gavin Barraclough <[email protected]>
Writable attribute not set correctly when redefining an accessor to a data descriptor
Modified: trunk/Source/_javascript_Core/parser/SourceProvider.h (109267 => 109268)
--- trunk/Source/_javascript_Core/parser/SourceProvider.h 2012-02-29 22:44:33 UTC (rev 109267)
+++ trunk/Source/_javascript_Core/parser/SourceProvider.h 2012-02-29 22:47:31 UTC (rev 109268)
@@ -47,7 +47,7 @@
, m_cache(cache ? cache : new SourceProviderCache)
, m_cacheOwned(!cache)
{
- deprecatedTurnOffVerifier();
+ turnOffVerifier();
}
virtual ~SourceProvider()
{
Modified: trunk/Source/_javascript_Core/runtime/SymbolTable.h (109267 => 109268)
--- trunk/Source/_javascript_Core/runtime/SymbolTable.h 2012-02-29 22:44:33 UTC (rev 109267)
+++ trunk/Source/_javascript_Core/runtime/SymbolTable.h 2012-02-29 22:47:31 UTC (rev 109268)
@@ -125,7 +125,7 @@
public:
static PassRefPtr<SharedSymbolTable> create() { return adoptRef(new SharedSymbolTable); }
private:
- SharedSymbolTable() { deprecatedTurnOffVerifier(); }
+ SharedSymbolTable() { turnOffVerifier(); }
};
} // namespace JSC
Modified: trunk/Source/_javascript_Core/wtf/MetaAllocator.cpp (109267 => 109268)
--- trunk/Source/_javascript_Core/wtf/MetaAllocator.cpp 2012-02-29 22:44:33 UTC (rev 109267)
+++ trunk/Source/_javascript_Core/wtf/MetaAllocator.cpp 2012-02-29 22:47:31 UTC (rev 109268)
@@ -64,6 +64,7 @@
ASSERT(allocator);
ASSERT(start);
ASSERT(sizeInBytes);
+ turnOffVerifier();
}
MetaAllocatorHandle::~MetaAllocatorHandle()
@@ -169,8 +170,6 @@
#endif
MetaAllocatorHandle* handle = new MetaAllocatorHandle(this, start, sizeInBytes, ownerUID);
- // FIXME: Implement a verifier scheme that groks MetaAllocatorHandles
- handle->deprecatedTurnOffVerifier();
if (UNLIKELY(!!m_tracker))
m_tracker->notify(handle);
Modified: trunk/Source/_javascript_Core/wtf/RefCounted.h (109267 => 109268)
--- trunk/Source/_javascript_Core/wtf/RefCounted.h 2012-02-29 22:44:33 UTC (rev 109267)
+++ trunk/Source/_javascript_Core/wtf/RefCounted.h 2012-02-29 22:47:31 UTC (rev 109268)
@@ -77,8 +77,15 @@
// Turns off verification. Use of this method is discouraged (instead extend
// ThreadRestrictionVerifier to verify your case).
- // FIXME: remove this method.
- void deprecatedTurnOffVerifier()
+ // NB. It is necessary to call this in the constructor of many objects in
+ // _javascript_Core, because _javascript_Core objects may be used from multiple
+ // threads even if the reference counting is done in a racy manner. This is
+ // because a JSC instance may be used from multiple threads so long as all
+ // accesses into that instance are protected by a per-instance lock. It would
+ // be absolutely wrong to prohibit this pattern, and it would be a disastrous
+ // regression to require that the objects within that instance use a thread-
+ // safe version of reference counting.
+ void turnOffVerifier()
{
#ifndef NDEBUG
m_verifier.turnOffVerification();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes