Changeset 37712 in webkit for trunk/JavaScriptCore/kjs/JSImmediate.h
- Timestamp:
- Oct 19, 2008, 10:58:02 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/JSImmediate.h
r37684 r37712 35 35 36 36 class ExecState; 37 class JSCell; 37 38 class JSObject; 38 39 class JSValue; 39 40 class UString; 40 41 41 typedef JSValue* JSValuePtr; 42 43 inline JSValuePtr noValue() { return 0; } 44 inline void* asPointer(JSValuePtr value) { return value; } 42 class JSValuePtr { 43 public: 44 JSValuePtr() { } // uninitialized (not zero) 45 JSValuePtr(const JSValue* payload) : m_payload(const_cast<JSValue*>(payload)) { } 46 JSValuePtr(const JSCell*); 47 48 JSValue* payload() const { return m_payload; } 49 JSValue** payloadPtr() { return &m_payload; } 50 51 bool operator!() const { return !payload(); } 52 53 // This conversion operator allows implicit conversion to bool but not to other integer types. 54 typedef JSValue* JSValuePtr::*UnspecifiedBoolType; 55 operator UnspecifiedBoolType() const { return payload() ? &JSValuePtr::m_payload : 0; } 56 57 JSValue* operator->() const { return payload(); } 58 59 private: 60 JSValue* m_payload; 61 }; 62 63 inline JSValuePtr noValue() { return static_cast<JSValue*>(0); } 64 inline void* asPointer(JSValuePtr value) { return value.payload(); } 45 65 46 66 /* … … 262 282 static ALWAYS_INLINE JSValuePtr makeValue(uintptr_t integer) 263 283 { 264 return reinterpret_cast<JSValue Ptr>(integer);284 return reinterpret_cast<JSValue*>(integer); 265 285 } 266 286 … … 302 322 static ALWAYS_INLINE uintptr_t rawValue(JSValuePtr v) 303 323 { 304 return reinterpret_cast<uintptr_t>(v );324 return reinterpret_cast<uintptr_t>(v.payload()); 305 325 } 306 326
Note:
See TracChangeset
for help on using the changeset viewer.