Changeset 35639 in webkit for trunk/JavaScriptCore/kjs/JSNumberCell.h
- Timestamp:
- Aug 8, 2008, 2:48:10 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/JSNumberCell.h
r35291 r35639 59 59 virtual JSObject* toThisObject(ExecState*) const; 60 60 virtual JSValue* getJSNumber(); 61 int32_t fastToInt32() const; 62 uint32_t fastToUInt32() const; 61 63 62 64 void* operator new(size_t size, ExecState* exec) … … 147 149 } 148 150 151 inline int32_t JSNumberCell::fastToInt32() const 152 { 153 if (m_value >= -2147483648.0 && m_value < 2147483648.0) 154 return static_cast<int32_t>(m_value); 155 bool scratch; 156 return JSValue::toInt32SlowCase(m_value, scratch); 157 } 158 159 inline uint32_t JSNumberCell::fastToUInt32() const 160 { 161 if (m_value >= 0.0 && m_value < 4294967296.0) 162 return static_cast<uint32_t>(m_value); 163 bool scratch; 164 return JSValue::toUInt32SlowCase(m_value, scratch); 165 } 166 149 167 ALWAYS_INLINE JSValue* JSValue::toJSNumber(ExecState* exec) const 150 168 {
Note:
See TracChangeset
for help on using the changeset viewer.