Title: [134118] branches/safari-536.28-branch/Source/_javascript_Core
- Revision
- 134118
- Author
- lforsch...@apple.com
- Date
- 2012-11-09 14:36:08 -0800 (Fri, 09 Nov 2012)
Log Message
Merged r126624. <rdar://problem/12486145>
Modified Paths
Diff
Modified: branches/safari-536.28-branch/Source/_javascript_Core/ChangeLog (134117 => 134118)
--- branches/safari-536.28-branch/Source/_javascript_Core/ChangeLog 2012-11-09 22:33:31 UTC (rev 134117)
+++ branches/safari-536.28-branch/Source/_javascript_Core/ChangeLog 2012-11-09 22:36:08 UTC (rev 134118)
@@ -1,3 +1,30 @@
+2012-11-09 Lucas Forschler <lforsch...@apple.com>
+
+ Merge r126624
+
+ 2012-08-24 Oliver Hunt <oli...@apple.com>
+
+ Always null check cells before marking
+ https://bugs.webkit.org/show_bug.cgi?id=94968
+
+ Reviewed by Geoffrey Garen.
+
+ Originally we tried to minimise null checks by only null checking values
+ that we knew could be null, however given that we can't ever guarantee
+ when a GC will happen, we're better off just always assuming that a null
+ check will be necessary. This results in a much less fragile code base
+ as we can add GC allocations to object initialisers without having to
+ subsequently worry about whether the object we are initialising will need
+ to add a bunch of null checks in its visitChildren implementation.
+
+ * heap/MarkStack.cpp:
+ (JSC::MarkStack::internalAppend):
+ * heap/MarkStackInlineMethods.h:
+ (JSC::MarkStack::append):
+ (JSC::MarkStack::appendUnbarrieredPointer):
+ * runtime/Structure.h:
+ (JSC::MarkStack::internalAppend):
+
2012-11-08 Lucas Forschler <lforsch...@apple.com>
Merge r125806
@@ -69210,3 +69237,4 @@
.
.
.
+.
Modified: branches/safari-536.28-branch/Source/_javascript_Core/heap/MarkStack.h (134117 => 134118)
--- branches/safari-536.28-branch/Source/_javascript_Core/heap/MarkStack.h 2012-11-09 22:33:31 UTC (rev 134117)
+++ branches/safari-536.28-branch/Source/_javascript_Core/heap/MarkStack.h 2012-11-09 22:36:08 UTC (rev 134118)
@@ -394,8 +394,6 @@
{
for (size_t i = 0; i < count; ++i) {
JSValue& value = slot[i];
- if (!value)
- continue;
internalAppend(value);
}
}
@@ -405,8 +403,7 @@
{
ASSERT(slot);
JSCell* cell = *slot;
- if (cell)
- internalAppend(cell);
+ internalAppend(cell);
}
ALWAYS_INLINE void MarkStack::append(JSValue* slot)
@@ -423,8 +420,7 @@
ALWAYS_INLINE void MarkStack::internalAppend(JSValue value)
{
- ASSERT(value);
- if (!value.isCell())
+ if (!value || !value.isCell())
return;
internalAppend(value.asCell());
}
Modified: branches/safari-536.28-branch/Source/_javascript_Core/runtime/Structure.h (134117 => 134118)
--- branches/safari-536.28-branch/Source/_javascript_Core/runtime/Structure.h 2012-11-09 22:33:31 UTC (rev 134117)
+++ branches/safari-536.28-branch/Source/_javascript_Core/runtime/Structure.h 2012-11-09 22:36:08 UTC (rev 134118)
@@ -378,6 +378,8 @@
ALWAYS_INLINE void MarkStack::internalAppend(JSCell* cell)
{
ASSERT(!m_isCheckingForDefaultMarkViolation);
+ if (!cell)
+ return;
#if ENABLE(GC_VALIDATION)
validate(cell);
#endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes