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

Side by Side Diff: test/mjsunit/array-push7.js

Issue 233293005: Remove hand-written assembly ArrayPush stubs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix test comments Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/array-push6.js ('k') | test/mjsunit/array-push8.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Flags: --allow-natives-syntax
6
7 var v = 0;
8
9 function push_wrapper(array, value) {
10 array.push(value);
11 }
12 function pop_wrapper(array) {
13 return array.pop();
14 }
15
16 // Test that Object.observe() notification events are properly sent from
17 // Array.push() and Array.pop() both from optimized and un-optimized code.
18 var array = [];
19
20 function somethingChanged(changes) {
21 v++;
22 }
23
24 Object.observe(array, somethingChanged);
25 push_wrapper(array, 1);
26 %RunMicrotasks();
27 assertEquals(1, array.length);
28 assertEquals(1, v);
29 push_wrapper(array, 1);
30 %RunMicrotasks();
31 assertEquals(2, array.length);
32 assertEquals(2, v);
33 %OptimizeFunctionOnNextCall(push_wrapper);
34 push_wrapper(array, 1);
35 %RunMicrotasks();
36 assertEquals(3, array.length);
37 assertEquals(3, v);
38 push_wrapper(array, 1);
39 %RunMicrotasks();
40 assertEquals(4, array.length);
41 assertEquals(4, v);
42
43 pop_wrapper(array);
44 %RunMicrotasks();
45 assertEquals(3, array.length);
46 assertEquals(5, v);
47 pop_wrapper(array);
48 %RunMicrotasks();
49 assertEquals(2, array.length);
50 assertEquals(6, v);
51 %OptimizeFunctionOnNextCall(pop_wrapper);
52 pop_wrapper(array);
53 %RunMicrotasks();
54 assertEquals(1, array.length);
55 assertEquals(7, v);
56 pop_wrapper(array);
57 %RunMicrotasks();
58 assertEquals(0, array.length);
59 assertEquals(8, v);
OLDNEW
« no previous file with comments | « test/mjsunit/array-push6.js ('k') | test/mjsunit/array-push8.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698