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

Side by Side Diff: tests/language/vm/reusable_boxes_test.dart

Issue 150063004: Support reusable boxes for Float32x4 fields (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
OLDNEW
(Empty)
1 // Copyright (c) 2013, 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 // Test correct handling reusable boxes.
5 // VMOptions=--optimization_counter_threshold=100
6
7 library reusable_boxes_test;
8
9 import 'dart:typed_data';
10
11 class D {
12 var a = 0.0;
13 var b = 1.0;
14 var c = 2.0;
15 test() {
16 a = 0.0;
17 b = 1.0;
18 c = a + b;
19 }
20
21 testParam(x, y) {
22 x = x * x;
23 y = y * y;
24 c = x + y;
25 }
26 }
27
28 testD() {
29 var f = new D();
30 for (var i = 0; i < 20; i++) {
31 f.test();
32 }
33 // Trigger a deopt of test.
34 f.testParam(new Float32x4(1.0, 2.0, 3.0, 4.0), new Float32x4.zero());
35 for (var i = 0; i < 20; i++) {
36 f.test();
Florian Schneider 2014/02/06 12:38:49 Maybe return a value to check from test(), or chec
Cutch 2014/02/06 23:15:38 Done.
37 }
38 }
39
40
41 class F {
42 var a = new Float32x4.zero();
43 var b = new Float32x4(1.0, 2.0, 3.0, 4.0);
44 var c = new Float32x4.zero();
45 test() {
46 a = new Float32x4.zero();
47 b = new Float32x4(1.0, 2.0, 3.0, 4.0);
48 c = a + b;
49 }
50
51 testParam(x, y) {
52 x = x * x;
53 y = y * y;
54 c = x + y;
55 }
56
57 }
58
59 testF() {
60 var f = new F();
61 for (var i = 0; i < 20; i++) {
62 f.test();
63 }
64 // Trigger a deopt of test.
65 f.testParam(1.0, 2.0);
66 for (var i = 0; i < 20; i++) {
67 f.test();
Florian Schneider 2014/02/06 12:38:49 Maybe return a value to check from test(), or chec
Cutch 2014/02/06 23:15:38 Done.
68 }
69 }
70
71
72 main() {
73 testD();
74 testF();
75 }
OLDNEW
« runtime/vm/intermediate_language_arm.cc ('K') | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698