OLD | NEW |
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 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 } | 900 } |
901 | 901 |
902 HType optimisticFieldType(Element element) { | 902 HType optimisticFieldType(Element element) { |
903 return fieldTypes.optimisticFieldType(element); | 903 return fieldTypes.optimisticFieldType(element); |
904 } | 904 } |
905 | 905 |
906 SourceString getCheckedModeHelper(DartType type) { | 906 SourceString getCheckedModeHelper(DartType type) { |
907 Element element = type.element; | 907 Element element = type.element; |
908 bool nativeCheck = | 908 bool nativeCheck = |
909 emitter.nativeEmitter.requiresNativeIsCheck(element); | 909 emitter.nativeEmitter.requiresNativeIsCheck(element); |
910 if (element == compiler.stringClass) { | 910 if (type == compiler.types.voidType) { |
| 911 return const SourceString('voidTypeCheck'); |
| 912 } else if (element == compiler.stringClass) { |
911 return const SourceString('stringTypeCheck'); | 913 return const SourceString('stringTypeCheck'); |
912 } else if (element == compiler.doubleClass) { | 914 } else if (element == compiler.doubleClass) { |
913 return const SourceString('doubleTypeCheck'); | 915 return const SourceString('doubleTypeCheck'); |
914 } else if (element == compiler.numClass) { | 916 } else if (element == compiler.numClass) { |
915 return const SourceString('numTypeCheck'); | 917 return const SourceString('numTypeCheck'); |
916 } else if (element == compiler.boolClass) { | 918 } else if (element == compiler.boolClass) { |
917 return const SourceString('boolTypeCheck'); | 919 return const SourceString('boolTypeCheck'); |
918 } else if (element == compiler.functionClass || element.isTypedef()) { | 920 } else if (element == compiler.functionClass || element.isTypedef()) { |
919 return const SourceString('functionTypeCheck'); | 921 return const SourceString('functionTypeCheck'); |
920 } else if (element == compiler.intClass) { | 922 } else if (element == compiler.intClass) { |
(...skipping 29 matching lines...) Expand all Loading... |
950 print("Inferred return types:"); | 952 print("Inferred return types:"); |
951 print("----------------------"); | 953 print("----------------------"); |
952 dumpReturnTypes(); | 954 dumpReturnTypes(); |
953 print(""); | 955 print(""); |
954 print("Inferred field types:"); | 956 print("Inferred field types:"); |
955 print("------------------------"); | 957 print("------------------------"); |
956 fieldTypes.dump(); | 958 fieldTypes.dump(); |
957 print(""); | 959 print(""); |
958 } | 960 } |
959 } | 961 } |
OLD | NEW |