Changeset 34074 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
May 23, 2008, 4:37:32 AM (17 years ago)
Author:
[email protected]
Message:

Fix call stack reported by profiler when entering event handlers.

Reviewed by Tim H

JSObject::call was arbitrarily notifying the profiler when it was
called, even if it was JS code, which notifies the profile on entry
in any case.

Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r34073 r34074  
     12008-05-23  Oliver Hunt  <[email protected]>
     2
     3        Reviewed by Tim H.
     4
     5        Fix call stack reported by profiler when entering event handlers.
     6
     7        JSObject::call was arbitrarily notifying the profiler when it was
     8        called, even if it was JS code, which notifies the profile on entry
     9        in any case.
     10
     11        * kjs/object.cpp:
     12        (KJS::JSObject::call):
     13
    1142008-05-23  Maciej Stachowiak  <[email protected]>
    215
  • trunk/JavaScriptCore/kjs/object.cpp

    r34067 r34074  
    9292  }
    9393#endif
    94 
    95     Profiler::profiler()->willExecute(exec, this);
    96  
    97     JSValue *ret = callAsFunction(exec,thisObj,args);
    98 
    99     Profiler::profiler()->didExecute(exec, this);
    100 
     94    CallData data;
     95    JSValue *ret;
     96    if (this->getCallData(data) == CallTypeJS) {
     97        // A native function will enter the VM, which will allow the profiler
     98        // to detect entry
     99        ret = callAsFunction(exec,thisObj,args);
     100    } else {
     101        Profiler** profiler = Profiler::enabledProfilerReference();
     102        if (*profiler)
     103            (*profiler)->willExecute(exec, this);
     104       
     105        ret = callAsFunction(exec,thisObj,args);
     106       
     107        if (*profiler)
     108            (*profiler)->didExecute(exec, this);
     109    }
    101110#if KJS_MAX_STACK > 0
    102111  --depth;
Note: See TracChangeset for help on using the changeset viewer.