Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Unified Diff: test/mjsunit/array-store-and-grow.js

Issue 149413010: A64: Synchronize with r16024. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/array-literal-transitions.js ('k') | test/mjsunit/compiler/dead-string-add.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/array-store-and-grow.js
diff --git a/test/mjsunit/array-store-and-grow.js b/test/mjsunit/array-store-and-grow.js
index 88f3db8f646ca93f12676ccd601d0a1372246bc5..a03a753e4469c5ccb025067095fd0ec06f9a3e39 100644
--- a/test/mjsunit/array-store-and-grow.js
+++ b/test/mjsunit/array-store-and-grow.js
@@ -25,6 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// Flags: --allow-natives-syntax
+
// Verifies that the KeyedStoreIC correctly handles out-of-bounds stores
// to an array that grow it by a single element. Test functions are
// called twice to make sure that the IC is used, first call is handled
@@ -184,3 +186,24 @@ a = [];
array_store_1(a, 0, 0.5);
assertEquals(0.5, a[0]);
assertEquals(0.5, array_store_1([], 0, 0.5));
+
+// Verify that a grow store will deoptimize if the max gap (difference between
+// the end of an array capacity and a new index) is passed. The wrapper is to
+// make sure array_store_10 isn't inlined.
+
+(function() {
+ function grow_store(a,b,c) {
+ a[b] = c;
+ }
+
+ a = new Array(1);
+ grow_store(a,1,1);
+ grow_store(a,2,1);
+ %OptimizeFunctionOnNextCall(grow_store);
+ grow_store(a,10,1);
+ assertOptimized(grow_store);
+ grow_store(a,2048,1);
+ assertUnoptimized(grow_store);
+ %ClearFunctionTypeFeedback(grow_store);
+})();
+
« no previous file with comments | « test/mjsunit/array-literal-transitions.js ('k') | test/mjsunit/compiler/dead-string-add.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698