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

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: Adapt to new way of computing elements needed for reflection. Created 6 years, 5 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 registerStaticUse(ctor.declaration); 313 registerStaticUse(ctor.declaration);
314 } 314 }
315 } 315 }
316 316
317 /// Enqeue the member [element] if it is required for reflection. 317 /// Enqeue the member [element] if it is required for reflection.
318 /// 318 ///
319 /// [enclosingWasIncluded] provides a hint whether the enclosing element was 319 /// [enclosingWasIncluded] provides a hint whether the enclosing element was
320 /// needed for reflection. 320 /// needed for reflection.
321 void enqueueReflectiveMember(Element element, bool enclosingWasIncluded) { 321 void enqueueReflectiveMember(Element element, bool enclosingWasIncluded) {
322 if (shouldIncludeElementDueToMirrors(element, 322 if (shouldIncludeElementDueToMirrors(element,
323 includedEnclosing: enclosingWasIncluded) 323 includedEnclosing: enclosingWasIncluded)) {
324 // Do not enqueue typedefs.
325 && !element.impliesType) {
326 logEnqueueReflectiveAction(element); 324 logEnqueueReflectiveAction(element);
327 if (Elements.isStaticOrTopLevel(element)) { 325 if (element.isTypedef) {
326 compiler.resolver.resolve(element);
herhut 2014/07/02 12:26:12 This code runs both during resolution enqueueing a
karlklose 2014/07/02 12:30:31 Done.
327 compiler.world.allTypedefs.add(element);
328 } else if (Elements.isStaticOrTopLevel(element)) {
328 registerStaticUse(element.declaration); 329 registerStaticUse(element.declaration);
329 } else if (element.isInstanceMember) { 330 } else if (element.isInstanceMember) {
330 // We need to enqueue all members matching this one in subclasses, as 331 // We need to enqueue all members matching this one in subclasses, as
331 // well. 332 // well.
332 // TODO(herhut): Use TypedSelector.subtype for enqueueing 333 // TODO(herhut): Use TypedSelector.subtype for enqueueing
333 Selector selector = new Selector.fromElement(element, compiler); 334 Selector selector = new Selector.fromElement(element, compiler);
334 registerSelectorUse(selector); 335 registerSelectorUse(selector);
335 if (element.isField) { 336 if (element.isField) {
336 Selector selector = 337 Selector selector =
337 new Selector.setter(element.name, element.library); 338 new Selector.setter(element.name, element.library);
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 } 850 }
850 CodegenWorkItem workItem = new CodegenWorkItem( 851 CodegenWorkItem workItem = new CodegenWorkItem(
851 element, itemCompilationContextCreator()); 852 element, itemCompilationContextCreator());
852 queue.add(workItem); 853 queue.add(workItem);
853 } 854 }
854 855
855 void _logSpecificSummary(log(message)) { 856 void _logSpecificSummary(log(message)) {
856 log('Compiled ${generatedCode.length} methods.'); 857 log('Compiled ${generatedCode.length} methods.');
857 } 858 }
858 } 859 }
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