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