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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/inline.dart

Issue 1564423002: Copy all fields of NullCheck (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library cps_ir.optimization.inline; 5 library cps_ir.optimization.inline;
6 6
7 import 'cps_fragment.dart'; 7 import 'cps_fragment.dart';
8 import 'cps_ir_builder.dart' show ThisParameterLocal; 8 import 'cps_ir_builder.dart' show ThisParameterLocal;
9 import 'cps_ir_nodes.dart'; 9 import 'cps_ir_nodes.dart';
10 import 'optimizers.dart'; 10 import 'optimizers.dart';
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 invoke.sourceInformation)); 463 invoke.sourceInformation));
464 condition.type = typeSystem.boolType; 464 condition.type = typeSystem.boolType;
465 Primitive check = _fragment.letPrim( 465 Primitive check = _fragment.letPrim(
466 new NullCheck.guarded( 466 new NullCheck.guarded(
467 condition, dartReceiver, selector, invoke.sourceInformation)); 467 condition, dartReceiver, selector, invoke.sourceInformation));
468 check.type = abstractReceiver.nonNullable(); 468 check.type = abstractReceiver.nonNullable();
469 return check; 469 return check;
470 } 470 }
471 471
472 Primitive check = _fragment.letPrim( 472 Primitive check = _fragment.letPrim(
473 new NullCheck(dartReceiver, invoke.sourceInformation)); 473 new NullCheck(dartReceiver, invoke.sourceInformation,
474 selector: selector));
474 check.type = abstractReceiver.nonNullable(); 475 check.type = abstractReceiver.nonNullable();
475 return check; 476 return check;
476 } 477 }
477 478
478 479
479 @override 480 @override
480 Primitive visitInvokeStatic(InvokeStatic node) { 481 Primitive visitInvokeStatic(InvokeStatic node) {
481 return tryInlining(node, node.target, null); 482 return tryInlining(node, node.target, null);
482 } 483 }
483 484
(...skipping 23 matching lines...) Expand all
507 // We cannot inline a constructor invocation containing type arguments 508 // We cannot inline a constructor invocation containing type arguments
508 // because CreateInstance in the body does not know the type arguments. 509 // because CreateInstance in the body does not know the type arguments.
509 // We would incorrectly instantiate a class like A instead of A<B>. 510 // We would incorrectly instantiate a class like A instead of A<B>.
510 // TODO(kmillikin): try to fix this. 511 // TODO(kmillikin): try to fix this.
511 GenericType generic = node.dartType; 512 GenericType generic = node.dartType;
512 if (generic.typeArguments.any((DartType t) => !t.isDynamic)) return null; 513 if (generic.typeArguments.any((DartType t) => !t.isDynamic)) return null;
513 } 514 }
514 return tryInlining(node, node.target, null); 515 return tryInlining(node, node.target, null);
515 } 516 }
516 } 517 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698