<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[196366] branches/safari-601-branch/Source/JavaScriptCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/196366">196366</a></dd>
<dt>Author</dt> <dd>bshafiei@apple.com</dd>
<dt>Date</dt> <dd>2016-02-10 08:53:49 -0800 (Wed, 10 Feb 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/196179">r196179</a>.  rdar://problem/24574519</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601branchSourceJavaScriptCoreChangeLog">branches/safari-601-branch/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceJavaScriptCoreruntimeJSArrayBufferViewcpp">branches/safari-601-branch/Source/JavaScriptCore/runtime/JSArrayBufferView.cpp</a></li>
<li><a href="#branchessafari601branchSourceJavaScriptCoreruntimeJSArrayBufferViewh">branches/safari-601-branch/Source/JavaScriptCore/runtime/JSArrayBufferView.h</a></li>
<li><a href="#branchessafari601branchSourceJavaScriptCoreruntimeJSGenericTypedArrayViewInlinesh">branches/safari-601-branch/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h</a></li>
<li><a href="#branchessafari601branchSourceJavaScriptCoreruntimeJSObjectcpp">branches/safari-601-branch/Source/JavaScriptCore/runtime/JSObject.cpp</a></li>
<li><a href="#branchessafari601branchSourceJavaScriptCoreruntimeStructureh">branches/safari-601-branch/Source/JavaScriptCore/runtime/Structure.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari601branchSourceJavaScriptCoretestsstressarrayifyarraystoragetypedarrayjs">branches/safari-601-branch/Source/JavaScriptCore/tests/stress/arrayify-array-storage-typed-array.js</a></li>
<li><a href="#branchessafari601branchSourceJavaScriptCoretestsstressarrayifyint32typedarrayjs">branches/safari-601-branch/Source/JavaScriptCore/tests/stress/arrayify-int32-typed-array.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601branchSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/JavaScriptCore/ChangeLog (196365 => 196366)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/ChangeLog        2016-02-10 10:28:23 UTC (rev 196365)
+++ branches/safari-601-branch/Source/JavaScriptCore/ChangeLog        2016-02-10 16:53:49 UTC (rev 196366)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2016-02-10  Babak Shafiei  &lt;bshafiei@apple.com&gt;
+
+        Merge r196179.
+
+    2016-02-05  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
+            Arrayify for a typed array shouldn't create a monster
+            https://bugs.webkit.org/show_bug.cgi?id=153908
+            rdar://problem/24290639
+
+            Reviewed by Mark Lam.
+
+            Previously if you convinced the DFG to emit an Arrayify to ArrayStorage and then gave it a
+            typed array, you'd corrupt the object.
+
+            * runtime/JSArrayBufferView.cpp:
+            (WTF::printInternal):
+            * runtime/JSArrayBufferView.h:
+            * runtime/JSGenericTypedArrayViewInlines.h:
+            (JSC::JSGenericTypedArrayView&lt;Adaptor&gt;::visitChildren):
+            (JSC::JSGenericTypedArrayView&lt;Adaptor&gt;::slowDownAndWasteMemory):
+            * runtime/JSObject.cpp:
+            (JSC::JSObject::copyButterfly):
+            (JSC::JSObject::enterDictionaryIndexingMode):
+            (JSC::JSObject::ensureInt32Slow):
+            (JSC::JSObject::ensureDoubleSlow):
+            (JSC::JSObject::ensureContiguousSlow):
+            (JSC::JSObject::ensureArrayStorageSlow):
+            (JSC::JSObject::growOutOfLineStorage):
+            (JSC::getBoundSlotBaseFunctionForGetterSetter):
+            * runtime/Structure.h:
+            * tests/stress/arrayify-array-storage-typed-array.js: Added. This test failed.
+            * tests/stress/arrayify-int32-typed-array.js: Added. This test case already had other protections, but we beefed them up.
+
</ins><span class="cx"> 2016-01-29  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r194479.
</span></span></pre></div>
<a id="branchessafari601branchSourceJavaScriptCoreruntimeJSArrayBufferViewcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/JavaScriptCore/runtime/JSArrayBufferView.cpp (196365 => 196366)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/runtime/JSArrayBufferView.cpp        2016-02-10 10:28:23 UTC (rev 196365)
+++ branches/safari-601-branch/Source/JavaScriptCore/runtime/JSArrayBufferView.cpp        2016-02-10 16:53:49 UTC (rev 196366)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -220,3 +220,28 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span><ins>+namespace WTF {
+
+using namespace JSC;
+
+void printInternal(PrintStream&amp; out, TypedArrayMode mode)
+{
+    switch (mode) {
+    case FastTypedArray:
+        out.print(&quot;FastTypedArray&quot;);
+        return;
+    case OversizeTypedArray:
+        out.print(&quot;OversizeTypedArray&quot;);
+        return;
+    case WastefulTypedArray:
+        out.print(&quot;WastefulTypedArray&quot;);
+        return;
+    case DataViewMode:
+        out.print(&quot;DataViewMode&quot;);
+        return;
+    }
+    RELEASE_ASSERT_NOT_REACHED();
+}
+
+} // namespace WTF
+
</ins></span></pre></div>
<a id="branchessafari601branchSourceJavaScriptCoreruntimeJSArrayBufferViewh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/JavaScriptCore/runtime/JSArrayBufferView.h (196365 => 196366)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/runtime/JSArrayBufferView.h        2016-02-10 10:28:23 UTC (rev 196365)
+++ branches/safari-601-branch/Source/JavaScriptCore/runtime/JSArrayBufferView.h        2016-02-10 16:53:49 UTC (rev 196366)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -184,5 +184,11 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span><ins>+namespace WTF {
+
+void printInternal(PrintStream&amp;, JSC::TypedArrayMode);
+
+} // namespace WTF
+
</ins><span class="cx"> #endif // JSArrayBufferView_h
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601branchSourceJavaScriptCoreruntimeJSGenericTypedArrayViewInlinesh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h (196365 => 196366)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h        2016-02-10 10:28:23 UTC (rev 196365)
+++ branches/safari-601-branch/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h        2016-02-10 16:53:49 UTC (rev 196366)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -448,6 +448,7 @@
</span><span class="cx">     }
</span><span class="cx">         
</span><span class="cx">     case WastefulTypedArray:
</span><ins>+        RELEASE_ASSERT(thisObject-&gt;existingBufferInButterfly());
</ins><span class="cx">         break;
</span><span class="cx">         
</span><span class="cx">     case DataViewMode:
</span><span class="lines">@@ -508,6 +509,7 @@
</span><span class="cx">         thisObject-&gt;m_butterfly.setWithoutWriteBarrier(
</span><span class="cx">             static_cast&lt;IndexingHeader*&gt;(thisObject-&gt;m_vector)-&gt;butterfly());
</span><span class="cx">     } else {
</span><ins>+        RELEASE_ASSERT(!thisObject-&gt;hasIndexingHeader());
</ins><span class="cx">         VM&amp; vm = *heap-&gt;vm();
</span><span class="cx">         thisObject-&gt;m_butterfly.set(vm, thisObject, Butterfly::createOrGrowArrayRight(
</span><span class="cx">             thisObject-&gt;butterfly(), vm, thisObject, thisObject-&gt;structure(),
</span></span></pre></div>
<a id="branchessafari601branchSourceJavaScriptCoreruntimeJSObjectcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/JavaScriptCore/runtime/JSObject.cpp (196365 => 196366)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/runtime/JSObject.cpp        2016-02-10 10:28:23 UTC (rev 196365)
+++ branches/safari-601-branch/Source/JavaScriptCore/runtime/JSObject.cpp        2016-02-10 16:53:49 UTC (rev 196366)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
</span><span class="cx">  *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
</span><del>- *  Copyright (C) 2003-2006, 2008, 2009, 2012-2015 Apple Inc. All rights reserved.
</del><ins>+ *  Copyright (C) 2003-2006, 2008, 2009, 2012-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *  Copyright (C) 2007 Eric Seidel (eric@webkit.org)
</span><span class="cx">  *
</span><span class="cx">  *  This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx">     size_t capacityInBytes = Butterfly::totalSize(preCapacity, propertyCapacity, hasIndexingHeader, indexingPayloadSizeInBytes);
</span><span class="cx">     if (visitor.checkIfShouldCopy(butterfly-&gt;base(preCapacity, propertyCapacity))) {
</span><span class="cx">         Butterfly* newButterfly = Butterfly::createUninitializedDuringCollection(visitor, preCapacity, propertyCapacity, hasIndexingHeader, indexingPayloadSizeInBytes);
</span><del>-        
</del><ins>+
</ins><span class="cx">         // Copy the properties.
</span><span class="cx">         PropertyStorage currentTarget = newButterfly-&gt;propertyStorage();
</span><span class="cx">         PropertyStorage currentSource = butterfly-&gt;propertyStorage();
</span><span class="lines">@@ -610,8 +610,11 @@
</span><span class="cx">     case ALL_DOUBLE_INDEXING_TYPES:
</span><span class="cx">     case ALL_CONTIGUOUS_INDEXING_TYPES:
</span><span class="cx">         // NOTE: this is horribly inefficient, as it will perform two conversions. We could optimize
</span><del>-        // this case if we ever cared.
-        enterDictionaryIndexingModeWhenArrayStorageAlreadyExists(vm, ensureArrayStorageSlow(vm));
</del><ins>+        // this case if we ever cared. Note that ensureArrayStorage() can return null if the object
+        // doesn't support traditional indexed properties. At the time of writing, this just affects
+        // typed arrays.
+        if (ArrayStorage* storage = ensureArrayStorageSlow(vm))
+            enterDictionaryIndexingModeWhenArrayStorageAlreadyExists(vm, storage);
</ins><span class="cx">         break;
</span><span class="cx">     case ALL_ARRAY_STORAGE_INDEXING_TYPES:
</span><span class="cx">         enterDictionaryIndexingModeWhenArrayStorageAlreadyExists(vm, m_butterfly-&gt;arrayStorage());
</span><span class="lines">@@ -982,6 +985,9 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(inherits(info()));
</span><span class="cx">     
</span><ins>+    if (structure(vm)-&gt;hijacksIndexingHeader())
+        return ContiguousJSValues();
+    
</ins><span class="cx">     switch (indexingType()) {
</span><span class="cx">     case ALL_BLANK_INDEXING_TYPES:
</span><span class="cx">         if (UNLIKELY(indexingShouldBeSparse() || structure(vm)-&gt;needsSlowPutIndexing()))
</span><span class="lines">@@ -1006,6 +1012,9 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(inherits(info()));
</span><span class="cx">     
</span><ins>+    if (structure(vm)-&gt;hijacksIndexingHeader())
+        return ContiguousDoubles();
+    
</ins><span class="cx">     switch (indexingType()) {
</span><span class="cx">     case ALL_BLANK_INDEXING_TYPES:
</span><span class="cx">         if (UNLIKELY(indexingShouldBeSparse() || structure(vm)-&gt;needsSlowPutIndexing()))
</span><span class="lines">@@ -1032,6 +1041,9 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(inherits(info()));
</span><span class="cx">     
</span><ins>+    if (structure(vm)-&gt;hijacksIndexingHeader())
+        return ContiguousJSValues();
+    
</ins><span class="cx">     switch (indexingType()) {
</span><span class="cx">     case ALL_BLANK_INDEXING_TYPES:
</span><span class="cx">         if (UNLIKELY(indexingShouldBeSparse() || structure(vm)-&gt;needsSlowPutIndexing()))
</span><span class="lines">@@ -1059,6 +1071,9 @@
</span><span class="cx"> ArrayStorage* JSObject::ensureArrayStorageSlow(VM&amp; vm)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(inherits(info()));
</span><ins>+
+    if (structure(vm)-&gt;hijacksIndexingHeader())
+        return nullptr;
</ins><span class="cx">     
</span><span class="cx">     switch (indexingType()) {
</span><span class="cx">     case ALL_BLANK_INDEXING_TYPES:
</span><span class="lines">@@ -2484,7 +2499,7 @@
</span><span class="cx"> 
</span><span class="cx">     // It's important that this function not rely on structure(), for the property
</span><span class="cx">     // capacity, since we might have already mutated the structure in-place.
</span><del>-    
</del><ins>+
</ins><span class="cx">     return Butterfly::createOrGrowPropertyStorage(m_butterfly.get(), vm, this, structure(vm), oldSize, newSize);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601branchSourceJavaScriptCoreruntimeStructureh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/JavaScriptCore/runtime/Structure.h (196365 => 196366)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/runtime/Structure.h        2016-02-10 10:28:23 UTC (rev 196365)
+++ branches/safari-601-branch/Source/JavaScriptCore/runtime/Structure.h        2016-02-10 16:53:49 UTC (rev 196366)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2009, 2012, 2013, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2009, 2012-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -272,11 +272,16 @@
</span><span class="cx">             &amp;&amp; offset &lt;= m_offset
</span><span class="cx">             &amp;&amp; (offset &lt; m_inlineCapacity || offset &gt;= firstOutOfLineOffset);
</span><span class="cx">     }
</span><ins>+
+    bool hijacksIndexingHeader() const
+    {
+        return isTypedView(m_classInfo-&gt;typedArrayStorageType);
+    }
</ins><span class="cx">     
</span><span class="cx">     bool couldHaveIndexingHeader() const
</span><span class="cx">     {
</span><span class="cx">         return hasIndexedProperties(indexingType())
</span><del>-            || isTypedView(m_classInfo-&gt;typedArrayStorageType);
</del><ins>+            || hijacksIndexingHeader();
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     bool hasIndexingHeader(const JSCell*) const;
</span></span></pre></div>
<a id="branchessafari601branchSourceJavaScriptCoretestsstressarrayifyarraystoragetypedarrayjsfromrev196179trunkSourceJavaScriptCoretestsstressarrayifyarraystoragetypedarrayjs"></a>
<div class="copfile"><h4>Copied: branches/safari-601-branch/Source/JavaScriptCore/tests/stress/arrayify-array-storage-typed-array.js (from rev 196179, trunk/Source/JavaScriptCore/tests/stress/arrayify-array-storage-typed-array.js) (0 => 196366)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/tests/stress/arrayify-array-storage-typed-array.js                                (rev 0)
+++ branches/safari-601-branch/Source/JavaScriptCore/tests/stress/arrayify-array-storage-typed-array.js        2016-02-10 16:53:49 UTC (rev 196366)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+function make1() {
+    var a = [];
+    a.__defineGetter__(42, function() { return 42; });
+    return a;
+}
+
+noInline(make1);
+
+function make2() {
+    return [42];
+}
+
+noInline(make2);
+
+for (var i = 0; i &lt; 10000; ++i) {
+    make1();
+    make2();
+}
+
+function foo(o) {
+    o[0] = 0;
+}
+
+noInline(foo);
+
+for (var i = 0; i &lt; 10000; ++i) {
+    foo(make1());
+    foo(make2());
+}
+
+var o = new Int8Array(100);
+var b = o.buffer;
+foo(o);
+if (o.buffer != b)
+    throw &quot;Error: buffer changed.&quot;;
+
</ins></span></pre></div>
<a id="branchessafari601branchSourceJavaScriptCoretestsstressarrayifyint32typedarrayjsfromrev196179trunkSourceJavaScriptCoretestsstressarrayifyint32typedarrayjs"></a>
<div class="copfile"><h4>Copied: branches/safari-601-branch/Source/JavaScriptCore/tests/stress/arrayify-int32-typed-array.js (from rev 196179, trunk/Source/JavaScriptCore/tests/stress/arrayify-int32-typed-array.js) (0 => 196366)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/tests/stress/arrayify-int32-typed-array.js                                (rev 0)
+++ branches/safari-601-branch/Source/JavaScriptCore/tests/stress/arrayify-int32-typed-array.js        2016-02-10 16:53:49 UTC (rev 196366)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+function make1() {
+    return [];
+}
+
+noInline(make1);
+
+function make2() {
+    return [42];
+}
+
+noInline(make2);
+
+for (var i = 0; i &lt; 10000; ++i) {
+    make1();
+    make2();
+}
+
+function foo(o) {
+    o[0] = 0;
+}
+
+noInline(foo);
+
+for (var i = 0; i &lt; 10000; ++i) {
+    foo(make1());
+    foo(make2());
+}
+
+var o = new Int8Array(100);
+var b = o.buffer;
+foo(o);
+if (o.buffer != b)
+    throw &quot;Error: buffer changed.&quot;;
+
</ins></span></pre>
</div>
</div>

</body>
</html>