2011-04-04 Oliver Hunt <oliver@apple.com>
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
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 543a3af..92f8321 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,5 +1,27 @@
2011-04-04 Oliver Hunt <oliver@apple.com>
+ 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 <oliver@apple.com>
+
Fix clang build.
* wtf/FastMalloc.cpp:
diff --git a/Source/JavaScriptCore/runtime/GetterSetter.h b/Source/JavaScriptCore/runtime/GetterSetter.h
index 8241275..0cdfec4 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 54fe909..00fe0a0 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 ab0e237..ebc63f8 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 <wtf/Noncopyable.h>
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 @@
virtual ~JSCell();
public:
- static PassRefPtr<Structure> createDummyStructure(JSGlobalData& globalData)
- {
- return Structure::create(globalData, jsNull(), TypeInfo(UnspecifiedType), AnonymousSlotCount, 0);
- }
+ static PassRefPtr<Structure> createDummyStructure(JSGlobalData&);
// Querying the type.
bool isString() const;
@@ -122,7 +121,7 @@
#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 @@
{
}
- 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 @@
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 @@
{
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 9113d4a..f0c82f0 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 cb70a34..6e43275 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 <wtf/FastAllocBase.h>
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/Structure.h b/Source/JavaScriptCore/runtime/Structure.h
index e6858b5..46e4670 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 @@
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<Structure> 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 34564ab..9969106 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 <wtf/OwnArrayPtr.h>
#include <wtf/PassRefPtr.h>