} doubles;
} NaNInf = { {
-#if PLATFORM(BIG_ENDIAN)
+#if CPU(BIG_ENDIAN)
{ 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 },
{ 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
-#elif PLATFORM(MIDDLE_ENDIAN)
+#elif CPU(MIDDLE_ENDIAN)
{ 0, 0, 0xf8, 0x7f, 0, 0, 0, 0 },
{ 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 }
#else
#endif // !(defined NAN && defined INFINITY)
-void* JSCell::operator new(size_t size, ExecState* exec)
-{
-#ifdef JAVASCRIPTCORE_BUILDING_ALL_IN_ONE_FILE
- return exec->heap()->inlineAllocate(size);
-#else
- return exec->heap()->allocate(size);
-#endif
-}
+const ClassInfo JSCell::s_dummyCellInfo = { "DummyCell", 0, 0, 0 };
bool JSCell::getUInt32(uint32_t&) const
{
return false;
}
-bool JSCell::getString(UString&stringValue) const
+bool JSCell::getString(ExecState* exec, UString&stringValue) const
{
if (!isString())
return false;
- stringValue = static_cast<const JSString*>(this)->value();
+ stringValue = static_cast<const JSString*>(this)->value(exec);
return true;
}
-UString JSCell::getString() const
+UString JSCell::getString(ExecState* exec) const
{
- return isString() ? static_cast<const JSString*>(this)->value() : UString();
+ return isString() ? static_cast<const JSString*>(this)->value(exec) : UString();
}
JSObject* JSCell::getObject()
{
- return isObject() ? static_cast<JSObject*>(this) : 0;
+ return isObject() ? asObject(this) : 0;
}
const JSObject* JSCell::getObject() const
// This is not a general purpose implementation of getOwnPropertySlot.
// It should only be called by JSValue::get.
// It calls getPropertySlot, not getOwnPropertySlot.
- JSObject* object = toObject(exec);
+ JSObject* object = toObject(exec, exec->lexicalGlobalObject());
slot.setBase(object);
if (!object->getPropertySlot(exec, identifier, slot))
slot.setUndefined();
// This is not a general purpose implementation of getOwnPropertySlot.
// It should only be called by JSValue::get.
// It calls getPropertySlot, not getOwnPropertySlot.
- JSObject* object = toObject(exec);
+ JSObject* object = toObject(exec, exec->lexicalGlobalObject());
slot.setBase(object);
if (!object->getPropertySlot(exec, identifier, slot))
slot.setUndefined();
void JSCell::put(ExecState* exec, const Identifier& identifier, JSValue value, PutPropertySlot& slot)
{
- toObject(exec)->put(exec, identifier, value, slot);
+ toObject(exec, exec->lexicalGlobalObject())->put(exec, identifier, value, slot);
}
void JSCell::put(ExecState* exec, unsigned identifier, JSValue value)
{
- toObject(exec)->put(exec, identifier, value);
+ toObject(exec, exec->lexicalGlobalObject())->put(exec, identifier, value);
}
bool JSCell::deleteProperty(ExecState* exec, const Identifier& identifier)
{
- return toObject(exec)->deleteProperty(exec, identifier);
+ return toObject(exec, exec->lexicalGlobalObject())->deleteProperty(exec, identifier);
}
bool JSCell::deleteProperty(ExecState* exec, unsigned identifier)
{
- return toObject(exec)->deleteProperty(exec, identifier);
+ return toObject(exec, exec->lexicalGlobalObject())->deleteProperty(exec, identifier);
}
JSObject* JSCell::toThisObject(ExecState* exec) const
{
- return toObject(exec);
+ return toObject(exec, exec->lexicalGlobalObject());
+}
+
+JSValue JSCell::getJSNumber()
+{
+ return JSValue();
+}
+
+bool JSCell::isGetterSetter() const
+{
+ return false;
+}
+
+JSValue JSCell::toPrimitive(ExecState*, PreferredPrimitiveType) const
+{
+ ASSERT_NOT_REACHED();
+ return JSValue();
}
-UString JSCell::toThisString(ExecState* exec) const
+bool JSCell::getPrimitiveNumber(ExecState*, double&, JSValue&)
{
- return toThisObject(exec)->toString(exec);
+ ASSERT_NOT_REACHED();
+ return false;
}
-JSString* JSCell::toThisJSString(ExecState* exec)
+bool JSCell::toBoolean(ExecState*) const
{
- return jsString(exec, toThisString(exec));
+ ASSERT_NOT_REACHED();
+ return false;
}
-const ClassInfo* JSCell::classInfo() const
+double JSCell::toNumber(ExecState*) const
{
+ ASSERT_NOT_REACHED();
return 0;
}
-JSValue JSCell::getJSNumber()
+UString JSCell::toString(ExecState*) const
{
- return JSValue();
+ ASSERT_NOT_REACHED();
+ return UString();
}
-bool JSCell::isGetterSetter() const
+JSObject* JSCell::toObject(ExecState*, JSGlobalObject*) const
+{
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
+bool isZombie(const JSCell* cell)
{
+#if ENABLE(JSC_ZOMBIES)
+ return cell && cell->isZombie();
+#else
+ UNUSED_PARAM(cell);
return false;
+#endif
+}
+
+void slowValidateCell(JSCell* cell)
+{
+ ASSERT_GC_OBJECT_LOOKS_VALID(cell);
}
} // namespace JSC