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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 * The members of instantiated interceptor classes: maps a member | 691 * The members of instantiated interceptor classes: maps a member |
692 * name to the list of members that have that name. This map is used | 692 * name to the list of members that have that name. This map is used |
693 * by the codegen to know whether a send must be intercepted or not. | 693 * by the codegen to know whether a send must be intercepted or not. |
694 */ | 694 */ |
695 final Map<SourceString, List<Element>> interceptedElements; | 695 final Map<SourceString, List<Element>> interceptedElements; |
696 | 696 |
697 List<CompilerTask> get tasks { | 697 List<CompilerTask> get tasks { |
698 return <CompilerTask>[builder, optimizer, generator, emitter]; | 698 return <CompilerTask>[builder, optimizer, generator, emitter]; |
699 } | 699 } |
700 | 700 |
| 701 final RuntimeTypeInformation rti; |
| 702 |
701 JavaScriptBackend(Compiler compiler, bool generateSourceMap, bool disableEval) | 703 JavaScriptBackend(Compiler compiler, bool generateSourceMap, bool disableEval) |
702 : namer = determineNamer(compiler), | 704 : namer = determineNamer(compiler), |
703 returnInfo = new Map<Element, ReturnInfo>(), | 705 returnInfo = new Map<Element, ReturnInfo>(), |
704 invalidateAfterCodegen = new List<Element>(), | 706 invalidateAfterCodegen = new List<Element>(), |
705 interceptors = new Interceptors(compiler), | 707 interceptors = new Interceptors(compiler), |
706 usedInterceptors = new Set<Selector>(), | 708 usedInterceptors = new Set<Selector>(), |
707 interceptedElements = new Map<SourceString, List<Element>>(), | 709 interceptedElements = new Map<SourceString, List<Element>>(), |
| 710 rti = new RuntimeTypeInformation(compiler), |
708 super(compiler, JAVA_SCRIPT_CONSTANT_SYSTEM) { | 711 super(compiler, JAVA_SCRIPT_CONSTANT_SYSTEM) { |
709 emitter = disableEval | 712 emitter = disableEval |
710 ? new CodeEmitterNoEvalTask(compiler, namer, generateSourceMap) | 713 ? new CodeEmitterNoEvalTask(compiler, namer, generateSourceMap) |
711 : new CodeEmitterTask(compiler, namer, generateSourceMap); | 714 : new CodeEmitterTask(compiler, namer, generateSourceMap); |
712 builder = new SsaBuilderTask(this); | 715 builder = new SsaBuilderTask(this); |
713 optimizer = new SsaOptimizerTask(this); | 716 optimizer = new SsaOptimizerTask(this); |
714 generator = new SsaCodeGeneratorTask(this); | 717 generator = new SsaCodeGeneratorTask(this); |
715 argumentTypes = new ArgumentTypesRegistry(this); | 718 argumentTypes = new ArgumentTypesRegistry(this); |
716 fieldTypes = new FieldTypesRegistry(this); | 719 fieldTypes = new FieldTypesRegistry(this); |
717 } | 720 } |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 print("Inferred return types:"); | 1087 print("Inferred return types:"); |
1085 print("----------------------"); | 1088 print("----------------------"); |
1086 dumpReturnTypes(); | 1089 dumpReturnTypes(); |
1087 print(""); | 1090 print(""); |
1088 print("Inferred field types:"); | 1091 print("Inferred field types:"); |
1089 print("------------------------"); | 1092 print("------------------------"); |
1090 fieldTypes.dump(); | 1093 fieldTypes.dump(); |
1091 print(""); | 1094 print(""); |
1092 } | 1095 } |
1093 } | 1096 } |
OLD | NEW |