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

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

Issue 23449019: Couple of backend fixes: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 class JavaScriptItemCompilationContext extends ItemCompilationContext { 7 class JavaScriptItemCompilationContext extends ItemCompilationContext {
8 final Set<HInstruction> boundsChecked; 8 final Set<HInstruction> boundsChecked;
9 9
10 JavaScriptItemCompilationContext() 10 JavaScriptItemCompilationContext()
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 static Namer determineNamer(Compiler compiler) { 362 static Namer determineNamer(Compiler compiler) {
363 return compiler.enableMinification ? 363 return compiler.enableMinification ?
364 new MinifyNamer(compiler) : 364 new MinifyNamer(compiler) :
365 new Namer(compiler); 365 new Namer(compiler);
366 } 366 }
367 367
368 bool canBeUsedForGlobalOptimizations(Element element) { 368 bool canBeUsedForGlobalOptimizations(Element element) {
369 if (element.isParameter() 369 if (element.isParameter()
370 || element.isFieldParameter() 370 || element.isFieldParameter()
371 || element.isField()) { 371 || element.isField()) {
372 element = element.enclosingElement; 372 if (!canBeUsedForGlobalOptimizations(element.enclosingElement)) {
373 return false;
374 }
373 } 375 }
374 element = element.declaration; 376 element = element.declaration;
375 return !isNeededForReflection(element) && !helpersUsed.contains(element); 377 return !isNeededForReflection(element) && !helpersUsed.contains(element);
376 } 378 }
377 379
378 bool isInterceptorClass(ClassElement element) { 380 bool isInterceptorClass(ClassElement element) {
379 if (element == null) return false; 381 if (element == null) return false;
380 if (Elements.isNativeOrExtendsNative(element)) return true; 382 if (Elements.isNativeOrExtendsNative(element)) return true;
381 if (interceptedClasses.contains(element)) return true; 383 if (interceptedClasses.contains(element)) return true;
382 if (classesMixedIntoNativeClasses.contains(element)) return true; 384 if (classesMixedIntoNativeClasses.contains(element)) return true;
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 void registerAbstractClassInstantiation(TreeElements elements) { 949 void registerAbstractClassInstantiation(TreeElements elements) {
948 enqueueInResolution(getThrowAbstractClassInstantiationError(), elements); 950 enqueueInResolution(getThrowAbstractClassInstantiationError(), elements);
949 // Also register the types of the arguments passed to this method. 951 // Also register the types of the arguments passed to this method.
950 enqueueClass(compiler.enqueuer.resolution, compiler.stringClass, elements); 952 enqueueClass(compiler.enqueuer.resolution, compiler.stringClass, elements);
951 } 953 }
952 954
953 void registerFallThroughError(TreeElements elements) { 955 void registerFallThroughError(TreeElements elements) {
954 enqueueInResolution(getFallThroughError(), elements); 956 enqueueInResolution(getFallThroughError(), elements);
955 } 957 }
956 958
959 void enableNoSuchMethod(Enqueuer world) {
960 enqueue(world, getCreateInvocationMirror(), compiler.globalDependencies);
961 world.registerInvocation(compiler.noSuchMethodSelector);
962 }
963
957 void registerSuperNoSuchMethod(TreeElements elements) { 964 void registerSuperNoSuchMethod(TreeElements elements) {
958 enqueueInResolution(getCreateInvocationMirror(), elements); 965 enqueueInResolution(getCreateInvocationMirror(), elements);
959 enqueueInResolution( 966 enqueueInResolution(
960 compiler.objectClass.lookupLocalMember(Compiler.NO_SUCH_METHOD), 967 compiler.objectClass.lookupLocalMember(Compiler.NO_SUCH_METHOD),
961 elements); 968 elements);
962 enqueueClass(compiler.enqueuer.resolution, compiler.listClass, elements); 969 enqueueClass(compiler.enqueuer.resolution, compiler.listClass, elements);
963 } 970 }
964 971
965 void registerRequiredType(DartType type, Element enclosingElement) { 972 void registerRequiredType(DartType type, Element enclosingElement) {
966 /** 973 /**
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
1690 copy(constant.values); 1697 copy(constant.values);
1691 copy(constant.protoValue); 1698 copy(constant.protoValue);
1692 copy(constant); 1699 copy(constant);
1693 } 1700 }
1694 1701
1695 void visitConstructed(ConstructedConstant constant) { 1702 void visitConstructed(ConstructedConstant constant) {
1696 copy(constant.fields); 1703 copy(constant.fields);
1697 copy(constant); 1704 copy(constant);
1698 } 1705 }
1699 } 1706 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698