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

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

Issue 3011803002: dart2js kernel: Sort constants
Patch Set: implement DartType ordering Created 3 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library dart2js.js_emitter.lazy_emitter; 5 library dart2js.js_emitter.lazy_emitter;
6 6
7 import 'package:js_runtime/shared/embedded_names.dart' show JsBuiltin; 7 import 'package:js_runtime/shared/embedded_names.dart' show JsBuiltin;
8 8
9 import '../../common.dart'; 9 import '../../common.dart';
10 import '../../compiler.dart' show Compiler; 10 import '../../compiler.dart' show Compiler;
(...skipping 13 matching lines...) Expand all
24 import 'model_emitter.dart'; 24 import 'model_emitter.dart';
25 25
26 class EmitterFactory implements emitterTask.EmitterFactory { 26 class EmitterFactory implements emitterTask.EmitterFactory {
27 @override 27 @override
28 bool get supportsReflection => false; 28 bool get supportsReflection => false;
29 29
30 @override 30 @override
31 Emitter createEmitter(CodeEmitterTask task, Namer namer, 31 Emitter createEmitter(CodeEmitterTask task, Namer namer,
32 ClosedWorld closedWorld, Sorter sorter) { 32 ClosedWorld closedWorld, Sorter sorter) {
33 return new Emitter( 33 return new Emitter(
34 task.compiler, namer, task.nativeEmitter, closedWorld, task); 34 task.compiler, namer, task.nativeEmitter, closedWorld, sorter, task);
35 } 35 }
36 } 36 }
37 37
38 class Emitter extends emitterTask.EmitterBase { 38 class Emitter extends emitterTask.EmitterBase {
39 final Compiler _compiler; 39 final Compiler _compiler;
40 final ClosedWorld _closedWorld; 40 final ClosedWorld _closedWorld;
41 final Namer namer; 41 final Namer namer;
42 final ModelEmitter _emitter; 42 final ModelEmitter _emitter;
43 43
44 JavaScriptBackend get _backend => _compiler.backend; 44 JavaScriptBackend get _backend => _compiler.backend;
45 45
46 Emitter(this._compiler, this.namer, NativeEmitter nativeEmitter, 46 Emitter(this._compiler, this.namer, NativeEmitter nativeEmitter,
47 this._closedWorld, CodeEmitterTask task) 47 this._closedWorld, Sorter sorter, CodeEmitterTask task)
48 : _emitter = new ModelEmitter( 48 : _emitter = new ModelEmitter(
49 _compiler, namer, nativeEmitter, _closedWorld, task); 49 _compiler, namer, nativeEmitter, _closedWorld, sorter, task);
50 50
51 DiagnosticReporter get reporter => _compiler.reporter; 51 DiagnosticReporter get reporter => _compiler.reporter;
52 52
53 @override 53 @override
54 int emitProgram(ProgramBuilder programBuilder) { 54 int emitProgram(ProgramBuilder programBuilder) {
55 Program program = programForTesting = programBuilder.buildProgram(); 55 Program program = programForTesting = programBuilder.buildProgram();
56 return _emitter.emitProgram(program); 56 return _emitter.emitProgram(program);
57 } 57 }
58 58
59 // TODO(floitsch): copied from full emitter. Adjust or share. 59 // TODO(floitsch): copied from full emitter. Adjust or share.
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 reporter.internalError( 166 reporter.internalError(
167 NO_LOCATION_SPANNABLE, "Unhandled Builtin: $builtin"); 167 NO_LOCATION_SPANNABLE, "Unhandled Builtin: $builtin");
168 return null; 168 return null;
169 } 169 }
170 } 170 }
171 171
172 @override 172 @override
173 // TODO(het): Generate this correctly 173 // TODO(het): Generate this correctly
174 int generatedSize(OutputUnit unit) => 0; 174 int generatedSize(OutputUnit unit) => 0;
175 } 175 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698