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

Side by Side Diff: test/mjsunit/array-push8.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-push7.js ('k') | no next file » | 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 function push_wrapper(array, value) {
8 array.push(value);
9 }
10 function pop_wrapper(array) {
11 return array.pop();
12 }
13
14 // Test the frzon arrays throw an exception if you try to push to them, both in
15 // optimized and non-optimized code.
16 var array = [2, 2];
17 Object.freeze(array);
18
19 try { push_wrapper(array, 1); } catch (e) {}
20 assertEquals(2, array.length);
21 try { push_wrapper(array, 1); } catch (e) {}
22 assertEquals(2, array.length);
23 %OptimizeFunctionOnNextCall(push_wrapper);
24 try { push_wrapper(array, 1); } catch (e) {}
25 assertEquals(2, array.length);
26 try { push_wrapper(array, 1); } catch (e) {}
27 assertEquals(2, array.length);
28
29 try { pop_wrapper(array); } catch (e) {}
30 assertEquals(2, array.length);
31 try { pop_wrapper(array); } catch (e) {}
32 assertEquals(2, array.length);
33 %OptimizeFunctionOnNextCall(pop_wrapper);
34 try { pop_wrapper(array); } catch (e) {}
35 assertEquals(2, array.length);
36 try { pop_wrapper(array); } catch (e) {}
37 assertEquals(2, array.length);
OLDNEW
« no previous file with comments | « test/mjsunit/array-push7.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698