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

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

Issue 12211013: Allow intercepted calls to have typed selectors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 SourceString getCheckedModeHelper(DartType type) { 1112 SourceString getCheckedModeHelper(DartType type) {
1113 Element element = type.element; 1113 Element element = type.element;
1114 bool nativeCheck = 1114 bool nativeCheck =
1115 emitter.nativeEmitter.requiresNativeIsCheck(element); 1115 emitter.nativeEmitter.requiresNativeIsCheck(element);
1116 if (type.isMalformed) { 1116 if (type.isMalformed) {
1117 // Check for malformed types first, because the type may be a list type 1117 // Check for malformed types first, because the type may be a list type
1118 // with a malformed argument type. 1118 // with a malformed argument type.
1119 return const SourceString('malformedTypeCheck'); 1119 return const SourceString('malformedTypeCheck');
1120 } else if (type == compiler.types.voidType) { 1120 } else if (type == compiler.types.voidType) {
1121 return const SourceString('voidTypeCheck'); 1121 return const SourceString('voidTypeCheck');
1122 } else if (element == compiler.stringClass) { 1122 } else if (element == jsStringClass
1123 || element == compiler.stringClass) {
1123 return const SourceString('stringTypeCheck'); 1124 return const SourceString('stringTypeCheck');
1124 } else if (element == compiler.doubleClass) { 1125 } else if (element == jsDoubleClass
1126 || element == compiler.doubleClass) {
1125 return const SourceString('doubleTypeCheck'); 1127 return const SourceString('doubleTypeCheck');
1126 } else if (element == compiler.numClass) { 1128 } else if (element == jsNumberClass
1129 || element == compiler.numClass) {
1127 return const SourceString('numTypeCheck'); 1130 return const SourceString('numTypeCheck');
1128 } else if (element == compiler.boolClass) { 1131 } else if (element == jsBoolClass
1132 || element == compiler.boolClass) {
1129 return const SourceString('boolTypeCheck'); 1133 return const SourceString('boolTypeCheck');
1130 } else if (element == compiler.functionClass) { 1134 } else if (element == jsFunctionClass
1135 || element == compiler.functionClass) {
1131 return const SourceString('functionTypeCheck'); 1136 return const SourceString('functionTypeCheck');
1132 } else if (element == compiler.intClass) { 1137 } else if (element == jsIntClass
1138 || element == compiler.intClass) {
1133 return const SourceString('intTypeCheck'); 1139 return const SourceString('intTypeCheck');
1134 } else if (Elements.isNumberOrStringSupertype(element, compiler)) { 1140 } else if (Elements.isNumberOrStringSupertype(element, compiler)) {
1135 return nativeCheck 1141 return nativeCheck
1136 ? const SourceString('numberOrStringSuperNativeTypeCheck') 1142 ? const SourceString('numberOrStringSuperNativeTypeCheck')
1137 : const SourceString('numberOrStringSuperTypeCheck'); 1143 : const SourceString('numberOrStringSuperTypeCheck');
1138 } else if (Elements.isStringOnlySupertype(element, compiler)) { 1144 } else if (Elements.isStringOnlySupertype(element, compiler)) {
1139 return nativeCheck 1145 return nativeCheck
1140 ? const SourceString('stringSuperNativeTypeCheck') 1146 ? const SourceString('stringSuperNativeTypeCheck')
1141 : const SourceString('stringSuperTypeCheck'); 1147 : const SourceString('stringSuperTypeCheck');
1142 } else if (identical(element, compiler.listClass)) { 1148 } else if (element == compiler.listClass
1149 || element == jsArrayClass) {
1143 return const SourceString('listTypeCheck'); 1150 return const SourceString('listTypeCheck');
1144 } else { 1151 } else {
1145 if (Elements.isListSupertype(element, compiler)) { 1152 if (Elements.isListSupertype(element, compiler)) {
1146 return nativeCheck 1153 return nativeCheck
1147 ? const SourceString('listSuperNativeTypeCheck') 1154 ? const SourceString('listSuperNativeTypeCheck')
1148 : const SourceString('listSuperTypeCheck'); 1155 : const SourceString('listSuperTypeCheck');
1149 } else { 1156 } else {
1150 return nativeCheck 1157 return nativeCheck
1151 ? const SourceString('callTypeCheck') 1158 ? const SourceString('callTypeCheck')
1152 : const SourceString('propertyTypeCheck'); 1159 : const SourceString('propertyTypeCheck');
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 } 1207 }
1201 1208
1202 Element getSetRuntimeTypeInfo() { 1209 Element getSetRuntimeTypeInfo() {
1203 return compiler.findHelper(const SourceString('setRuntimeTypeInfo')); 1210 return compiler.findHelper(const SourceString('setRuntimeTypeInfo'));
1204 } 1211 }
1205 1212
1206 Element getGetRuntimeTypeInfo() { 1213 Element getGetRuntimeTypeInfo() {
1207 return compiler.findHelper(const SourceString('getRuntimeTypeInfo')); 1214 return compiler.findHelper(const SourceString('getRuntimeTypeInfo'));
1208 } 1215 }
1209 } 1216 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698