Ignore:
Timestamp:
Oct 18, 2008, 6:52:42 PM (17 years ago)
Author:
Darin Adler
Message:

JavaScriptCore:

2008-10-18 Darin Adler <Darin Adler>

Reviewed by Cameron Zwarich.

Use JSValuePtr everywhere instead of JSValue*. In the future, we'll be
changing JSValuePtr to be a class, and then eventually renaming it
to JSValue once that's done.

  • JavaScriptCore.exp: Update entry points, since some now take JSValue* instead of const JSValue*.
  • API/APICast.h:
  • API/JSCallbackConstructor.h:
  • API/JSCallbackFunction.cpp:
  • API/JSCallbackFunction.h:
  • API/JSCallbackObject.h:
  • API/JSCallbackObjectFunctions.h:
  • API/JSContextRef.cpp:
  • API/JSObjectRef.cpp:
  • API/JSValueRef.cpp:
  • VM/CTI.cpp:
  • VM/CTI.h:
  • VM/CodeBlock.cpp:
  • VM/CodeBlock.h:
  • VM/CodeGenerator.cpp:
  • VM/CodeGenerator.h:
  • VM/ExceptionHelpers.cpp:
  • VM/ExceptionHelpers.h:
  • VM/JSPropertyNameIterator.cpp:
  • VM/JSPropertyNameIterator.h:
  • VM/Machine.cpp:
  • VM/Machine.h:
  • VM/Register.h:
  • kjs/ArgList.cpp:
  • kjs/ArgList.h:
  • kjs/Arguments.cpp:
  • kjs/Arguments.h:
  • kjs/ArrayConstructor.cpp:
  • kjs/ArrayPrototype.cpp:
  • kjs/BooleanConstructor.cpp:
  • kjs/BooleanConstructor.h:
  • kjs/BooleanObject.h:
  • kjs/BooleanPrototype.cpp:
  • kjs/CallData.cpp:
  • kjs/CallData.h:
  • kjs/ConstructData.cpp:
  • kjs/ConstructData.h:
  • kjs/DateConstructor.cpp:
  • kjs/DateInstance.h:
  • kjs/DatePrototype.cpp:
  • kjs/DebuggerCallFrame.cpp:
  • kjs/DebuggerCallFrame.h:
  • kjs/ErrorConstructor.cpp:
  • kjs/ErrorPrototype.cpp:
  • kjs/ExecState.cpp:
  • kjs/ExecState.h:
  • kjs/FunctionConstructor.cpp:
  • kjs/FunctionPrototype.cpp:
  • kjs/GetterSetter.cpp:
  • kjs/GetterSetter.h:
  • kjs/InternalFunction.h:
  • kjs/JSActivation.cpp:
  • kjs/JSActivation.h:
  • kjs/JSArray.cpp:
  • kjs/JSArray.h:
  • kjs/JSCell.cpp:
  • kjs/JSCell.h:
  • kjs/JSFunction.cpp:
  • kjs/JSFunction.h:
  • kjs/JSGlobalData.h:
  • kjs/JSGlobalObject.cpp:
  • kjs/JSGlobalObject.h:
  • kjs/JSGlobalObjectFunctions.cpp:
  • kjs/JSGlobalObjectFunctions.h:
  • kjs/JSImmediate.cpp:
  • kjs/JSImmediate.h:
  • kjs/JSNotAnObject.cpp:
  • kjs/JSNotAnObject.h:
  • kjs/JSNumberCell.cpp:
  • kjs/JSNumberCell.h:
  • kjs/JSObject.cpp:
  • kjs/JSObject.h:
  • kjs/JSStaticScopeObject.cpp:
  • kjs/JSStaticScopeObject.h:
  • kjs/JSString.cpp:
  • kjs/JSString.h:
  • kjs/JSValue.h:
  • kjs/JSVariableObject.h:
  • kjs/JSWrapperObject.h:
  • kjs/MathObject.cpp:
  • kjs/NativeErrorConstructor.cpp:
  • kjs/NumberConstructor.cpp:
  • kjs/NumberConstructor.h:
  • kjs/NumberObject.cpp:
  • kjs/NumberObject.h:
  • kjs/NumberPrototype.cpp:
  • kjs/ObjectConstructor.cpp:
  • kjs/ObjectPrototype.cpp:
  • kjs/ObjectPrototype.h:
  • kjs/PropertyMap.h:
  • kjs/PropertySlot.cpp:
  • kjs/PropertySlot.h:
  • kjs/RegExpConstructor.cpp:
  • kjs/RegExpConstructor.h:
  • kjs/RegExpMatchesArray.h:
  • kjs/RegExpObject.cpp:
  • kjs/RegExpObject.h:
  • kjs/RegExpPrototype.cpp:
  • kjs/Shell.cpp:
  • kjs/StringConstructor.cpp:
  • kjs/StringObject.cpp:
  • kjs/StringObject.h:
  • kjs/StringObjectThatMasqueradesAsUndefined.h:
  • kjs/StringPrototype.cpp:
  • kjs/StructureID.cpp:
  • kjs/StructureID.h:
  • kjs/collector.cpp:
  • kjs/collector.h:
  • kjs/completion.h:
  • kjs/grammar.y:
  • kjs/interpreter.cpp:
  • kjs/interpreter.h:
  • kjs/lookup.cpp:
  • kjs/lookup.h:
  • kjs/nodes.h:
  • kjs/operations.cpp:
  • kjs/operations.h:
  • kjs/protect.h:
  • profiler/ProfileGenerator.cpp: Replace JSValue* with JSValuePtr.

