OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 document.onload = (function(d3){ | 5 document.onload = (function(d3){ |
6 "use strict"; | 6 "use strict"; |
7 var jsonObj; | 7 var jsonObj; |
8 var sourceExpandClassList = document.getElementById(SOURCE_EXPAND_ID).classLis
t; | 8 var sourceExpandClassList = document.getElementById(SOURCE_EXPAND_ID).classLis
t; |
9 var sourceCollapseClassList = document.getElementById(SOURCE_COLLAPSE_ID).clas
sList; | 9 var sourceCollapseClassList = document.getElementById(SOURCE_COLLAPSE_ID).clas
sList; |
10 var sourceExpanded = sourceCollapseClassList.contains(COLLAPSE_PANE_BUTTON_VIS
IBLE); | 10 var sourceExpanded = sourceCollapseClassList.contains(COLLAPSE_PANE_BUTTON_VIS
IBLE); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 var txtRes = filereader.result; | 150 var txtRes = filereader.result; |
151 // If the JSON isn't properly terminated, assume compiler crashed and | 151 // If the JSON isn't properly terminated, assume compiler crashed and |
152 // add best-guess empty termination | 152 // add best-guess empty termination |
153 if (txtRes[txtRes.length-2] == ',') { | 153 if (txtRes[txtRes.length-2] == ',') { |
154 txtRes += '{"name":"disassembly","type":"disassembly","data":""}]}'; | 154 txtRes += '{"name":"disassembly","type":"disassembly","data":""}]}'; |
155 } | 155 } |
156 try{ | 156 try{ |
157 jsonObj = JSON.parse(txtRes); | 157 jsonObj = JSON.parse(txtRes); |
158 | 158 |
159 sourceView.initializeCode(jsonObj.source, jsonObj.sourcePosition); | 159 sourceView.initializeCode(jsonObj.source, jsonObj.sourcePosition); |
| 160 disassemblyView.initializeCode(jsonObj.source, jsonObj.sourcePositio
n); |
160 schedule.setNodePositionMap(jsonObj.nodePositions); | 161 schedule.setNodePositionMap(jsonObj.nodePositions); |
161 | 162 |
162 var selectMenu = document.getElementById('display-selector'); | 163 var selectMenu = document.getElementById('display-selector'); |
163 var disassemblyPhase = null; | 164 var disassemblyPhase = null; |
164 selectMenu.innerHTML = ''; | 165 selectMenu.innerHTML = ''; |
165 for (var i = 0; i < jsonObj.phases.length; ++i) { | 166 for (var i = 0; i < jsonObj.phases.length; ++i) { |
166 var optionElement = document.createElement("option"); | 167 var optionElement = document.createElement("option"); |
167 optionElement.text = jsonObj.phases[i].name; | 168 optionElement.text = jsonObj.phases[i].name; |
168 if (optionElement.text == 'disassembly') { | 169 if (optionElement.text == 'disassembly') { |
169 disassemblyPhase = jsonObj.phases[i]; | 170 disassemblyPhase = jsonObj.phases[i]; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 empty = new EmptyView(EMPTY_PANE_ID, selectionBroker); | 203 empty = new EmptyView(EMPTY_PANE_ID, selectionBroker); |
203 | 204 |
204 initializeHandlers(graph); | 205 initializeHandlers(graph); |
205 | 206 |
206 setSourceExpanded(true); | 207 setSourceExpanded(true); |
207 setDisassemblyExpanded(false); | 208 setDisassemblyExpanded(false); |
208 | 209 |
209 displayPhaseView(empty, null); | 210 displayPhaseView(empty, null); |
210 fitPanesToParents(); | 211 fitPanesToParents(); |
211 })(window.d3); | 212 })(window.d3); |
OLD | NEW |