Ignore:
Timestamp:
May 23, 2008, 2:28:31 PM (17 years ago)
Author:
[email protected]
Message:

2008-05-23 Geoffrey Garen <[email protected]>

Rolling back in r34085, with performance resolved.


Apparently, passing the eval function to callEval gave GCC a hernia.

Reviewed by Darin Adler, Kevin McCullough, and Oliver Hunt.


Fixed <rdar://problem/5959447> Crashes and incorrect reporting in the
JavaScript profiler

  • VM/Machine.cpp: (KJS::callEval): Made this profiler hooks slightly faster by passing in the eval function.


(KJS::Machine::unwindCallFrame): Fixed incorrect reporting / a crash
when unwinding from inside eval and/or program code: detect the
difference, and do the right thing. Also, be sure to notify the profiler
*before* deref'ing the scope chain, since the profiler uses the scope chain.

(KJS::Machine::execute): Fixed incorrect reporting / crash when calling
a JS function re-entrently: Machine::execute(FunctionBodyNode*...)
should not invoke the didExecute hook, because op_ret already does that.
Also, use the new function's ExecState when calling out to the profiler.
(Not important now, but could have become a subtle bug later.)

(KJS::Machine::privateExecute): Fixed a hard to reproduce crash when
profiling JS functions: notify the profiler *before* deref'ing the scope
chain, since the profiler uses the scope chain.

  • kjs/object.cpp: (KJS::JSObject::call): Removed these hooks, because they are now unnecessary.
  • profiler/Profile.cpp: Added a comment to explain a subtlety that only Kevin and I understood previously. (Now, the whole world can understand!)
  • profiler/Profiler.cpp: (KJS::shouldExcludeFunction): Don't exclude .call and .apply. That was a hack to fix bugs that no longer exist.

Finally, sped things up a little bit by changing the "Is the profiler
running?" check into an ASSERT, since we only call into the profiler
when it's running:

(KJS::Profiler::willExecute):
(KJS::Profiler::didExecute):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/profiler/Profile.cpp

    r34086 r34090  
    5757{
    5858    ASSERT(m_currentNode);
    59 
    6059    m_currentNode = m_currentNode->willExecute(callIdentifier);
    6160}
     
    6362void Profile::didExecute(const CallIdentifier& callIdentifier)
    6463{
     64    ASSERT(m_currentNode);
     65
     66    // In case the profiler started recording calls in the middle of a stack frame,
     67    // when returning up the stack it needs to insert the calls it missed on the
     68    // way down.
    6569    if (m_currentNode == m_headNode) {
    6670        m_currentNode = ProfileNode::create(callIdentifier, m_headNode.get(), m_headNode.get());
Note: See TracChangeset for help on using the changeset viewer.