Minor cleanup and extra debug data

Change-Id: Ifdf502c27ae24e73674e025fd415530516dd0d5f
Reviewed-on: https://dart-review.googlesource.com/39380
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This commit is contained in:
Sigmund Cherem 2018-02-06 21:41:53 +00:00 committed by commit-bot@chromium.org
parent 011e1cc1c5
commit 762b336f2b
2 changed files with 13 additions and 4 deletions

View file

@ -545,12 +545,15 @@ class RuntimeTypesNeedImpl implements RuntimeTypesNeed {
}
bool localFunctionNeedsSignature(Local function) {
// This function should not be called when the compiler is using the new FE
// (--use-kernel). As an invariant, localFunctionsNeedingSignature is always
// null when --use-kernel is true.
if (localFunctionsNeedingSignature == null) {
// [localFunctionNeedsRti] is only used by the old frontend.
throw new UnsupportedError('RuntimeTypesNeed.localFunctionsNeedingRti');
throw new UnsupportedError(
'RuntimeTypesNeed.localFunctionNeedingSignature with --use-kernel');
}
return localFunctionsNeedingSignature.contains(function) ||
_backendUsage.isRuntimeTypeUsed;
return _backendUsage.isRuntimeTypeUsed ||
localFunctionsNeedingSignature.contains(function);
}
@override

View file

@ -372,7 +372,9 @@ class KernelScopeInfo {
String toString() {
StringBuffer sb = new StringBuffer();
sb.write('this=$hasThisLocal,');
sb.write('freeVriables=$freeVariables,');
sb.write('localsUsedInTryOrSync={${localsUsedInTryOrSync.join(', ')}}');
sb.write('freeVariablesForRti={${freeVariablesForRti.join(', ')}}');
return sb.toString();
}
}
@ -818,6 +820,10 @@ class ScopeModel {
/// Collected [ScopeInfo] data for nodes.
Map<ir.TreeNode, KernelScopeInfo> closuresToGenerate =
<ir.TreeNode, KernelScopeInfo>{};
String toString() {
return '$scopeInfo\n$capturedScopesMap\n$closuresToGenerate';
}
}
enum TypeVariableKind { cls, method, local, function }