Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1512)

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart

Issue 12263009: - Trust type annotations on fields of HTML classes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
+ }
}
}
}
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698