<?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>16595</bug_id>
          
          <creation_ts>2007-12-24 00:58:48 -0800</creation_ts>
          <short_desc>Add evaluateToVoid() and LoopNode subclasses which ignore completion type</short_desc>
          <delta_ts>2008-09-03 02:41:38 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Eric Seidel (no email)">eric</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ggaren</cc>
    
    <cc>mjs</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>65183</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2007-12-24 00:58:48 -0800</bug_when>
    <thetext>Add evaluateToVoid() and LoopNode subclasses which ignore completion type

Loop nodes are spending time updating a completion value to be returned (and generally ignored).  For example, most for loops never have their returned completion type examined.  I&apos;ve never seen code like this:

function bar() {
  for(var x = 0; x &lt; 10; x++)
       x;
}

alert(bar());

Only in cases like that do we need to care what the loop completion value was.

In the common case, we can use a reverse execution walk through the node tree to keep track of when completion values are ignored:

var x = 2; // the fact that this updates the last completion value is completely ignored
var y = 4;

and use evaluateToVoid() calls instead.  We could even swap out entire BlockNodes which call void executeToVoid(exec) instead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65184</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2007-12-24 01:01:55 -0800</bug_when>
    <thetext>actually, the only way to access a completion value is from a function w/o a return value or an eval statement so you don&apos;t even need to walk, you just look at the last statement.  in the global context you can always evaluate to void</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89994</commentid>
    <comment_count>2</comment_count>
    <who name="Cameron Zwarich (cpst)">zwarich</who>
    <bug_when>2008-09-03 02:41:38 -0700</bug_when>
    <thetext>This is now irrelevant after SquirrelFish.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>