Changeset 72351 in webkit for trunk/JavaScriptCore/profiler/ProfileGenerator.cpp
- Timestamp:
- Nov 18, 2010, 4:54:26 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/profiler/ProfileGenerator.cpp
r72176 r72351 64 64 65 65 exec->interpreter()->retrieveLastCaller(exec, lineNumber, sourceID, sourceURL, function); 66 m_currentNode = ProfileNode::create( Profiler::createCallIdentifier(exec, function ? function.toThisObject(exec) : 0, sourceURL, lineNumber), m_head.get(), m_head.get());66 m_currentNode = ProfileNode::create(exec, Profiler::createCallIdentifier(exec, function ? function.toThisObject(exec) : 0, sourceURL, lineNumber), m_head.get(), m_head.get()); 67 67 m_head->insertNode(m_currentNode.get()); 68 68 } … … 73 73 } 74 74 75 void ProfileGenerator::willExecute( const CallIdentifier& callIdentifier)75 void ProfileGenerator::willExecute(ExecState* callerCallFrame, const CallIdentifier& callIdentifier) 76 76 { 77 77 if (JAVASCRIPTCORE_PROFILE_WILL_EXECUTE_ENABLED()) { … … 84 84 return; 85 85 86 ASSERT _ARG(m_currentNode,m_currentNode);87 m_currentNode = m_currentNode->willExecute(call Identifier);86 ASSERT(m_currentNode); 87 m_currentNode = m_currentNode->willExecute(callerCallFrame, callIdentifier); 88 88 } 89 89 90 void ProfileGenerator::didExecute( const CallIdentifier& callIdentifier)90 void ProfileGenerator::didExecute(ExecState* callerCallFrame, const CallIdentifier& callIdentifier) 91 91 { 92 92 if (JAVASCRIPTCORE_PROFILE_DID_EXECUTE_ENABLED()) { … … 99 99 return; 100 100 101 ASSERT _ARG(m_currentNode,m_currentNode);101 ASSERT(m_currentNode); 102 102 if (m_currentNode->callIdentifier() != callIdentifier) { 103 RefPtr<ProfileNode> returningNode = ProfileNode::create(call Identifier, m_head.get(), m_currentNode.get());103 RefPtr<ProfileNode> returningNode = ProfileNode::create(callerCallFrame, callIdentifier, m_head.get(), m_currentNode.get()); 104 104 returningNode->setStartTime(m_currentNode->startTime()); 105 105 returningNode->didExecute(); … … 111 111 } 112 112 113 void ProfileGenerator::exceptionUnwind(ExecState* handlerCallFrame, const CallIdentifier&) 114 { 115 // If the current node was called by the handler (==) or any 116 // more nested function (>) the we have exited early from it. 117 ASSERT(m_currentNode); 118 while (m_currentNode->callerCallFrame() >= handlerCallFrame) { 119 didExecute(m_currentNode->callerCallFrame(), m_currentNode->callIdentifier()); 120 ASSERT(m_currentNode); 121 } 122 } 123 113 124 void ProfileGenerator::stopProfiling() 114 125 { … … 118 129 removeProfileEnd(); 119 130 120 ASSERT _ARG(m_currentNode,m_currentNode);131 ASSERT(m_currentNode); 121 132 122 133 // Set the current node to the parent, because we are in a call that … … 125 136 126 137 if (double headSelfTime = m_head->selfTime()) { 127 RefPtr<ProfileNode> idleNode = ProfileNode::create( CallIdentifier(NonJSExecution, UString(), 0), m_head.get(), m_head.get());138 RefPtr<ProfileNode> idleNode = ProfileNode::create(0, CallIdentifier(NonJSExecution, UString(), 0), m_head.get(), m_head.get()); 128 139 129 140 idleNode->setTotalTime(headSelfTime);
Note:
See TracChangeset
for help on using the changeset viewer.