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

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

Issue 2230083004: [turbolizer] Use locations rather than ranges everywhere (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove stray change Created 4 years, 4 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 | « tools/turbolizer/code-view.js ('k') | tools/turbolizer/graph-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 "use strict"; 5 "use strict";
6 6
7 class DisassemblyView extends TextView { 7 class DisassemblyView extends TextView {
8 constructor(id, broker, sortedPositionList) { 8 constructor(id, broker) {
9 super(id, broker, null, false); 9 super(id, broker, null, false);
10 10
11 let view = this; 11 let view = this;
12 let ADDRESS_STYLE = { 12 let ADDRESS_STYLE = {
13 css: 'tag', 13 css: 'tag',
14 location: function(text) { 14 location: function(text) {
15 ADDRESS_STYLE.last_address = text; 15 ADDRESS_STYLE.last_address = text;
16 return undefined; 16 return undefined;
17 } 17 }
18 }; 18 };
(...skipping 14 matching lines...) Expand all
33 }; 33 };
34 let POSITION_STYLE = { 34 let POSITION_STYLE = {
35 css: 'com', 35 css: 'com',
36 location: function(text) { 36 location: function(text) {
37 view.pos_start = Number(text); 37 view.pos_start = Number(text);
38 } 38 }
39 }; 39 };
40 let OPCODE_STYLE = { 40 let OPCODE_STYLE = {
41 css: 'kwd', 41 css: 'kwd',
42 location: function(text) { 42 location: function(text) {
43 return { 43 if (BLOCK_HEADER_STYLE.block_id != undefined) {
44 address: ADDRESS_STYLE.last_address 44 return {
45 }; 45 address: ADDRESS_STYLE.last_address,
46 block_id: BLOCK_HEADER_STYLE.block_id
47 };
48 } else {
49 return {
50 address: ADDRESS_STYLE.last_address
51 };
52 }
46 } 53 }
47 }; 54 };
48 const BLOCK_HEADER_STYLE = { 55 const BLOCK_HEADER_STYLE = {
49 css: 'com', 56 css: 'com',
50 block_id: -1, 57 block_id: -1,
51 location: function(text) { 58 location: function(text) {
52 let matches = /\d+/.exec(text); 59 let matches = /\d+/.exec(text);
53 if (!matches) return undefined; 60 if (!matches) return undefined;
54 BLOCK_HEADER_STYLE.block_id = Number(matches[0]); 61 BLOCK_HEADER_STYLE.block_id = Number(matches[0]);
55 return { 62 return {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 // Pad extra spaces to keep alignment for all instructions. 236 // Pad extra spaces to keep alignment for all instructions.
230 str = (" ".repeat(10) + str).slice(-10); 237 str = (" ".repeat(10) + str).slice(-10);
231 238
232 fragments.splice(0, 0, view.createFragment(str, css_cls)); 239 fragments.splice(0, 0, view.createFragment(str, css_cls));
233 } 240 }
234 } 241 }
235 } 242 }
236 return fragments; 243 return fragments;
237 } 244 }
238 } 245 }
OLDNEW
« no previous file with comments | « tools/turbolizer/code-view.js ('k') | tools/turbolizer/graph-view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698