From 5e594b14d4b0295ad562211a43fdc996437bac17 Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Sat, 15 Dec 2012 23:42:32 +1100 Subject: Fix undefined reference to JSC::JSCell::classInfo with MinGW-w64 JSC::JSCell::classInfo is defined inline in JSDestructibleObject.h but not all the classes that that inherit directly from JSCell include JSDestructibleObject.h. Move JSC::JSCell::classInfo from JSDestructibleObject.h into JSObject.h to resolve the undefined reference errors when compiling with MinGW-w64. JSDestructibleObject.h is already removed upstream in SVN r128851 but the commit has a lot of other changes which don't apply cleanly. Task-number: QTBUG-27764 Change-Id: I75b13c93dd13a346e672ca76fd7b23a616653a79 Reviewed-by: Simon Hausmann Reviewed-by: Alexey Pavlov --- .../JavaScriptCore/runtime/JSDestructibleObject.h | 37 ---------------------- Source/JavaScriptCore/runtime/JSObject.h | 31 ++++++++++++++++++ 2 files changed, 31 insertions(+), 37 deletions(-) (limited to 'Source/JavaScriptCore/runtime') diff --git a/Source/JavaScriptCore/runtime/JSDestructibleObject.h b/Source/JavaScriptCore/runtime/JSDestructibleObject.h index b8479be62..efbe2b4f6 100644 --- a/Source/JavaScriptCore/runtime/JSDestructibleObject.h +++ b/Source/JavaScriptCore/runtime/JSDestructibleObject.h @@ -3,41 +3,4 @@ #include "JSObject.h" -namespace JSC { - -struct ClassInfo; - -class JSDestructibleObject : public JSNonFinalObject { -public: - typedef JSNonFinalObject Base; - - static const bool needsDestruction = true; - - const ClassInfo* classInfo() const { return m_classInfo; } - -protected: - JSDestructibleObject(JSGlobalData& globalData, Structure* structure, Butterfly* butterfly = 0) - : JSNonFinalObject(globalData, structure, butterfly) - , m_classInfo(structure->classInfo()) - { - ASSERT(m_classInfo); - } - -private: - const ClassInfo* m_classInfo; -}; - -inline const ClassInfo* JSCell::classInfo() const -{ - if (MarkedBlock::blockFor(this)->destructorType() == MarkedBlock::Normal) - return static_cast(this)->classInfo(); -#if ENABLE(GC_VALIDATION) - return m_structure.unvalidatedGet()->classInfo(); -#else - return m_structure->classInfo(); -#endif -} - -} // namespace JSC - #endif diff --git a/Source/JavaScriptCore/runtime/JSObject.h b/Source/JavaScriptCore/runtime/JSObject.h index 4f7f4700b..957ba8227 100644 --- a/Source/JavaScriptCore/runtime/JSObject.h +++ b/Source/JavaScriptCore/runtime/JSObject.h @@ -1560,6 +1560,37 @@ inline int offsetRelativeToBase(PropertyOffset offset) COMPILE_ASSERT(!(sizeof(JSObject) % sizeof(WriteBarrierBase)), JSObject_inline_storage_has_correct_alignment); +class JSDestructibleObject : public JSNonFinalObject { +public: + typedef JSNonFinalObject Base; + + static const bool needsDestruction = true; + + const ClassInfo* classInfo() const { return m_classInfo; } + +protected: + JSDestructibleObject(JSGlobalData& globalData, Structure* structure, Butterfly* butterfly = 0) + : JSNonFinalObject(globalData, structure, butterfly) + , m_classInfo(structure->classInfo()) + { + ASSERT(m_classInfo); + } + +private: + const ClassInfo* m_classInfo; +}; + +inline const ClassInfo* JSCell::classInfo() const +{ + if (MarkedBlock::blockFor(this)->destructorType() == MarkedBlock::Normal) + return static_cast(this)->classInfo(); +#if ENABLE(GC_VALIDATION) + return m_structure.unvalidatedGet()->classInfo(); +#else + return m_structure->classInfo(); +#endif +} + } // namespace JSC #endif // JSObject_h -- cgit v1.2.1