Files
sdk/runtime/tests/vm/dart/entrypoints/static_this.dart
T
Samir Jindel ae3a33bd79 [vm/aot] Fix issues with multiple entry-points.
- We can now skip checks on tearoffs of functions called only via tearoffs.
- We don't always insert a check when intrinsifying the an unchecked call to set indexed.
- We only build the unchecked entry-point of regular methods when inlining to reduce code size.

Change-Id: I2e6a647409130385cda03906e734a3c161d56ab4
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/86562
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-12-13 16:13:50 +00:00

46 lines
1.0 KiB
Dart

// Copyright (c) 2016, 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 that 'StaticCall's against "this" go through the unchecked entry-point.
import "common.dart";
import "package:expect/expect.dart";
class C<T> {
@pragma("vm:testing.unsafe.trace-entrypoints-fn", validate)
@NeverInline
@AlwaysInline
void target2(T x) {
Expect.notEquals(x, -1);
}
@NeverInline
void target1(T x) {
target2(x);
}
}
test(List<String> args) {
// Make sure the precise runtime-type of C is not known below.
C c = args.length == 0 ? C<int>() : C<String>();
// Warmup.
expectedEntryPoint = -1;
for (int i = 0; i < 100; ++i) {
c.target1(i);
}
expectedEntryPoint = 1;
const int iterations = benchmarkMode ? 400000000 : 100;
for (int i = 0; i < iterations; ++i) {
c.target1(i);
}
expectedEntryPoint = 0;
dynamic x = c;
x.target2(0);
Expect.isTrue(validateRan);
}