<?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>172458</bug_id>
          
          <creation_ts>2017-05-22 11:44:54 -0700</creation_ts>
          <short_desc>for-in bytecode generation is exponential</short_desc>
          <delta_ts>2021-07-23 16:55:05 -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>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>227989</dup_id>
          
          <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="Saam Barati">saam</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ashvayka</cc>
    
    <cc>benjamin</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>gskachkov</cc>
    
    <cc>jfbastien</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>msaboff</cc>
    
    <cc>oliver</cc>
    
    <cc>ticaiolima</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1311465</commentid>
    <comment_count>0</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-05-22 11:44:54 -0700</bug_when>
    <thetext>we emit the loop 3 times. If we start nesting for-in loops, this is exponential. I&apos;ll verify this is indeed the case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1311467</commentid>
    <comment_count>1</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-05-22 11:46:41 -0700</bug_when>
    <thetext>Yup. We emit 1072675 instruction words for this function:
```
function foo(o) {
    for (let i in o) {
        for (let i in o) {
            for (let i in o) {
                for (let i in o) {
                    for (let i in o) {
                        for (let i in o) {
                            for (let i in o) {
                                for (let i in o) {
                                    for (let i in o) {
                                        2+2;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

}
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1779247</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Shvayka">ashvayka</who>
    <bug_when>2021-07-23 16:55:05 -0700</bug_when>
    <thetext>Keith is fixing for / in to emit only one loop in https://bugs.webkit.org/show_bug.cgi?id=227989.

*** This bug has been marked as a duplicate of bug 227989 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>