| Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
|
| ===================================================================
|
| --- sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (revision 18508)
|
| +++ sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (working copy)
|
| @@ -1528,6 +1528,23 @@
|
| } else if (target == backend.jsStringConcat) {
|
| push(new js.Binary('+', object, arguments[0]), node);
|
| return;
|
| + } else if (target.isNative() && !compiler.enableTypeAssertions) {
|
| + // Enable direct calls to a native method only if we don't
|
| + // run in checked mode, where the Dart version may have
|
| + // type annotations on parameters and return type that it
|
| + // should check.
|
| + // Also check that the parameters are not functions: it's
|
| + // the callee that will translate them to JS functions.
|
| + bool canInlineNativeCall = true;
|
| + target.computeSignature(compiler).forEachParameter((Element element) {
|
| + DartType type = element.computeType(compiler).unalias(compiler);
|
| + if (type is FunctionType) {
|
| + canInlineNativeCall = false;
|
| + }
|
| + });
|
| + if (canInlineNativeCall) {
|
| + methodName = target.fixedBackendName();
|
| + }
|
| }
|
| }
|
| }
|
|
|