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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/code_emitter_task.dart

Issue 849623003: dart2js: start using the model in the old emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More uses. Created 5 years, 11 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/model.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 dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 const USE_NEW_EMITTER = const bool.fromEnvironment("dart2js.use.new.emitter"); 7 const USE_NEW_EMITTER = const bool.fromEnvironment("dart2js.use.new.emitter");
8 8
9 /** 9 /**
10 * Generates the code for all used classes in the program. Static fields (even 10 * Generates the code for all used classes in the program. Static fields (even
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 computeNeededStaticNonFinalFields(); 408 computeNeededStaticNonFinalFields();
409 computeNeededLibraries(); 409 computeNeededLibraries();
410 } 410 }
411 411
412 int assembleProgram() { 412 int assembleProgram() {
413 return measure(() { 413 return measure(() {
414 emitter.invalidateCaches(); 414 emitter.invalidateCaches();
415 415
416 computeAllNeededEntities(); 416 computeAllNeededEntities();
417 417
418 Program program; 418 Program program =
419 if (USE_NEW_EMITTER) { 419 new ProgramBuilder(compiler, namer, this).buildProgram();
420 program = new ProgramBuilder(compiler, namer, this).buildProgram();
421 }
422 return emitter.emitProgram(program); 420 return emitter.emitProgram(program);
423 }); 421 });
424 } 422 }
425 } 423 }
426 424
427 abstract class Emitter { 425 abstract class Emitter {
428 /// Emits [program] and returns the size of the generated output. 426 /// Emits [program] and returns the size of the generated output.
429 int emitProgram(Program program); 427 int emitProgram(Program program);
430 428
431 /// Returns the JS function that must be invoked to get the value of the 429 /// Returns the JS function that must be invoked to get the value of the
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 jsAst.Expression typeAccess(Element e); 461 jsAst.Expression typeAccess(Element e);
464 462
465 /// Returns the JS constructor for the given closure class [e]. 463 /// Returns the JS constructor for the given closure class [e].
466 jsAst.Expression closureClassConstructorAccess(ClosureClassElement e); 464 jsAst.Expression closureClassConstructorAccess(ClosureClassElement e);
467 465
468 int compareConstants(ConstantValue a, ConstantValue b); 466 int compareConstants(ConstantValue a, ConstantValue b);
469 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); 467 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant);
470 468
471 void invalidateCaches(); 469 void invalidateCaches();
472 } 470 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/model.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698