<?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>60866</bug_id>
          
          <creation_ts>2011-05-15 19:28:57 -0700</creation_ts>
          <short_desc>Evaluation order broken for empty alternatives in subpatterns</short_desc>
          <delta_ts>2011-05-23 13:51:01 -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>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>60860</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gavin Barraclough">barraclough</reporter>
          <assigned_to name="Gavin Barraclough">barraclough</assigned_to>
          <cc>ggaren</cc>
    
    <cc>pvarga</cc>
    
    <cc>zherczeg</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>404249</commentid>
    <comment_count>0</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2011-05-15 19:28:57 -0700</bug_when>
    <thetext>for example:
    /(|a)/.exec(&quot;a&quot;);
should return [&quot;&quot;,&quot;&quot;], but instead returns [&quot;a&quot;,&quot;a&quot;].

This was broken by https://bugs.webkit.org/show_bug.cgi?id=51395, which will be reverted (this unsafe optimization does not appear significant to any benchmarks we are tracking, we should reimplement in a more restricted, safe fashion only if we can demonstrate an important workload benefitting from doing so).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>404251</commentid>
    <comment_count>1</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2011-05-15 19:33:28 -0700</bug_when>
    <thetext>This unsafe optimization is masking further problems in the JIT, reverting the optimization causes failures in fast/regex/parentheses.

These issues are fixed by 60860.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>404325</commentid>
    <comment_count>2</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2011-05-16 00:08:29 -0700</bug_when>
    <thetext>rs=me to roll out that optimization with a layout test for

/(|a)/.exec(&quot;a&quot;)
/(a|)/.exec(&quot;b&quot;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>404375</commentid>
    <comment_count>3</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2011-05-16 02:08:37 -0700</bug_when>
    <thetext>Fixed in r86547.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>405670</commentid>
    <comment_count>4</comment_count>
    <who name="Zoltan Herczeg">zherczeg</who>
    <bug_when>2011-05-18 06:24:45 -0700</bug_when>
    <thetext>Perhaps a non-greedy conversion? (|a) == a?? (a|) == a?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>408250</commentid>
    <comment_count>5</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2011-05-23 13:51:01 -0700</bug_when>
    <thetext>Conversion to an appropriately greedy quantifier would be possible, but would limit the scope of this optimization.  We would consider such a patch if it were to provide a useful performance gain on an interesting workload.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>