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

Unified Diff: pkg/compiler/lib/src/ssa/optimize.dart

Issue 2998413002: dart2js kernel: update tryInlineNativeMethod to Entities (Closed)
Patch Set: Created 3 years, 4 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 | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | pkg/compiler/lib/src/ssa/rasta_ssa_builder_task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/optimize.dart
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
index bf6e754e4d9866dc9329f9ceca51de5699879bbd..22c120f65186d580e39627ea6089c82c0f3fec3f 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -9,7 +9,7 @@ import '../compiler.dart' show Compiler;
import '../constants/constant_system.dart';
import '../constants/values.dart';
import '../common_elements.dart' show CommonElements;
-import '../elements/elements.dart' show ClassElement, MethodElement;
+import '../elements/elements.dart' show ClassElement;
import '../elements/entities.dart';
import '../elements/resolution_types.dart';
import '../elements/types.dart';
@@ -531,7 +531,7 @@ class SsaInstructionSimplifier extends HBaseVisitor
}
HInstruction tryInlineNativeMethod(
- HInvokeDynamicMethod node, MethodElement method) {
+ HInvokeDynamicMethod node, FunctionEntity method) {
// 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.
@@ -544,11 +544,7 @@ class SsaInstructionSimplifier extends HBaseVisitor
if (!node.isInterceptedCall) return null;
- // TODO(sra): Check for legacy methods with bodies in the native strings.
- // foo() native 'return something';
- // They should not be used.
-
- ResolutionFunctionType type = method.type;
+ FunctionType type = _closedWorld.elementEnvironment.getFunctionType(method);
if (type.namedParameters.isNotEmpty) return null;
// Return types on native methods don't need to be checked, since the
@@ -567,7 +563,7 @@ class SsaInstructionSimplifier extends HBaseVisitor
canInline = false;
} else {
int inputPosition = 1; // Skip receiver.
- void checkParameterType(ResolutionDartType type) {
+ void checkParameterType(DartType type) {
if (inputPosition++ < inputs.length && canInline) {
if (type.unaliased.isFunctionType) {
canInline = false;
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | pkg/compiler/lib/src/ssa/rasta_ssa_builder_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698