Changeset 51457 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
Nov 28, 2009, 2:31:18 AM (15 years ago)
Author:
[email protected]
Message:

2009-11-28 Zoltan Herczeg <[email protected]>

Reviewed by Gavin Barraclough.

https://bugs.webkit.org/show_bug.cgi?id=31930

Seems a typo. We don't need ~270k memory to determine the vptrs.

  • runtime/JSGlobalData.cpp: (JSC::VPtrSet::VPtrSet):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSGlobalData.cpp

    r51329 r51457  
    9191VPtrSet::VPtrSet()
    9292{
    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));
    9697    JSCell* jsArray = new (storage) JSArray(JSArray::createStructure(jsNull()));
    9798    jsArrayVPtr = jsArray->vptr();
    9899    jsArray->~JSCell();
    99100
     101    ASSERT(sizeof(JSByteArray) <= sizeof(CollectorCell));
    100102    JSCell* jsByteArray = new (storage) JSByteArray(JSByteArray::VPtrStealingHack);
    101103    jsByteArrayVPtr = jsByteArray->vptr();
    102104    jsByteArray->~JSCell();
    103105
     106    ASSERT(sizeof(JSString) <= sizeof(CollectorCell));
    104107    JSCell* jsString = new (storage) JSString(JSString::VPtrStealingHack);
    105108    jsStringVPtr = jsString->vptr();
    106109    jsString->~JSCell();
    107110
     111    ASSERT(sizeof(JSFunction) <= sizeof(CollectorCell));
    108112    JSCell* jsFunction = new (storage) JSFunction(JSFunction::createStructure(jsNull()));
    109113    jsFunctionVPtr = jsFunction->vptr();
    110114    jsFunction->~JSCell();
    111 
    112     fastFree(storage);
    113115}
    114116
Note: See TracChangeset for help on using the changeset viewer.