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

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

Issue 2938193003: Revert "Towards compiling Hello World!" and "Compile and run Hello World!" (Closed)
Patch Set: 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 3a0b393a4a648092bf5a21f57e02fa79063bf51b..ccf7f1eff5a6886227b34725750bf9213d7c50db 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)) {
- FunctionEntity method = element;
+ MethodElement method = element;
if (_nativeData.isNativeMember(method)) {
HInstruction folded = tryInlineNativeMethod(node, method);
@@ -490,9 +490,11 @@ class SsaInstructionSimplifier extends HBaseVisitor
} else {
// TODO(ngeoffray): If the method has optional parameters,
// we should pass the default values.
- ParameterStructure parameters = method.parameterStructure;
- if (parameters.optionalParameters == 0 ||
- parameters.requiredParameters + parameters.optionalParameters ==
+ ResolutionFunctionType type = method.type;
+ int optionalParameterCount =
+ type.optionalParameterTypes.length + type.namedParameters.length;
+ if (optionalParameterCount == 0 ||
+ type.parameterTypes.length + optionalParameterCount ==
node.selector.argumentCount) {
node.element = method;
}
@@ -1023,16 +1025,14 @@ class SsaInstructionSimplifier extends HBaseVisitor
}
HInstruction receiver = node.getDartReceiver(_closedWorld);
- FieldEntity field =
+ FieldElement 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) {
- // TODO(johnniwinther): Support field entities.
- FieldElement element = field;
- DartType type = element.type;
+ ResolutionDartType type = field.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