JavaScriptGlue:

2008-10-18 Darin Adler <Darin Adler>

Reviewed by Cameron Zwarich.

Use JSValuePtr everywhere instead of JSValue*. In the future, we'll be
changing JSValuePtr to be a class, and then eventually renaming it
to JSValue once that's done.

  • JSObject.cpp:
  • JSValueWrapper.cpp:
  • UserObjectImp.cpp:
  • UserObjectImp.h: Replace JSValue* with JSValuePtr.

WebCore:

2008-10-18 Darin Adler <Darin Adler>

Reviewed by Cameron Zwarich.

Use JSValuePtr everywhere instead of JSValue*. In the future, we'll be
changing JSValuePtr to be a class, and then eventually renaming it
to JSValue once that's done.

  • bindings/js/JSAttrCustom.cpp:
  • bindings/js/JSCSSRuleCustom.cpp:
  • bindings/js/JSCSSStyleDeclarationCustom.cpp:
  • bindings/js/JSCSSValueCustom.cpp:
  • bindings/js/JSCanvasPixelArrayCustom.h:
  • bindings/js/JSCanvasRenderingContext2DCustom.cpp:
  • bindings/js/JSClipboardCustom.cpp:
  • bindings/js/JSConsoleCustom.cpp:
  • bindings/js/JSCustomSQLStatementCallback.cpp:
  • bindings/js/JSCustomSQLStatementErrorCallback.cpp:
  • bindings/js/JSCustomSQLTransactionCallback.cpp:
  • bindings/js/JSCustomSQLTransactionErrorCallback.cpp:
  • bindings/js/JSCustomVoidCallback.cpp:
  • bindings/js/JSCustomVoidCallback.h:
  • bindings/js/JSCustomXPathNSResolver.cpp:
  • bindings/js/JSDOMApplicationCacheCustom.cpp:
  • bindings/js/JSDOMBinding.cpp:
  • bindings/js/JSDOMBinding.h:
  • bindings/js/JSDOMWindowBase.cpp:
  • bindings/js/JSDOMWindowBase.h:
  • bindings/js/JSDOMWindowCustom.cpp:
  • bindings/js/JSDOMWindowCustom.h:
  • bindings/js/JSDOMWindowShell.cpp:
  • bindings/js/JSDOMWindowShell.h:
  • bindings/js/JSDatabaseCustom.cpp:
  • bindings/js/JSDocumentCustom.cpp:
  • bindings/js/JSElementCustom.cpp:
  • bindings/js/JSEventCustom.cpp:
  • bindings/js/JSEventListener.cpp:
  • bindings/js/JSEventTarget.cpp:
  • bindings/js/JSEventTargetBase.h:
  • bindings/js/JSEventTargetNodeCustom.cpp:
  • bindings/js/JSHTMLAllCollection.h:
  • bindings/js/JSHTMLAppletElementCustom.cpp:
  • bindings/js/JSHTMLCollectionCustom.cpp:
  • bindings/js/JSHTMLDocumentCustom.cpp:
  • bindings/js/JSHTMLEmbedElementCustom.cpp:
  • bindings/js/JSHTMLFormElementCustom.cpp:
  • bindings/js/JSHTMLFrameElementCustom.cpp:
  • bindings/js/JSHTMLFrameSetElementCustom.cpp:
  • bindings/js/JSHTMLIFrameElementCustom.cpp:
  • bindings/js/JSHTMLInputElementCustom.cpp:
  • bindings/js/JSHTMLObjectElementCustom.cpp:
  • bindings/js/JSHTMLOptionsCollectionCustom.cpp:
  • bindings/js/JSHTMLSelectElementCustom.cpp:
  • bindings/js/JSHTMLSelectElementCustom.h:
  • bindings/js/JSHistoryCustom.cpp:
  • bindings/js/JSImageDataCustom.cpp:
  • bindings/js/JSInspectedObjectWrapper.cpp:
  • bindings/js/JSInspectedObjectWrapper.h:
  • bindings/js/JSInspectorCallbackWrapper.cpp:
  • bindings/js/JSInspectorCallbackWrapper.h:
  • bindings/js/JSJavaScriptCallFrameCustom.cpp:
  • bindings/js/JSLocationCustom.cpp:
  • bindings/js/JSMessagePortCustom.cpp:
  • bindings/js/JSMimeTypeArrayCustom.cpp:
  • bindings/js/JSNamedNodeMapCustom.cpp:
  • bindings/js/JSNamedNodesCollection.cpp:
  • bindings/js/JSNamedNodesCollection.h:
  • bindings/js/JSNavigatorCustom.cpp:
  • bindings/js/JSNodeCustom.cpp:
  • bindings/js/JSNodeFilterCondition.cpp:
  • bindings/js/JSNodeFilterCustom.cpp:
  • bindings/js/JSNodeIteratorCustom.cpp:
  • bindings/js/JSNodeListCustom.cpp:
  • bindings/js/JSPluginArrayCustom.cpp:
  • bindings/js/JSPluginCustom.cpp:
  • bindings/js/JSPluginElementFunctions.cpp:
  • bindings/js/JSPluginElementFunctions.h:
  • bindings/js/JSQuarantinedObjectWrapper.cpp:
  • bindings/js/JSQuarantinedObjectWrapper.h:
  • bindings/js/JSRGBColor.cpp:
  • bindings/js/JSRGBColor.h:
  • bindings/js/JSSQLResultSetRowListCustom.cpp:
  • bindings/js/JSSQLTransactionCustom.cpp:
  • bindings/js/JSSVGElementInstanceCustom.cpp:
  • bindings/js/JSSVGLengthCustom.cpp:
  • bindings/js/JSSVGMatrixCustom.cpp:
  • bindings/js/JSSVGPathSegCustom.cpp:
  • bindings/js/JSSVGPathSegListCustom.cpp:
  • bindings/js/JSSVGPointListCustom.cpp:
  • bindings/js/JSSVGTransformListCustom.cpp:
  • bindings/js/JSStorageCustom.cpp:
  • bindings/js/JSStyleSheetCustom.cpp:
  • bindings/js/JSStyleSheetListCustom.cpp:
  • bindings/js/JSTextCustom.cpp:
  • bindings/js/JSTreeWalkerCustom.cpp:
  • bindings/js/JSXMLHttpRequestCustom.cpp:
  • bindings/js/JSXMLHttpRequestUploadCustom.cpp:
  • bindings/js/JSXSLTProcessorCustom.cpp:
  • bindings/js/ScheduledAction.cpp:
  • bindings/js/ScheduledAction.h:
  • bindings/js/ScriptController.cpp:
  • bindings/js/ScriptController.h:
  • bindings/objc/WebScriptObject.mm:
  • bindings/scripts/CodeGeneratorJS.pm:
  • bridge/NP_jsobject.cpp:
  • bridge/c/c_instance.cpp:
  • bridge/c/c_instance.h:
  • bridge/c/c_runtime.cpp:
  • bridge/c/c_runtime.h:
  • bridge/c/c_utility.cpp:
  • bridge/jni/jni_instance.cpp:
  • bridge/jni/jni_instance.h:
  • bridge/jni/jni_jsobject.mm:
  • bridge/jni/jni_objc.mm:
  • bridge/jni/jni_runtime.cpp:
  • bridge/jni/jni_runtime.h:
  • bridge/jni/jni_utility.cpp:
  • bridge/objc/objc_class.mm:
  • bridge/objc/objc_instance.h:
  • bridge/objc/objc_instance.mm:
  • bridge/objc/objc_runtime.h:
  • bridge/objc/objc_runtime.mm:
  • bridge/objc/objc_utility.h:
  • bridge/objc/objc_utility.mm:
  • bridge/runtime.h:
  • bridge/runtime_array.cpp:
  • bridge/runtime_array.h:
  • bridge/runtime_method.cpp:
  • bridge/runtime_method.h:
  • bridge/runtime_object.cpp:
  • bridge/runtime_object.h:
  • inspector/JavaScriptCallFrame.cpp:
  • inspector/JavaScriptCallFrame.h:
  • inspector/JavaScriptProfile.cpp:
  • inspector/JavaScriptProfileNode.cpp:
  • loader/FrameLoader.cpp:
  • loader/FrameLoader.h:
  • page/Console.cpp:
  • page/Console.h:
  • plugins/MimeTypeArray.h:
  • plugins/Plugin.h:
  • plugins/PluginArray.h:
  • xml/XMLHttpRequest.cpp: Replace JSValue* with JSValuePtr.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/JSImmediate.h

    r37681 r37684  
    3939    class UString;
    4040
    41     inline JSValue* noValue() { return 0; }
    42     inline void* asPointer(JSValue* value) { return value; }
     41    typedef JSValue* JSValuePtr;
     42
     43    inline JSValuePtr noValue() { return 0; }
     44    inline void* asPointer(JSValuePtr value) { return value; }
    4345
    4446    /*
    45      * A JSValue* is either a pointer to a cell (a heap-allocated object) or an immediate (a type-tagged
    46      * value masquerading as a pointer). The low two bits in a JSValue* are available for type tagging
     47     * A JSValuePtr is either a pointer to a cell (a heap-allocated object) or an immediate (a type-tagged
     48     * value masquerading as a pointer). The low two bits in a JSValuePtr are available for type tagging
    4749     * because allocator alignment guarantees they will be 00 in cell pointers.
    4850     *
     
    107109 
    108110    public:
    109         static ALWAYS_INLINE bool isImmediate(const JSValue* v)
     111        static ALWAYS_INLINE bool isImmediate(JSValuePtr v)
    110112        {
    111113            return rawValue(v) & TagMask;
    112114        }
    113115       
    114         static ALWAYS_INLINE bool isNumber(const JSValue* v)
     116        static ALWAYS_INLINE bool isNumber(JSValuePtr v)
    115117        {
    116118            return rawValue(v) & TagBitTypeInteger;
    117119        }
    118120
    119         static ALWAYS_INLINE bool isPositiveNumber(const JSValue* v)
     121        static ALWAYS_INLINE bool isPositiveNumber(JSValuePtr v)
    120122        {
    121123            // A single mask to check for the sign bit and the number tag all at once.
     
    123125        }
    124126       
    125         static ALWAYS_INLINE bool isBoolean(const JSValue* v)
     127        static ALWAYS_INLINE bool isBoolean(JSValuePtr v)
    126128        {
    127129            return (rawValue(v) & FullTagTypeMask) == FullTagTypeBool;
    128130        }
    129131       
    130         static ALWAYS_INLINE bool isUndefinedOrNull(const JSValue* v)
     132        static ALWAYS_INLINE bool isUndefinedOrNull(JSValuePtr v)
    131133        {
    132134            // Undefined and null share the same value, bar the 'undefined' bit in the extended tag.
     
    134136        }
    135137
    136         static bool isNegative(const JSValue* v)
     138        static bool isNegative(JSValuePtr v)
    137139        {
    138140            ASSERT(isNumber(v));
     
    140142        }
    141143
    142         static JSValue* from(char);
    143         static JSValue* from(signed char);
    144         static JSValue* from(unsigned char);
    145         static JSValue* from(short);
    146         static JSValue* from(unsigned short);
    147         static JSValue* from(int);
    148         static JSValue* from(unsigned);
    149         static JSValue* from(long);
    150         static JSValue* from(unsigned long);
    151         static JSValue* from(long long);
    152         static JSValue* from(unsigned long long);
    153         static JSValue* from(double);
    154 
    155         static ALWAYS_INLINE bool isEitherImmediate(const JSValue* v1, const JSValue* v2)
     144        static JSValuePtr from(char);
     145        static JSValuePtr from(signed char);
     146        static JSValuePtr from(unsigned char);
     147        static JSValuePtr from(short);
     148        static JSValuePtr from(unsigned short);
     149        static JSValuePtr from(int);
     150        static JSValuePtr from(unsigned);
     151        static JSValuePtr from(long);
     152        static JSValuePtr from(unsigned long);
     153        static JSValuePtr from(long long);
     154        static JSValuePtr from(unsigned long long);
     155        static JSValuePtr from(double);
     156
     157        static ALWAYS_INLINE bool isEitherImmediate(JSValuePtr v1, JSValuePtr v2)
    156158        {
    157159            return (rawValue(v1) | rawValue(v2)) & TagMask;
    158160        }
    159161
    160         static ALWAYS_INLINE bool isAnyImmediate(const JSValue* v1, const JSValue* v2, JSValue* v3)
     162        static ALWAYS_INLINE bool isAnyImmediate(JSValuePtr v1, JSValuePtr v2, JSValuePtr v3)
    161163        {
    162164            return (rawValue(v1) | rawValue(v2) | rawValue(v3)) & TagMask;
    163165        }
    164166
    165         static ALWAYS_INLINE bool areBothImmediate(const JSValue* v1, const JSValue* v2)
     167        static ALWAYS_INLINE bool areBothImmediate(JSValuePtr v1, JSValuePtr v2)
    166168        {
    167169            return isImmediate(v1) & isImmediate(v2);
    168170        }
    169171
    170         static ALWAYS_INLINE bool areBothImmediateNumbers(const JSValue* v1, const JSValue* v2)
     172        static ALWAYS_INLINE bool areBothImmediateNumbers(JSValuePtr v1, JSValuePtr v2)
    171173        {
    172174            return rawValue(v1) & rawValue(v2) & TagBitTypeInteger;
    173175        }
    174176
    175         static ALWAYS_INLINE JSValue* andImmediateNumbers(const JSValue* v1, const JSValue* v2)
     177        static ALWAYS_INLINE JSValuePtr andImmediateNumbers(JSValuePtr v1, JSValuePtr v2)
    176178        {
    177179            ASSERT(areBothImmediateNumbers(v1, v2));
     
    179181        }
    180182
    181         static ALWAYS_INLINE JSValue* xorImmediateNumbers(const JSValue* v1, const JSValue* v2)
     183        static ALWAYS_INLINE JSValuePtr xorImmediateNumbers(JSValuePtr v1, JSValuePtr v2)
    182184        {
    183185            ASSERT(areBothImmediateNumbers(v1, v2));
     
    185187        }
    186188
    187         static ALWAYS_INLINE JSValue* orImmediateNumbers(const JSValue* v1, const JSValue* v2)
     189        static ALWAYS_INLINE JSValuePtr orImmediateNumbers(JSValuePtr v1, JSValuePtr v2)
    188190        {
    189191            ASSERT(areBothImmediateNumbers(v1, v2));
     
    191193        }
    192194
    193         static ALWAYS_INLINE JSValue* rightShiftImmediateNumbers(const JSValue* val, const JSValue* shift)
     195        static ALWAYS_INLINE JSValuePtr rightShiftImmediateNumbers(JSValuePtr val, JSValuePtr shift)
    194196        {
    195197            ASSERT(areBothImmediateNumbers(val, shift));
     
    197199        }
    198200
    199         static ALWAYS_INLINE bool canDoFastAdditiveOperations(const JSValue* v)
     201        static ALWAYS_INLINE bool canDoFastAdditiveOperations(JSValuePtr v)
    200202        {
    201203            // Number is non-negative and an operation involving two of these can't overflow.
     
    204206        }
    205207
    206         static ALWAYS_INLINE JSValue* addImmediateNumbers(const JSValue* v1, const JSValue* v2)
     208        static ALWAYS_INLINE JSValuePtr addImmediateNumbers(JSValuePtr v1, JSValuePtr v2)
    207209        {
    208210            ASSERT(canDoFastAdditiveOperations(v1));
     
    211213        }
    212214
    213         static ALWAYS_INLINE JSValue* subImmediateNumbers(const JSValue* v1, const JSValue* v2)
     215        static ALWAYS_INLINE JSValuePtr subImmediateNumbers(JSValuePtr v1, JSValuePtr v2)
    214216        {
    215217            ASSERT(canDoFastAdditiveOperations(v1));
     
    218220        }
    219221
    220         static ALWAYS_INLINE JSValue* incImmediateNumber(const JSValue* v)
     222        static ALWAYS_INLINE JSValuePtr incImmediateNumber(JSValuePtr v)
    221223        {
    222224            ASSERT(canDoFastAdditiveOperations(v));
     
    224226        }
    225227
    226         static ALWAYS_INLINE JSValue* decImmediateNumber(const JSValue* v)
     228        static ALWAYS_INLINE JSValuePtr decImmediateNumber(JSValuePtr v)
    227229        {
    228230            ASSERT(canDoFastAdditiveOperations(v));
     
    230232        }
    231233
    232         static double toDouble(const JSValue*);
    233         static bool toBoolean(const JSValue*);
    234         static JSObject* toObject(const JSValue*, ExecState*);
    235         static UString toString(const JSValue*);
    236 
    237         static bool getUInt32(const JSValue*, uint32_t&);
    238         static bool getTruncatedInt32(const JSValue*, int32_t&);
    239         static bool getTruncatedUInt32(const JSValue*, uint32_t&);
    240 
    241         static int32_t getTruncatedInt32(const JSValue*);
    242         static uint32_t getTruncatedUInt32(const JSValue*);
    243 
    244         static JSValue* trueImmediate();
    245         static JSValue* falseImmediate();
    246         static JSValue* undefinedImmediate();
    247         static JSValue* nullImmediate();
    248         static JSValue* zeroImmediate();
    249         static JSValue* oneImmediate();
    250 
    251         static JSValue* impossibleValue();
    252        
    253         static JSObject* prototype(const JSValue*, ExecState*);
     234        static double toDouble(JSValuePtr);
     235        static bool toBoolean(JSValuePtr);
     236        static JSObject* toObject(JSValuePtr, ExecState*);
     237        static UString toString(JSValuePtr);
     238
     239        static bool getUInt32(JSValuePtr, uint32_t&);
     240        static bool getTruncatedInt32(JSValuePtr, int32_t&);
     241        static bool getTruncatedUInt32(JSValuePtr, uint32_t&);
     242
     243        static int32_t getTruncatedInt32(JSValuePtr);
     244        static uint32_t getTruncatedUInt32(JSValuePtr);
     245
     246        static JSValuePtr trueImmediate();
     247        static JSValuePtr falseImmediate();
     248        static JSValuePtr undefinedImmediate();
     249        static JSValuePtr nullImmediate();
     250        static JSValuePtr zeroImmediate();
     251        static JSValuePtr oneImmediate();
     252
     253        static JSValuePtr impossibleValue();
     254       
     255        static JSObject* prototype(JSValuePtr, ExecState*);
    254256
    255257    private:
     
    258260        static const unsigned maxImmediateUInt = maxImmediateInt;
    259261
    260         static ALWAYS_INLINE JSValue* makeValue(uintptr_t integer)
    261         {
    262             return reinterpret_cast<JSValue*>(integer);
    263         }
    264 
    265         static ALWAYS_INLINE JSValue* makeInt(int32_t value)
     262        static ALWAYS_INLINE JSValuePtr makeValue(uintptr_t integer)
     263        {
     264            return reinterpret_cast<JSValuePtr>(integer);
     265        }
     266
     267        static ALWAYS_INLINE JSValuePtr makeInt(int32_t value)
    266268        {
    267269            return makeValue((value << IntegerPayloadShift) | TagBitTypeInteger);
    268270        }
    269271       
    270         static ALWAYS_INLINE JSValue* makeBool(bool b)
     272        static ALWAYS_INLINE JSValuePtr makeBool(bool b)
    271273        {
    272274            return makeValue((static_cast<uintptr_t>(b) << ExtendedPayloadShift) | FullTagTypeBool);
    273275        }
    274276       
    275         static ALWAYS_INLINE JSValue* makeUndefined()
     277        static ALWAYS_INLINE JSValuePtr makeUndefined()
    276278        {
    277279            return makeValue(FullTagTypeUndefined);
    278280        }
    279281       
    280         static ALWAYS_INLINE JSValue* makeNull()
     282        static ALWAYS_INLINE JSValuePtr makeNull()
    281283        {
    282284            return makeValue(FullTagTypeNull);
    283285        }
    284286       
    285         static ALWAYS_INLINE int32_t intValue(const JSValue* v)
     287        static ALWAYS_INLINE int32_t intValue(JSValuePtr v)
    286288        {
    287289            return static_cast<int32_t>(static_cast<intptr_t>(rawValue(v)) >> IntegerPayloadShift);
    288290        }
    289291       
    290         static ALWAYS_INLINE uint32_t uintValue(const JSValue* v)
     292        static ALWAYS_INLINE uint32_t uintValue(JSValuePtr v)
    291293        {
    292294            return static_cast<uint32_t>(rawValue(v) >> IntegerPayloadShift);
    293295        }
    294296       
    295         static ALWAYS_INLINE bool boolValue(const JSValue* v)
     297        static ALWAYS_INLINE bool boolValue(JSValuePtr v)
    296298        {
    297299            return rawValue(v) & ExtendedPayloadBitBoolValue;
    298300        }
    299301       
    300         static ALWAYS_INLINE uintptr_t rawValue(const JSValue* v)
     302        static ALWAYS_INLINE uintptr_t rawValue(JSValuePtr v)
    301303        {
    302304            return reinterpret_cast<uintptr_t>(v);
     
    306308    };
    307309
    308     ALWAYS_INLINE JSValue* JSImmediate::trueImmediate() { return makeBool(true); }
    309     ALWAYS_INLINE JSValue* JSImmediate::falseImmediate() { return makeBool(false); }
    310     ALWAYS_INLINE JSValue* JSImmediate::undefinedImmediate() { return makeUndefined(); }
    311     ALWAYS_INLINE JSValue* JSImmediate::nullImmediate() { return makeNull(); }
    312     ALWAYS_INLINE JSValue* JSImmediate::zeroImmediate() { return makeInt(0); }
    313     ALWAYS_INLINE JSValue* JSImmediate::oneImmediate() { return makeInt(1); }
     310    ALWAYS_INLINE JSValuePtr JSImmediate::trueImmediate() { return makeBool(true); }
     311    ALWAYS_INLINE JSValuePtr JSImmediate::falseImmediate() { return makeBool(false); }
     312    ALWAYS_INLINE JSValuePtr JSImmediate::undefinedImmediate() { return makeUndefined(); }
     313    ALWAYS_INLINE JSValuePtr JSImmediate::nullImmediate() { return makeNull(); }
     314    ALWAYS_INLINE JSValuePtr JSImmediate::zeroImmediate() { return makeInt(0); }
     315    ALWAYS_INLINE JSValuePtr JSImmediate::oneImmediate() { return makeInt(1); }
    314316
    315317    // This value is impossible because 0x4 is not a valid pointer but a tag of 0 would indicate non-immediate
    316     ALWAYS_INLINE JSValue* JSImmediate::impossibleValue() { return makeValue(0x4); }
    317 
    318     ALWAYS_INLINE bool JSImmediate::toBoolean(const JSValue* v)
     318    ALWAYS_INLINE JSValuePtr JSImmediate::impossibleValue() { return makeValue(0x4); }
     319
     320    ALWAYS_INLINE bool JSImmediate::toBoolean(JSValuePtr v)
    319321    {
    320322        ASSERT(isImmediate(v));
     
    325327    }
    326328
    327     ALWAYS_INLINE uint32_t JSImmediate::getTruncatedUInt32(const JSValue* v)
     329    ALWAYS_INLINE uint32_t JSImmediate::getTruncatedUInt32(JSValuePtr v)
    328330    {
    329331        ASSERT(isNumber(v));
     
    331333    }
    332334
    333     ALWAYS_INLINE JSValue* JSImmediate::from(char i)
    334     {
    335         return makeInt(i);
    336     }
    337 
    338     ALWAYS_INLINE JSValue* JSImmediate::from(signed char i)
    339     {
    340         return makeInt(i);
    341     }
    342 
    343     ALWAYS_INLINE JSValue* JSImmediate::from(unsigned char i)
    344     {
    345         return makeInt(i);
    346     }
    347 
    348     ALWAYS_INLINE JSValue* JSImmediate::from(short i)
    349     {
    350         return makeInt(i);
    351     }
    352 
    353     ALWAYS_INLINE JSValue* JSImmediate::from(unsigned short i)
    354     {
    355         return makeInt(i);
    356     }
    357 
    358     ALWAYS_INLINE JSValue* JSImmediate::from(int i)
     335    ALWAYS_INLINE JSValuePtr JSImmediate::from(char i)
     336    {
     337        return makeInt(i);
     338    }
     339
     340    ALWAYS_INLINE JSValuePtr JSImmediate::from(signed char i)
     341    {
     342        return makeInt(i);
     343    }
     344
     345    ALWAYS_INLINE JSValuePtr JSImmediate::from(unsigned char i)
     346    {
     347        return makeInt(i);
     348    }
     349
     350    ALWAYS_INLINE JSValuePtr JSImmediate::from(short i)
     351    {
     352        return makeInt(i);
     353    }
     354
     355    ALWAYS_INLINE JSValuePtr JSImmediate::from(unsigned short i)
     356    {
     357        return makeInt(i);
     358    }
     359
     360    ALWAYS_INLINE JSValuePtr JSImmediate::from(int i)
    359361    {
    360362        if ((i < minImmediateInt) | (i > maxImmediateInt))
     
    363365    }
    364366
    365     ALWAYS_INLINE JSValue* JSImmediate::from(unsigned i)
     367    ALWAYS_INLINE JSValuePtr JSImmediate::from(unsigned i)
    366368    {
    367369        if (i > maxImmediateUInt)
     
    370372    }
    371373
    372     ALWAYS_INLINE JSValue* JSImmediate::from(long i)
     374    ALWAYS_INLINE JSValuePtr JSImmediate::from(long i)
    373375    {
    374376        if ((i < minImmediateInt) | (i > maxImmediateInt))
     
    377379    }
    378380
    379     ALWAYS_INLINE JSValue* JSImmediate::from(unsigned long i)
     381    ALWAYS_INLINE JSValuePtr JSImmediate::from(unsigned long i)
    380382    {
    381383        if (i > maxImmediateUInt)
     
    384386    }
    385387
    386     ALWAYS_INLINE JSValue* JSImmediate::from(long long i)
     388    ALWAYS_INLINE JSValuePtr JSImmediate::from(long long i)
    387389    {
    388390        if ((i < minImmediateInt) | (i > maxImmediateInt))
     
    391393    }
    392394
    393     ALWAYS_INLINE JSValue* JSImmediate::from(unsigned long long i)
     395    ALWAYS_INLINE JSValuePtr JSImmediate::from(unsigned long long i)
    394396    {
    395397        if (i > maxImmediateUInt)
     
    398400    }
    399401
    400     ALWAYS_INLINE JSValue* JSImmediate::from(double d)
     402    ALWAYS_INLINE JSValuePtr JSImmediate::from(double d)
    401403    {
    402404        const int intVal = static_cast<int>(d);
     
    412414    }
    413415
    414     ALWAYS_INLINE int32_t JSImmediate::getTruncatedInt32(const JSValue* v)
     416    ALWAYS_INLINE int32_t JSImmediate::getTruncatedInt32(JSValuePtr v)
    415417    {
    416418        ASSERT(isNumber(v));
     
    418420    }
    419421
    420     ALWAYS_INLINE double JSImmediate::toDouble(const JSValue* v)
     422    ALWAYS_INLINE double JSImmediate::toDouble(JSValuePtr v)
    421423    {
    422424        ASSERT(isImmediate(v));
     
    431433    }
    432434
    433     ALWAYS_INLINE bool JSImmediate::getUInt32(const JSValue* v, uint32_t& i)
     435    ALWAYS_INLINE bool JSImmediate::getUInt32(JSValuePtr v, uint32_t& i)
    434436    {
    435437        i = uintValue(v);
     
    437439    }
    438440
    439     ALWAYS_INLINE bool JSImmediate::getTruncatedInt32(const JSValue* v, int32_t& i)
     441    ALWAYS_INLINE bool JSImmediate::getTruncatedInt32(JSValuePtr v, int32_t& i)
    440442    {
    441443        i = intValue(v);
     
    443445    }
    444446
    445     ALWAYS_INLINE bool JSImmediate::getTruncatedUInt32(const JSValue* v, uint32_t& i)
     447    ALWAYS_INLINE bool JSImmediate::getTruncatedUInt32(JSValuePtr v, uint32_t& i)
    446448    {
    447449        return getUInt32(v, i);
    448450    }
    449451
    450     ALWAYS_INLINE JSValue* jsUndefined()
     452    ALWAYS_INLINE JSValuePtr jsUndefined()
    451453    {
    452454        return JSImmediate::undefinedImmediate();
    453455    }
    454456
    455     inline JSValue* jsNull()
     457    inline JSValuePtr jsNull()
    456458    {
    457459        return JSImmediate::nullImmediate();
    458460    }
    459461
    460     inline JSValue* jsBoolean(bool b)
     462    inline JSValuePtr jsBoolean(bool b)
    461463    {
    462464        return b ? JSImmediate::trueImmediate() : JSImmediate::falseImmediate();
Note: See TracChangeset for help on using the changeset viewer.