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

Side by Side Diff: runtime/observatory/lib/src/elements/script_inset.dart

Issue 1596563003: Properly display un-compiled nested functions. (Closed) Base URL: git@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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 script_inset_element; 5 library script_inset_element;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'dart:math'; 9 import 'dart:math';
10 import 'observatory_element.dart'; 10 import 'observatory_element.dart';
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 if (lineNumber == _currentLine) { 1077 if (lineNumber == _currentLine) {
1078 hitsCurrent(e); 1078 hitsCurrent(e);
1079 return e; 1079 return e;
1080 } 1080 }
1081 var ranges = _rangeMap[lineNumber]; 1081 var ranges = _rangeMap[lineNumber];
1082 if ((ranges == null) || ranges.isEmpty) { 1082 if ((ranges == null) || ranges.isEmpty) {
1083 // This line is not code. 1083 // This line is not code.
1084 hitsUnknown(e); 1084 hitsUnknown(e);
1085 return e; 1085 return e;
1086 } 1086 }
1087 bool compiled = false; 1087 bool compiled = true;
1088 bool hasCallInfo = false; 1088 bool hasCallInfo = false;
1089 bool executed = false; 1089 bool executed = false;
1090 for (var range in ranges) { 1090 for (var range in ranges) {
1091 if (range['compiled']) { 1091 if (range['compiled']) {
1092 compiled = true;
1093 for (var callSite in range['callSites']) { 1092 for (var callSite in range['callSites']) {
1094 var callLine = line.script.tokenToLine(callSite['tokenPos']); 1093 var callLine = line.script.tokenToLine(callSite['tokenPos']);
1095 if (lineNumber == callLine) { 1094 if (lineNumber == callLine) {
1096 // The call site is on the current line. 1095 // The call site is on the current line.
1097 hasCallInfo = true; 1096 hasCallInfo = true;
1098 for (var cacheEntry in callSite['cacheEntries']) { 1097 for (var cacheEntry in callSite['cacheEntries']) {
1099 if (cacheEntry['count'] > 0) { 1098 if (cacheEntry['count'] > 0) {
1100 // If any call site on the line has been executed, we 1099 // If any call site on the line has been executed, we
1101 // mark the line as executed. 1100 // mark the line as executed.
1102 executed = true; 1101 executed = true;
1103 break; 1102 break;
1104 } 1103 }
1105 } 1104 }
1106 } 1105 }
1107 } 1106 }
1107 } else {
1108 // If any range isn't compiled, show the line as not compiled.
1109 // This is necessary so that nested functions appear to be uncompiled.
1110 compiled = false;
1108 } 1111 }
1109 } 1112 }
1110 if (executed) { 1113 if (executed) {
1111 hitsExecuted(e); 1114 hitsExecuted(e);
1112 } else if (hasCallInfo) { 1115 } else if (hasCallInfo) {
1113 hitsNotExecuted(e); 1116 hitsNotExecuted(e);
1114 } else if (compiled) { 1117 } else if (compiled) {
1115 hitsCompiled(e); 1118 hitsCompiled(e);
1116 } else { 1119 } else {
1117 hitsNotCompiled(e); 1120 hitsNotCompiled(e);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 class SourceInsetElement extends PolymerElement { 1195 class SourceInsetElement extends PolymerElement {
1193 SourceInsetElement.created() : super.created(); 1196 SourceInsetElement.created() : super.created();
1194 1197
1195 @published SourceLocation location; 1198 @published SourceLocation location;
1196 @published String height = null; 1199 @published String height = null;
1197 @published int currentPos; 1200 @published int currentPos;
1198 @published bool inDebuggerContext = false; 1201 @published bool inDebuggerContext = false;
1199 @published ObservableList variables; 1202 @published ObservableList variables;
1200 @published Element scroller; 1203 @published Element scroller;
1201 } 1204 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698