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

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

Issue 2647613004: Use entities in code_emitter_task (Closed)
Patch Set: Updated cf. comments Created 3 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.startup_emitter; 5 library dart2js.js_emitter.startup_emitter;
6 6
7 import 'package:js_runtime/shared/embedded_names.dart' 7 import 'package:js_runtime/shared/embedded_names.dart'
8 show JsBuiltin, METADATA, STATIC_FUNCTION_NAME_TO_CLOSURE, TYPES; 8 show JsBuiltin, METADATA, STATIC_FUNCTION_NAME_TO_CLOSURE, TYPES;
9 9
10 import '../../common.dart'; 10 import '../../common.dart';
11 import '../../compiler.dart' show Compiler; 11 import '../../compiler.dart' show Compiler;
12 import '../../constants/values.dart' show ConstantValue; 12 import '../../constants/values.dart' show ConstantValue;
13 import '../../elements/elements.dart' 13 import '../../elements/elements.dart'
14 show ClassElement, Element, FieldElement, FunctionElement; 14 show ClassElement, Element, FieldElement, MethodElement;
15 import '../../js/js.dart' as js; 15 import '../../js/js.dart' as js;
16 import '../../js_backend/js_backend.dart' show JavaScriptBackend, Namer; 16 import '../../js_backend/js_backend.dart' show JavaScriptBackend, Namer;
17 import '../../world.dart' show ClosedWorld; 17 import '../../world.dart' show ClosedWorld;
18 import '../js_emitter.dart' show CodeEmitterTask, NativeEmitter; 18 import '../js_emitter.dart' show CodeEmitterTask, NativeEmitter;
19 import '../js_emitter.dart' as emitterTask show Emitter, EmitterFactory; 19 import '../js_emitter.dart' as emitterTask show Emitter, EmitterFactory;
20 import '../model.dart'; 20 import '../model.dart';
21 import '../program_builder/program_builder.dart' show ProgramBuilder; 21 import '../program_builder/program_builder.dart' show ProgramBuilder;
22 import 'model_emitter.dart'; 22 import 'model_emitter.dart';
23 23
24 class EmitterFactory implements emitterTask.EmitterFactory { 24 class EmitterFactory implements emitterTask.EmitterFactory {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return pa; 95 return pa;
96 } 96 }
97 97
98 @override 98 @override
99 js.Expression isolateLazyInitializerAccess(FieldElement element) { 99 js.Expression isolateLazyInitializerAccess(FieldElement element) {
100 return js.js('#.#', 100 return js.js('#.#',
101 [namer.globalObjectFor(element), namer.lazyInitializerName(element)]); 101 [namer.globalObjectFor(element), namer.lazyInitializerName(element)]);
102 } 102 }
103 103
104 @override 104 @override
105 js.Expression isolateStaticClosureAccess(FunctionElement element) { 105 js.Expression isolateStaticClosureAccess(MethodElement element) {
106 return _emitter.generateStaticClosureAccess(element); 106 return _emitter.generateStaticClosureAccess(element);
107 } 107 }
108 108
109 @override 109 @override
110 js.PropertyAccess staticFieldAccess(FieldElement element) { 110 js.PropertyAccess staticFieldAccess(FieldElement element) {
111 return _globalPropertyAccess(element); 111 return _globalPropertyAccess(element);
112 } 112 }
113 113
114 @override 114 @override
115 js.PropertyAccess staticFunctionAccess(FunctionElement element) { 115 js.PropertyAccess staticFunctionAccess(MethodElement element) {
116 return _globalPropertyAccess(element); 116 return _globalPropertyAccess(element);
117 } 117 }
118 118
119 @override 119 @override
120 js.PropertyAccess constructorAccess(ClassElement element) { 120 js.PropertyAccess constructorAccess(ClassElement element) {
121 return _globalPropertyAccess(element); 121 return _globalPropertyAccess(element);
122 } 122 }
123 123
124 @override 124 @override
125 js.PropertyAccess prototypeAccess( 125 js.PropertyAccess prototypeAccess(
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 default: 190 default:
191 reporter.internalError( 191 reporter.internalError(
192 NO_LOCATION_SPANNABLE, "Unhandled Builtin: $builtin"); 192 NO_LOCATION_SPANNABLE, "Unhandled Builtin: $builtin");
193 return null; 193 return null;
194 } 194 }
195 } 195 }
196 196
197 @override 197 @override
198 void invalidateCaches() {} 198 void invalidateCaches() {}
199 } 199 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/native_emitter.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698