Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
| =================================================================== |
| --- sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (revision 18453) |
| +++ 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. |
|
sra1
2013/02/13 19:30:02
TODO: Can still inline if all the arguments are kn
ngeoffray
2013/02/14 10:41:28
Done.
|
| + // 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(); |
| + } |
| } |
| } |
| } |