OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |