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

Unified Diff: tests/language/list_length_tracer_test.dart

Issue 24680006: Fix list length optimization bug: do not inline a length access to a constant if the receiver can b… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/optimize.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/list_length_tracer_test.dart
===================================================================
--- tests/language/list_length_tracer_test.dart (revision 27940)
+++ tests/language/list_length_tracer_test.dart (working copy)
@@ -2,8 +2,8 @@
// 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 that a loop invariant code motion optimization does not try to
-// hoist instructions that may throw.
+// Test that dart2js' optimization on list length does not fold a
+// length getter to a constant if the receiver can be null.
import "package:expect/expect.dart";
@@ -11,12 +11,6 @@
var b;
main() {
- Expect.throws(() {
- while (true) {
- a = 54;
- b.length;
- }
- });
- b = [];
- Expect.equals(54, a);
+ Expect.throws(() => b.length);
+ b = const [42];
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/optimize.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698