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

Unified Diff: tests/language/vm/precompiled_static_initializer_test.dart

Issue 1497783002: Fix optimizations on static fields in precompiled code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comment Created 5 years 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 | « runtime/vm/intermediate_language.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/vm/precompiled_static_initializer_test.dart
diff --git a/tests/lib/mirrors/null2_test.dart b/tests/language/vm/precompiled_static_initializer_test.dart
similarity index 54%
copy from tests/lib/mirrors/null2_test.dart
copy to tests/language/vm/precompiled_static_initializer_test.dart
index 4c5590d398f9ad7f7d251438ffbb1e3f2104c6cc..36067a2a2f0a4f86522cfa717cfd5f3aa964137f 100644
--- a/tests/lib/mirrors/null2_test.dart
+++ b/tests/language/vm/precompiled_static_initializer_test.dart
@@ -1,16 +1,19 @@
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// Test optimizations with static fields with precompilation.
+// VMOptions=--noopt --inlining-hotness=0
-library test.null_test;
+import 'package:expect/expect.dart';
-import 'dart:mirrors';
+init() => 123;
-import 'package:expect/expect.dart';
+final a = init();
main() {
- InstanceMirror nullMirror = reflect(null);
- for (int i = 0; i < 10; i++) {
- Expect.isTrue(nullMirror.getField(#hashCode).reflectee is int);
+ var s = 0;
+ for (var i = 0; i < 10; i++) {
+ s += a;
}
+ Expect.equals(10 * 123, s);
}
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698