[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 11:55:19 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 70a90fc6f2d66bb4a95496e4611af7ec91959bd0
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Aug 11 12:14:06 2010 +0000
2010-08-11 Nathan Lawrence <nlawrence at apple.com>
Reviewed by Geoffrey Garen.
At collection time, we frequently want to mark a cell, while checking
whether it was originally checked. Previously, this was a get
operation follwed by a set operation. Fusing the two saves
computation and gives a 0.5% sunspider speedup.
* runtime/Collector.h:
(JSC::CollectorBitmap::getset):
(JSC::Heap::checkMarkCell):
* runtime/JSArray.h:
(JSC::MarkStack::drain):
* runtime/JSCell.h:
(JSC::MarkStack::append):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65146 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index fccb23b..6160b31 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-08-11 Nathan Lawrence <nlawrence at apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ At collection time, we frequently want to mark a cell, while checking
+ whether it was originally checked. Previously, this was a get
+ operation follwed by a set operation. Fusing the two saves
+ computation and gives a 0.5% sunspider speedup.
+
+ * runtime/Collector.h:
+ (JSC::CollectorBitmap::getset):
+ (JSC::Heap::checkMarkCell):
+ * runtime/JSArray.h:
+ (JSC::MarkStack::drain):
+ * runtime/JSCell.h:
+ (JSC::MarkStack::append):
+
2010-08-11 Steve Falkenburg <sfalken at apple.com>
Reviewed by Adam Roben.
diff --git a/JavaScriptCore/runtime/Collector.h b/JavaScriptCore/runtime/Collector.h
index 38c178b..05d5c10 100644
--- a/JavaScriptCore/runtime/Collector.h
+++ b/JavaScriptCore/runtime/Collector.h
@@ -130,6 +130,7 @@ namespace JSC {
void registerThread(); // Only needs to be called by clients that can use the same heap from multiple threads.
static bool isCellMarked(const JSCell*);
+ static bool checkMarkCell(const JSCell*);
static void markCell(JSCell*);
WeakGCHandle* addWeakGCHandle(JSCell*);
@@ -226,6 +227,14 @@ namespace JSC {
FixedArray<uint32_t, BITMAP_WORDS> bits;
bool get(size_t n) const { return !!(bits[n >> 5] & (1 << (n & 0x1F))); }
void set(size_t n) { bits[n >> 5] |= (1 << (n & 0x1F)); }
+ bool getset(size_t n)
+ {
+ unsigned i = (1 << (n & 0x1F));
+ uint32_t& b = bits[n >> 5];
+ bool r = !!(b & i);
+ b |= i;
+ return r;
+ }
void clear(size_t n) { bits[n >> 5] &= ~(1 << (n & 0x1F)); }
void clearAll() { memset(bits.data(), 0, sizeof(bits)); }
ALWAYS_INLINE void advanceToNextPossibleFreeCell(size_t& startCell)
@@ -288,6 +297,11 @@ namespace JSC {
return cellBlock(cell)->marked.get(cellOffset(cell));
}
+ inline bool Heap::checkMarkCell(const JSCell* cell)
+ {
+ return cellBlock(cell)->marked.getset(cellOffset(cell));
+ }
+
inline void Heap::markCell(JSCell* cell)
{
cellBlock(cell)->marked.set(cellOffset(cell));
diff --git a/JavaScriptCore/runtime/JSArray.h b/JavaScriptCore/runtime/JSArray.h
index f718d7e..f8a7d81 100644
--- a/JavaScriptCore/runtime/JSArray.h
+++ b/JavaScriptCore/runtime/JSArray.h
@@ -236,7 +236,7 @@ namespace JSC {
current.m_values++;
JSCell* cell;
- if (!value || !value.isCell() || Heap::isCellMarked(cell = value.asCell())) {
+ if (!value || !value.isCell() || Heap::checkMarkCell(cell = value.asCell())) {
if (current.m_values == end) {
m_markSets.removeLast();
continue;
@@ -244,7 +244,6 @@ namespace JSC {
goto findNextUnmarkedNullValue;
}
- Heap::markCell(cell);
if (cell->structure()->typeInfo().type() < CompoundType) {
if (current.m_values == end) {
m_markSets.removeLast();
diff --git a/JavaScriptCore/runtime/JSCell.h b/JavaScriptCore/runtime/JSCell.h
index 72f81df..2ffce8d 100644
--- a/JavaScriptCore/runtime/JSCell.h
+++ b/JavaScriptCore/runtime/JSCell.h
@@ -333,9 +333,8 @@ namespace JSC {
{
ASSERT(!m_isCheckingForDefaultMarkViolation);
ASSERT(cell);
- if (Heap::isCellMarked(cell))
+ if (Heap::checkMarkCell(cell))
return;
- Heap::markCell(cell);
if (cell->structure()->typeInfo().type() >= CompoundType)
m_values.append(cell);
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list