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

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

Issue 12598003: Support type variables as expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 9 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 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 } 1061 }
1062 1062
1063 void registerRuntimeType(TreeElements elements) { 1063 void registerRuntimeType(TreeElements elements) {
1064 enqueueInResolution(getSetRuntimeTypeInfo(), elements); 1064 enqueueInResolution(getSetRuntimeTypeInfo(), elements);
1065 enqueueInResolution(getGetRuntimeTypeInfo(), elements); 1065 enqueueInResolution(getGetRuntimeTypeInfo(), elements);
1066 enqueueInResolution(getGetRuntimeTypeArgument(), elements); 1066 enqueueInResolution(getGetRuntimeTypeArgument(), elements);
1067 compiler.enqueuer.resolution.registerInstantiatedClass( 1067 compiler.enqueuer.resolution.registerInstantiatedClass(
1068 compiler.listClass, elements); 1068 compiler.listClass, elements);
1069 } 1069 }
1070 1070
1071 void registerTypeVariableExpression(TreeElements elements) {
1072 registerRuntimeType(elements);
1073 enqueueInResolution(getRuntimeTypeToString(), elements);
1074 enqueueInResolution(getCreateRuntimeType(), elements);
1075 }
1076
1071 void registerIsCheck(DartType type, Enqueuer world, TreeElements elements) { 1077 void registerIsCheck(DartType type, Enqueuer world, TreeElements elements) {
1072 world.registerInstantiatedClass(compiler.boolClass, elements); 1078 world.registerInstantiatedClass(compiler.boolClass, elements);
1073 bool isTypeVariable = type.kind == TypeKind.TYPE_VARIABLE; 1079 bool isTypeVariable = type.kind == TypeKind.TYPE_VARIABLE;
1074 if (!type.isRaw || isTypeVariable) { 1080 if (!type.isRaw || isTypeVariable) {
1075 enqueueInResolution(getSetRuntimeTypeInfo(), elements); 1081 enqueueInResolution(getSetRuntimeTypeInfo(), elements);
1076 enqueueInResolution(getGetRuntimeTypeInfo(), elements); 1082 enqueueInResolution(getGetRuntimeTypeInfo(), elements);
1077 enqueueInResolution(getGetRuntimeTypeArgument(), elements); 1083 enqueueInResolution(getGetRuntimeTypeArgument(), elements);
1078 enqueueInResolution(getCheckArguments(), elements); 1084 enqueueInResolution(getCheckArguments(), elements);
1079 if (isTypeVariable) { 1085 if (isTypeVariable) {
1080 enqueueInResolution(getGetObjectIsSubtype(), elements); 1086 enqueueInResolution(getGetObjectIsSubtype(), elements);
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 } 1538 }
1533 1539
1534 Element getGetRuntimeTypeInfo() { 1540 Element getGetRuntimeTypeInfo() {
1535 return compiler.findHelper(const SourceString('getRuntimeTypeInfo')); 1541 return compiler.findHelper(const SourceString('getRuntimeTypeInfo'));
1536 } 1542 }
1537 1543
1538 Element getGetRuntimeTypeArgument() { 1544 Element getGetRuntimeTypeArgument() {
1539 return compiler.findHelper(const SourceString('getRuntimeTypeArgument')); 1545 return compiler.findHelper(const SourceString('getRuntimeTypeArgument'));
1540 } 1546 }
1541 1547
1548 Element getRuntimeTypeToString() {
1549 return compiler.findHelper(const SourceString('runtimeTypeToString'));
1550 }
1551
1542 Element getCheckArguments() { 1552 Element getCheckArguments() {
1543 return compiler.findHelper(const SourceString('checkArguments')); 1553 return compiler.findHelper(const SourceString('checkArguments'));
1544 } 1554 }
1545 1555
1546 Element getGetObjectIsSubtype() { 1556 Element getGetObjectIsSubtype() {
1547 return compiler.findHelper(const SourceString('objectIsSubtype')); 1557 return compiler.findHelper(const SourceString('objectIsSubtype'));
1548 } 1558 }
1549 1559
1550 Element getThrowNoSuchMethod() { 1560 Element getThrowNoSuchMethod() {
1551 return compiler.findHelper(const SourceString('throwNoSuchMethod')); 1561 return compiler.findHelper(const SourceString('throwNoSuchMethod'));
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 ClassElement get constListImplementation => jsArrayClass; 1602 ClassElement get constListImplementation => jsArrayClass;
1593 ClassElement get fixedListImplementation => jsFixedArrayClass; 1603 ClassElement get fixedListImplementation => jsFixedArrayClass;
1594 ClassElement get growableListImplementation => jsExtendableArrayClass; 1604 ClassElement get growableListImplementation => jsExtendableArrayClass;
1595 ClassElement get mapImplementation => mapLiteralClass; 1605 ClassElement get mapImplementation => mapLiteralClass;
1596 ClassElement get constMapImplementation => constMapLiteralClass; 1606 ClassElement get constMapImplementation => constMapLiteralClass;
1597 ClassElement get functionImplementation => jsFunctionClass; 1607 ClassElement get functionImplementation => jsFunctionClass;
1598 ClassElement get typeImplementation => typeLiteralClass; 1608 ClassElement get typeImplementation => typeLiteralClass;
1599 ClassElement get boolImplementation => jsBoolClass; 1609 ClassElement get boolImplementation => jsBoolClass;
1600 ClassElement get nullImplementation => jsNullClass; 1610 ClassElement get nullImplementation => jsNullClass;
1601 } 1611 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698