Ignore:
Timestamp:
Jun 19, 2008, 10:29:29 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Darin.

Prepare JavaScript heap for being per-thread.

File:
1 edited

Legend:

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

    r34607 r34659  
    3939
    4040#if USE(MULTIPLE_THREADS)
     41#include <wtf/Threading.h>
    4142#include <wtf/ThreadSpecific.h>
    4243#endif
     
    5657
    5758JSGlobalData::JSGlobalData()
    58 //    : heap(new Heap)
     59    : heap(new Heap)
    5960#if USE(MULTIPLE_THREADS)
    60     : arrayTable(new HashTable(KJS::arrayTable))
     61    , arrayTable(new HashTable(KJS::arrayTable))
    6162    , dateTable(new HashTable(KJS::dateTable))
    6263    , mathTable(new HashTable(KJS::mathTable))
     
    6667    , stringTable(new HashTable(KJS::stringTable))
    6768#else
    68     : arrayTable(&KJS::arrayTable)
     69    , arrayTable(&KJS::arrayTable)
    6970    , dateTable(&KJS::dateTable)
    7071    , mathTable(&KJS::mathTable)
     
    119120}
    120121
     122JSGlobalData& JSGlobalData::sharedInstance()
     123{
     124    return threadInstance();
     125/*
     126#if USE(MULTIPLE_THREADS)
     127    AtomicallyInitializedStatic(JSGlobalData, sharedInstance);
     128#else
     129    static JSGlobalData sharedInstance;
     130#endif
     131    return sharedInstance;
     132*/
    121133}
     134
     135}
Note: See TracChangeset for help on using the changeset viewer.