JavaScriptCore:
authorkmccullough@apple.com <kmccullough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 May 2008 02:06:27 +0000 (02:06 +0000)
committerkmccullough@apple.com <kmccullough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 May 2008 02:06:27 +0000 (02:06 +0000)
2008-05-14  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by Tim.

        <rdar://problem/5770054> JavaScript profiler (10928)
        - Expose the new profiler functions to the WebInspector.

        * JavaScriptCore.exp:

WebCore:

2008-05-14  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by Tim.

        <rdar://problem/5770054> JavaScript profiler (10928)
        - Expose the new Profiler functions to the WebInspector.

        * page/JavaScriptProfileNode.cpp:
        (WebCore::getTotalPercent):
        (WebCore::getSelfPercent):
        (WebCore::ProfileNodeClass):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@33474 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.exp
WebCore/ChangeLog
WebCore/page/JavaScriptProfileNode.cpp

index e91ec11..7a85142 100644 (file)
@@ -1,5 +1,14 @@
 2008-05-14  Kevin McCullough  <kmccullough@apple.com>
 
+        Reviewed by Tim.
+
+        <rdar://problem/5770054> JavaScript profiler (10928)
+        - Expose the new profiler functions to the WebInspector.
+
+        * JavaScriptCore.exp:
+
+2008-05-14  Kevin McCullough  <kmccullough@apple.com>
+
         Giving credit where credit is due.
 
         * ChangeLog:
index 9f4d5e8..253da97 100644 (file)
@@ -234,6 +234,8 @@ __ZN3WTF8CollatorC1EPKc
 __ZN3WTF8CollatorD1Ev
 __ZN3WTF8fastFreeEPv
 __ZNK3KJS11ProfileNode8selfTimeEv
+__ZNK3KJS11ProfileNode11selfPercentEv
+__ZNK3KJS11ProfileNode12totalPercentEv
 __ZNK3KJS11PropertyMap3getERKNS_10IdentifierE
 __ZNK3KJS12DateInstance7getTimeERdRi
 __ZNK3KJS13ArrayInstance7getItemEj
index e5eb2a5..79e05c7 100644 (file)
@@ -1,3 +1,15 @@
+2008-05-14  Kevin McCullough  <kmccullough@apple.com>
+
+        Reviewed by Tim.
+
+        <rdar://problem/5770054> JavaScript profiler (10928)
+        - Expose the new Profiler functions to the WebInspector.
+
+        * page/JavaScriptProfileNode.cpp:
+        (WebCore::getTotalPercent):
+        (WebCore::getSelfPercent):
+        (WebCore::ProfileNodeClass):
+
 2008-05-14  Timothy Hatcher  <timothy@apple.com>
 
         Fixes a crash in JavaScriptDebugServer::returnEvent when debugging
index 3646452..4dae4f5 100644 (file)
@@ -84,6 +84,28 @@ static JSValueRef getSelfTime(JSContextRef ctx, JSObjectRef thisObject, JSString
     return JSValueMakeNumber(ctx, profileNode->selfTime());
 }
 
+static JSValueRef getTotalPercent(JSContextRef ctx, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    KJS::JSLock lock;
+
+    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass()))
+        return JSValueMakeUndefined(ctx);
+
+    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject));
+    return JSValueMakeNumber(ctx, profileNode->totalPercent());
+}
+
+static JSValueRef getSelfPercent(JSContextRef ctx, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    KJS::JSLock lock;
+
+    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass()))
+        return JSValueMakeUndefined(ctx);
+
+    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject));
+    return JSValueMakeNumber(ctx, profileNode->selfPercent());
+}
+
 static JSValueRef getNumberOfCalls(JSContextRef ctx, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
 {
     KJS::JSLock lock;
@@ -154,6 +176,8 @@ JSClassRef ProfileNodeClass()
         { "functionName", getFunctionName, 0, kJSPropertyAttributeNone },
         { "totalTime", getTotalTime, 0, kJSPropertyAttributeNone },
         { "selfTime", getSelfTime, 0, kJSPropertyAttributeNone },
+        { "totalPercent", getTotalPercent, 0, kJSPropertyAttributeNone },
+        { "selfPercent", getSelfPercent, 0, kJSPropertyAttributeNone },
         { "numberOfCalls", getNumberOfCalls, 0, kJSPropertyAttributeNone },
         { "children", getChildren, 0, kJSPropertyAttributeNone },
         { 0, 0, 0, 0 }