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

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

Issue 11361060: Support checked mode for return type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/lib/js_helper.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698