Ignore:
Timestamp:
Apr 24, 2008, 10:20:01 AM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2008-04-24 Kevin McCullough <[email protected]>

Reviewed by Adam and Sam.

-<rdar://problem/5770054> JavaScript profiler (10928)
-Only profile the page group that starts profiling to avoid profiling
tools that shouldn't be profiled unless explicitly requested to.

  • JavaScriptCore.exp: Export new signature.
  • kjs/JSGlobalObject.cpp: Add unique identifiers to the JSGlobalObject. (KJS::JSGlobalObject::init):
  • kjs/JSGlobalObject.h: Ditto. (KJS::JSGlobalObject::setPageGroupIdentifier): (KJS::JSGlobalObject::pageGroupIdentifier):
  • profiler/Profiler.cpp: Check the identifier of the page group of the lexical global exec state and only profile if it matches the given page group identifier. (KJS::Profiler::startProfiling): (KJS::Profiler::willExecute): (KJS::Profiler::didExecute):
  • profiler/Profiler.h: Ditto. (KJS::Profiler::Profiler):

WebCore:

2008-04-24 Kevin McCullough <[email protected]>

Reviewed by Adam and Sam.

-<rdar://problem/5770054> JavaScript profiler (10928)
-Only profile the page group that starts profiling to avoid profiling
tools that shouldn't be profiled unless explicitly requested to.

  • bindings/js/kjs_proxy.cpp: When a new global object is created set its page group identifier. (WebCore::KJSProxy::clear): (WebCore::KJSProxy::initScript):
  • page/Console.cpp: When calling console.profile set the identifier of the page group being profiled. (WebCore::Console::profile):
  • page/PageGroup.cpp: Implement unique identifiers. (WebCore::getUniqueIdentifier): (WebCore::PageGroup::PageGroup):
  • page/PageGroup.h: Ditto. (WebCore::PageGroup::identifier):
File:
1 edited

Legend:

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

    r32354 r32495  
    3131
    3232#include "FunctionCallProfile.h"
    33 #include <kjs/ExecState.h>
    34 #include <kjs/function.h>
     33#include "JSGlobalObject.h"
     34#include "ExecState.h"
     35#include "function.h"
    3536
    3637#include <stdio.h>
     
    5354}
    5455
    55 void Profiler::startProfiling()
     56void Profiler::startProfiling(unsigned pageGroupIdentifier)
    5657{
    5758    if (m_profiling)
    5859        return;
     60
     61    m_pageGroupIdentifier = pageGroupIdentifier;
    5962
    6063    // FIXME: When multi-threading is supported this will be a vector and calls
     
    7275void Profiler::willExecute(ExecState* exec, JSObject* calledFunction)
    7376{
    74     if (!m_profiling)
     77    if (!m_profiling || exec->lexicalGlobalObject()->pageGroupIdentifier() != m_pageGroupIdentifier)
    7578        return;
    7679
     
    8285void Profiler::willExecute(ExecState* exec, const UString& sourceURL, int startingLineNumber)
    8386{
    84     if (!m_profiling)
     87    if (!m_profiling || exec->lexicalGlobalObject()->pageGroupIdentifier() != m_pageGroupIdentifier)
    8588        return;
    8689
     
    9295void Profiler::didExecute(ExecState* exec, JSObject* calledFunction)
    9396{
    94     if (!m_profiling)
     97    if (!m_profiling || exec->lexicalGlobalObject()->pageGroupIdentifier() != m_pageGroupIdentifier)
    9598        return;
    9699
     
    102105void Profiler::didExecute(ExecState* exec, const UString& sourceURL, int startingLineNumber)
    103106{
    104     if (!m_profiling)
     107    if (!m_profiling || exec->lexicalGlobalObject()->pageGroupIdentifier() != m_pageGroupIdentifier)
    105108        return;
    106109
Note: See TracChangeset for help on using the changeset viewer.