Ignore:
Timestamp:
Oct 5, 2008, 7:48:08 PM (17 years ago)
Author:
[email protected]
Message:

2008-10-05 Maciej Stachowiak <[email protected]>

Reviewed by Oliver Hunt.



The problem is that dynamicGlobalObject had become O(N) in number
of call frames, but unwinding the stack for an exception called it
for every call frame, resulting in O(N2) behavior for an
exception thrown from inside deep recursion.

Instead of doing it that way, stash the dynamic global object in JSGlobalData.


  • JavaScriptCore.exp:
  • VM/Machine.cpp: (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Helper class to temporarily store and later restore a dynamicGlobalObject in JSGlobalData. (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope): (JSC::Machine::execute): In each version, establish a DynamicGlobalObjectScope. For ProgramNode, always establish set new dynamicGlobalObject, for FunctionBody and Eval, only if none is currently set.
  • VM/Machine.h:
  • kjs/ExecState.h:
  • kjs/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): Ininitalize new dynamicGlobalObject field to 0.
  • kjs/JSGlobalData.h:
  • kjs/JSGlobalObject.h: (JSC::ExecState::dynamicGlobalObject): Moved here from ExecState for benefit of inlining. Return lexical global object if this is a globalExec(), otherwise look in JSGlobalData for the one stashed there.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.exp

    r37275 r37323  
    207207__ZN3JSC7CStringaSERKS0_
    208208__ZN3JSC7JSArray4infoE
    209 __ZN3JSC7Machine14firstCallFrameEPKNS_8RegisterE
    210209__ZN3JSC7Profile10restoreAllEv
    211210__ZN3JSC7Profile5focusEPKNS_11ProfileNodeE
Note: See TracChangeset for help on using the changeset viewer.