| 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, sortedPositionList) { |
| 9 super(id, broker, null, false); | 9 super(id, broker, null, false); |
| 10 this.pos_start = -1; | |
| 11 this.pos_lines = null; | |
| 12 this.addr_event_counts = null; | |
| 13 this.total_event_counts = null; | |
| 14 | 10 |
| 15 let view = this; | 11 let view = this; |
| 16 let ADDRESS_STYLE = { | 12 let ADDRESS_STYLE = { |
| 17 css: 'tag', | 13 css: 'tag', |
| 18 location: function(text) { | 14 location: function(text) { |
| 19 ADDRESS_STYLE.last_address = text; | 15 ADDRESS_STYLE.last_address = text; |
| 20 return undefined; | 16 return undefined; |
| 21 } | 17 } |
| 22 }; | 18 }; |
| 23 let ADDRESS_LINK_STYLE = { | 19 let ADDRESS_LINK_STYLE = { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 return result; | 142 return result; |
| 147 } | 143 } |
| 148 | 144 |
| 149 initializeContent(data, rememberedSelection) { | 145 initializeContent(data, rememberedSelection) { |
| 150 this.data = data; | 146 this.data = data; |
| 151 super.initializeContent(data, rememberedSelection); | 147 super.initializeContent(data, rememberedSelection); |
| 152 } | 148 } |
| 153 | 149 |
| 154 initializeCode(sourceText, sourcePosition) { | 150 initializeCode(sourceText, sourcePosition) { |
| 155 let view = this; | 151 let view = this; |
| 152 view.pos_start = -1; |
| 153 view.addr_event_counts = null; |
| 154 view.total_event_counts = null; |
| 156 view.pos_lines = new Array(); | 155 view.pos_lines = new Array(); |
| 157 // Comment lines for line 0 include sourcePosition already, only need to | 156 // Comment lines for line 0 include sourcePosition already, only need to |
| 158 // add sourcePosition for lines > 0. | 157 // add sourcePosition for lines > 0. |
| 159 view.pos_lines[0] = sourcePosition; | 158 view.pos_lines[0] = sourcePosition; |
| 160 if (sourceText != "") { | 159 if (sourceText != "") { |
| 161 let base = sourcePosition; | 160 let base = sourcePosition; |
| 162 let current = 0; | 161 let current = 0; |
| 163 let source_lines = sourceText.split("\n"); | 162 let source_lines = sourceText.split("\n"); |
| 164 for (let i = 1; i < source_lines.length; i++) { | 163 for (let i = 1; i < source_lines.length; i++) { |
| 165 // Add 1 for newline character that is split off. | 164 // Add 1 for newline character that is split off. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 // Pad extra spaces to keep alignment for all instructions. | 229 // Pad extra spaces to keep alignment for all instructions. |
| 231 str = (" ".repeat(10) + str).slice(-10); | 230 str = (" ".repeat(10) + str).slice(-10); |
| 232 | 231 |
| 233 fragments.splice(0, 0, view.createFragment(str, css_cls)); | 232 fragments.splice(0, 0, view.createFragment(str, css_cls)); |
| 234 } | 233 } |
| 235 } | 234 } |
| 236 } | 235 } |
| 237 return fragments; | 236 return fragments; |
| 238 } | 237 } |
| 239 } | 238 } |
| OLD | NEW |