| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 dart2js.ir_builder; | 5 library dart2js.ir_builder; |
| 6 | 6 |
| 7 import '../closure.dart' as closure; | 7 import '../closure.dart' as closure; |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../common/names.dart' show | 9 import '../common/names.dart' show |
| 10 Names, | 10 Names, |
| (...skipping 2570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2581 /// | 2581 /// |
| 2582 /// If inside a closure class, [buildThis] will redirect access through | 2582 /// If inside a closure class, [buildThis] will redirect access through |
| 2583 /// closure fields in order to access the receiver from the enclosing method. | 2583 /// closure fields in order to access the receiver from the enclosing method. |
| 2584 ir.Primitive buildThis() { | 2584 ir.Primitive buildThis() { |
| 2585 if (state.enclosingThis != null) return state.enclosingThis; | 2585 if (state.enclosingThis != null) return state.enclosingThis; |
| 2586 assert(state.thisParameter != null); | 2586 assert(state.thisParameter != null); |
| 2587 return state.thisParameter; | 2587 return state.thisParameter; |
| 2588 } | 2588 } |
| 2589 | 2589 |
| 2590 ir.Primitive buildFieldGet(ir.Primitive receiver, FieldElement target) { | 2590 ir.Primitive buildFieldGet(ir.Primitive receiver, FieldElement target) { |
| 2591 return addPrimitive(new ir.GetField(receiver, target, | 2591 return addPrimitive(new ir.GetField(receiver, target)); |
| 2592 isFinal: program.fieldNeverChanges(target))); | |
| 2593 } | 2592 } |
| 2594 | 2593 |
| 2595 void buildFieldSet(ir.Primitive receiver, | 2594 void buildFieldSet(ir.Primitive receiver, |
| 2596 FieldElement target, | 2595 FieldElement target, |
| 2597 ir.Primitive value) { | 2596 ir.Primitive value) { |
| 2598 addPrimitive(new ir.SetField(receiver, target, value)); | 2597 addPrimitive(new ir.SetField(receiver, target, value)); |
| 2599 } | 2598 } |
| 2600 | 2599 |
| 2601 ir.Primitive buildSuperFieldGet(FieldElement target) { | 2600 ir.Primitive buildSuperFieldGet(FieldElement target) { |
| 2602 return addPrimitive(new ir.GetField(buildThis(), target)); | 2601 return addPrimitive(new ir.GetField(buildThis(), target)); |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2937 this.stackTraceVariable, | 2936 this.stackTraceVariable, |
| 2938 this.buildCatchBlock}); | 2937 this.buildCatchBlock}); |
| 2939 } | 2938 } |
| 2940 | 2939 |
| 2941 class SwitchCaseInfo { | 2940 class SwitchCaseInfo { |
| 2942 final SubbuildFunction buildCondition; | 2941 final SubbuildFunction buildCondition; |
| 2943 final SubbuildFunction buildBody; | 2942 final SubbuildFunction buildBody; |
| 2944 | 2943 |
| 2945 SwitchCaseInfo(this.buildCondition, this.buildBody); | 2944 SwitchCaseInfo(this.buildCondition, this.buildBody); |
| 2946 } | 2945 } |
| OLD | NEW |