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

Side by Side Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 2970943002: Use index in J/KTypeVariable and fix remaining inequivalence (Closed)
Patch Set: Created 3 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
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 library js_backend.backend; 5 library js_backend.backend;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/backend_api.dart' 8 import '../common/backend_api.dart'
9 show ForeignResolver, NativeRegistry, ImpactTransformer; 9 show ForeignResolver, NativeRegistry, ImpactTransformer;
10 import '../common/codegen.dart' show CodegenWorkItem; 10 import '../common/codegen.dart' show CodegenWorkItem;
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 /// One category of elements that do not apply is runtime helpers that the 679 /// One category of elements that do not apply is runtime helpers that the
680 /// backend calls, but the optimizations don't see those calls. 680 /// backend calls, but the optimizations don't see those calls.
681 bool canFunctionParametersBeUsedForGlobalOptimizations( 681 bool canFunctionParametersBeUsedForGlobalOptimizations(
682 FunctionElement element, ClosedWorld closedWorld) { 682 FunctionElement element, ClosedWorld closedWorld) {
683 if (element.isLocal) return true; 683 if (element.isLocal) return true;
684 MethodElement method = element; 684 MethodElement method = element;
685 return !closedWorld.backendUsage.isFunctionUsedByBackend(method) && 685 return !closedWorld.backendUsage.isFunctionUsedByBackend(method) &&
686 !mirrorsData.invokedReflectively(method); 686 !mirrorsData.invokedReflectively(method);
687 } 687 }
688 688
689 bool operatorEqHandlesNullArgument(FunctionEntity operatorEqfunction) {
690 return specialOperatorEqClasses.contains(operatorEqfunction.enclosingClass);
691 }
692
693 void validateInterceptorImplementsAllObjectMethods( 689 void validateInterceptorImplementsAllObjectMethods(
694 ClassEntity interceptorClass) { 690 ClassEntity interceptorClass) {
695 if (interceptorClass == null) return; 691 if (interceptorClass == null) return;
696 ClassEntity objectClass = frontendStrategy.commonElements.objectClass; 692 ClassEntity objectClass = frontendStrategy.commonElements.objectClass;
697 frontendStrategy.elementEnvironment.forEachClassMember(objectClass, 693 frontendStrategy.elementEnvironment.forEachClassMember(objectClass,
698 (_, MemberEntity member) { 694 (_, MemberEntity member) {
699 if (member.isConstructor) return; 695 if (member.isConstructor) return;
700 MemberEntity interceptorMember = frontendStrategy.elementEnvironment 696 MemberEntity interceptorMember = frontendStrategy.elementEnvironment
701 .lookupClassMember(interceptorClass, member.name); 697 .lookupClassMember(interceptorClass, member.name);
702 // Interceptors must override all Object methods due to calling convention 698 // Interceptors must override all Object methods due to calling convention
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 void onLibrariesLoaded( 1044 void onLibrariesLoaded(
1049 CommonElements commonElements, LoadedLibraries loadedLibraries) { 1045 CommonElements commonElements, LoadedLibraries loadedLibraries) {
1050 if (loadedLibraries.containsLibrary(Uris.dart_core)) { 1046 if (loadedLibraries.containsLibrary(Uris.dart_core)) {
1051 assert(loadedLibraries.containsLibrary(Uris.dart_core)); 1047 assert(loadedLibraries.containsLibrary(Uris.dart_core));
1052 assert(loadedLibraries.containsLibrary(Uris.dart__interceptors)); 1048 assert(loadedLibraries.containsLibrary(Uris.dart__interceptors));
1053 assert(loadedLibraries.containsLibrary(Uris.dart__js_helper)); 1049 assert(loadedLibraries.containsLibrary(Uris.dart__js_helper));
1054 1050
1055 // These methods are overwritten with generated versions. 1051 // These methods are overwritten with generated versions.
1056 inlineCache.markAsNonInlinable(commonElements.getInterceptorMethod, 1052 inlineCache.markAsNonInlinable(commonElements.getInterceptorMethod,
1057 insideLoop: true); 1053 insideLoop: true);
1058
1059 specialOperatorEqClasses
1060 ..add(commonElements.objectClass)
1061 ..add(commonElements.jsInterceptorClass)
1062 ..add(commonElements.jsNullClass);
1063 } 1054 }
1064 } 1055 }
1065 1056
1066 /// Called when the compiler starts running the codegen enqueuer. The 1057 /// Called when the compiler starts running the codegen enqueuer. The
1067 /// [WorldImpact] of enabled backend features is returned. 1058 /// [WorldImpact] of enabled backend features is returned.
1068 WorldImpact onCodegenStart(ClosedWorld closedWorld, 1059 WorldImpact onCodegenStart(ClosedWorld closedWorld,
1069 CodegenWorldBuilder codegenWorldBuilder, Sorter sorter) { 1060 CodegenWorldBuilder codegenWorldBuilder, Sorter sorter) {
1070 functionCompiler.onCodegenStart(); 1061 functionCompiler.onCodegenStart();
1071 _oneShotInterceptorData = new OneShotInterceptorData( 1062 _oneShotInterceptorData = new OneShotInterceptorData(
1072 closedWorld.interceptorData, closedWorld.commonElements); 1063 closedWorld.interceptorData, closedWorld.commonElements);
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 1391
1401 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { 1392 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) {
1402 return !selector.isGetter; 1393 return !selector.isGetter;
1403 } 1394 }
1404 1395
1405 /// Returns `true` if [member] is called from a subclass via `super`. 1396 /// Returns `true` if [member] is called from a subclass via `super`.
1406 bool isAliasedSuperMember(MemberEntity member) { 1397 bool isAliasedSuperMember(MemberEntity member) {
1407 return _aliasedSuperMembers.contains(member); 1398 return _aliasedSuperMembers.contains(member);
1408 } 1399 }
1409 } 1400 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698