Ignore:
Timestamp:
Jun 26, 2008, 11:59:26 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Maciej.

Make JSGlobalData per-thread.

No change on SunSpider total.

  • wtf/ThreadSpecific.h: Re-enabled the actual implementation.
  • kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::~JSGlobalObject): Re-added a JSLock-related assertion. We'll probably want to preserve these somehow to keep legacy behavior in working condition. (KJS::JSGlobalObject::init): Initialize globalData pointer earlier, so that it is ready when updating JSGlobalObject linked list.
  • kjs/JSGlobalObject.h: (KJS::JSGlobalObject::head): Changed head() to be non-static, and to use JSGlobalData associated with the current object.
  • kjs/InitializeThreading.cpp: (KJS::initializeThreadingOnce): Removed a no longer needed Heap::registerAsMainThread() call.
  • kjs/JSGlobalData.h: Removed a lying lie comment - parserObjectExtraRefCounts is not transient, and while newParserObjects may conceptually be such, there is still some node manipulation going on outside Parser::parse which touches it.
  • kjs/JSGlobalData.cpp: (KJS::JSGlobalData::~JSGlobalData): Delete recently added members. (KJS::JSGlobalData::sharedInstance): Actually use a separate instance.
  • kjs/collector.cpp: (KJS::Heap::Heap): (KJS::Heap::~Heap): Added a destructor, which unconditionally deletes everything. (KJS::Heap::sweep): Removed code related to "collect on main thread only" logic. (KJS::Heap::collect): Ditto. (KJS::Heap::globalObjectCount): Explicitly use per-thread instance of JSGlobalObject linked list now that JSGlobalObject::head() is not static. Curently, WebCoreStatistics methods only work with the main thread currently anyway. (KJS::Heap::protectedGlobalObjectCount): Ditto.
  • kjs/collector.h: Removed code related to "collect on main thread only" logic.
File:
1 edited

Legend:

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

    r34754 r34810  
    9292JSGlobalObject::~JSGlobalObject()
    9393{
     94    ASSERT(JSLock::currentThreadIsHoldingLock());
     95
    9496    if (d()->debugger)
    9597        d()->debugger->detach(this);
     
    114116    ASSERT(JSLock::currentThreadIsHoldingLock());
    115117
     118    d()->globalData = (Heap::heap(this) == JSGlobalData::sharedInstance().heap) ? &JSGlobalData::sharedInstance() : &JSGlobalData::threadInstance();
     119
    116120    if (JSGlobalObject*& headObject = head()) {
    117121        d()->prev = headObject;
     
    129133    d()->debugger = 0;
    130134   
    131     d()->globalData = (Heap::heap(this) == JSGlobalData::sharedInstance().heap) ? &JSGlobalData::sharedInstance() : &JSGlobalData::threadInstance();
    132 
    133135    d()->globalExec.set(new ExecState(this, thisValue, d()->globalScopeChain.node()));
    134136
Note: See TracChangeset for help on using the changeset viewer.