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

Unified Diff: pkg/compiler/lib/src/cps_ir/insert_refinements.dart

Issue 1859343004: dartfmt pkg/compiler (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/cps_ir/inline.dart ('k') | pkg/compiler/lib/src/cps_ir/loop_effects.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/insert_refinements.dart
diff --git a/pkg/compiler/lib/src/cps_ir/insert_refinements.dart b/pkg/compiler/lib/src/cps_ir/insert_refinements.dart
index d5412c6ad342300d8484466c12fcab2e1d058e72..28d013f879ce1d39ce60e7f005b674ecd4e9573e 100644
--- a/pkg/compiler/lib/src/cps_ir/insert_refinements.dart
+++ b/pkg/compiler/lib/src/cps_ir/insert_refinements.dart
@@ -118,15 +118,14 @@ class InsertRefinements extends TrampolineRecursiveVisitor implements Pass {
// Skip arguments that provide no refinement.
if (argSuccessType == types.dynamicType) continue;
- applyRefinement(node.parent,
- new Refinement(node.argument(i), argSuccessType));
+ applyRefinement(
+ node.parent, new Refinement(node.argument(i), argSuccessType));
}
}
void visitInvokeStatic(InvokeStatic node) {
node.argumentRefs.forEach(processReference);
- _refineArguments(node,
- _getSuccessTypesForStaticMethod(types, node.target));
+ _refineArguments(node, _getSuccessTypesForStaticMethod(types, node.target));
}
void visitInvokeMethod(InvokeMethod node) {
@@ -150,8 +149,8 @@ class InsertRefinements extends TrampolineRecursiveVisitor implements Pass {
// Refine arguments of methods on numbers which we know will throw on
// invalid argument values.
- _refineArguments(node,
- _getSuccessTypesForInstanceMethod(types, type, selector));
+ _refineArguments(
+ node, _getSuccessTypesForInstanceMethod(types, type, selector));
}
}
@@ -212,10 +211,8 @@ class InsertRefinements extends TrampolineRecursiveVisitor implements Pass {
// This can happen either for calls to `==` or `identical` calls, such
// as the ones inserted by the unsugaring pass.
- void refineEquality(Primitive first,
- Primitive second,
- Continuation trueCont,
- Continuation falseCont) {
+ void refineEquality(Primitive first, Primitive second,
+ Continuation trueCont, Continuation falseCont) {
if (second is Constant && second.value.isNull) {
Refinement refinedTrue = new Refinement(first, types.nullType);
Refinement refinedFalse = new Refinement(first, types.nonNullType);
@@ -233,19 +230,15 @@ class InsertRefinements extends TrampolineRecursiveVisitor implements Pass {
}
if (condition is InvokeMethod && condition.selector == Selectors.equals) {
- refineEquality(condition.receiver,
- condition.argument(0),
- trueCont,
- falseCont);
+ refineEquality(
+ condition.receiver, condition.argument(0), trueCont, falseCont);
return;
}
if (condition is ApplyBuiltinOperator &&
condition.operator == BuiltinOperator.Identical) {
- refineEquality(condition.argument(0),
- condition.argument(1),
- trueCont,
- falseCont);
+ refineEquality(
+ condition.argument(0), condition.argument(1), trueCont, falseCont);
return;
}
@@ -292,7 +285,7 @@ List<TypeMask> _getSuccessTypesForInstanceMethod(
return [types.intType];
case 'modPow':
- return [types.intType, types.intType];
+ return [types.intType, types.intType];
}
// Note: num methods on int values are handled below.
}
@@ -300,13 +293,13 @@ List<TypeMask> _getSuccessTypesForInstanceMethod(
if (types.isDefinitelyNum(receiver)) {
switch (selector.name) {
case 'clamp':
- return [types.numType, types.numType];
+ return [types.numType, types.numType];
case 'toStringAsFixed':
case 'toStringAsPrecision':
case 'toRadixString':
- return [types.intType];
+ return [types.intType];
case 'toStringAsExponential':
- return [types.intType.nullable()];
+ return [types.intType.nullable()];
case 'compareTo':
case 'remainder':
case '+':
@@ -324,7 +317,7 @@ List<TypeMask> _getSuccessTypesForInstanceMethod(
case '>':
case '<=':
case '>=':
- return [types.numType];
+ return [types.numType];
default:
return null;
}
@@ -385,7 +378,7 @@ List<TypeMask> _getSuccessTypesForInstanceMethod(
case 'sublist':
return [types.uintType, types.uintType.nullable()];
case 'length':
- return selector.isSetter ? [types.uintType] : null;
+ return selector.isSetter ? [types.uintType] : null;
case '[]':
case '[]=':
return [types.uintType];
@@ -410,7 +403,7 @@ List<TypeMask> _getSuccessTypesForStaticMethod(
}
if (lib.isPlatformLibrary && '${lib.canonicalUri}' == 'dart:math') {
- switch(target.name) {
+ switch (target.name) {
case 'sqrt':
case 'sin':
case 'cos':
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/inline.dart ('k') | pkg/compiler/lib/src/cps_ir/loop_effects.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698