Changeset 128851 in webkit for trunk/Source/JavaScriptCore/runtime/JSCell.h
- Timestamp:
- Sep 17, 2012, 11:00:21 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSCell.h
r128813 r128851 37 37 namespace JSC { 38 38 39 class JSDestructibleObject;40 39 class JSGlobalObject; 41 40 class LLIntOffsetsExtractor; … … 323 322 #endif 324 323 325 template<class T>326 struct HasImmortalStructure {327 static const bool value = false;328 };329 330 #define HAS_IMMORTAL_STRUCTURE(klass) \331 template <> \332 struct HasImmortalStructure<klass> {\333 static const bool value = true;\334 }335 336 #define NEEDS_DESTRUCTOR(klass, v) \337 template <> \338 struct NeedsDestructor<klass> {\339 static const bool value = v;\340 }341 342 324 template<typename T> 343 325 void* allocateCell(Heap& heap) … … 348 330 #endif 349 331 JSCell* result = 0; 350 if (NeedsDestructor<T>::value && HasImmortalStructure<T>::value) 351 result = static_cast<JSCell*>(heap.allocateWithImmortalStructureDestructor(sizeof(T))); 352 else if (NeedsDestructor<T>::value && !HasImmortalStructure<T>::value) 353 result = static_cast<JSCell*>(heap.allocateWithNormalDestructor(sizeof(T))); 354 else 332 if (NeedsDestructor<T>::value) 333 result = static_cast<JSCell*>(heap.allocateWithDestructor(sizeof(T))); 334 else { 335 ASSERT(T::s_info.methodTable.destroy == JSCell::destroy); 355 336 result = static_cast<JSCell*>(heap.allocateWithoutDestructor(sizeof(T))); 337 } 356 338 result->clearStructure(); 357 339 return result; … … 367 349 #endif 368 350 JSCell* result = 0; 369 if (NeedsDestructor<T>::value && HasImmortalStructure<T>::value) 370 result = static_cast<JSCell*>(heap.allocateWithImmortalStructureDestructor(size)); 371 else if (NeedsDestructor<T>::value && !HasImmortalStructure<T>::value) 372 result = static_cast<JSCell*>(heap.allocateWithNormalDestructor(size)); 351 if (NeedsDestructor<T>::value) 352 result = static_cast<JSCell*>(heap.allocateWithDestructor(size)); 373 353 else { 374 354 ASSERT(T::s_info.methodTable.destroy == JSCell::destroy); … … 390 370 return static_cast<To>(from); 391 371 } 392 372 393 373 template<typename To> 394 374 inline To jsCast(JSValue from)
Note:
See TracChangeset
for help on using the changeset viewer.