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

Side by Side Diff: pkg/compiler/lib/src/js_backend/codegen/glue.dart

Issue 1383483006: Extract DiagnosticReporter implementation from Compiler. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes after rebase. Created 5 years, 2 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 code_generator_dependencies; 5 library code_generator_dependencies;
6 6
7 import '../js_backend.dart'; 7 import '../js_backend.dart';
8 import '../../common/registry.dart' show 8 import '../../common/registry.dart' show
9 Registry; 9 Registry;
10 import '../../compiler.dart' show 10 import '../../compiler.dart' show
11 Compiler; 11 Compiler;
12 import '../../constants/values.dart'; 12 import '../../constants/values.dart';
13 import '../../dart_types.dart' show 13 import '../../dart_types.dart' show
14 DartType, 14 DartType,
15 TypeVariableType, 15 TypeVariableType,
16 InterfaceType; 16 InterfaceType;
17 import '../../diagnostics/diagnostic_listener.dart' show
18 DiagnosticReporter;
19 import '../../diagnostics/spannable.dart' show
20 CURRENT_ELEMENT_SPANNABLE;
17 import '../../enqueue.dart' show 21 import '../../enqueue.dart' show
18 CodegenEnqueuer; 22 CodegenEnqueuer;
19 import '../../elements/elements.dart'; 23 import '../../elements/elements.dart';
20 import '../../js_emitter/js_emitter.dart'; 24 import '../../js_emitter/js_emitter.dart';
21 import '../../js/js.dart' as js; 25 import '../../js/js.dart' as js;
22 import '../../universe/selector.dart' show 26 import '../../universe/selector.dart' show
23 Selector; 27 Selector;
24 import '../../world.dart' show 28 import '../../world.dart' show
25 ClassWorld; 29 ClassWorld;
26 30
(...skipping 12 matching lines...) Expand all
39 JavaScriptBackend get _backend => _compiler.backend; 43 JavaScriptBackend get _backend => _compiler.backend;
40 44
41 CodeEmitterTask get _emitter => _backend.emitter; 45 CodeEmitterTask get _emitter => _backend.emitter;
42 46
43 Namer get _namer => _backend.namer; 47 Namer get _namer => _backend.namer;
44 48
45 Glue(this._compiler); 49 Glue(this._compiler);
46 50
47 ClassWorld get classWorld => _compiler.world; 51 ClassWorld get classWorld => _compiler.world;
48 52
53 DiagnosticReporter get reporter => _compiler.reporter;
54
49 js.Expression constantReference(ConstantValue value) { 55 js.Expression constantReference(ConstantValue value) {
50 return _emitter.constantReference(value); 56 return _emitter.constantReference(value);
51 } 57 }
52 58
53 reportInternalError(String message) { 59 reportInternalError(String message) {
54 _compiler.internalError(_compiler.currentElement, message); 60 reporter.internalError(CURRENT_ELEMENT_SPANNABLE, message);
55 } 61 }
56 62
57 bool isUsedAsMixin(ClassElement classElement) { 63 bool isUsedAsMixin(ClassElement classElement) {
58 return classWorld.isUsedAsMixin(classElement); 64 return classWorld.isUsedAsMixin(classElement);
59 } 65 }
60 66
61 ConstantValue getConstantValueForVariable(VariableElement variable) { 67 ConstantValue getConstantValueForVariable(VariableElement variable) {
62 return _backend.constants.getConstantValueForVariable(variable); 68 return _backend.constants.getConstantValueForVariable(variable);
63 } 69 }
64 70
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 ClassElement get jsMutableArrayClass => _backend.jsMutableArrayClass; 268 ClassElement get jsMutableArrayClass => _backend.jsMutableArrayClass;
263 269
264 bool isStringClass(ClassElement classElement) => 270 bool isStringClass(ClassElement classElement) =>
265 classElement == _backend.jsStringClass || 271 classElement == _backend.jsStringClass ||
266 classElement == _compiler.stringClass; 272 classElement == _compiler.stringClass;
267 273
268 bool isBoolClass(ClassElement classElement) => 274 bool isBoolClass(ClassElement classElement) =>
269 classElement == _backend.jsBoolClass || 275 classElement == _backend.jsBoolClass ||
270 classElement == _compiler.boolClass; 276 classElement == _compiler.boolClass;
271 } 277 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698