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

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

Issue 737353002: cps-ir: Implement boolean conversion in and use it to implement '&&', '||', and '?:'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase to new test infrastructure. Created 6 years, 1 month 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) 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 '../../dart2jslib.dart'; 8 import '../../dart2jslib.dart';
9 import '../../js_emitter/js_emitter.dart'; 9 import '../../js_emitter/js_emitter.dart';
10 import '../../js/js.dart' as js; 10 import '../../js/js.dart' as js;
11 import '../../constants/values.dart'; 11 import '../../constants/values.dart';
12 import '../../elements/elements.dart'; 12 import '../../elements/elements.dart';
13 13
14 /// Encapsulates the dependencies of the function-compiler to the compiler, 14 /// Encapsulates the dependencies of the function-compiler to the compiler,
15 /// backend and emitter. 15 /// backend and emitter.
16 // TODO(sigurdm): Should be refactored when we have a better feeling for the 16 // TODO(sigurdm): Should be refactored when we have a better feeling for the
17 // interface. 17 // interface.
18 class Glue { 18 class Glue {
19 final Compiler _compiler; 19 final Compiler _compiler;
20 20
21 JavaScriptBackend get _backend => _compiler.backend; 21 JavaScriptBackend get _backend => _compiler.backend;
22
22 CodeEmitterTask get _emitter => _backend.emitter; 23 CodeEmitterTask get _emitter => _backend.emitter;
23 Namer get _namer => _backend.namer; 24 Namer get _namer => _backend.namer;
24 25
25 Glue(this._compiler); 26 Glue(this._compiler);
26 27
27 js.Expression constantReference(ConstantValue value) { 28 js.Expression constantReference(ConstantValue value) {
28 return _emitter.constantReference(value); 29 return _emitter.constantReference(value);
29 } 30 }
30 31
32 reportInternalError(String message) {
33 _compiler.internalError(_compiler.currentElement, message);
34 }
35
31 js.Expression elementAccess(Element element) { 36 js.Expression elementAccess(Element element) {
32 return _namer.elementAccess(element); 37 return _namer.elementAccess(element);
33 } 38 }
34 39
35 String safeVariableName(String name) { 40 String safeVariableName(String name) {
36 return _namer.safeVariableName(name); 41 return _namer.safeVariableName(name);
37 } 42 }
38
39 ClassElement get listClass => _compiler.listClass; 43 ClassElement get listClass => _compiler.listClass;
40 44
41 } 45 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/codegen.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