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

Side by Side Diff: frog/value.dart

Issue 8591033: Support globals in frog isolates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 9 years, 1 month 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 5 /**
6 * Represents a meta-value for code generation. 6 * Represents a meta-value for code generation.
7 */ 7 */
8 class Value { 8 class Value {
9 /** The [Type] of the [Value]. */ 9 /** The [Type] of the [Value]. */
10 Type type; 10 Type type;
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 var name = "const\$$uniqueId"; 637 var name = "const\$$uniqueId";
638 var codeWithComment = "$name/*${exp.span.text}*/"; 638 var codeWithComment = "$name/*${exp.span.text}*/";
639 return new GlobalValue( 639 return new GlobalValue(
640 exp.type, codeWithComment, true, null, name, exp, name, 640 exp.type, codeWithComment, true, null, name, exp, name,
641 exp.span, 641 exp.span,
642 dependencies.filter((d) => d is GlobalValue)); 642 dependencies.filter((d) => d is GlobalValue));
643 } 643 }
644 644
645 GlobalValue(Type type, String code, bool isConst, 645 GlobalValue(Type type, String code, bool isConst,
646 this.field, this.name, this.exp, this.canonicalCode, 646 this.field, this.name, this.exp, this.canonicalCode,
647 SourceSpan span, this.dependencies) 647 SourceSpan span, List<GlobalValue> _dependencies)
648 : super(type, code, span, !isConst); 648 : super(type, code, span, !isConst), dependencies = [] {
649 // store transitive-dependencies so sorting algorithm works correctly.
650 for (final dep in _dependencies) {
651 dependencies.add(dep);
652 dependencies.addAll(dep.dependencies);
653 }
654 }
649 655
650 int compareTo(GlobalValue other) { 656 int compareTo(GlobalValue other) {
651 // order by dependencies, o.w. by name 657 // order by dependencies, o.w. by name
652 if (other == this) { 658 if (other == this) {
653 return 0; 659 return 0;
654 } else if (dependencies.indexOf(other, 0) >= 0) { 660 } else if (dependencies.indexOf(other, 0) >= 0) {
655 return 1; 661 return 1;
656 } else if (other.dependencies.indexOf(this, 0) >= 0) { 662 } else if (other.dependencies.indexOf(this, 0) >= 0) {
657 return -1; 663 return -1;
658 } else if (dependencies.length > other.dependencies.length) { 664 } else if (dependencies.length > other.dependencies.length) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 708
703 // Then look for members in my library. 709 // Then look for members in my library.
704 member = home.library.lookup(name, span); 710 member = home.library.lookup(name, span);
705 if (member != null) { 711 if (member != null) {
706 return member; 712 return member;
707 } 713 }
708 714
709 return null; 715 return null;
710 } 716 }
711 } 717 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698