diff options
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSValue.h')
-rw-r--r-- | Source/JavaScriptCore/runtime/JSValue.h | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/Source/JavaScriptCore/runtime/JSValue.h b/Source/JavaScriptCore/runtime/JSValue.h index b2e7a51..098123e 100644 --- a/Source/JavaScriptCore/runtime/JSValue.h +++ b/Source/JavaScriptCore/runtime/JSValue.h @@ -37,6 +37,7 @@ namespace JSC { class Identifier; class JSCell; class JSGlobalData; + class JSGlobalObject; class JSImmediate; class JSObject; class JSString; @@ -52,11 +53,33 @@ namespace JSC { enum PreferredPrimitiveType { NoPreference, PreferNumber, PreferString }; + #if USE(JSVALUE32_64) typedef int64_t EncodedJSValue; #else typedef void* EncodedJSValue; #endif + + union EncodedValueDescriptor { + EncodedJSValue asEncodedJSValue; +#if USE(JSVALUE32_64) + double asDouble; +#elif USE(JSVALUE64) + JSCell* ptr; +#endif + +#if CPU(BIG_ENDIAN) + struct { + int32_t tag; + int32_t payload; + } asBits; +#else + struct { + int32_t payload; + int32_t tag; + } asBits; +#endif + }; double nonInlineNaN(); @@ -167,6 +190,7 @@ namespace JSC { UString toString(ExecState*) const; UString toPrimitiveString(ExecState*) const; JSObject* toObject(ExecState*) const; + JSObject* toObject(ExecState*, JSGlobalObject*) const; // Integer conversions. double toInteger(ExecState*) const; @@ -222,7 +246,7 @@ namespace JSC { JSValue(HashTableDeletedValueTag); inline const JSValue asValue() const { return *this; } - JSObject* toObjectSlowCase(ExecState*) const; + JSObject* toObjectSlowCase(ExecState*, JSGlobalObject*) const; JSObject* toThisObjectSlowCase(ExecState*) const; JSObject* synthesizePrototype(ExecState*) const; @@ -239,28 +263,14 @@ namespace JSC { enum { DeletedValueTag = 0xfffffff8 }; enum { LowestTag = DeletedValueTag }; - + uint32_t tag() const; int32_t payload() const; - union { - EncodedJSValue asEncodedJSValue; - double asDouble; -#if CPU(BIG_ENDIAN) - struct { - int32_t tag; - int32_t payload; - } asBits; -#else - struct { - int32_t payload; - int32_t tag; - } asBits; -#endif - } u; -#else // USE(JSVALUE32_64) + EncodedValueDescriptor u; +#elif USE(JSVALUE64) JSCell* m_ptr; -#endif // USE(JSVALUE32_64) +#endif }; #if USE(JSVALUE32_64) @@ -392,9 +402,6 @@ namespace JSC { { JSValue v; v.u.asEncodedJSValue = encodedJSValue; -#if ENABLE(JSC_ZOMBIES) - ASSERT(!v.isZombie()); -#endif return v; } |