Title: [124355] trunk/Source/_javascript_Core
- Revision
- 124355
- Author
- [email protected]
- Date
- 2012-08-01 12:24:58 -0700 (Wed, 01 Aug 2012)
Log Message
C++ code should get ClassInfo from the Structure
https://bugs.webkit.org/show_bug.cgi?id=92892
Reviewed by Geoffrey Garen.
In our march to remove ClassInfo from our JSCell object headers, we can switch
C++ code over to grabbing the ClassInfo from the Structure since it is finally
safe to do so now that Structure access is safe during finalization/destruction.
The remaining JIT code changes can be done in a separate patch.
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::callDestructor): We don't want to clear the Structure any more
since the Structure should still be valid at this point.
* heap/WeakSetInlines.h:
(JSC::WeakBlock::finalize): Ditto.
* runtime/JSCell.h:
(JSC):
* runtime/Structure.h:
(JSC::JSCell::classInfo): Move JSCell's classInfo() to Structure.h so it can be
inline. Use a different method of getting the JSCell's Structure based on
whether we're in GC_VALIDATION mode or not, since always using get() will cause
infinite recursion in GC_VALIDATION mode.
(JSC):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (124354 => 124355)
--- trunk/Source/_javascript_Core/ChangeLog 2012-08-01 19:05:55 UTC (rev 124354)
+++ trunk/Source/_javascript_Core/ChangeLog 2012-08-01 19:24:58 UTC (rev 124355)
@@ -1,3 +1,29 @@
+2012-08-01 Mark Hahnenberg <[email protected]>
+
+ C++ code should get ClassInfo from the Structure
+ https://bugs.webkit.org/show_bug.cgi?id=92892
+
+ Reviewed by Geoffrey Garen.
+
+ In our march to remove ClassInfo from our JSCell object headers, we can switch
+ C++ code over to grabbing the ClassInfo from the Structure since it is finally
+ safe to do so now that Structure access is safe during finalization/destruction.
+ The remaining JIT code changes can be done in a separate patch.
+
+ * heap/MarkedBlock.cpp:
+ (JSC::MarkedBlock::callDestructor): We don't want to clear the Structure any more
+ since the Structure should still be valid at this point.
+ * heap/WeakSetInlines.h:
+ (JSC::WeakBlock::finalize): Ditto.
+ * runtime/JSCell.h:
+ (JSC):
+ * runtime/Structure.h:
+ (JSC::JSCell::classInfo): Move JSCell's classInfo() to Structure.h so it can be
+ inline. Use a different method of getting the JSCell's Structure based on
+ whether we're in GC_VALIDATION mode or not, since always using get() will cause
+ infinite recursion in GC_VALIDATION mode.
+ (JSC):
+
2012-07-31 Mark Hahnenberg <[email protected]>
MarkedBlock::sweep() should sweep another block if it can't sweep a Structure block
Modified: trunk/Source/_javascript_Core/heap/MarkedBlock.cpp (124354 => 124355)
--- trunk/Source/_javascript_Core/heap/MarkedBlock.cpp 2012-08-01 19:05:55 UTC (rev 124354)
+++ trunk/Source/_javascript_Core/heap/MarkedBlock.cpp 2012-08-01 19:24:58 UTC (rev 124355)
@@ -61,10 +61,6 @@
m_heap->m_destroyedTypeCounts.countVPtr(vptr);
#endif
-#if !ASSERT_DISABLED || ENABLE(GC_VALIDATION)
- cell->clearStructure();
-#endif
-
cell->methodTable()->destroy(cell);
cell->zap();
}
Modified: trunk/Source/_javascript_Core/heap/WeakSetInlines.h (124354 => 124355)
--- trunk/Source/_javascript_Core/heap/WeakSetInlines.h 2012-08-01 19:05:55 UTC (rev 124354)
+++ trunk/Source/_javascript_Core/heap/WeakSetInlines.h 2012-08-01 19:24:58 UTC (rev 124355)
@@ -49,9 +49,6 @@
WeakHandleOwner* weakHandleOwner = weakImpl->weakHandleOwner();
if (!weakHandleOwner)
return;
-#if !ASSERT_DISABLED || ENABLE(GC_VALIDATION)
- weakImpl->jsValue().asCell()->clearStructure();
-#endif
weakHandleOwner->finalize(Handle<Unknown>::wrapSlot(&const_cast<JSValue&>(weakImpl->jsValue())), weakImpl->context());
}
Modified: trunk/Source/_javascript_Core/runtime/JSCell.h (124354 => 124355)
--- trunk/Source/_javascript_Core/runtime/JSCell.h 2012-08-01 19:05:55 UTC (rev 124354)
+++ trunk/Source/_javascript_Core/runtime/JSCell.h 2012-08-01 19:24:58 UTC (rev 124355)
@@ -192,11 +192,6 @@
return m_structure.get();
}
- inline const ClassInfo* JSCell::classInfo() const
- {
- return m_classInfo;
- }
-
inline void JSCell::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
MARK_LOG_PARENT(visitor, cell);
Modified: trunk/Source/_javascript_Core/runtime/Structure.h (124354 => 124355)
--- trunk/Source/_javascript_Core/runtime/Structure.h 2012-08-01 19:05:55 UTC (rev 124354)
+++ trunk/Source/_javascript_Core/runtime/Structure.h 2012-08-01 19:24:58 UTC (rev 124355)
@@ -602,6 +602,15 @@
ASSERT(m_structure || !globalData.structureStructure);
}
+ inline const ClassInfo* JSCell::classInfo() const
+ {
+#if ENABLE(GC_VALIDATION)
+ return m_structure.unvalidatedGet()->classInfo();
+#else
+ return m_structure->classInfo();
+#endif
+ }
+
} // namespace JSC
#endif // Structure_h
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes