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

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

Issue 14478002: Revert "Fix x.runtimeType for native classes" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 typedef void Recompile(Element element); 7 typedef void Recompile(Element element);
8 8
9 class ReturnInfo { 9 class ReturnInfo {
10 HType returnType; 10 HType returnType;
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 void addInterceptorsForNativeClassMembers( 971 void addInterceptorsForNativeClassMembers(
972 ClassElement cls, Enqueuer enqueuer) { 972 ClassElement cls, Enqueuer enqueuer) {
973 if (enqueuer.isResolutionQueue) { 973 if (enqueuer.isResolutionQueue) {
974 cls.ensureResolved(compiler); 974 cls.ensureResolved(compiler);
975 cls.forEachMember((ClassElement classElement, Element member) { 975 cls.forEachMember((ClassElement classElement, Element member) {
976 // All methods on [Object] are shadowed by [Interceptor]. 976 // All methods on [Object] are shadowed by [Interceptor].
977 if (classElement == compiler.objectClass) return; 977 if (classElement == compiler.objectClass) return;
978 Set<Element> set = interceptedElements.putIfAbsent( 978 Set<Element> set = interceptedElements.putIfAbsent(
979 member.name, () => new Set<Element>()); 979 member.name, () => new Set<Element>());
980 set.add(member); 980 set.add(member);
981 if (classElement == jsInterceptorClass) return;
982 if (!classElement.isNative()) { 981 if (!classElement.isNative()) {
983 MixinApplicationElement mixinApplication = classElement; 982 MixinApplicationElement mixinApplication = classElement;
984 assert(member.getEnclosingClass() == mixinApplication.mixin); 983 assert(member.getEnclosingClass() == mixinApplication.mixin);
985 classesMixedIntoNativeClasses.add(mixinApplication.mixin); 984 classesMixedIntoNativeClasses.add(mixinApplication.mixin);
986 } 985 }
987 }, 986 },
988 includeSuperMembers: true); 987 includeSuperMembers: true);
989 } 988 }
990 } 989 }
991 990
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 } 1360 }
1362 1361
1363 native.NativeEnqueuer nativeResolutionEnqueuer(Enqueuer world) { 1362 native.NativeEnqueuer nativeResolutionEnqueuer(Enqueuer world) {
1364 return new native.NativeResolutionEnqueuer(world, compiler); 1363 return new native.NativeResolutionEnqueuer(world, compiler);
1365 } 1364 }
1366 1365
1367 native.NativeEnqueuer nativeCodegenEnqueuer(Enqueuer world) { 1366 native.NativeEnqueuer nativeCodegenEnqueuer(Enqueuer world) {
1368 return new native.NativeCodegenEnqueuer(world, compiler, emitter); 1367 return new native.NativeCodegenEnqueuer(world, compiler, emitter);
1369 } 1368 }
1370 1369
1371 ClassElement defaultSuperclass(ClassElement element) {
1372 // Native classes inherit from Interceptor.
1373 return element.isNative() ? jsInterceptorClass : compiler.objectClass;
1374 }
1375
1376 /** 1370 /**
1377 * Unit test hook that returns code of an element as a String. 1371 * Unit test hook that returns code of an element as a String.
1378 * 1372 *
1379 * Invariant: [element] must be a declaration element. 1373 * Invariant: [element] must be a declaration element.
1380 */ 1374 */
1381 String assembleCode(Element element) { 1375 String assembleCode(Element element) {
1382 assert(invariant(element, element.isDeclaration)); 1376 assert(invariant(element, element.isDeclaration));
1383 return jsAst.prettyPrint(generatedCode[element], compiler).getText(); 1377 return jsAst.prettyPrint(generatedCode[element], compiler).getText();
1384 } 1378 }
1385 1379
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
1785 ClassElement get constListImplementation => jsArrayClass; 1779 ClassElement get constListImplementation => jsArrayClass;
1786 ClassElement get fixedListImplementation => jsFixedArrayClass; 1780 ClassElement get fixedListImplementation => jsFixedArrayClass;
1787 ClassElement get growableListImplementation => jsExtendableArrayClass; 1781 ClassElement get growableListImplementation => jsExtendableArrayClass;
1788 ClassElement get mapImplementation => mapLiteralClass; 1782 ClassElement get mapImplementation => mapLiteralClass;
1789 ClassElement get constMapImplementation => constMapLiteralClass; 1783 ClassElement get constMapImplementation => constMapLiteralClass;
1790 ClassElement get functionImplementation => jsFunctionClass; 1784 ClassElement get functionImplementation => jsFunctionClass;
1791 ClassElement get typeImplementation => typeLiteralClass; 1785 ClassElement get typeImplementation => typeLiteralClass;
1792 ClassElement get boolImplementation => jsBoolClass; 1786 ClassElement get boolImplementation => jsBoolClass;
1793 ClassElement get nullImplementation => jsNullClass; 1787 ClassElement get nullImplementation => jsNullClass;
1794 } 1788 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/compiler.dart ('k') | sdk/lib/_internal/compiler/implementation/lib/core_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698