Changeset 54576 in webkit


Ignore:
Timestamp:
Feb 9, 2010 6:02:30 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-02-09 Mikhail Naganov <mnaganov@chromium.org>

Reviewed by Pavel Feldman.

Continuing debugger and profiler unforking: narrow scope of JSC-specific ifdefs.
Also, enable JAVASCRIPT_DEBUGGER explicitly in features, it appears to be required
for really enabling it in V8 bindings generation.

https://bugs.webkit.org/show_bug.cgi?id=34706

  • inspector/InjectedScriptHost.idl:
  • inspector/InspectorBackend.cpp: (WebCore::InspectorBackend::currentCallFrame): (WebCore::InspectorBackend::getProfile):
  • inspector/InspectorBackend.h:
  • inspector/InspectorBackend.idl:
  • inspector/InspectorController.cpp: (WebCore::InspectorController::InspectorController): (WebCore::InspectorController::addProfile): (WebCore::InspectorController::getProfile): (WebCore::InspectorController::startUserInitiatedProfiling): (WebCore::InspectorController::stopUserInitiatedProfiling): (WebCore::InspectorController::enableProfiler): (WebCore::InspectorController::disableProfiler):
  • inspector/InspectorController.h:
  • inspector/InspectorFrontend.cpp: (WebCore::InspectorFrontend::pausedScript): (WebCore::InspectorFrontend::resumedScript): (WebCore::InspectorFrontend::profilerWasEnabled): (WebCore::InspectorFrontend::profilerWasDisabled): (WebCore::InspectorFrontend::didGetProfile):
  • inspector/InspectorFrontend.h:
  • page/Console.idl:

2010-02-09 Mikhail Naganov <mnaganov@chromium.org>

Reviewed by Pavel Feldman.

Continuing debugger and profiler unforking: narrow scope of JSC-specific ifdefs.
Also, enable JAVASCRIPT_DEBUGGER explicitly in features, it appears to be required
for really enabling it in V8 bindings generation.

