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

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

Issue 362973002: Revert "Emit declarations for typedefs that are needed by reflection." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 assert(_membersNeededForReflection != null); 319 assert(_membersNeededForReflection != null);
320 return _membersNeededForReflection; 320 return _membersNeededForReflection;
321 } 321 }
322 322
323 /// List of symbols that the user has requested for reflection. 323 /// List of symbols that the user has requested for reflection.
324 final Set<String> symbolsUsed = new Set<String>(); 324 final Set<String> symbolsUsed = new Set<String>();
325 325
326 /// List of elements that the backend may use. 326 /// List of elements that the backend may use.
327 final Set<Element> helpersUsed = new Set<Element>(); 327 final Set<Element> helpersUsed = new Set<Element>();
328 328
329 /// Set of typedefs that are used as type literals.
330 final Set<TypedefElement> typedefTypeLiterals = new Set<TypedefElement>();
331
329 /// All the checked mode helpers. 332 /// All the checked mode helpers.
330 static const checkedModeHelpers = CheckedModeHelper.helpers; 333 static const checkedModeHelpers = CheckedModeHelper.helpers;
331 334
332 // Checked mode helpers indexed by name. 335 // Checked mode helpers indexed by name.
333 Map<String, CheckedModeHelper> checkedModeHelperByName = 336 Map<String, CheckedModeHelper> checkedModeHelperByName =
334 new Map<String, CheckedModeHelper>.fromIterable( 337 new Map<String, CheckedModeHelper>.fromIterable(
335 checkedModeHelpers, 338 checkedModeHelpers,
336 key: (helper) => helper.name); 339 key: (helper) => helper.name);
337 340
338 TypeVariableHandler typeVariableHandler; 341 TypeVariableHandler typeVariableHandler;
(...skipping 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after
2127 } 2130 }
2128 2131
2129 void onTypeLiteral(DartType type, Registry registry) { 2132 void onTypeLiteral(DartType type, Registry registry) {
2130 assert(registry.isForResolution); 2133 assert(registry.isForResolution);
2131 registerBackendInstantiation(backend.typeImplementation, registry); 2134 registerBackendInstantiation(backend.typeImplementation, registry);
2132 registerBackendStaticInvocation(backend.getCreateRuntimeType(), registry); 2135 registerBackendStaticInvocation(backend.getCreateRuntimeType(), registry);
2133 // TODO(ahe): Might want to register [element] as an instantiated class 2136 // TODO(ahe): Might want to register [element] as an instantiated class
2134 // when reflection is used. However, as long as we disable tree-shaking 2137 // when reflection is used. However, as long as we disable tree-shaking
2135 // eagerly it doesn't matter. 2138 // eagerly it doesn't matter.
2136 if (type.isTypedef) { 2139 if (type.isTypedef) {
2137 backend.compiler.world.allTypedefs.add(type.element); 2140 backend.typedefTypeLiterals.add(type.element);
2138 } 2141 }
2139 backend.customElementsAnalysis.registerTypeLiteral(type, registry); 2142 backend.customElementsAnalysis.registerTypeLiteral(type, registry);
2140 } 2143 }
2141 2144
2142 void onStackTraceInCatch(Registry registry) { 2145 void onStackTraceInCatch(Registry registry) {
2143 assert(registry.isForResolution); 2146 assert(registry.isForResolution);
2144 registerBackendStaticInvocation(backend.getTraceFromException(), registry); 2147 registerBackendStaticInvocation(backend.getTraceFromException(), registry);
2145 } 2148 }
2146 2149
2147 2150
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
2274 } 2277 }
2275 2278
2276 /// Records that [constant] is used by the element behind [registry]. 2279 /// Records that [constant] is used by the element behind [registry].
2277 class Dependency { 2280 class Dependency {
2278 final Constant constant; 2281 final Constant constant;
2279 // TODO(johnniwinther): Change to [Element] when dependency nodes are added. 2282 // TODO(johnniwinther): Change to [Element] when dependency nodes are added.
2280 final Registry registry; 2283 final Registry registry;
2281 2284
2282 const Dependency(this.constant, this.registry); 2285 const Dependency(this.constant, this.registry);
2283 } 2286 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698