| OLD | NEW |
| 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:async'; | 5 import 'dart:async'; |
| 6 import 'dart:collection' show Queue; | 6 import 'dart:collection' show Queue; |
| 7 | 7 |
| 8 import 'package:kernel/ast.dart' as ir; | 8 import 'package:kernel/ast.dart' as ir; |
| 9 import 'package:kernel/checks.dart' show CheckParentPointers; | 9 import 'package:kernel/checks.dart' show CheckParentPointers; |
| 10 | 10 |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 internalError(function, "Deferred loader."); | 401 internalError(function, "Deferred loader."); |
| 402 } | 402 } |
| 403 if (function.isLocal) { | 403 if (function.isLocal) { |
| 404 internalError(function, "Local function."); | 404 internalError(function, "Local function."); |
| 405 } | 405 } |
| 406 if (isSyntheticError(function)) { | 406 if (isSyntheticError(function)) { |
| 407 internalError(function, "Synthetic error function: $function."); | 407 internalError(function, "Synthetic error function: $function."); |
| 408 } | 408 } |
| 409 function = function.declaration; | 409 function = function.declaration; |
| 410 return functions.putIfAbsent(function, () { | 410 return functions.putIfAbsent(function, () { |
| 411 compiler.analyzeElement(function); | 411 compiler.resolution.ensureResolved(function); |
| 412 compiler.enqueuer.resolution.emptyDeferredQueueForTesting(); | 412 compiler.enqueuer.resolution.emptyDeferredQueueForTesting(); |
| 413 function = function.implementation; | 413 function = function.implementation; |
| 414 ir.Member member; | 414 ir.Member member; |
| 415 ir.Constructor constructor; | 415 ir.Constructor constructor; |
| 416 ir.Procedure procedure; | 416 ir.Procedure procedure; |
| 417 ir.Name name = irName(function.name, function); | 417 ir.Name name = irName(function.name, function); |
| 418 bool isNative = isNativeMethod(function); | 418 bool isNative = isNativeMethod(function); |
| 419 if (function.isGenerativeConstructor) { | 419 if (function.isGenerativeConstructor) { |
| 420 member = constructor = new ir.Constructor(null, | 420 member = constructor = new ir.Constructor(null, |
| 421 name: name, | 421 name: name, |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 void endFactoryScope(FunctionElement function) { | 499 void endFactoryScope(FunctionElement function) { |
| 500 factoryTypeParameters.clear(); | 500 factoryTypeParameters.clear(); |
| 501 } | 501 } |
| 502 | 502 |
| 503 ir.Field fieldToIr(FieldElement field) { | 503 ir.Field fieldToIr(FieldElement field) { |
| 504 if (isSyntheticError(field)) { | 504 if (isSyntheticError(field)) { |
| 505 internalError(field, "Synthetic error field: $field."); | 505 internalError(field, "Synthetic error field: $field."); |
| 506 } | 506 } |
| 507 field = field.declaration; | 507 field = field.declaration; |
| 508 return fields.putIfAbsent(field, () { | 508 return fields.putIfAbsent(field, () { |
| 509 compiler.analyzeElement(field); | 509 compiler.resolution.ensureResolved(field); |
| 510 compiler.enqueuer.resolution.emptyDeferredQueueForTesting(); | 510 compiler.enqueuer.resolution.emptyDeferredQueueForTesting(); |
| 511 field = field.implementation; | 511 field = field.implementation; |
| 512 ir.DartType type = | 512 ir.DartType type = |
| 513 field.isMalformed ? const ir.InvalidType() : typeToIr(field.type); | 513 field.isMalformed ? const ir.InvalidType() : typeToIr(field.type); |
| 514 ir.Field fieldNode = new ir.Field(irName(field.memberName.text, field), | 514 ir.Field fieldNode = new ir.Field(irName(field.memberName.text, field), |
| 515 type: type, | 515 type: type, |
| 516 initializer: null, | 516 initializer: null, |
| 517 isFinal: field.isFinal, | 517 isFinal: field.isFinal, |
| 518 isStatic: field.isStatic || field.isTopLevel, | 518 isStatic: field.isStatic || field.isTopLevel, |
| 519 isConst: field.isConst); | 519 isConst: field.isConst); |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 } | 754 } |
| 755 | 755 |
| 756 class ConstructorTarget { | 756 class ConstructorTarget { |
| 757 final ConstructorElement element; | 757 final ConstructorElement element; |
| 758 final DartType type; | 758 final DartType type; |
| 759 | 759 |
| 760 ConstructorTarget(this.element, this.type); | 760 ConstructorTarget(this.element, this.type); |
| 761 | 761 |
| 762 String toString() => "ConstructorTarget($element, $type)"; | 762 String toString() => "ConstructorTarget($element, $type)"; |
| 763 } | 763 } |
| OLD | NEW |