Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: pkg/compiler/lib/src/ssa/locals_handler.dart

Issue 2995113002: Share locals between members (Closed)
Patch Set: Rebased Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | tests/compiler/dart2js_extra/dart2js_extra.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698