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

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

Issue 2653203002: Use entities in CommonElements interface. (Closed)
Patch Set: Created 3 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
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.full_emitter; 5 library dart2js.js_emitter.full_emitter;
6 6
7 import 'dart:collection' show HashMap; 7 import 'dart:collection' show HashMap;
8 import 'dart:convert'; 8 import 'dart:convert';
9 9
10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; 10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames;
11 import 'package:js_runtime/shared/embedded_names.dart' 11 import 'package:js_runtime/shared/embedded_names.dart'
12 show JsBuiltin, JsGetName; 12 show JsBuiltin, JsGetName;
13 13
14 import '../../common.dart'; 14 import '../../common.dart';
15 import '../../compiler.dart' show Compiler; 15 import '../../compiler.dart' show Compiler;
16 import '../../constants/values.dart'; 16 import '../../constants/values.dart';
17 import '../../core_types.dart' show CommonElements; 17 import '../../core_types.dart' show CommonElements;
18 import '../../elements/resolution_types.dart' show ResolutionDartType; 18 import '../../elements/resolution_types.dart' show ResolutionDartType;
19 import '../../deferred_load.dart' show OutputUnit; 19 import '../../deferred_load.dart' show OutputUnit;
20 import '../../elements/elements.dart' 20 import '../../elements/elements.dart'
21 show 21 show
22 ClassElement, 22 ClassElement,
23 Element, 23 Element,
24 Elements, 24 Elements,
25 Entity,
25 FieldElement, 26 FieldElement,
26 FunctionElement, 27 FunctionElement,
27 FunctionSignature, 28 FunctionSignature,
28 LibraryElement, 29 LibraryElement,
29 MethodElement, 30 MethodElement,
30 TypedefElement, 31 TypedefElement,
31 VariableElement; 32 VariableElement;
32 import '../../hash/sha1.dart' show Hasher; 33 import '../../hash/sha1.dart' show Hasher;
33 import '../../io/code_output.dart'; 34 import '../../io/code_output.dart';
34 import '../../io/line_column_provider.dart' 35 import '../../io/line_column_provider.dart'
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 ClassElement element, bool hasBeenInstantiated) { 352 ClassElement element, bool hasBeenInstantiated) {
352 return jsAst.js('#.prototype', constructorAccess(element)); 353 return jsAst.js('#.prototype', constructorAccess(element));
353 } 354 }
354 355
355 @override 356 @override
356 jsAst.PropertyAccess interceptorClassAccess(ClassElement element) { 357 jsAst.PropertyAccess interceptorClassAccess(ClassElement element) {
357 return globalPropertyAccess(element); 358 return globalPropertyAccess(element);
358 } 359 }
359 360
360 @override 361 @override
361 jsAst.PropertyAccess typeAccess(Element element) { 362 jsAst.PropertyAccess typeAccess(Entity element) {
362 return globalPropertyAccess(element); 363 return globalPropertyAccess(element);
363 } 364 }
364 365
365 @override 366 @override
366 jsAst.Template templateForBuiltin(JsBuiltin builtin) { 367 jsAst.Template templateForBuiltin(JsBuiltin builtin) {
367 switch (builtin) { 368 switch (builtin) {
368 case JsBuiltin.dartObjectConstructor: 369 case JsBuiltin.dartObjectConstructor:
369 return jsAst.js 370 return jsAst.js
370 .expressionTemplateYielding(typeAccess(commonElements.objectClass)); 371 .expressionTemplateYielding(typeAccess(commonElements.objectClass));
371 372
(...skipping 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after
2181 void invalidateCaches() { 2182 void invalidateCaches() {
2182 if (!compiler.options.hasIncrementalSupport) return; 2183 if (!compiler.options.hasIncrementalSupport) return;
2183 if (cachedElements.isEmpty) return; 2184 if (cachedElements.isEmpty) return;
2184 for (Element element in backend.codegenEnqueuer.newlyEnqueuedElements) { 2185 for (Element element in backend.codegenEnqueuer.newlyEnqueuedElements) {
2185 if (element.isInstanceMember) { 2186 if (element.isInstanceMember) {
2186 cachedClassBuilders.remove(element.enclosingClass); 2187 cachedClassBuilders.remove(element.enclosingClass);
2187 } 2188 }
2188 } 2189 }
2189 } 2190 }
2190 } 2191 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698