From ed66e7781cc37802764377b6d0166042db4841d4 Mon Sep 17 00:00:00 2001 From: "oliver@apple.com" Date: Tue, 5 Apr 2011 01:33:58 +0000 Subject: [PATCH] 2011-04-04 Oliver Hunt Reviewed by Antti Koivisto. Stop JSCell.h from including Structure.h https://bugs.webkit.org/show_bug.cgi?id=57809 * runtime/GetterSetter.h: * runtime/JSAPIValueWrapper.h: * runtime/JSCell.h: (JSC::JSCell::JSValue::toThisObject): * runtime/JSString.h: * runtime/ScopeChain.h: * runtime/Structure.h: (JSC::JSCell::isObject): (JSC::JSCell::isString): (JSC::JSCell::classInfo): (JSC::JSCell::createDummyStructure): (JSC::JSValue::needsThisConversion): (JSC::MarkStack::internalAppend): * runtime/StructureChain.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82898 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/JavaScriptCore/ChangeLog | 22 +++++++++++ Source/JavaScriptCore/runtime/GetterSetter.h | 1 + .../runtime/JSAPIValueWrapper.h | 1 + Source/JavaScriptCore/runtime/JSCell.h | 38 +++---------------- Source/JavaScriptCore/runtime/JSString.h | 1 + Source/JavaScriptCore/runtime/ScopeChain.h | 1 + Source/JavaScriptCore/runtime/Structure.h | 38 +++++++++++++++++++ .../JavaScriptCore/runtime/StructureChain.h | 1 + 8 files changed, 70 insertions(+), 33 deletions(-) diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog index 543a3af7d27..92f832144b1 100644 --- a/Source/JavaScriptCore/ChangeLog +++ b/Source/JavaScriptCore/ChangeLog @@ -1,3 +1,25 @@ +2011-04-04 Oliver Hunt + + Reviewed by Antti Koivisto. + + Stop JSCell.h from including Structure.h + https://bugs.webkit.org/show_bug.cgi?id=57809 + + * runtime/GetterSetter.h: + * runtime/JSAPIValueWrapper.h: + * runtime/JSCell.h: + (JSC::JSCell::JSValue::toThisObject): + * runtime/JSString.h: + * runtime/ScopeChain.h: + * runtime/Structure.h: + (JSC::JSCell::isObject): + (JSC::JSCell::isString): + (JSC::JSCell::classInfo): + (JSC::JSCell::createDummyStructure): + (JSC::JSValue::needsThisConversion): + (JSC::MarkStack::internalAppend): + * runtime/StructureChain.h: + 2011-04-04 Oliver Hunt Fix clang build. diff --git a/Source/JavaScriptCore/runtime/GetterSetter.h b/Source/JavaScriptCore/runtime/GetterSetter.h index 8241275f4d2..0cdfec49886 100644 --- a/Source/JavaScriptCore/runtime/GetterSetter.h +++ b/Source/JavaScriptCore/runtime/GetterSetter.h @@ -26,6 +26,7 @@ #include "JSCell.h" #include "CallFrame.h" +#include "Structure.h" namespace JSC { diff --git a/Source/JavaScriptCore/runtime/JSAPIValueWrapper.h b/Source/JavaScriptCore/runtime/JSAPIValueWrapper.h index 54fe909abca..00fe0a01339 100644 --- a/Source/JavaScriptCore/runtime/JSAPIValueWrapper.h +++ b/Source/JavaScriptCore/runtime/JSAPIValueWrapper.h @@ -25,6 +25,7 @@ #include "JSCell.h" #include "CallFrame.h" +#include "Structure.h" namespace JSC { diff --git a/Source/JavaScriptCore/runtime/JSCell.h b/Source/JavaScriptCore/runtime/JSCell.h index ab0e2373518..ebc63f8e6ca 100644 --- a/Source/JavaScriptCore/runtime/JSCell.h +++ b/Source/JavaScriptCore/runtime/JSCell.h @@ -24,18 +24,20 @@ #define JSCell_h #include "CallData.h" +#include "CallFrame.h" #include "ConstructData.h" #include "Heap.h" #include "JSImmediate.h" #include "JSLock.h" #include "JSValue.h" #include "MarkStack.h" -#include "Structure.h" +#include "UString.h" #include namespace JSC { class JSGlobalObject; + class Structure; #if COMPILER(MSVC) // If WTF_MAKE_NONCOPYABLE is applied to JSCell we end up with a bunch of @@ -75,10 +77,7 @@ namespace JSC { virtual ~JSCell(); public: - static PassRefPtr createDummyStructure(JSGlobalData& globalData) - { - return Structure::create(globalData, jsNull(), TypeInfo(UnspecifiedType), AnonymousSlotCount, 0); - } + static PassRefPtr createDummyStructure(JSGlobalData&); // Querying the type. bool isString() const; @@ -122,7 +121,7 @@ namespace JSC { #endif // Object operations, with the toObject operation included. - const ClassInfo* classInfo() const { return m_structure->classInfo(); } + const ClassInfo* classInfo() const; virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); virtual void put(ExecState*, unsigned propertyName, JSValue); virtual bool deleteProperty(ExecState*, const Identifier& propertyName); @@ -169,16 +168,6 @@ namespace JSC { { } - inline bool JSCell::isObject() const - { - return m_structure->typeInfo().type() == ObjectType; - } - - inline bool JSCell::isString() const - { - return m_structure->typeInfo().type() == StringType; - } - inline Structure* JSCell::structure() const { return m_structure; @@ -321,13 +310,6 @@ namespace JSC { return isUndefined() ? nonInlineNaN() : 0; // null and false both convert to 0. } - inline bool JSValue::needsThisConversion() const - { - if (UNLIKELY(!isCell())) - return true; - return asCell()->structure()->typeInfo().needsThisConversion(); - } - inline JSValue JSValue::getJSNumber() { if (isInt32() || isDouble()) @@ -351,16 +333,6 @@ namespace JSC { { return isCell() ? asCell()->toThisObject(exec) : toThisObjectSlowCase(exec); } - - ALWAYS_INLINE void MarkStack::internalAppend(JSCell* cell) - { - ASSERT(!m_isCheckingForDefaultMarkViolation); - ASSERT(cell); - if (Heap::testAndSetMarked(cell)) - return; - if (cell->structure()->typeInfo().type() >= CompoundType) - m_values.append(cell); - } inline Heap* Heap::heap(JSValue v) { diff --git a/Source/JavaScriptCore/runtime/JSString.h b/Source/JavaScriptCore/runtime/JSString.h index 9113d4a04fb..f0c82f085fa 100644 --- a/Source/JavaScriptCore/runtime/JSString.h +++ b/Source/JavaScriptCore/runtime/JSString.h @@ -30,6 +30,7 @@ #include "PropertyDescriptor.h" #include "PropertySlot.h" #include "RopeImpl.h" +#include "Structure.h" namespace JSC { diff --git a/Source/JavaScriptCore/runtime/ScopeChain.h b/Source/JavaScriptCore/runtime/ScopeChain.h index cb70a346b96..6e432758309 100644 --- a/Source/JavaScriptCore/runtime/ScopeChain.h +++ b/Source/JavaScriptCore/runtime/ScopeChain.h @@ -22,6 +22,7 @@ #define ScopeChain_h #include "JSCell.h" +#include "Structure.h" #include namespace JSC { diff --git a/Source/JavaScriptCore/runtime/Structure.h b/Source/JavaScriptCore/runtime/Structure.h index e6858b5208d..46e4670aadd 100644 --- a/Source/JavaScriptCore/runtime/Structure.h +++ b/Source/JavaScriptCore/runtime/Structure.h @@ -27,6 +27,7 @@ #define Structure_h #include "Identifier.h" +#include "JSCell.h" #include "JSType.h" #include "JSValue.h" #include "PropertyMapHashTable.h" @@ -262,6 +263,43 @@ namespace JSC { return entry ? entry->offset : notFound; } + inline bool JSCell::isObject() const + { + return m_structure->typeInfo().type() == ObjectType; + } + + inline bool JSCell::isString() const + { + return m_structure->typeInfo().type() == StringType; + } + + inline const ClassInfo* JSCell::classInfo() const + { + return m_structure->classInfo(); + } + + inline PassRefPtr JSCell::createDummyStructure(JSGlobalData& globalData) + { + return Structure::create(globalData, jsNull(), TypeInfo(UnspecifiedType), AnonymousSlotCount, 0); + } + + inline bool JSValue::needsThisConversion() const + { + if (UNLIKELY(!isCell())) + return true; + return asCell()->structure()->typeInfo().needsThisConversion(); + } + + ALWAYS_INLINE void MarkStack::internalAppend(JSCell* cell) + { + ASSERT(!m_isCheckingForDefaultMarkViolation); + ASSERT(cell); + if (Heap::testAndSetMarked(cell)) + return; + if (cell->structure()->typeInfo().type() >= CompoundType) + m_values.append(cell); + } + } // namespace JSC #endif // Structure_h diff --git a/Source/JavaScriptCore/runtime/StructureChain.h b/Source/JavaScriptCore/runtime/StructureChain.h index 34564ab1c01..99691065fe4 100644 --- a/Source/JavaScriptCore/runtime/StructureChain.h +++ b/Source/JavaScriptCore/runtime/StructureChain.h @@ -27,6 +27,7 @@ #define StructureChain_h #include "JSCell.h" +#include "Structure.h" #include #include -- GitLab