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>
Fix clang build.
......
......@@ -26,6 +26,7 @@
#include "JSCell.h"
#include "CallFrame.h"
#include "Structure.h"
namespace JSC {
......
......@@ -25,6 +25,7 @@
#include "JSCell.h"
#include "CallFrame.h"
#include "Structure.h"
namespace JSC {
......
......@@ -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 @@ namespace JSC {
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 @@ 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)
{
......
......@@ -30,6 +30,7 @@
#include "PropertyDescriptor.h"
#include "PropertySlot.h"
#include "RopeImpl.h"
#include "Structure.h"
namespace JSC {
......
......@@ -22,6 +22,7 @@
#define ScopeChain_h
#include "JSCell.h"
#include "Structure.h"
#include <wtf/FastAllocBase.h>
namespace JSC {
......
......@@ -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<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
......@@ -27,6 +27,7 @@
#define StructureChain_h
#include "JSCell.h"
#include "Structure.h"
#include <wtf/OwnArrayPtr.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