Changeset 86209 in webkit for trunk/Source/JavaScriptCore/heap/Handle.h
- Timestamp:
- May 10, 2011, 7:29:51 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/heap/Handle.h
r84660 r86209 27 27 #define Handle_h 28 28 29 #include "WriteBarrier.h" 30 #include <wtf/Assertions.h> 29 #include "HandleTypes.h" 31 30 32 31 namespace JSC { … … 76 75 private: 77 76 HandleSlot m_slot; 78 };79 80 template <typename T> struct HandleTypes {81 typedef T* ExternalType;82 static ExternalType getFromSlot(HandleSlot slot) { return (slot && *slot) ? reinterpret_cast<ExternalType>(slot->asCell()) : 0; }83 static JSValue toJSValue(T* cell) { return reinterpret_cast<JSCell*>(cell); }84 template <typename U> static void validateUpcast() { T* temp; temp = (U*)0; }85 };86 87 template <> struct HandleTypes<Unknown> {88 typedef JSValue ExternalType;89 static ExternalType getFromSlot(HandleSlot slot) { return slot ? *slot : JSValue(); }90 static JSValue toJSValue(const JSValue& v) { return v; }91 template <typename U> static void validateUpcast() {}92 77 }; 93 78
Note:
See TracChangeset
for help on using the changeset viewer.