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

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

Issue 1885273004: Observatory: Tweak disassembly comments (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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
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 code_view_element; 5 library code_view_element;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'observatory_element.dart'; 9 import 'observatory_element.dart';
10 import 'service_ref.dart'; 10 import 'service_ref.dart';
(...skipping 10 matching lines...) Expand all
21 InlineTable(columns) : super(columns); 21 InlineTable(columns) : super(columns);
22 } 22 }
23 23
24 @CustomTag('code-view') 24 @CustomTag('code-view')
25 class CodeViewElement extends ObservatoryElement { 25 class CodeViewElement extends ObservatoryElement {
26 @observable Code code; 26 @observable Code code;
27 ProfileCode get profile => code == null ? null : code.profile; 27 ProfileCode get profile => code == null ? null : code.profile;
28 DisassemblyTable disassemblyTable; 28 DisassemblyTable disassemblyTable;
29 InlineTable inlineTable; 29 InlineTable inlineTable;
30 30
31 static const kDisassemblyColumnIndex = 3;
32
31 CodeViewElement.created() : super.created() { 33 CodeViewElement.created() : super.created() {
32 // Create table models. 34 // Create table models.
33 var columns = [ 35 var columns = [
34 new SortedTableColumn('Address'), 36 new SortedTableColumn('Address'),
35 new SortedTableColumn('Inclusive'), 37 new SortedTableColumn('Inclusive'),
36 new SortedTableColumn('Exclusive'), 38 new SortedTableColumn('Exclusive'),
37 new SortedTableColumn('Disassembly'), 39 new SortedTableColumn('Disassembly'),
38 new SortedTableColumn('Objects'), 40 new SortedTableColumn('Objects'),
39 ]; 41 ];
40 disassemblyTable = new DisassemblyTable(columns); 42 disassemblyTable = new DisassemblyTable(columns);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 final row = disassemblyTable.rows[rowIndex]; 207 final row = disassemblyTable.rows[rowIndex];
206 final n = row.values.length; 208 final n = row.values.length;
207 for (var i = 0; i < n; i++) { 209 for (var i = 0; i < n; i++) {
208 final cell = tr.children[i]; 210 final cell = tr.children[i];
209 final content = row.values[i]; 211 final content = row.values[i];
210 if (content is ServiceObject) { 212 if (content is ServiceObject) {
211 ServiceRefElement element = new Element.tag('any-service-ref'); 213 ServiceRefElement element = new Element.tag('any-service-ref');
212 element.ref = content; 214 element.ref = content;
213 cell.children = [element]; 215 cell.children = [element];
214 } else if (content != null) { 216 } else if (content != null) {
215 cell.text = content.toString(); 217 String text = '$content';
218 if (i == kDisassemblyColumnIndex) {
219 // Disassembly might be a comment. Reduce indentation, change styling,
220 // widen to span next column.
221 if (text.startsWith(' ;;')) {
222 cell.attributes['colspan'] = '2';
223 cell.classes.add('code-comment');
224 text = text.substring(6);
225 } else {
226 cell.attributes['colspan'] = '1';
227 cell.classes.remove('code-comment');
228 }
229 }
230 cell.text = text;
216 } 231 }
217 } 232 }
218 } 233 }
219 234
220 void _updateDisassemblyDOMTable() { 235 void _updateDisassemblyDOMTable() {
221 var tableBody = $['disassemblyTableBody']; 236 var tableBody = $['disassemblyTableBody'];
222 assert(tableBody != null); 237 assert(tableBody != null);
223 // Resize DOM table. 238 // Resize DOM table.
224 if (tableBody.children.length > disassemblyTable.sortedRows.length) { 239 if (tableBody.children.length > disassemblyTable.sortedRows.length) {
225 // Shrink the table. 240 // Shrink the table.
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 } 389 }
375 390
376 void mouseOut(Event e, var detail, Node target) { 391 void mouseOut(Event e, var detail, Node target) {
377 var jt = _findJumpTarget(target); 392 var jt = _findJumpTarget(target);
378 if (jt == null) { 393 if (jt == null) {
379 return; 394 return;
380 } 395 }
381 jt.classes.remove('highlight'); 396 jt.classes.remove('highlight');
382 } 397 }
383 } 398 }
OLDNEW
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/code_view.html » ('j') | runtime/observatory/pubspec.yaml » ('J')

Powered by Google App Engine
This is Rietveld 408576698