Ejemplo n.º 1
0
void ProfileGenerator::willExecute(ExecState* callerCallFrame, const CallIdentifier& callIdentifier)
{
    if (JAVASCRIPTCORE_PROFILE_WILL_EXECUTE_ENABLED()) {
        CString name = callIdentifier.functionName().utf8();
        CString url = callIdentifier.url().utf8();
        JAVASCRIPTCORE_PROFILE_WILL_EXECUTE(m_profileGroup, const_cast<char*>(name.data()), const_cast<char*>(url.data()), callIdentifier.lineNumber(), callIdentifier.columnNumber());
    }

    if (!m_origin)
        return;

    if (m_suspended)
        return;

    RefPtr<ProfileNode> calleeNode = nullptr;

    // Find or create a node for the callee call frame.
    for (const RefPtr<ProfileNode>& child : m_currentNode->children()) {
        if (child->callIdentifier() == callIdentifier)
            calleeNode = child;
    }

    if (!calleeNode) {
        calleeNode = ProfileNode::create(callerCallFrame, callIdentifier, m_currentNode.get());
        m_currentNode->addChild(calleeNode);
    }

    m_currentNode = calleeNode;
    beginCallEntry(calleeNode.get(), m_stopwatch->elapsedTime());
}
void ProfileGenerator::willExecute(ExecState* callerCallFrame, const CallIdentifier& callIdentifier)
{
    if (JAVASCRIPTCORE_PROFILE_WILL_EXECUTE_ENABLED()) {
        CString name = callIdentifier.m_name.utf8();
        CString url = callIdentifier.m_url.utf8();
        JAVASCRIPTCORE_PROFILE_WILL_EXECUTE(m_profileGroup, const_cast<char*>(name.data()), const_cast<char*>(url.data()), callIdentifier.m_lineNumber);
    }

    if (!m_origin)
        return;

    ASSERT(m_currentNode);
    m_currentNode = m_currentNode->willExecute(callerCallFrame, callIdentifier);
}
void ProfileGenerator::willExecute(const CallIdentifier& callIdentifier)
{
    if (JAVASCRIPTCORE_PROFILE_WILL_EXECUTE_ENABLED()) {
        CString name = callIdentifier.m_name.UTF8String();
        CString url = callIdentifier.m_url.UTF8String();
        JAVASCRIPTCORE_PROFILE_WILL_EXECUTE(m_profileGroup, const_cast<char*>(name.c_str()), const_cast<char*>(url.c_str()), callIdentifier.m_lineNumber);
    }

    if (!m_originatingGlobalExec)
        return;

    ASSERT_ARG(m_currentNode, m_currentNode);
    m_currentNode = m_currentNode->willExecute(callIdentifier);
}