Changeset 39851 in webkit for trunk/JavaScriptCore/runtime/JSValue.h
- Timestamp:
- Jan 12, 2009, 8:51:16 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/JSValue.h
r39769 r39851 34 34 class Identifier; 35 35 class JSCell; 36 class JSNumberCell; 36 37 class JSObject; 37 38 class JSString; … … 121 122 bool getBoolean(bool&) const; 122 123 bool getBoolean() const; // false if not a boolean 123 double getNumber() const; // NaN if not a number124 bool getNumber(double&) const; 124 125 double uncheckedGetNumber() const; 125 126 bool getString(UString&) const; … … 149 150 150 151 // Integer conversions. 152 // 'x.numberToInt32(output)' is equivalent to 'x.isNumber() && x.toInt32(output)' 151 153 double toInteger(ExecState*) const; 152 154 double toIntegerPreserveNaN(ExecState*) const; 153 155 int32_t toInt32(ExecState*) const; 154 156 int32_t toInt32(ExecState*, bool& ok) const; 157 bool numberToInt32(int32_t& arg); 155 158 uint32_t toUInt32(ExecState*) const; 156 159 uint32_t toUInt32(ExecState*, bool& ok) const; 157 158 // Floating point conversions. 160 bool numberToUInt32(uint32_t& arg); 161 162 // Fast integer operations; these values return results where the value is trivially available 163 // in a convenient form, for use in optimizations. No assumptions should be made based on the 164 // results of these operations, for example !isInt32Fast() does not necessarily indicate the 165 // result of getNumber will not be 0. 166 bool isInt32Fast() const; 167 int32_t getInt32Fast() const; 168 bool isUInt32Fast() const; 169 uint32_t getUInt32Fast() const; 170 static JSValuePtr makeInt32Fast(int32_t); 171 static bool areBothInt32Fast(JSValuePtr, JSValuePtr); 172 173 // Floating point conversions (this is a convenience method for webcore; 174 // signle precision float is not a representation used in JS or JSC). 159 175 float toFloat(ExecState* exec) const { return static_cast<float>(toNumber(exec)); } 160 176 … … 176 192 JSString* toThisJSString(ExecState*); 177 193 178 JSValuePtr getJSNumber(); // 0 if this is not a JSNumber or number object 179 194 static bool equal(ExecState* exec, JSValuePtr v1, JSValuePtr v2); 195 static bool equalSlowCase(ExecState* exec, JSValuePtr v1, JSValuePtr v2); 196 static bool equalSlowCaseInline(ExecState* exec, JSValuePtr v1, JSValuePtr v2); 197 static bool strictEqual(JSValuePtr v1, JSValuePtr v2); 198 static bool strictEqualSlowCase(JSValuePtr v1, JSValuePtr v2); 199 static bool strictEqualSlowCaseInline(JSValuePtr v1, JSValuePtr v2); 200 201 JSValuePtr getJSNumber(); // noValue() if this is not a JSNumber or number object 202 203 bool isCell() const; 180 204 JSCell* asCell() const; 181 205 … … 183 207 inline const JSValuePtr asValue() const { return *this; } 184 208 185 int32_t toInt32SlowCase(ExecState*, bool& ok) const;186 uint32_t toUInt32SlowCase(ExecState*, bool& ok) const;209 bool isNumberCell() const; 210 JSNumberCell* asNumberCell() const; 187 211 188 212 JSCell* m_ptr;
Note:
See TracChangeset
for help on using the changeset viewer.