Files
sdk/tests/language/optimized_isempty_test.dart
T
fschneider@google.com 68a90e4386 Fix crash in optimized code caused by missing IC data.
When inling intrinsified methods like String.isEmpty that are
not native, we have to emit the full unoptimized code so that
those method can be correctly optimized and inlined later.

Also, remove an invalid assertion in the type propagator: ToNullableCid
may be called on values from the callee graph in the inliner where
type propagation has not yet been performed.

BUG=https://code.google.com/p/dart/issues/detail?id=12691
TEST=tests/language/optimized_isempty_test.dart
R=srdjan@google.com

Review URL: https://codereview.chromium.org//23123012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26629 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 09:46:30 +00:00

22 lines
632 B
Dart

// 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.
// VMOptions=--optimization-counter-threshold=10 --no-use-osr
// Test optimization and polymorphic inlining of String.isEmpty.
import "package:expect/expect.dart";
test(s) => s.isEmpty;
main() {
var x = "abc";
var y = [123, 12345, 765];
Expect.equals(false, test(x));
Expect.equals(false, test(y));
for (var i=0; i<20; i++) test(x);
Expect.equals(false, test(x));
Expect.equals(false, test(y));
}