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

Side by Side Diff: tests/language/memory_swap_test.dart

Issue 337503003: Fix a bug in ParallelMoveResolver::AllocateScratchRegister, where we end up allocating PC on ARM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | « runtime/vm/flow_graph_compiler.cc ('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 (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Test that the ParalleMoveResolver in the VM uses valid registers
6 // when requiring scratch registers.
7
8 main() {
9 // Iterate enough to ensure optimizing `spillingMethod`.
10 for (int i = 0; i < 100000; i++) {
11 spillingMethod(i, () => 0);
12 }
13 }
14
15 spillingMethod(what, obfuscate) {
16 // Define lots of variables to get a few in stack.
17 var a = obfuscate();
18 var b = obfuscate();
19 var c = obfuscate();
20 var d = obfuscate();
21 var e = obfuscate();
22 var f = obfuscate();
23 var g = obfuscate();
24 var h = obfuscate();
25 var i = obfuscate();
26 var j = obfuscate();
27 var k = obfuscate();
28 var l = obfuscate();
29 var m = obfuscate();
30 var n = obfuscate();
31 var o = obfuscate();
32 var p = obfuscate();
33 var q = obfuscate();
34 var r = obfuscate();
35 var s = obfuscate();
36 var t = obfuscate();
37 var u = obfuscate();
38 var v = obfuscate();
39
40 // Swap all variables, in the hope of a memory <-> memory swap operation.
41 while (what == 42) {
42 a = b;
43 b = a;
44 c = d;
45 d = c;
46 e = f;
47 f = e;
48 g = h;
49 h = g;
50 i = j;
51 j = i;
52 k = l;
53 l = k;
54 m = n;
55 n = m;
56 o = p;
57 p = o;
58 q = r;
59 r = q;
60 s = t;
61 t = s;
62 u = v;
63 v = u;
64 what++;
65 }
66
67 // Keep all variables alive.
68 return a + b + c + d + e + f + g + h + i + j + k + l + m + n + o
69 + p + q + r + s + t + u + v;
70 }
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698