2fe5db885d
- include reason for 'too difficult' in the expectations - fix inlining of dynamic call with optional argument Change-Id: I02e4885ff3eb4a991501bb3f5d8432d35165491e Reviewed-on: https://dart-review.googlesource.com/27220 Reviewed-by: Stephen Adams <sra@google.com>
53 lines
1.3 KiB
Dart
53 lines
1.3 KiB
Dart
// Copyright (c) 2017, 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.
|
|
|
|
/// ignore: IMPORT_INTERNAL_LIBRARY
|
|
import 'dart:_js_helper';
|
|
|
|
/*element: main:[]*/
|
|
main() {
|
|
forceInlineDynamic();
|
|
forceInlineOptional();
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
// Force inline a dynamic call.
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
class Class1 {
|
|
/*element: Class1.:[]*/
|
|
@NoInline()
|
|
Class1();
|
|
|
|
/*element: Class1.method:[forceInlineDynamic]*/
|
|
@ForceInline()
|
|
method() {}
|
|
}
|
|
|
|
/*element: forceInlineDynamic:[]*/
|
|
@NoInline()
|
|
forceInlineDynamic() {
|
|
new Class1().method();
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
// Force inline a instance method with optional argument.
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
class Class2 {
|
|
/*element: Class2.:[]*/
|
|
@NoInline()
|
|
Class2();
|
|
|
|
/*element: Class2.method:[forceInlineOptional]*/
|
|
@ForceInline()
|
|
method([x]) {}
|
|
}
|
|
|
|
/*element: forceInlineOptional:[]*/
|
|
@NoInline()
|
|
forceInlineOptional() {
|
|
new Class2().method();
|
|
}
|