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

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

Issue 541683002: Generate needed classes for constant maps in metadata. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 js_backend; 5 part of js_backend;
6 6
7 const VERBOSE_OPTIMIZER_HINTS = false; 7 const VERBOSE_OPTIMIZER_HINTS = false;
8 8
9 class JavaScriptItemCompilationContext extends ItemCompilationContext { 9 class JavaScriptItemCompilationContext extends ItemCompilationContext {
10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>();
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 } 719 }
720 if (type.element == typeImplementation) { 720 if (type.element == typeImplementation) {
721 // If we use a type literal in a constant, the compile time 721 // If we use a type literal in a constant, the compile time
722 // constant emitter will generate a call to the createRuntimeType 722 // constant emitter will generate a call to the createRuntimeType
723 // helper so we register a use of that. 723 // helper so we register a use of that.
724 registry.registerStaticInvocation(getCreateRuntimeType()); 724 registry.registerStaticInvocation(getCreateRuntimeType());
725 } 725 }
726 } 726 }
727 } 727 }
728 728
729 void registerMetadataConstant(Constant constant, 729 void registerMetadataConstant(MetadataAnnotation metadata,
730 Element annotatedElement, 730 Element annotatedElement,
731 Registry registry) { 731 Registry registry) {
732 assert(registry.isForResolution); 732 assert(registry.isForResolution);
733 Constant constant = constants.getConstantForMetadata(metadata);
733 registerCompileTimeConstant(constant, registry); 734 registerCompileTimeConstant(constant, registry);
734 metadataConstants.add(new Dependency(constant, annotatedElement)); 735 metadataConstants.add(new Dependency(constant, annotatedElement));
735 } 736 }
736 737
737 void registerInstantiatedClass(ClassElement cls, 738 void registerInstantiatedClass(ClassElement cls,
738 Enqueuer enqueuer, 739 Enqueuer enqueuer,
739 Registry registry) { 740 Registry registry) {
740 if (!cls.typeVariables.isEmpty) { 741 if (!cls.typeVariables.isEmpty) {
741 typeVariableHandler.registerClassWithTypeVariables(cls); 742 typeVariableHandler.registerClassWithTypeVariables(cls);
742 } 743 }
(...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after
2363 } 2364 }
2364 } 2365 }
2365 2366
2366 /// Records that [constant] is used by the element behind [registry]. 2367 /// Records that [constant] is used by the element behind [registry].
2367 class Dependency { 2368 class Dependency {
2368 final Constant constant; 2369 final Constant constant;
2369 final Element annotatedElement; 2370 final Element annotatedElement;
2370 2371
2371 const Dependency(this.constant, this.annotatedElement); 2372 const Dependency(this.constant, this.annotatedElement);
2372 } 2373 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698