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

Side by Side Diff: pkg/compiler/lib/src/kernel/kernel.dart

Issue 2981843002: Tag default constructors in rasta (Closed)
Patch Set: Created 3 years, 5 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 import 'dart:collection' show Queue; 5 import 'dart:collection' show Queue;
6 6
7 import 'package:kernel/ast.dart' as ir; 7 import 'package:kernel/ast.dart' as ir;
8 import 'package:kernel/verifier.dart' show CheckParentPointers; 8 import 'package:kernel/verifier.dart' show CheckParentPointers;
9 9
10 import '../common.dart'; 10 import '../common.dart';
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 return functions.putIfAbsent(function, () { 424 return functions.putIfAbsent(function, () {
425 assert(compiler.resolution.hasBeenResolved(function) || 425 assert(compiler.resolution.hasBeenResolved(function) ||
426 function.isMalformed); 426 function.isMalformed);
427 function = function.implementation; 427 function = function.implementation;
428 ir.Member member; 428 ir.Member member;
429 ir.Constructor constructor; 429 ir.Constructor constructor;
430 ir.Procedure procedure; 430 ir.Procedure procedure;
431 ir.Name name = irName(function.name, function); 431 ir.Name name = irName(function.name, function);
432 bool isNative = isNativeMethod(function); 432 bool isNative = isNativeMethod(function);
433 if (function.isGenerativeConstructor) { 433 if (function.isGenerativeConstructor) {
434 ConstructorElement constructorElement = function;
434 member = constructor = new ir.Constructor(null, 435 member = constructor = new ir.Constructor(null,
435 name: name, 436 name: name,
436 isConst: function.isConst, 437 isConst: constructorElement.isConst,
437 isExternal: isNative || function.isExternal, 438 isExternal: isNative || constructorElement.isExternal,
438 initializers: null); 439 initializers: null,
440 isSyntheticDefault: constructorElement.isDefaultConstructor);
439 } else { 441 } else {
440 member = procedure = new ir.Procedure(name, null, null, 442 member = procedure = new ir.Procedure(name, null, null,
441 isAbstract: function.isAbstract, 443 isAbstract: function.isAbstract,
442 isStatic: function.isStatic || 444 isStatic: function.isStatic ||
443 function.isTopLevel || 445 function.isTopLevel ||
444 function.isFactoryConstructor, 446 function.isFactoryConstructor,
445 isExternal: isNative || function.isExternal, 447 isExternal: isNative || function.isExternal,
446 isConst: false); // TODO(ahe): When is this true? 448 isConst: false); // TODO(ahe): When is this true?
447 } 449 }
448 addWork(function, () { 450 addWork(function, () {
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 } 788 }
787 789
788 class ConstructorTarget { 790 class ConstructorTarget {
789 final ConstructorElement element; 791 final ConstructorElement element;
790 final ResolutionDartType type; 792 final ResolutionDartType type;
791 793
792 ConstructorTarget(this.element, this.type); 794 ConstructorTarget(this.element, this.type);
793 795
794 String toString() => "ConstructorTarget($element, $type)"; 796 String toString() => "ConstructorTarget($element, $type)";
795 } 797 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/kernel/visitor_test.dart » ('j') | tests/compiler/dart2js/kernel/visitor_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698