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

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

Issue 360493002: Emit declarations for typedefs that are needed by reflection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/backend.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 typedef ItemCompilationContext ItemCompilationContextCreator(); 7 typedef ItemCompilationContext ItemCompilationContextCreator();
8 8
9 class EnqueueTask extends CompilerTask { 9 class EnqueueTask extends CompilerTask {
10 final ResolutionEnqueuer resolution; 10 final ResolutionEnqueuer resolution;
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 registerStaticUse(ctor.declaration); 307 registerStaticUse(ctor.declaration);
308 } 308 }
309 } 309 }
310 310
311 /// Enqeue the member [element] if it is required for reflection. 311 /// Enqeue the member [element] if it is required for reflection.
312 /// 312 ///
313 /// [enclosingWasIncluded] provides a hint whether the enclosing element was 313 /// [enclosingWasIncluded] provides a hint whether the enclosing element was
314 /// needed for reflection. 314 /// needed for reflection.
315 void enqueueReflectiveMember(Element element, bool enclosingWasIncluded) { 315 void enqueueReflectiveMember(Element element, bool enclosingWasIncluded) {
316 if (shouldIncludeElementDueToMirrors(element, 316 if (shouldIncludeElementDueToMirrors(element,
317 includedEnclosing: enclosingWasIncluded) 317 includedEnclosing: enclosingWasIncluded)) {
318 // Do not enqueue typedefs.
319 && !element.impliesType) {
320 logEnqueueReflectiveAction(element); 318 logEnqueueReflectiveAction(element);
321 if (Elements.isStaticOrTopLevel(element)) { 319 if (element.isTypedef) {
320 TypedefElement typedef = element;
321 typedef.ensureResolved(compiler);
322 compiler.world.allTypedefs.add(element);
323 } else if (Elements.isStaticOrTopLevel(element)) {
322 registerStaticUse(element.declaration); 324 registerStaticUse(element.declaration);
323 } else if (element.isInstanceMember) { 325 } else if (element.isInstanceMember) {
324 // We need to enqueue all members matching this one in subclasses, as 326 // We need to enqueue all members matching this one in subclasses, as
325 // well. 327 // well.
326 // TODO(herhut): Use TypedSelector.subtype for enqueueing 328 // TODO(herhut): Use TypedSelector.subtype for enqueueing
327 Selector selector = new Selector.fromElement(element, compiler); 329 Selector selector = new Selector.fromElement(element, compiler);
328 registerSelectorUse(selector); 330 registerSelectorUse(selector);
329 if (element.isField) { 331 if (element.isField) {
330 Selector selector = 332 Selector selector =
331 new Selector.setter(element.name, element.library); 333 new Selector.setter(element.name, element.library);
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 } 867 }
866 } 868 }
867 }); 869 });
868 return true; 870 return true;
869 } 871 }
870 872
871 void processWorkItem(void f(WorkItem work), WorkItem work) { 873 void processWorkItem(void f(WorkItem work), WorkItem work) {
872 f(work); 874 f(work);
873 } 875 }
874 } 876 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698