Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/names.dart'; | 8 import '../common/names.dart'; |
| 9 import '../compiler.dart'; | 9 import '../compiler.dart'; |
| 10 import '../constants/expressions.dart'; | 10 import '../constants/expressions.dart'; |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 384 } else if (info is CallSiteTypeInformation) { | 384 } else if (info is CallSiteTypeInformation) { |
| 385 if (info is StaticCallSiteTypeInformation && | 385 if (info is StaticCallSiteTypeInformation && |
| 386 info.selector != null && | 386 info.selector != null && |
| 387 info.selector.isCall) { | 387 info.selector.isCall) { |
| 388 // This is a constructor call to a class with a call method. So we | 388 // This is a constructor call to a class with a call method. So we |
| 389 // need to trace the call method here. | 389 // need to trace the call method here. |
| 390 MethodElement calledElement = info.calledElement; | 390 MethodElement calledElement = info.calledElement; |
| 391 assert(calledElement.isGenerativeConstructor); | 391 assert(calledElement.isGenerativeConstructor); |
| 392 ClassElement cls = calledElement.enclosingClass; | 392 ClassElement cls = calledElement.enclosingClass; |
| 393 MethodElement callMethod = cls.lookupMember(Identifiers.call); | 393 MethodElement callMethod = cls.lookupMember(Identifiers.call); |
| 394 if (callMethod == null) { | |
| 395 callMethod = cls.lookupMember(Identifiers.noSuchMethod_); | |
|
Siggi Cherem (dart-lang)
2017/07/11 16:53:39
I don't recall this changing in your CLs last week
Johnni Winther
2017/07/12 08:13:07
Ancient bug!
| |
| 396 } | |
| 394 assert(callMethod != null, failedAt(cls)); | 397 assert(callMethod != null, failedAt(cls)); |
| 395 Iterable<FunctionEntity> elements = [callMethod]; | 398 Iterable<FunctionEntity> elements = [callMethod]; |
| 396 trace(elements, new ClosureTracerVisitor(elements, info, this)); | 399 trace(elements, new ClosureTracerVisitor(elements, info, this)); |
| 397 } else { | 400 } else { |
| 398 // We only are interested in functions here, as other targets | 401 // We only are interested in functions here, as other targets |
| 399 // of this closure call are not a root to trace but an intermediate | 402 // of this closure call are not a root to trace but an intermediate |
| 400 // for some other function. | 403 // for some other function. |
| 401 Iterable<FunctionEntity> elements = new List<FunctionEntity>.from( | 404 Iterable<FunctionEntity> elements = new List<FunctionEntity>.from( |
| 402 info.callees.where((e) => e.isFunction)); | 405 info.callees.where((e) => e.isFunction)); |
| 403 trace(elements, new ClosureTracerVisitor(elements, info, this)); | 406 trace(elements, new ClosureTracerVisitor(elements, info, this)); |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1104 /** | 1107 /** |
| 1105 * Records that the captured variable [local] is read. | 1108 * Records that the captured variable [local] is read. |
| 1106 */ | 1109 */ |
| 1107 void recordCapturedLocalRead(Local local) {} | 1110 void recordCapturedLocalRead(Local local) {} |
| 1108 | 1111 |
| 1109 /** | 1112 /** |
| 1110 * Records that the variable [local] is being updated. | 1113 * Records that the variable [local] is being updated. |
| 1111 */ | 1114 */ |
| 1112 void recordLocalUpdate(Local local, TypeInformation type) {} | 1115 void recordLocalUpdate(Local local, TypeInformation type) {} |
| 1113 } | 1116 } |
| OLD | NEW |