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 var DEFAULT_NODE_WIDTH = 240; | 5 var DEFAULT_NODE_WIDTH = 240; |
6 var DEFAULT_NODE_HEIGHT = 40; | 6 var DEFAULT_NODE_HEIGHT = 40; |
7 var TYPE_HEIGHT = 25; | 7 var TYPE_HEIGHT = 25; |
8 var DEFAULT_NODE_BUBBLE_RADIUS = 4; | 8 var DEFAULT_NODE_BUBBLE_RADIUS = 4; |
9 var NODE_INPUT_WIDTH = 20; | 9 var NODE_INPUT_WIDTH = 20; |
10 var MINIMUM_NODE_INPUT_APPROACH = 20; | 10 var MINIMUM_NODE_INPUT_APPROACH = 20; |
11 var MINIMUM_NODE_OUTPUT_APPROACH = 15; | 11 var MINIMUM_NODE_OUTPUT_APPROACH = 15; |
12 | 12 |
13 function isNodeInitiallyVisible(node) { | 13 function isNodeInitiallyVisible(node) { |
14 return node.cfg; | 14 return node.cfg; |
15 } | 15 } |
16 | 16 |
17 var Node = { | 17 var Node = { |
18 isControl: function() { | 18 isControl: function() { |
19 return this.control; | 19 return this.control; |
20 }, | 20 }, |
21 isInput: function() { | 21 isInput: function() { |
22 return this.opcode == 'Parameter' || this.opcode.endsWith('Constant'); | 22 return this.opcode == 'Parameter' || this.opcode.endsWith('Constant'); |
23 }, | 23 }, |
| 24 isLive: function() { |
| 25 return this.live; |
| 26 }, |
24 isJavaScript: function() { | 27 isJavaScript: function() { |
25 return this.opcode.startsWith('JS'); | 28 return this.opcode.startsWith('JS'); |
26 }, | 29 }, |
27 isSimplified: function() { | 30 isSimplified: function() { |
28 if (this.isJavaScript) return false; | 31 if (this.isJavaScript) return false; |
29 return this.opcode.endsWith('Phi') || | 32 return this.opcode.endsWith('Phi') || |
30 this.opcode.startsWith('Boolean') || | 33 this.opcode.startsWith('Boolean') || |
31 this.opcode.startsWith('Number') || | 34 this.opcode.startsWith('Number') || |
32 this.opcode.startsWith('String') || | 35 this.opcode.startsWith('String') || |
33 this.opcode.startsWith('Change') || | 36 this.opcode.startsWith('Change') || |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 }, | 140 }, |
138 getFunctionRelativeSourcePosition: function(graph) { | 141 getFunctionRelativeSourcePosition: function(graph) { |
139 return this.pos - graph.sourcePosition; | 142 return this.pos - graph.sourcePosition; |
140 }, | 143 }, |
141 hasBackEdges: function() { | 144 hasBackEdges: function() { |
142 return (this.opcode == "Loop") || | 145 return (this.opcode == "Loop") || |
143 ((this.opcode == "Phi" || this.opcode == "EffectPhi") && | 146 ((this.opcode == "Phi" || this.opcode == "EffectPhi") && |
144 this.inputs[this.inputs.length - 1].source.opcode == "Loop"); | 147 this.inputs[this.inputs.length - 1].source.opcode == "Loop"); |
145 } | 148 } |
146 }; | 149 }; |
OLD | NEW |