Files
sdk/tests/compiler/dart2js/inlining/data/dynamic.dart
T
Johnni Winther 2fe5db885d Fix inlining 'too difficult' test
- 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>
2017-12-08 16:05:42 +00:00

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();
}