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

Side by Side Diff: pkg/compiler/lib/src/ssa/optimize.dart

Issue 1383503002: Add Resolution and Parsing interfaces for computeType, ensureResolved and parseNode. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add TODOs. Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/ssa/nodes.dart ('k') | pkg/compiler/lib/src/ssa/ssa.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of ssa; 5 part of ssa;
6 6
7 abstract class OptimizationPhase { 7 abstract class OptimizationPhase {
8 String get name; 8 String get name;
9 void visitGraph(HGraph graph); 9 void visitGraph(HGraph graph);
10 } 10 }
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 // declaration has to be truthful. 430 // declaration has to be truthful.
431 431
432 // The call site might omit optional arguments. The inlined code must 432 // The call site might omit optional arguments. The inlined code must
433 // preserve the number of arguments, so check only the actual arguments. 433 // preserve the number of arguments, so check only the actual arguments.
434 434
435 List<HInstruction> inputs = node.inputs.sublist(1); 435 List<HInstruction> inputs = node.inputs.sublist(1);
436 int inputPosition = 1; // Skip receiver. 436 int inputPosition = 1; // Skip receiver.
437 bool canInline = true; 437 bool canInline = true;
438 signature.forEachParameter((ParameterElement element) { 438 signature.forEachParameter((ParameterElement element) {
439 if (inputPosition++ < inputs.length && canInline) { 439 if (inputPosition++ < inputs.length && canInline) {
440 DartType type = element.type.unalias(compiler); 440 DartType type = element.type.unalias(compiler.resolution);
441 if (type is FunctionType) { 441 if (type is FunctionType) {
442 canInline = false; 442 canInline = false;
443 } 443 }
444 if (compiler.enableTypeAssertions) { 444 if (compiler.enableTypeAssertions) {
445 // TODO(sra): Check if [input] is guaranteed to pass the parameter 445 // TODO(sra): Check if [input] is guaranteed to pass the parameter
446 // type check. Consider using a strengthened type check to avoid 446 // type check. Consider using a strengthened type check to avoid
447 // passing `null` to primitive types since the native methods usually 447 // passing `null` to primitive types since the native methods usually
448 // have non-nullable primitive parameter types. 448 // have non-nullable primitive parameter types.
449 canInline = false; 449 canInline = false;
450 } 450 }
(...skipping 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after
2359 2359
2360 keyedValues.forEach((receiver, values) { 2360 keyedValues.forEach((receiver, values) {
2361 result.keyedValues[receiver] = 2361 result.keyedValues[receiver] =
2362 new Map<HInstruction, HInstruction>.from(values); 2362 new Map<HInstruction, HInstruction>.from(values);
2363 }); 2363 });
2364 2364
2365 result.nonEscapingReceivers.addAll(nonEscapingReceivers); 2365 result.nonEscapingReceivers.addAll(nonEscapingReceivers);
2366 return result; 2366 return result;
2367 } 2367 }
2368 } 2368 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/nodes.dart ('k') | pkg/compiler/lib/src/ssa/ssa.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698