X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..fb8617cde5834786bd4e4afd579883e4acf5666e:/runtime/JSCell.cpp diff --git a/runtime/JSCell.cpp b/runtime/JSCell.cpp index d449deb..869fbfc 100644 --- a/runtime/JSCell.cpp +++ b/runtime/JSCell.cpp @@ -59,10 +59,10 @@ static const union { } 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 @@ -76,46 +76,27 @@ extern const double Inf = NaNInf.doubles.Inf_Double; #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 -} - bool JSCell::getUInt32(uint32_t&) const { return false; } -bool JSCell::getTruncatedInt32(int32_t&) const -{ - return false; -} - -bool JSCell::getTruncatedUInt32(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(this)->value(); + stringValue = static_cast(this)->value(exec); return true; } -UString JSCell::getString() const +UString JSCell::getString(ExecState* exec) const { - return isString() ? static_cast(this)->value() : UString(); + return isString() ? static_cast(this)->value(exec) : UString(); } JSObject* JSCell::getObject() { - return isObject() ? static_cast(this) : 0; + return isObject() ? asObject(this) : 0; } const JSObject* JSCell::getObject() const @@ -157,12 +138,12 @@ bool JSCell::getOwnPropertySlot(ExecState* exec, unsigned identifier, PropertySl return true; } -void JSCell::put(ExecState* exec, const Identifier& identifier, JSValuePtr value, PutPropertySlot& slot) +void JSCell::put(ExecState* exec, const Identifier& identifier, JSValue value, PutPropertySlot& slot) { toObject(exec)->put(exec, identifier, value, slot); } -void JSCell::put(ExecState* exec, unsigned identifier, JSValuePtr value) +void JSCell::put(ExecState* exec, unsigned identifier, JSValue value) { toObject(exec)->put(exec, identifier, value); } @@ -197,9 +178,9 @@ const ClassInfo* JSCell::classInfo() const return 0; } -JSValuePtr JSCell::getJSNumber() +JSValue JSCell::getJSNumber() { - return noValue(); + return JSValue(); } bool JSCell::isGetterSetter() const @@ -207,4 +188,40 @@ bool JSCell::isGetterSetter() const return false; } +JSValue JSCell::toPrimitive(ExecState*, PreferredPrimitiveType) const +{ + ASSERT_NOT_REACHED(); + return JSValue(); +} + +bool JSCell::getPrimitiveNumber(ExecState*, double&, JSValue&) +{ + ASSERT_NOT_REACHED(); + return false; +} + +bool JSCell::toBoolean(ExecState*) const +{ + ASSERT_NOT_REACHED(); + return false; +} + +double JSCell::toNumber(ExecState*) const +{ + ASSERT_NOT_REACHED(); + return 0; +} + +UString JSCell::toString(ExecState*) const +{ + ASSERT_NOT_REACHED(); + return UString(); +} + +JSObject* JSCell::toObject(ExecState*) const +{ + ASSERT_NOT_REACHED(); + return 0; +} + } // namespace JSC