| OLD | NEW |
| 1 library dart2js.cps_ir_integrity; | 1 library dart2js.cps_ir_integrity; |
| 2 | 2 |
| 3 import 'cps_ir_nodes.dart'; | 3 import 'cps_ir_nodes.dart'; |
| 4 import 'cps_ir_nodes_sexpr.dart'; | 4 import 'cps_ir_nodes_sexpr.dart'; |
| 5 import '../tracer.dart' as tracer; | 5 import '../tracer.dart' as tracer; |
| 6 | 6 |
| 7 /// Dump S-expressions on error if the tracer is enabled. | 7 /// Dump S-expressions on error if the tracer is enabled. |
| 8 /// | 8 /// |
| 9 /// Technically this has nothing to do with the tracer, but if you want one | 9 /// Technically this has nothing to do with the tracer, but if you want one |
| 10 /// enabled, you typically want the other as well, so we use the same flag. | 10 /// enabled, you typically want the other as well, so we use the same flag. |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 147 } |
| 148 visit(node.body); | 148 visit(node.body); |
| 149 } | 149 } |
| 150 | 150 |
| 151 @override | 151 @override |
| 152 processReference(Reference ref) { | 152 processReference(Reference ref) { |
| 153 Definition def = ref.definition; | 153 Definition def = ref.definition; |
| 154 if (inScope[def] == ScopeType.NotInScope) { | 154 if (inScope[def] == ScopeType.NotInScope) { |
| 155 error('Referenced out of scope: $def', ref); | 155 error('Referenced out of scope: $def', ref); |
| 156 } | 156 } |
| 157 if (ref.previous == ref) { |
| 158 error('Shared Reference object to $def', ref); |
| 159 } |
| 157 if (ref.previous == null && def.firstRef != ref || | 160 if (ref.previous == null && def.firstRef != ref || |
| 158 ref.previous != null && ref.previous.next != ref) { | 161 ref.previous != null && ref.previous.next != ref) { |
| 159 error('Broken .previous link in reference to $def', def); | 162 error('Broken .previous link in reference to $def', def); |
| 160 } | 163 } |
| 161 ref.previous = ref; // Mark reference as "seen". We will repair it later. | 164 ref.previous = ref; // Mark reference as "seen". We will repair it later. |
| 162 } | 165 } |
| 163 | 166 |
| 164 @override | 167 @override |
| 165 processInvokeContinuation(InvokeContinuation node) { | 168 processInvokeContinuation(InvokeContinuation node) { |
| 166 Continuation target = node.continuation.definition; | 169 Continuation target = node.continuation.definition; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 } | 248 } |
| 246 | 249 |
| 247 @override | 250 @override |
| 248 processReference(Reference node) { | 251 processReference(Reference node) { |
| 249 if (node.parent != _parent) { | 252 if (node.parent != _parent) { |
| 250 error('Parent pointer on $node is ${node.parent} but should be $_parent', | 253 error('Parent pointer on $node is ${node.parent} but should be $_parent', |
| 251 node); | 254 node); |
| 252 } | 255 } |
| 253 } | 256 } |
| 254 } | 257 } |
| OLD | NEW |