Commit ed66e778 authored by oliver@apple.com's avatar oliver@apple.com

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
parent 1b3a24aa
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> 2011-04-04 Oliver Hunt <oliver@apple.com>
Fix clang build. Fix clang build.
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "JSCell.h" #include "JSCell.h"
#include "CallFrame.h" #include "CallFrame.h"
#include "Structure.h"
namespace JSC { namespace JSC {
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "JSCell.h" #include "JSCell.h"
#include "CallFrame.h" #include "CallFrame.h"
#include "Structure.h"
namespace JSC { namespace JSC {
......
...@@ -24,18 +24,20 @@ ...@@ -24,18 +24,20 @@
#define JSCell_h #define JSCell_h
#include "CallData.h" #include "CallData.h"
#include "CallFrame.h"
#include "ConstructData.h" #include "ConstructData.h"
#include "Heap.h" #include "Heap.h"
#include "JSImmediate.h" #include "JSImmediate.h"
#include "JSLock.h" #include "JSLock.h"
#include "JSValue.h" #include "JSValue.h"
#include "MarkStack.h" #include "MarkStack.h"
#include "Structure.h" #include "UString.h"
#include <wtf/Noncopyable.h> #include <wtf/Noncopyable.h>
namespace JSC { namespace JSC {
class JSGlobalObject; class JSGlobalObject;
class Structure;
#if COMPILER(MSVC) #if COMPILER(MSVC)
// If WTF_MAKE_NONCOPYABLE is applied to JSCell we end up with a bunch of // If WTF_MAKE_NONCOPYABLE is applied to JSCell we end up with a bunch of
...@@ -75,10 +77,7 @@ namespace JSC { ...@@ -75,10 +77,7 @@ namespace JSC {
virtual ~JSCell(); virtual ~JSCell();
public: public:
static PassRefPtr<Structure> createDummyStructure(JSGlobalData& globalData) static PassRefPtr<Structure> createDummyStructure(JSGlobalData&);
{
return Structure::create(globalData, jsNull(), TypeInfo(UnspecifiedType), AnonymousSlotCount, 0);
}
// Querying the type. // Querying the type.
bool isString() const; bool isString() const;
...@@ -122,7 +121,7 @@ namespace JSC { ...@@ -122,7 +121,7 @@ namespace JSC {
#endif #endif
// Object operations, with the toObject operation included. // 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*, const Identifier& propertyName, JSValue, PutPropertySlot&);
virtual void put(ExecState*, unsigned propertyName, JSValue); virtual void put(ExecState*, unsigned propertyName, JSValue);
virtual bool deleteProperty(ExecState*, const Identifier& propertyName); virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
...@@ -169,16 +168,6 @@ namespace JSC { ...@@ -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 inline Structure* JSCell::structure() const
{ {
return m_structure; return m_structure;
...@@ -321,13 +310,6 @@ namespace JSC { ...@@ -321,13 +310,6 @@ namespace JSC {
return isUndefined() ? nonInlineNaN() : 0; // null and false both convert to 0. 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() inline JSValue JSValue::getJSNumber()
{ {
if (isInt32() || isDouble()) if (isInt32() || isDouble())
...@@ -352,16 +334,6 @@ namespace JSC { ...@@ -352,16 +334,6 @@ namespace JSC {
return isCell() ? asCell()->toThisObject(exec) : toThisObjectSlowCase(exec); 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) inline Heap* Heap::heap(JSValue v)
{ {
if (!v.isCell()) if (!v.isCell())
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "PropertyDescriptor.h" #include "PropertyDescriptor.h"
#include "PropertySlot.h" #include "PropertySlot.h"
#include "RopeImpl.h" #include "RopeImpl.h"
#include "Structure.h"
namespace JSC { namespace JSC {
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#define ScopeChain_h #define ScopeChain_h
#include "JSCell.h" #include "JSCell.h"
#include "Structure.h"
#include <wtf/FastAllocBase.h> #include <wtf/FastAllocBase.h>
namespace JSC { namespace JSC {
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#define Structure_h #define Structure_h
#include "Identifier.h" #include "Identifier.h"
#include "JSCell.h"
#include "JSType.h" #include "JSType.h"
#include "JSValue.h" #include "JSValue.h"
#include "PropertyMapHashTable.h" #include "PropertyMapHashTable.h"
...@@ -262,6 +263,43 @@ namespace JSC { ...@@ -262,6 +263,43 @@ namespace JSC {
return entry ? entry->offset : notFound; 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 } // namespace JSC
#endif // Structure_h #endif // Structure_h
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#define StructureChain_h #define StructureChain_h
#include "JSCell.h" #include "JSCell.h"
#include "Structure.h"
#include <wtf/OwnArrayPtr.h> #include <wtf/OwnArrayPtr.h>
#include <wtf/PassRefPtr.h> #include <wtf/PassRefPtr.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment