https://bugs.webkit.org/show_bug.cgi?id=180335
Reviewed by Filip Pizlo.
Changing DestroyFunc structures to more specific names to avoid
conflits on unified builds.
* heap/HeapCellType.cpp:
(JSC::HeapCellType::finishSweep):
(JSC::HeapCellType::destroy):
* runtime/JSDestructibleObjectHeapCellType.cpp:
(JSC::JSDestructibleObjectHeapCellType::finishSweep):
(JSC::JSDestructibleObjectHeapCellType::destroy):
* runtime/JSSegmentedVariableObjectHeapCellType.cpp:
(JSC::JSSegmentedVariableObjectHeapCellType::finishSweep):
(JSC::JSSegmentedVariableObjectHeapCellType::destroy):
* runtime/JSStringHeapCellType.cpp:
(JSC::JSStringHeapCellType::finishSweep):
(JSC::JSStringHeapCellType::destroy):
* wasm/js/JSWebAssemblyCodeBlockHeapCellType.cpp:
(JSC::JSWebAssemblyCodeBlockHeapCellType::finishSweep):
(JSC::JSWebAssemblyCodeBlockHeapCellType::destroy):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225464
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2017-12-03 Caio Lima <ticaiolima@gmail.com>
+
+ Rename DestroyFunc to avoid redefinition on unified build
+ https://bugs.webkit.org/show_bug.cgi?id=180335
+
+ Reviewed by Filip Pizlo.
+
+ Changing DestroyFunc structures to more specific names to avoid
+ conflits on unified builds.
+
+ * heap/HeapCellType.cpp:
+ (JSC::HeapCellType::finishSweep):
+ (JSC::HeapCellType::destroy):
+ * runtime/JSDestructibleObjectHeapCellType.cpp:
+ (JSC::JSDestructibleObjectHeapCellType::finishSweep):
+ (JSC::JSDestructibleObjectHeapCellType::destroy):
+ * runtime/JSSegmentedVariableObjectHeapCellType.cpp:
+ (JSC::JSSegmentedVariableObjectHeapCellType::finishSweep):
+ (JSC::JSSegmentedVariableObjectHeapCellType::destroy):
+ * runtime/JSStringHeapCellType.cpp:
+ (JSC::JSStringHeapCellType::finishSweep):
+ (JSC::JSStringHeapCellType::destroy):
+ * wasm/js/JSWebAssemblyCodeBlockHeapCellType.cpp:
+ (JSC::JSWebAssemblyCodeBlockHeapCellType::finishSweep):
+ (JSC::JSWebAssemblyCodeBlockHeapCellType::destroy):
+
2017-12-01 JF Bastien <jfbastien@apple.com>
JavaScriptCore: missing exception checks in Math functions that take more than one argument
namespace JSC {
-namespace {
-
// Writing it this way ensures that when you pass this as a functor, the callee is specialized for
// this callback. If you wrote this as a normal function then the callee would be specialized for
// the function's type and it would have indirect calls to that function. And unlike a lambda, it's
// possible to mark this ALWAYS_INLINE.
-struct DestroyFunc {
+struct DefaultDestroyFunc {
ALWAYS_INLINE void operator()(VM& vm, JSCell* cell) const
{
ASSERT(cell->structureID());
}
};
-} // anonymous namespace
-
HeapCellType::HeapCellType(AllocatorAttributes attributes)
: m_attributes(attributes)
{
void HeapCellType::finishSweep(MarkedBlock::Handle& block, FreeList* freeList)
{
- block.finishSweepKnowingHeapCellType(freeList, DestroyFunc());
+ block.finishSweepKnowingHeapCellType(freeList, DefaultDestroyFunc());
}
void HeapCellType::destroy(VM& vm, JSCell* cell)
{
- DestroyFunc()(vm, cell);
+ DefaultDestroyFunc()(vm, cell);
}
} // namespace JSC
namespace JSC {
-namespace {
-
-struct DestroyFunc {
+struct JSDestructibleObjectDestroyFunc {
ALWAYS_INLINE void operator()(VM&, JSCell* cell) const
{
static_cast<JSDestructibleObject*>(cell)->classInfo()->methodTable.destroy(cell);
}
};
-} // anonymous namespace
-
JSDestructibleObjectHeapCellType::JSDestructibleObjectHeapCellType()
: HeapCellType(AllocatorAttributes(NeedsDestruction, HeapCell::JSCell))
{
void JSDestructibleObjectHeapCellType::finishSweep(MarkedBlock::Handle& handle, FreeList* freeList)
{
- handle.finishSweepKnowingHeapCellType(freeList, DestroyFunc());
+ handle.finishSweepKnowingHeapCellType(freeList, JSDestructibleObjectDestroyFunc());
}
void JSDestructibleObjectHeapCellType::destroy(VM& vm, JSCell* cell)
{
- DestroyFunc()(vm, cell);
+ JSDestructibleObjectDestroyFunc()(vm, cell);
}
} // namespace JSC
namespace JSC {
-namespace {
-
-struct DestroyFunc {
+struct JSSegmentedVariableObjectDestroyFunc {
ALWAYS_INLINE void operator()(VM&, JSCell* cell) const
{
static_cast<JSSegmentedVariableObject*>(cell)->classInfo()->methodTable.destroy(cell);
}
};
-} // anonymous namespace
-
JSSegmentedVariableObjectHeapCellType::JSSegmentedVariableObjectHeapCellType()
: HeapCellType(AllocatorAttributes(NeedsDestruction, HeapCell::JSCell))
{
void JSSegmentedVariableObjectHeapCellType::finishSweep(MarkedBlock::Handle& handle, FreeList* freeList)
{
- handle.finishSweepKnowingHeapCellType(freeList, DestroyFunc());
+ handle.finishSweepKnowingHeapCellType(freeList, JSSegmentedVariableObjectDestroyFunc());
}
void JSSegmentedVariableObjectHeapCellType::destroy(VM& vm, JSCell* cell)
{
- DestroyFunc()(vm, cell);
+ JSSegmentedVariableObjectDestroyFunc()(vm, cell);
}
} // namespace JSC
namespace JSC {
-namespace {
-
-struct DestroyFunc {
+struct JSStringDestroyFunc {
ALWAYS_INLINE void operator()(VM&, JSCell* cell) const
{
static_cast<JSString*>(cell)->JSString::~JSString();
}
};
-} // anonymous namespace
-
JSStringHeapCellType::JSStringHeapCellType()
: HeapCellType(AllocatorAttributes(NeedsDestruction, HeapCell::JSCell))
{
void JSStringHeapCellType::finishSweep(MarkedBlock::Handle& handle, FreeList* freeList)
{
- handle.finishSweepKnowingHeapCellType(freeList, DestroyFunc());
+ handle.finishSweepKnowingHeapCellType(freeList, JSStringDestroyFunc());
}
void JSStringHeapCellType::destroy(VM& vm, JSCell* cell)
{
- DestroyFunc()(vm, cell);
+ JSStringDestroyFunc()(vm, cell);
}
} // namespace JSC
namespace JSC {
-namespace {
-
-struct DestroyFunc {
+struct JSWebAssemblyCodeBlockDestroyFunc {
ALWAYS_INLINE void operator()(VM&, JSCell* cell) const
{
static_assert(std::is_final<JSWebAssemblyCodeBlock>::value, "Otherwise, this code would not be correct.");
}
};
-} // anonymous namespace
-
JSWebAssemblyCodeBlockHeapCellType::JSWebAssemblyCodeBlockHeapCellType()
: HeapCellType(AllocatorAttributes(NeedsDestruction, HeapCell::JSCell))
{
void JSWebAssemblyCodeBlockHeapCellType::finishSweep(MarkedBlock::Handle& handle, FreeList* freeList)
{
- handle.finishSweepKnowingHeapCellType(freeList, DestroyFunc());
+ handle.finishSweepKnowingHeapCellType(freeList, JSWebAssemblyCodeBlockDestroyFunc());
}
void JSWebAssemblyCodeBlockHeapCellType::destroy(VM& vm, JSCell* cell)
{
- DestroyFunc()(vm, cell);
+ JSWebAssemblyCodeBlockDestroyFunc()(vm, cell);
}
} // namespace JSC