<?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>117554</bug_id>
          
          <creation_ts>2013-06-12 11:40:39 -0700</creation_ts>
          <short_desc>DFG NewTypedArray should be a DCE candidate</short_desc>
          <delta_ts>2014-01-23 16:21:09 -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>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>OS X 10.8</op_sys>
          <bug_status>UNCONFIRMED</bug_status>
          <resolution></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>0</everconfirmed>
          <reporter>evan.exe</reporter>
          <assigned_to name="Filip Pizlo">fpizlo</assigned_to>
          <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>sergio</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>899645</commentid>
    <comment_count>0</comment_count>
    <who name="">evan.exe</who>
    <bug_when>2013-06-12 11:40:39 -0700</bug_when>
    <thetext>The attached page uses binary search to find the maximum size that the Uint8Array constructor accepts. In Firefox and Chrome the test completes in 4 seconds but with both Safari and WebKit Nightly the test takes 15 minutes and eats up 40gb of virtual memory. This is on a MacBook Air with 4gb of memory.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>899649</commentid>
    <comment_count>1</comment_count>
      <attachid>204465</attachid>
    <who name="">evan.exe</who>
    <bug_when>2013-06-12 11:42:39 -0700</bug_when>
    <thetext>Created attachment 204465
typed-array-limit.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>971380</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2014-01-23 16:03:48 -0800</bug_when>
    <thetext>Safari 7 says &quot;Maximum is around 2048mb, found in 37.4 seconds&quot;. This is nowhere as horrible as before, but still still 10x slower than Firefox.

ToT is about 20% slower on top of that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>971385</commentid>
    <comment_count>3</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2014-01-23 16:19:58 -0800</bug_when>
    <thetext>I think that the title is a bit dramatic.  I suspect that all that we&apos;re missing is the compiler smarts to eliminate the allocation of the typed array entirely.  In this program, the statement:

    new Uint8Array(mid);

is trivially dead code.  Our optimizing compiler currently refuses to DCE typed array allocations because of (likely unfounded) paranoia about the typed array allocation having observable error checking.  It probably has no observable error checking if the constructor is known to be passed an integer and that integer is non-negative.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>204465</attachid>
            <date>2013-06-12 11:42:39 -0700</date>
            <delta_ts>2013-06-12 11:42:39 -0700</delta_ts>
            <desc>typed-array-limit.html</desc>
            <filename>typed-array-limit.html</filename>
            <type>text/html</type>
            <size>1117</size>
            <attacher>evan.exe</attacher>
            
              <data encoding="base64">PGJvZHk+CiAgPHA+CiAgICBUaGlzIGZpZ3VyZXMgb3V0IHRoZSBzaXplIGxpbWl0IG9mIGEgc2lu
Z2xlIHR5cGVkIGFycmF5IHVzaW5nIGJpbmFyeSBzZWFyY2guCiAgPC9wPgogIDx1bD4KICAgIDxs
aT5DaHJvbWU6IDQ2MG1iIGluIDQgc2Vjb25kcyAoNzY4bWIgb24gYSBnb29kIGRheSk8L2xpPgog
ICAgPGxpPkZpcmVmb3ggTmlnaHRseTogMjA0OG1iIGluIDQgc2Vjb25kcyAoYWN0dWFsIGxpbWl0
I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