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

Side by Side Diff: tools/turbolizer/code-view.js

Issue 2133663002: [turbolizer] Improve code comments in disassembly (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: [turbolizer] Improve code comments in disassembly Created 4 years, 5 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 | tools/turbolizer/disassembly-view.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var CodeView = function(divID, PR, sourceText, sourcePosition, broker) { 5 var CodeView = function(divID, PR, sourceText, sourcePosition, broker) {
6 "use strict"; 6 "use strict";
7 var view = this; 7 var view = this;
8 8
9 view.divElement = document.getElementById(divID); 9 view.divElement = document.getElementById(divID);
10 view.broker = broker; 10 view.broker = broker;
(...skipping 12 matching lines...) Expand all
23 if (selected) { 23 if (selected) {
24 span.classList.add("selected"); 24 span.classList.add("selected");
25 } else { 25 } else {
26 span.classList.remove("selected"); 26 span.classList.remove("selected");
27 } 27 }
28 } 28 }
29 var ranges = []; 29 var ranges = [];
30 for (var span of items) { 30 for (var span of items) {
31 ranges.push([span.start, span.end, null]); 31 ranges.push([span.start, span.end, null]);
32 } 32 }
33 broker.clear(selectionHandler);
33 broker.select(selectionHandler, ranges, selected); 34 broker.select(selectionHandler, ranges, selected);
34 }, 35 },
35 selectionDifference: function(span1, inclusive1, span2, inclusive2) { 36 selectionDifference: function(span1, inclusive1, span2, inclusive2) {
36 var pos1 = span1.start; 37 var pos1 = span1.start;
37 var pos2 = span2.start; 38 var pos2 = span2.start;
38 var result = []; 39 var result = [];
39 var lineListDiv = view.divElement.firstChild.firstChild.childNodes; 40 var lineListDiv = view.divElement.firstChild.firstChild.childNodes;
40 for (var i=0; i < lineListDiv.length; i++) { 41 for (var i=0; i < lineListDiv.length; i++) {
41 var currentLineElement = lineListDiv[i]; 42 var currentLineElement = lineListDiv[i];
42 var spans = currentLineElement.childNodes; 43 var spans = currentLineElement.childNodes;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 169
169 this.resizeToParent(); 170 this.resizeToParent();
170 } 171 }
171 172
172 CodeView.prototype.resizeToParent = function() { 173 CodeView.prototype.resizeToParent = function() {
173 var view = this; 174 var view = this;
174 var documentElement = document.documentElement; 175 var documentElement = document.documentElement;
175 var y = view.divElement.parentNode.clientHeight || documentElement.clientHeigh t; 176 var y = view.divElement.parentNode.clientHeight || documentElement.clientHeigh t;
176 view.divElement.style.height = y + "px"; 177 view.divElement.style.height = y + "px";
177 } 178 }
OLDNEW
« no previous file with comments | « no previous file | tools/turbolizer/disassembly-view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698