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

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

Issue 2942863002: Compile and run Hello World! (Closed)
Patch Set: Rebased Created 3 years, 6 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
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 ccf7f1eff5a6886227b34725750bf9213d7c50db..3a0b393a4a648092bf5a21f57e02fa79063bf51b 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -482,7 +482,7 @@ class SsaInstructionSimplifier extends HBaseVisitor
// [:noSuchMethod:] we just ignore it.
&&
node.selector.applies(element)) {
- MethodElement method = element;
+ FunctionEntity method = element;
if (_nativeData.isNativeMember(method)) {
HInstruction folded = tryInlineNativeMethod(node, method);
@@ -490,11 +490,9 @@ class SsaInstructionSimplifier extends HBaseVisitor
} else {
// TODO(ngeoffray): If the method has optional parameters,
// we should pass the default values.
- ResolutionFunctionType type = method.type;
- int optionalParameterCount =
- type.optionalParameterTypes.length + type.namedParameters.length;
- if (optionalParameterCount == 0 ||
- type.parameterTypes.length + optionalParameterCount ==
+ ParameterStructure parameters = method.parameterStructure;
+ if (parameters.optionalParameters == 0 ||
+ parameters.requiredParameters + parameters.optionalParameters ==
node.selector.argumentCount) {
node.element = method;
}
@@ -1025,14 +1023,16 @@ class SsaInstructionSimplifier extends HBaseVisitor
}
HInstruction receiver = node.getDartReceiver(_closedWorld);
- FieldElement field =
+ FieldEntity field =
findConcreteFieldForDynamicAccess(receiver, node.selector);
if (field == null || !field.isAssignable) return node;
// Use `node.inputs.last` in case the call follows the interceptor calling
// convention, but is not a call on an interceptor.
HInstruction value = node.inputs.last;
if (_options.enableTypeAssertions) {
- ResolutionDartType type = field.type;
+ // TODO(johnniwinther): Support field entities.
+ FieldElement element = field;
+ DartType type = element.type;
if (!type.treatAsRaw ||
type.isTypeVariable ||
type.unaliased.isFunctionType) {
« no previous file with comments | « pkg/compiler/lib/src/ssa/kernel_ast_adapter.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