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/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