https://bugs.webkit.org/show_bug.cgi?id=34706

  • features.gypi:
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r54571 r54576  
     12010-02-09  Mikhail Naganov  <mnaganov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Continuing debugger and profiler unforking: narrow scope of JSC-specific ifdefs.
     6        Also, enable JAVASCRIPT_DEBUGGER explicitly in features, it appears to be required
     7        for really enabling it in V8 bindings generation.
     8
     9        https://bugs.webkit.org/show_bug.cgi?id=34706
     10
     11        * inspector/InjectedScriptHost.idl:
     12        * inspector/InspectorBackend.cpp:
     13        (WebCore::InspectorBackend::currentCallFrame):
     14        (WebCore::InspectorBackend::getProfile):
     15        * inspector/InspectorBackend.h:
     16        * inspector/InspectorBackend.idl:
     17        * inspector/InspectorController.cpp:
     18        (WebCore::InspectorController::InspectorController):
     19        (WebCore::InspectorController::addProfile):
     20        (WebCore::InspectorController::getProfile):
     21        (WebCore::InspectorController::startUserInitiatedProfiling):
     22        (WebCore::InspectorController::stopUserInitiatedProfiling):
     23        (WebCore::InspectorController::enableProfiler):
     24        (WebCore::InspectorController::disableProfiler):
     25        * inspector/InspectorController.h:
     26        * inspector/InspectorFrontend.cpp:
     27        (WebCore::InspectorFrontend::pausedScript):
     28        (WebCore::InspectorFrontend::resumedScript):
     29        (WebCore::InspectorFrontend::profilerWasEnabled):
     30        (WebCore::InspectorFrontend::profilerWasDisabled):
     31        (WebCore::InspectorFrontend::didGetProfile):
     32        * inspector/InspectorFrontend.h:
     33        * page/Console.idl:
     34
    1352010-02-09  Gavin Barraclough  <barraclough@apple.com>
    236
  • trunk/WebCore/inspector/InjectedScriptHost.idl

    r54421 r54576  
    4242        long pushNodeByPathToFrontend(in DOMString path);
    4343
    44 #if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
     44#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER && !(defined(V8_BINDING) && V8_BINDING)
    4545        [Custom] DOMObject currentCallFrame();
    4646        [Custom] boolean isActivation(in DOMObject object);
  • trunk/WebCore/inspector/InspectorBackend.cpp

    r54421 r54576  
    223223}
    224224
     225JavaScriptCallFrame* InspectorBackend::currentCallFrame() const
     226{
     227    return JavaScriptDebugServer::shared().currentCallFrame();
     228}
     229#endif
     230
     231#if ENABLE(JAVASCRIPT_DEBUGGER)
    225232bool InspectorBackend::profilerEnabled()
    226233{
     
    264271    if (m_inspectorController)
    265272        m_inspectorController->getProfile(callId, uid);
    266 }
    267 
    268 JavaScriptCallFrame* InspectorBackend::currentCallFrame() const
    269 {
    270     return JavaScriptDebugServer::shared().currentCallFrame();
    271273}
    272274#endif
  • trunk/WebCore/inspector/InspectorBackend.h

    r54329 r54576  
    9393    void stepOutOfFunctionInDebugger();
    9494
     95    JavaScriptCallFrame* currentCallFrame() const;
     96#endif
     97#if ENABLE(JAVASCRIPT_DEBUGGER)
    9598    bool profilerEnabled();
    9699    void enableProfiler(bool always);
     
    102105    void getProfileHeaders(long callId);
    103106    void getProfile(long callId, unsigned uid);
    104 
    105     JavaScriptCallFrame* currentCallFrame() const;
    106107#endif
    107108
  • trunk/WebCore/inspector/InspectorBackend.idl

    r53855 r54576  
    4848        void stopTimelineProfiler();
    4949
    50 #if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
     50#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER && !(defined(V8_BINDING) && V8_BINDING)
    5151        boolean debuggerEnabled();
    5252        void enableDebugger(in boolean always);
     
    6666        long pauseOnExceptionsState();
    6767        void setPauseOnExceptionsState(in long pauseOnExceptionsState);
    68 
     68#endif
     69#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
    6970        boolean profilerEnabled();
    7071        void enableProfiler(in boolean always);
  • trunk/WebCore/inspector/InspectorController.cpp

    r54435 r54576  
    147147    , m_debuggerEnabled(false)
    148148    , m_attachDebuggerWhenShown(false)
    149     , m_profilerEnabled(false)
     149#endif
     150#if ENABLE(JAVASCRIPT_DEBUGGER)
     151    , m_profilerEnabled(!WTF_USE_JSC)
    150152    , m_recordingUserInitiatedProfile(false)
    151153    , m_currentUserInitiatedProfileNumber(-1)
     
    13431345}
    13441346
    1345 #if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
     1347#if ENABLE(JAVASCRIPT_DEBUGGER)
    13461348void InspectorController::addProfile(PassRefPtr<ScriptProfile> prpProfile, unsigned lineNumber, const String& sourceURL)
    13471349{
     
    13531355
    13541356    if (m_frontend) {
     1357#if USE(JSC)
    13551358        JSLock lock(SilenceAssertionsOnly);
     1359#endif
    13561360        m_frontend->addProfileHeader(createProfileHeader(*profile));
    13571361    }
     
    13911395        return;
    13921396    ProfilesMap::iterator it = m_profiles.find(uid);
     1397#if USE(JSC)
    13931398    if (it != m_profiles.end())
    13941399        m_frontend->didGetProfile(callId, toJS(m_frontendScriptState, it->second.get()));
     1400#endif
    13951401}
    13961402
     
    14241430    if (!profilerEnabled()) {
    14251431        enableProfiler(false, true);
     1432#if USE(JSC)
    14261433        JavaScriptDebugServer::shared().recompileAllJSFunctions();
     1434#endif
    14271435    }
    14281436
     
    14311439    String title = getCurrentUserInitiatedProfileName(true);
    14321440
     1441#if USE(JSC)
    14331442    ExecState* scriptState = toJSDOMWindow(m_inspectedPage->mainFrame(), debuggerWorld())->globalExec();
     1443#else
     1444    ScriptState* scriptState = 0;
     1445#endif
    14341446    ScriptProfiler::start(scriptState, title);
    14351447
     
    14481460    String title = getCurrentUserInitiatedProfileName();
    14491461
     1462#if USE(JSC)
    14501463    ExecState* scriptState = toJSDOMWindow(m_inspectedPage->mainFrame(), debuggerWorld())->globalExec();
     1464#else
     1465    ScriptState* scriptState = 0;
     1466#endif
    14511467    RefPtr<ScriptProfile> profile = ScriptProfiler::stop(scriptState, title);
    14521468    if (profile)
     
    14731489    m_profilerEnabled = true;
    14741490
     1491#if USE(JSC)
    14751492    if (!skipRecompile)
    14761493        JavaScriptDebugServer::shared().recompileAllJSFunctionsSoon();
     1494#endif
    14771495
    14781496    if (m_frontend)
     
    14901508    m_profilerEnabled = false;
    14911509
     1510#if USE(JSC)
    14921511    JavaScriptDebugServer::shared().recompileAllJSFunctionsSoon();
     1512#endif
    14931513
    14941514    if (m_frontend)
    14951515        m_frontend->profilerWasDisabled();
    14961516}
    1497 
     1517#endif
     1518
     1519#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
    14981520void InspectorController::enableDebuggerFromFrontend(bool always)
    14991521{
  • trunk/WebCore/inspector/InspectorController.h

    r54334 r54576  
    221221    void markTimeline(const String& message);
    222222
    223 #if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
     223#if ENABLE(JAVASCRIPT_DEBUGGER)
    224224    void addProfile(PassRefPtr<ScriptProfile>, unsigned lineNumber, const String& sourceURL);
    225225    void addProfileFinishedMessageToConsole(PassRefPtr<ScriptProfile>, unsigned lineNumber, const String& sourceURL);
     
    235235    void disableProfiler(bool always = false);
    236236    bool profilerEnabled() const { return enabled() && m_profilerEnabled; }
    237 
     237#endif
     238
     239#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
    238240    void enableDebugger();
    239241    void disableDebugger(bool always = false);
     
    269271    void deleteCookie(const String& cookieName, const String& domain);
    270272
    271 #if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
     273#if ENABLE(JAVASCRIPT_DEBUGGER)
    272274    typedef HashMap<unsigned int, RefPtr<ScriptProfile> > ProfilesMap;
    273275
     
    350352    bool m_debuggerEnabled;
    351353    bool m_attachDebuggerWhenShown;
     354#endif
     355#if ENABLE(JAVASCRIPT_DEBUGGER)
    352356    bool m_profilerEnabled;
    353357    bool m_recordingUserInitiatedProfile;
  • trunk/WebCore/inspector/InspectorFrontend.cpp

    r54421 r54576  
    267267}
    268268
    269 void InspectorFrontend::profilerWasEnabled()
    270 {
    271     callSimpleFunction("profilerWasEnabled");
    272 }
    273 
    274 void InspectorFrontend::profilerWasDisabled()
    275 {
    276     callSimpleFunction("profilerWasDisabled");
    277 }
    278 
    279269void InspectorFrontend::parsedScriptSource(const JSC::SourceCode& source)
    280270{
     
    300290}
    301291
     292void InspectorFrontend::pausedScript(SerializedScriptValue* callFrames)
     293{
     294    ScriptValue callFramesValue = ScriptValue::deserialize(scriptState(), callFrames);
     295    ScriptFunctionCall function(m_webInspector, "dispatch");
     296    function.appendArgument("pausedScript");
     297    function.appendArgument(callFramesValue);
     298    function.call();
     299}
     300
     301void InspectorFrontend::resumedScript()
     302{
     303    callSimpleFunction("resumedScript");
     304}
     305#endif
     306
     307#if ENABLE(JAVASCRIPT_DEBUGGER)
     308void InspectorFrontend::profilerWasEnabled()
     309{
     310    callSimpleFunction("profilerWasEnabled");
     311}
     312
     313void InspectorFrontend::profilerWasDisabled()
     314{
     315    callSimpleFunction("profilerWasDisabled");
     316}
     317
    302318void InspectorFrontend::addProfileHeader(const ScriptValue& profile)
    303319{
     
    332348    function.appendArgument(profile);
    333349    function.call();
    334 }
    335 
    336 void InspectorFrontend::pausedScript(SerializedScriptValue* callFrames)
    337 {
    338     ScriptValue callFramesValue = ScriptValue::deserialize(scriptState(), callFrames);
    339     ScriptFunctionCall function(m_webInspector, "dispatch");
    340     function.appendArgument("pausedScript");
    341     function.appendArgument(callFramesValue);
    342     function.call();
    343 }
    344 
    345 void InspectorFrontend::resumedScript()
    346 {
    347     callSimpleFunction("resumedScript");
    348350}
    349351#endif
  • trunk/WebCore/inspector/InspectorFrontend.h

    r54421 r54576  
    8989        void debuggerWasEnabled();
    9090        void debuggerWasDisabled();
     91        void parsedScriptSource(const JSC::SourceCode&);
     92        void failedToParseScriptSource(const JSC::SourceCode&, int errorLine, const JSC::UString& errorMessage);
     93        void pausedScript(SerializedScriptValue* callFrames);
     94        void resumedScript();
     95#endif
     96#if ENABLE(JAVASCRIPT_DEBUGGER)
    9197        void profilerWasEnabled();
    9298        void profilerWasDisabled();
    93         void parsedScriptSource(const JSC::SourceCode&);
    94         void failedToParseScriptSource(const JSC::SourceCode&, int errorLine, const JSC::UString& errorMessage);
    9599        void addProfileHeader(const ScriptValue& profile);
    96100        void setRecordingProfile(bool isProfiling);
    97101        void didGetProfileHeaders(int callId, const ScriptArray& headers);
    98102        void didGetProfile(int callId, const ScriptValue& profile);
    99         void pausedScript(SerializedScriptValue* callFrames);
    100         void resumedScript();
    101103#endif
    102104
  • trunk/WebCore/page/Console.idl

    r54417 r54576  
    3131    interface [OmitConstructor] Console {
    3232
    33 #if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
     33        // Not enabled in V8 because it requires request-reply style.
     34#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER && !(defined(V8_BINDING) && V8_BINDING)
    3435        readonly attribute [CustomGetter] Array profiles;
    3536#endif
  • trunk/WebKit/chromium/ChangeLog

    r54565 r54576  
     12010-02-09  Mikhail Naganov  <mnaganov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Continuing debugger and profiler unforking: narrow scope of JSC-specific ifdefs.
     6        Also, enable JAVASCRIPT_DEBUGGER explicitly in features, it appears to be required
     7        for really enabling it in V8 bindings generation.
     8
     9        https://bugs.webkit.org/show_bug.cgi?id=34706
     10
     11        * features.gypi:
     12
    1132010-02-09  Jian Li  <jianli@chromium.org>
    214
  • trunk/WebKit/chromium/features.gypi

    r54417 r54576  
    4848        'ENABLE_DOM_STORAGE=1',
    4949        'ENABLE_GEOLOCATION=1',
     50        'ENABLE_JAVASCRIPT_DEBUGGER=1',
    5051        'ENABLE_JSC_MULTIPLE_THREADS=0',
    5152        'ENABLE_ICONDATABASE=0',
Note: See TracChangeset for help on using the changeset viewer.