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

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

Issue 1334203002: Compute Compiler.proxyConstant on demand. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
Index: pkg/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index db180aa93f496307e18dd23bfc5d99c00e88b4f9..249176adc4563fda5ae09fd1640c3a16871d5a01 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -848,11 +848,6 @@ abstract class Compiler implements DiagnosticListener {
functionClass.ensureResolved(this);
functionApplyMethod = functionClass.lookupLocalMember('apply');
- proxyConstant =
- constants.getConstantValue(
- resolver.constantCompiler.compileConstant(
- coreLibrary.find('proxy')));
-
if (preserveComments) {
return libraryLoader.loadLibrary(Uris.dart_mirrors)
.then((LibraryElement libraryElement) {
@@ -862,6 +857,18 @@ abstract class Compiler implements DiagnosticListener {
}).then((_) => backend.onLibrariesLoaded(loadedLibraries));
}
+ bool isProxyConstant(ConstantValue value) {
+ FieldElement field = coreLibrary.find('proxy');
+ if (field == null) return false;
+ if (!enqueuer.resolution.hasBeenResolved(field)) return false;
+ if (proxyConstant == null) {
+ proxyConstant =
+ constants.getConstantValue(
+ resolver.constantCompiler.compileConstant(field));
+ }
+ return proxyConstant == value;
+ }
+
Element findRequiredElement(LibraryElement library, String name) {
var element = library.find(name);
if (element == null) {

Powered by Google App Engine
This is Rietveld 408576698