Ignore:
Timestamp:
May 1, 2009, 5:48:40 PM (16 years ago)
Author:
[email protected]
Message:

2009-05-01 Sam Weinig <[email protected]>

Reviewed by Geoffrey "Too Far!" Garen.

Move JS number construction into JSValue.

  • runtime/JSImmediate.h:
  • runtime/JSNumberCell.h: (JSC::JSValue::JSValue):
  • runtime/JSValue.h: (JSC::jsNumber):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSValue.h

    r43130 r43131  
    2929#include "CallData.h"
    3030#include "ConstructData.h"
     31#include <wtf/AlwaysInline.h>
    3132
    3233namespace JSC {
     
    3435    class Identifier;
    3536    class JSCell;
     37    class JSGlobalData;
    3638    class JSImmediate;
    3739    class JSObject;
     
    7981        JSValue(JSCell* ptr);
    8082        JSValue(const JSCell* ptr);
     83
     84        // Numbers
     85        JSValue(ExecState*, double);
     86        JSValue(ExecState*, int);
     87        JSValue(ExecState*, unsigned);
     88        JSValue(ExecState*, long);
     89        JSValue(ExecState*, unsigned long);
     90        JSValue(ExecState*, long long);
     91        JSValue(ExecState*, unsigned long long);
     92        JSValue(JSGlobalData*, double);
     93        JSValue(JSGlobalData*, int);
     94        JSValue(JSGlobalData*, unsigned);
     95        JSValue(JSGlobalData*, long);
     96        JSValue(JSGlobalData*, unsigned long);
     97        JSValue(JSGlobalData*, long long);
     98        JSValue(JSGlobalData*, unsigned long long);
    8199
    82100        operator bool() const;
     
    218236    }
    219237
     238    ALWAYS_INLINE JSValue jsNumber(ExecState* exec, double d)
     239    {
     240        return JSValue(exec, d);
     241    }
     242
     243    ALWAYS_INLINE JSValue jsNumber(ExecState* exec, int i)
     244    {
     245        return JSValue(exec, i);
     246    }
     247
     248    ALWAYS_INLINE JSValue jsNumber(ExecState* exec, unsigned i)
     249    {
     250        return JSValue(exec, i);
     251    }
     252
     253    ALWAYS_INLINE JSValue jsNumber(ExecState* exec, long i)
     254    {
     255        return JSValue(exec, i);
     256    }
     257
     258    ALWAYS_INLINE JSValue jsNumber(ExecState* exec, unsigned long i)
     259    {
     260        return JSValue(exec, i);
     261    }
     262
     263    ALWAYS_INLINE JSValue jsNumber(ExecState* exec, long long i)
     264    {
     265        return JSValue(exec, i);
     266    }
     267
     268    ALWAYS_INLINE JSValue jsNumber(ExecState* exec, unsigned long long i)
     269    {
     270        return JSValue(exec, i);
     271    }
     272
     273    ALWAYS_INLINE JSValue jsNumber(JSGlobalData* globalData, double d)
     274    {
     275        return JSValue(globalData, d);
     276    }
     277
     278    ALWAYS_INLINE JSValue jsNumber(JSGlobalData* globalData, int i)
     279    {
     280        return JSValue(globalData, i);
     281    }
     282
     283    ALWAYS_INLINE JSValue jsNumber(JSGlobalData* globalData, unsigned i)
     284    {
     285        return JSValue(globalData, i);
     286    }
     287
     288    ALWAYS_INLINE JSValue jsNumber(JSGlobalData* globalData, long i)
     289    {
     290        return JSValue(globalData, i);
     291    }
     292
     293    ALWAYS_INLINE JSValue jsNumber(JSGlobalData* globalData, unsigned long i)
     294    {
     295        return JSValue(globalData, i);
     296    }
     297
     298    ALWAYS_INLINE JSValue jsNumber(JSGlobalData* globalData, long long i)
     299    {
     300        return JSValue(globalData, i);
     301    }
     302
     303    ALWAYS_INLINE JSValue jsNumber(JSGlobalData* globalData, unsigned long long i)
     304    {
     305        return JSValue(globalData, i);
     306    }
     307
    220308    inline bool operator==(const JSValue a, const JSCell* b) { return a == JSValue(b); }
    221309    inline bool operator==(const JSCell* a, const JSValue b) { return JSValue(a) == b; }
Note: See TracChangeset for help on using the changeset viewer.