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

Unified Diff: pkg/compiler/lib/src/common_elements.dart

Issue 2851163002: Handle symbol literals in closed_world2_test (Closed)
Patch Set: Reinsert test code Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compile_time_constants.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/common_elements.dart
diff --git a/pkg/compiler/lib/src/common_elements.dart b/pkg/compiler/lib/src/common_elements.dart
index e113ed2d908b37c0f38595b9b7f5d2a3076358cd..ebb860eb29eef8168f9ac56ef8f4dfcdf073652a 100644
--- a/pkg/compiler/lib/src/common_elements.dart
+++ b/pkg/compiler/lib/src/common_elements.dart
@@ -137,27 +137,32 @@ class CommonElements {
/// Reference to the internal library to lookup functions to always inline.
LibraryEntity _internalLibrary;
- LibraryEntity get internalLibrary =>
- _internalLibrary ??= _env.lookupLibrary(Uris.dart__internal);
+ LibraryEntity get internalLibrary => _internalLibrary ??=
+ _env.lookupLibrary(Uris.dart__internal, required: true);
/// The `NativeTypedData` class from dart:typed_data.
ClassEntity _typedDataClass;
ClassEntity get typedDataClass =>
_typedDataClass ??= _findClass(typedDataLibrary, 'NativeTypedData');
- /// Constructor of the `Symbol` class. This getter will ensure that `Symbol`
- /// is resolved and lookup the constructor on demand.
- ConstructorEntity _symbolConstructor;
- ConstructorEntity get symbolConstructor =>
- // TODO(johnniwinther): Kernel does not include redirecting factories
- // so this cannot be found in kernel. Find a consistent way to handle
- // this and similar cases.
- _symbolConstructor ??= _findConstructor(symbolClass, '', required: false);
+ /// Constructor of the `Symbol` class in dart:internal. This getter will
+ /// ensure that `Symbol` is resolved and lookup the constructor on demand.
+ ConstructorEntity _symbolConstructorTarget;
+ ConstructorEntity get symbolConstructorTarget {
+ // TODO(johnniwinther): Kernel does not include redirecting factories
+ // so this cannot be found in kernel. Find a consistent way to handle
+ // this and similar cases.
+ return _symbolConstructorTarget ??=
+ _findConstructor(symbolImplementationClass, '');
+ }
/// Whether [element] is the same as [symbolConstructor]. Used to check
/// for the constructor without computing it until it is likely to be seen.
// TODO(johnniwinther): Change type of [e] to [MemberEntity].
- bool isSymbolConstructor(Entity e) => e == symbolConstructor;
+ bool isSymbolConstructor(Entity e) {
+ return e == symbolConstructorTarget ||
+ e == _findConstructor(symbolClass, '', required: false);
+ }
/// The `MirrorSystem` class in dart:mirrors.
ClassEntity _mirrorSystemClass;
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compile_time_constants.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698