6127386cfa
Since allocation instructions can throw OOM exceptions, they require deopt information. In general it's rather hard to test that this deopt information is correct. In order to test this, this CL makes those IR instructions support lazy deopt and add tests that exercise this deopt sequence, thereby ensuring the deoptimization environment is correct. Issue https://github.com/dart-lang/sdk/issues/45213 TEST=New vm/dart_2/isolates/deopt/*_test. Change-Id: I6a02dcf5a0c47636f1f0aa4cd8cc0d2b4f032ca0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192687 Commit-Queue: Martin Kustermann <kustermann@google.com> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
18 lines
632 B
Dart
18 lines
632 B
Dart
// Copyright (c) 2021, 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=--disable-dart-dev --no-inline-alloc --use-slow-path --deoptimize-on-runtime-call-every=1 --deterministic --optimization-counter-threshold=1 --deoptimize-on-runtime-call-name-filter=AllocateArray
|
|
|
|
main() {
|
|
for (int i = 0; i < 20; ++i) {
|
|
final list = foo(1);
|
|
if (list[0] != 42) throw 'a';
|
|
}
|
|
}
|
|
|
|
@pragma('vm:never-inline')
|
|
List foo(int a) {
|
|
return List<dynamic>.filled(a, null)..[0] = 42;
|
|
}
|