| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import '../closure.dart'; | 5 import '../closure.dart'; |
| 6 import '../common.dart'; | 6 import '../common.dart'; |
| 7 import '../elements/elements.dart'; | 7 import '../elements/elements.dart'; |
| 8 import '../elements/entities.dart'; | 8 import '../elements/entities.dart'; |
| 9 import '../elements/types.dart'; | 9 import '../elements/types.dart'; |
| 10 import '../io/source_information.dart'; | 10 import '../io/source_information.dart'; |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 } | 415 } |
| 416 | 416 |
| 417 /// Sets the [element] to [value]. If the element is boxed or stored in a | 417 /// Sets the [element] to [value]. If the element is boxed or stored in a |
| 418 /// closure then the method generates code to set the value. | 418 /// closure then the method generates code to set the value. |
| 419 void updateLocal(Local local, HInstruction value, | 419 void updateLocal(Local local, HInstruction value, |
| 420 {SourceInformation sourceInformation}) { | 420 {SourceInformation sourceInformation}) { |
| 421 if (value is HRef) { | 421 if (value is HRef) { |
| 422 HRef ref = value; | 422 HRef ref = value; |
| 423 value = ref.value; | 423 value = ref.value; |
| 424 } | 424 } |
| 425 assert(!isStoredInClosureField(local)); | 425 assert(!isStoredInClosureField(local), |
| 426 "Local $local is stored in a closure field."); |
| 426 if (isAccessedDirectly(local)) { | 427 if (isAccessedDirectly(local)) { |
| 427 directLocals[local] = value; | 428 directLocals[local] = value; |
| 428 } else if (isBoxed(local)) { | 429 } else if (isBoxed(local)) { |
| 429 FieldEntity redirect = redirectionMapping[local]; | 430 FieldEntity redirect = redirectionMapping[local]; |
| 430 assert(redirect != null); | 431 assert(redirect != null); |
| 431 BoxLocal localBox; | 432 BoxLocal localBox; |
| 432 if (redirect is BoxFieldElement) { | 433 if (redirect is BoxFieldElement) { |
| 433 localBox = redirect.box; | 434 localBox = redirect.box; |
| 434 } else if (redirect is JBoxedField) { | 435 } else if (redirect is JBoxedField) { |
| 435 localBox = redirect.box; | 436 localBox = redirect.box; |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 final MemberEntity memberContext; | 693 final MemberEntity memberContext; |
| 693 | 694 |
| 694 // Avoid slow Object.hashCode. | 695 // Avoid slow Object.hashCode. |
| 695 final int hashCode = _nextHashCode = (_nextHashCode + 1).toUnsigned(30); | 696 final int hashCode = _nextHashCode = (_nextHashCode + 1).toUnsigned(30); |
| 696 static int _nextHashCode = 0; | 697 static int _nextHashCode = 0; |
| 697 | 698 |
| 698 SyntheticLocal(this.name, this.executableContext, this.memberContext); | 699 SyntheticLocal(this.name, this.executableContext, this.memberContext); |
| 699 | 700 |
| 700 toString() => 'SyntheticLocal($name)'; | 701 toString() => 'SyntheticLocal($name)'; |
| 701 } | 702 } |
| OLD | NEW |