Changeset 51457 in webkit for trunk/JavaScriptCore/runtime
- Timestamp:
- Nov 28, 2009, 2:31:18 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/JSGlobalData.cpp
r51329 r51457 91 91 VPtrSet::VPtrSet() 92 92 { 93 // Bizarrely, calling fastMalloc here is faster than allocating space on the stack. 94 void* storage = fastMalloc(sizeof(CollectorBlock)); 95 93 CollectorCell cell; 94 void* storage = &cell; 95 96 ASSERT(sizeof(JSArray) <= sizeof(CollectorCell)); 96 97 JSCell* jsArray = new (storage) JSArray(JSArray::createStructure(jsNull())); 97 98 jsArrayVPtr = jsArray->vptr(); 98 99 jsArray->~JSCell(); 99 100 101 ASSERT(sizeof(JSByteArray) <= sizeof(CollectorCell)); 100 102 JSCell* jsByteArray = new (storage) JSByteArray(JSByteArray::VPtrStealingHack); 101 103 jsByteArrayVPtr = jsByteArray->vptr(); 102 104 jsByteArray->~JSCell(); 103 105 106 ASSERT(sizeof(JSString) <= sizeof(CollectorCell)); 104 107 JSCell* jsString = new (storage) JSString(JSString::VPtrStealingHack); 105 108 jsStringVPtr = jsString->vptr(); 106 109 jsString->~JSCell(); 107 110 111 ASSERT(sizeof(JSFunction) <= sizeof(CollectorCell)); 108 112 JSCell* jsFunction = new (storage) JSFunction(JSFunction::createStructure(jsNull())); 109 113 jsFunctionVPtr = jsFunction->vptr(); 110 114 jsFunction->~JSCell(); 111 112 fastFree(storage);113 115 } 114 116
Note:
See TracChangeset
for help on using the changeset viewer.