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

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

Issue 880773003: dart2js: support native classes in the new emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 years, 10 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/new_emitter/emitter.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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 new Set<TypeVariableElement>(); 45 new Set<TypeVariableElement>();
46 46
47 List<TypedefElement> typedefsNeededForReflection; 47 List<TypedefElement> typedefsNeededForReflection;
48 48
49 JavaScriptBackend get backend => compiler.backend; 49 JavaScriptBackend get backend => compiler.backend;
50 50
51 CodeEmitterTask(Compiler compiler, Namer namer, bool generateSourceMap) 51 CodeEmitterTask(Compiler compiler, Namer namer, bool generateSourceMap)
52 : super(compiler), 52 : super(compiler),
53 this.namer = namer, 53 this.namer = namer,
54 this.typeTestRegistry = new TypeTestRegistry(compiler) { 54 this.typeTestRegistry = new TypeTestRegistry(compiler) {
55 nativeEmitter = new NativeEmitter(this);
55 oldEmitter = new OldEmitter(compiler, namer, generateSourceMap, this); 56 oldEmitter = new OldEmitter(compiler, namer, generateSourceMap, this);
56 emitter = USE_NEW_EMITTER 57 emitter = USE_NEW_EMITTER
57 ? new new_js_emitter.Emitter(compiler, namer) 58 ? new new_js_emitter.Emitter(compiler, namer, nativeEmitter)
58 : oldEmitter; 59 : oldEmitter;
59 nativeEmitter = new NativeEmitter(this);
60 metadataCollector = new MetadataCollector(compiler, emitter); 60 metadataCollector = new MetadataCollector(compiler, emitter);
61 } 61 }
62 62
63 String get name => 'Code emitter'; 63 String get name => 'Code emitter';
64 64
65 /// Returns the closure expression of a static function. 65 /// Returns the closure expression of a static function.
66 jsAst.Expression isolateStaticClosureAccess(FunctionElement element) { 66 jsAst.Expression isolateStaticClosureAccess(FunctionElement element) {
67 return emitter.isolateStaticClosureAccess(element); 67 return emitter.isolateStaticClosureAccess(element);
68 } 68 }
69 69
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 jsAst.Expression typeAccess(Element e); 459 jsAst.Expression typeAccess(Element e);
460 460
461 /// Returns the JS expression representing a function that returns 'null' 461 /// Returns the JS expression representing a function that returns 'null'
462 jsAst.Expression generateFunctionThatReturnsNull(); 462 jsAst.Expression generateFunctionThatReturnsNull();
463 463
464 int compareConstants(ConstantValue a, ConstantValue b); 464 int compareConstants(ConstantValue a, ConstantValue b);
465 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); 465 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant);
466 466
467 void invalidateCaches(); 467 void invalidateCaches();
468 } 468 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698