<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>110667</bug_id>
          
          <creation_ts>2013-02-22 17:26:04 -0800</creation_ts>
          <short_desc>[V8] meta: Insert TRACE_EVENT_STATE() macros into DOM attribute getters/setters/methods</short_desc>
          <delta_ts>2014-12-16 00:47:49 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore JavaScript</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>110669</dependson>
    
    <dependson>110671</dependson>
    
    <dependson>110676</dependson>
    
    <dependson>110726</dependson>
    
    <dependson>110765</dependson>
    
    <dependson>110769</dependson>
    
    <dependson>110781</dependson>
    
    <dependson>110791</dependson>
    
    <dependson>110794</dependson>
    
    <dependson>110799</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Kentaro Hara">haraken</reporter>
          <assigned_to name="Kentaro Hara">haraken</assigned_to>
          <cc>abarth</cc>
    
    <cc>nduca</cc>
    
    <cc>ulfar.chromium</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>840156</commentid>
    <comment_count>0</comment_count>
    <who name="Kentaro Hara">haraken</who>
    <bug_when>2013-02-22 17:26:04 -0800</bug_when>
    <thetext>To enable sampling profiling, we want to insert TRACE_EVENT_STATE() macros into DOM attribute getters/setters/methods. Specifically, CodeGeneratorV8.pm should generate the following code:

// DOM attribute getter
Handle&lt;Value&gt; xxxAttrGetterCallback(...) {
  TRACE_EVENT_STATE(&quot;DOMAttributeGetter&quot;);
  Handle&lt;Value&gt; value = xxxAttrGetter(...);
  TRACE_EVENT_STATE(&quot;Other&quot;);
  return value;
}

// DOM attribute getter (custom)
Handle&lt;Value&gt; xxxAttrGetterCallback(...) {
  TRACE_EVENT_STATE(&quot;DOMAttributeGetter&quot;);
  Handle&lt;Value&gt; value = xxxAttrGetterCustom(...);
  TRACE_EVENT_STATE(&quot;Other&quot;);
  return value;
}

// DOM attribute setter
void xxxAttrSetterCallback(...) {
  TRACE_EVENT_STATE(&quot;DOMAttributeSetter&quot;);
  xxxAttrSetter(...);
  TRACE_EVENT_STATE(&quot;Other&quot;);
}

// DOM attribute setter (custom)
void xxxAttrSetterCallback(...) {
  TRACE_EVENT_STATE(&quot;DOMAttributeSetter&quot;);
  xxxAttrSetterCustom(...);
  TRACE_EVENT_STATE(&quot;Other&quot;);
}

// DOM method
Handle&lt;Value&gt; xxxMethodCallback(...) {
  TRACE_EVENT_STATE(&quot;DOMMethod&quot;);
  Handle&lt;Value&gt; value = xxxMethod();
  TRACE_EVENT_STATE(&quot;Other&quot;);
  return value;
}

// DOM attribute method (custom)
Handle&lt;Value&gt; xxxMethodCallback(...) {
  TRACE_EVENT_STATE(&quot;DOMMethod&quot;);
  Handle&lt;Value&gt; value = xxxMethodCustom();
  TRACE_EVENT_STATE(&quot;Other&quot;);
  return value;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>840182</commentid>
    <comment_count>1</comment_count>
    <who name="Kentaro Hara">haraken</who>
    <bug_when>2013-02-22 17:48:07 -0800</bug_when>
    <thetext>And DOM constructors will look like:

// DOM constructor
Handle&lt;Value&gt; constructorCallback(...) {
  TRACE_EVENT_STATE(&quot;DOMConstructor&quot;);
  Handle&lt;Value&gt; value = constructor(...);
  TRACE_EVENT_STATE(&quot;Other&quot;);
  return value;
}

// DOM constructor (custom)
Handle&lt;Value&gt; constructorCallback(...) {
  TRACE_EVENT_STATE(&quot;DOMConstructor&quot;);
  Handle&lt;Value&gt; value = constructorCustom(...);
  TRACE_EVENT_STATE(&quot;Other&quot;);
  return value;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>846960</commentid>
    <comment_count>2</comment_count>
    <who name="Ulfar Erlingsson">ulfar.chromium</who>
    <bug_when>2013-03-04 16:05:08 -0800</bug_when>
    <thetext>Kentaro, FYI, see the draft patch I have at https://bugs.webkit.org/show_bug.cgi?id=107207, which allows for a closure to be wrapped around any (or all) DOM getters/setters/methods.   The closures are created based on policy, and no overhead is incurred for DOM invocations without a closure.  It&apos;s work I&apos;ve been doing with Ankur Taly on DOM activity logging for extensions, and bug https://bugs.webkit.org/show_bug.cgi?id=110779 where both you and Adam Barth commented on the relationship with your work on tracing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>846978</commentid>
    <comment_count>3</comment_count>
    <who name="Kentaro Hara">haraken</who>
    <bug_when>2013-03-04 16:13:11 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; Kentaro, FYI, see the draft patch I have at https://bugs.webkit.org/show_bug.cgi?id=107207, which allows for a closure to be wrapped around any (or all) DOM getters/setters/methods.   The closures are created based on policy, and no overhead is incurred for DOM invocations without a closure.  It&apos;s work I&apos;ve been doing with Ankur Taly on DOM activity logging for extensions, and bug https://bugs.webkit.org/show_bug.cgi?id=110779 where both you and Adam Barth commented on the relationship with your work on tracing.

Thanks for the info! I added comments on your bug.

In my understanding, the objectives of sampling TRACE_EVENTs and DOM closures are different, and thus both are needed, right? (See discussion in bug 110779)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>847847</commentid>
    <comment_count>4</comment_count>
    <who name="Ulfar Erlingsson">ulfar.chromium</who>
    <bug_when>2013-03-05 11:17:22 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; Kentaro, FYI, see the draft patch I have at https://bugs.webkit.org/show_bug.cgi?id=107207, which allows for a closure to be wrapped around any (or all) DOM getters/setters/methods.   The closures are created based on policy, and no overhead is incurred for DOM invocations without a closure.  It&apos;s work I&apos;ve been doing with Ankur Taly on DOM activity logging for extensions, and bug https://bugs.webkit.org/show_bug.cgi?id=110779 where both you and Adam Barth commented on the relationship with your work on tracing.
&gt; 
&gt; Thanks for the info! I added comments on your bug.
&gt; 
&gt; In my understanding, the objectives of sampling TRACE_EVENTs and DOM closures are different, and thus both are needed, right? (See discussion in bug 110779)

Thanks for the comments.  I&apos;ve replied on the other thread.

Yes, the two features are different, and both are needed.

However, in case you were interested, I just wanted to point out that closure mechanisms like those in bug 107207 could easily be used to dynamically add counters like the ones in this patch.  This could be advantageous, if you wanted to remove the overhead of tracing macros from the normal case use of DOM element wrappers), and it might make it easier for you to make later changes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1055907</commentid>
    <comment_count>5</comment_count>
    <who name="Brian Burg">burg</who>
    <bug_when>2014-12-16 00:47:49 -0800</bug_when>
    <thetext>Closing some V8-related work items.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>