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

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

Issue 10915104: Move namer into javascript backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 typedef void Recompile(Element element); 5 typedef void Recompile(Element element);
6 6
7 class ReturnInfo { 7 class ReturnInfo {
8 HType returnType; 8 HType returnType;
9 List<Element> compiledFunctions; 9 List<Element> compiledFunctions;
10 10
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 294
295 JavaScriptItemCompilationContext() : types = new HTypeMap(); 295 JavaScriptItemCompilationContext() : types = new HTypeMap();
296 } 296 }
297 297
298 class JavaScriptBackend extends Backend { 298 class JavaScriptBackend extends Backend {
299 SsaBuilderTask builder; 299 SsaBuilderTask builder;
300 SsaOptimizerTask optimizer; 300 SsaOptimizerTask optimizer;
301 SsaCodeGeneratorTask generator; 301 SsaCodeGeneratorTask generator;
302 CodeEmitterTask emitter; 302 CodeEmitterTask emitter;
303 303
304 final Namer namer;
305
304 final Map<Element, Map<Element, HType>> fieldInitializers; 306 final Map<Element, Map<Element, HType>> fieldInitializers;
305 final Map<Element, Map<Element, HType>> fieldConstructorSetters; 307 final Map<Element, Map<Element, HType>> fieldConstructorSetters;
306 final Map<Element, Map<Element, HType>> fieldSettersType; 308 final Map<Element, Map<Element, HType>> fieldSettersType;
307 309
308 final Map<Element, ReturnInfo> returnInfo; 310 final Map<Element, ReturnInfo> returnInfo;
309 311
310 final List<Element> invalidateAfterCodegen; 312 final List<Element> invalidateAfterCodegen;
311 ArgumentTypesRegistry argumentTypes; 313 ArgumentTypesRegistry argumentTypes;
312 314
313 List<CompilerTask> get tasks { 315 List<CompilerTask> get tasks {
314 return <CompilerTask>[builder, optimizer, generator, emitter]; 316 return <CompilerTask>[builder, optimizer, generator, emitter];
315 } 317 }
316 318
317 JavaScriptBackend(Compiler compiler, bool generateSourceMap) 319 JavaScriptBackend(Compiler compiler, bool generateSourceMap)
318 : emitter = new CodeEmitterTask(compiler, generateSourceMap), 320 : fieldInitializers = new Map<Element, Map<Element, HType>>(),
319 fieldInitializers = new Map<Element, Map<Element, HType>>(),
320 fieldConstructorSetters = new Map<Element, Map<Element, HType>>(), 321 fieldConstructorSetters = new Map<Element, Map<Element, HType>>(),
321 fieldSettersType = new Map<Element, Map<Element, HType>>(), 322 fieldSettersType = new Map<Element, Map<Element, HType>>(),
323 namer = new Namer(compiler),
322 returnInfo = new Map<Element, ReturnInfo>(), 324 returnInfo = new Map<Element, ReturnInfo>(),
323 invalidateAfterCodegen = new List<Element>(), 325 invalidateAfterCodegen = new List<Element>(),
324 super(compiler, constantSystem: JAVA_SCRIPT_CONSTANT_SYSTEM) { 326 super(compiler, constantSystem: JAVA_SCRIPT_CONSTANT_SYSTEM) {
327 emitter = new CodeEmitterTask(compiler, namer, generateSourceMap);
325 builder = new SsaBuilderTask(this); 328 builder = new SsaBuilderTask(this);
326 optimizer = new SsaOptimizerTask(this); 329 optimizer = new SsaOptimizerTask(this);
327 generator = new SsaCodeGeneratorTask(this); 330 generator = new SsaCodeGeneratorTask(this);
328 argumentTypes = new ArgumentTypesRegistry(this); 331 argumentTypes = new ArgumentTypesRegistry(this);
329 } 332 }
330 333
331 Element get cyclicThrowHelper() { 334 Element get cyclicThrowHelper() {
332 return compiler.findHelper(const SourceString("throwCyclicInit")); 335 return compiler.findHelper(const SourceString("throwCyclicInit"));
333 } 336 }
334 337
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 return const SourceString('listSuperTypeCheck'); 597 return const SourceString('listSuperTypeCheck');
595 } 598 }
596 } else if (nativeCheck) { 599 } else if (nativeCheck) {
597 return const SourceString('callTypeCheck'); 600 return const SourceString('callTypeCheck');
598 } else { 601 } else {
599 return const SourceString('propertyTypeCheck'); 602 return const SourceString('propertyTypeCheck');
600 } 603 }
601 } 604 }
602 } 605 }
603 } 606 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698