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

Side by Side Diff: dart/sdk/lib/_internal/compiler/implementation/constants.dart

Issue 21110003: Implement MirrorUsed.targets for libraries (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r25609 and added test. Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of dart2js; 5 part of dart2js;
6 6
7 abstract class ConstantVisitor<R> { 7 abstract class ConstantVisitor<R> {
8 R visitFunction(FunctionConstant constant); 8 R visitFunction(FunctionConstant constant);
9 R visitNull(NullConstant constant); 9 R visitNull(NullConstant constant);
10 R visitInt(IntConstant constant); 10 R visitInt(IntConstant constant);
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 if (fields.length != other.fields.length) return false; 478 if (fields.length != other.fields.length) return false;
479 for (int i = 0; i < fields.length; i++) { 479 for (int i = 0; i < fields.length; i++) {
480 if (fields[i] != other.fields[i]) return false; 480 if (fields[i] != other.fields[i]) return false;
481 } 481 }
482 return true; 482 return true;
483 } 483 }
484 484
485 List<Constant> getDependencies() => fields; 485 List<Constant> getDependencies() => fields;
486 486
487 accept(ConstantVisitor visitor) => visitor.visitConstructed(this); 487 accept(ConstantVisitor visitor) => visitor.visitConstructed(this);
488
489 Map<Element, Constant> get fieldElements {
490 // TODO(ahe): Refactor constant system to store this information directly.
491 ClassElement classElement = type.element;
492 int count = 0;
493 Map<Element, Constant> result = new Map<Element, Constant>();
494 classElement.implementation.forEachInstanceField((holder, field) {
495 result[field] = fields[count++];
496 }, includeSuperAndInjectedMembers: true);
497 return result;
498 }
488 } 499 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698