OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library cps_ir.cps_fragment; | 5 library cps_ir.cps_fragment; |
6 | 6 |
7 import 'cps_ir_nodes.dart'; | 7 import 'cps_ir_nodes.dart'; |
8 import '../constants/values.dart'; | 8 import '../constants/values.dart'; |
9 import '../universe/universe.dart' show Selector; | 9 import '../universe/universe.dart' show Selector; |
10 import '../types/types.dart' show TypeMask; | 10 import '../types/types.dart' show TypeMask; |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 other.root = null; | 271 other.root = null; |
272 } | 272 } |
273 | 273 |
274 /// Reads the value of the given mutable variable. | 274 /// Reads the value of the given mutable variable. |
275 Primitive getMutable(MutableVariable variable) { | 275 Primitive getMutable(MutableVariable variable) { |
276 return letPrim(new GetMutableVariable(variable)); | 276 return letPrim(new GetMutableVariable(variable)); |
277 } | 277 } |
278 | 278 |
279 /// Sets the value of the given mutable variable. | 279 /// Sets the value of the given mutable variable. |
280 void setMutable(MutableVariable variable, Primitive value) { | 280 void setMutable(MutableVariable variable, Primitive value) { |
281 SetMutableVariable setter = new SetMutableVariable(variable, value); | 281 letPrim(new SetMutableVariable(variable, value)); |
282 put(setter); | |
283 context = setter; | |
284 } | 282 } |
285 | 283 |
286 /// Declare a new mutable variable. | 284 /// Declare a new mutable variable. |
287 void letMutable(MutableVariable variable, Primitive initialValue) { | 285 void letMutable(MutableVariable variable, Primitive initialValue) { |
288 LetMutable let = new LetMutable(variable, initialValue); | 286 LetMutable let = new LetMutable(variable, initialValue); |
289 put(let); | 287 put(let); |
290 context = let; | 288 context = let; |
291 } | 289 } |
292 } | 290 } |
OLD | NEW |