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

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

Issue 1960213002: Skip adding line based range data for ranges that don't map to a line. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 var sourceReport = await script.isolate.getSourceReport( 590 var sourceReport = await script.isolate.getSourceReport(
591 reports, 591 reports,
592 script, startPos, endPos); 592 script, startPos, endPos);
593 _possibleBreakpointLines = getPossibleBreakpointLines(sourceReport, script); 593 _possibleBreakpointLines = getPossibleBreakpointLines(sourceReport, script);
594 _rangeMap.clear(); 594 _rangeMap.clear();
595 _callSites.clear(); 595 _callSites.clear();
596 _profileMap.clear(); 596 _profileMap.clear();
597 for (var range in sourceReport['ranges']) { 597 for (var range in sourceReport['ranges']) {
598 int startLine = script.tokenToLine(range['startPos']); 598 int startLine = script.tokenToLine(range['startPos']);
599 int endLine = script.tokenToLine(range['endPos']); 599 int endLine = script.tokenToLine(range['endPos']);
600 for (var line = startLine; line <= endLine; line++) { 600 if ((startLine != null) && (endLine != null)) {
turnidge 2016/05/09 19:20:12 Can you add a TODO(turnidge) here to track down th
Cutch 2016/05/09 20:40:04 Done.
601 var rangeList = _rangeMap[line]; 601 for (var line = startLine; line <= endLine; line++) {
602 if (rangeList == null) { 602 var rangeList = _rangeMap[line];
603 _rangeMap[line] = [range]; 603 if (rangeList == null) {
604 } else { 604 _rangeMap[line] = [range];
605 rangeList.add(range); 605 } else {
606 rangeList.add(range);
607 }
606 } 608 }
607 } 609 }
608 if (_includeProfile && range['profile'] != null) { 610 if (_includeProfile && range['profile'] != null) {
609 List positions = range['profile']['positions']; 611 List positions = range['profile']['positions'];
610 List exclusiveTicks = range['profile']['exclusiveTicks']; 612 List exclusiveTicks = range['profile']['exclusiveTicks'];
611 List inclusiveTicks = range['profile']['inclusiveTicks']; 613 List inclusiveTicks = range['profile']['inclusiveTicks'];
612 int sampleCount = range['profile']['metadata']['sampleCount']; 614 int sampleCount = range['profile']['metadata']['sampleCount'];
613 assert(positions.length == exclusiveTicks.length); 615 assert(positions.length == exclusiveTicks.length);
614 assert(positions.length == inclusiveTicks.length); 616 assert(positions.length == inclusiveTicks.length);
615 for (int i = 0; i < positions.length; i++) { 617 for (int i = 0; i < positions.length; i++) {
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 class SourceInsetElement extends PolymerElement { 1368 class SourceInsetElement extends PolymerElement {
1367 SourceInsetElement.created() : super.created(); 1369 SourceInsetElement.created() : super.created();
1368 1370
1369 @published SourceLocation location; 1371 @published SourceLocation location;
1370 @published String height = null; 1372 @published String height = null;
1371 @published int currentPos; 1373 @published int currentPos;
1372 @published bool inDebuggerContext = false; 1374 @published bool inDebuggerContext = false;
1373 @published ObservableList variables; 1375 @published ObservableList variables;
1374 @published Element scroller; 1376 @published Element scroller;
1375 } 1377 }
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