<?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>150290</bug_id>
          
          <creation_ts>2015-10-17 16:08:13 -0700</creation_ts>
          <short_desc>[ES6] Implement Generators</short_desc>
          <delta_ts>2023-09-29 10:47:27 -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>FIXED</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>151547</dependson>
    
    <dependson>150769</dependson>
    
    <dependson>150792</dependson>
    
    <dependson>151545</dependson>
    
    <dependson>151546</dependson>
    
    <dependson>151552</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yusuke Suzuki">ysuzuki</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>adam</cc>
    
    <cc>ashvayka</cc>
    
    <cc>fealebenpae</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>gskachkov</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>msaboff</cc>
    
    <cc>saam</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1134261</commentid>
    <comment_count>0</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2015-10-17 16:08:13 -0700</bug_when>
    <thetext>Implement ES6 generators.
Consider the following case,

let generator = gen();
// first example.
for (let value of generator) {
    ...
}

function* gen() {
    // (1).
    ...
    // (2).
    yield;
}

in for-of, we call generator.next(). In the first case, it starts from (1). And the second call starts from (2).
So I think generating the following code for ES6 generator is the easiest way to handle it in DFG / FTL. How about this?

// Entry point is only one. Every time we call generator.next(), the function will start from here.
resume_to_yield (generator_object)  // This resumes frame and jump.
label_1:
// (1).
special_return;
label_2:
// (2).
special_return;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1138169</commentid>
    <comment_count>1</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2015-10-31 10:34:10 -0700</bug_when>
    <thetext>Working on syntax part at first...</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>