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

Unified Diff: lib/compiler/implementation/namer.dart

Issue 10855174: Lazy implementation of final variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase wrt CL 10832351. Created 8 years, 4 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: lib/compiler/implementation/namer.dart
diff --git a/lib/compiler/implementation/namer.dart b/lib/compiler/implementation/namer.dart
index fc43d2fa4769c638aa0247219b969aa64655b66d..abaefdce30461faff54a6697ef597c24a4900478 100644
--- a/lib/compiler/implementation/namer.dart
+++ b/lib/compiler/implementation/namer.dart
@@ -35,6 +35,8 @@ class Namer {
/** Some closures must contain their name. The name is stored in
* [STATIC_CLOSURE_NAME_NAME]. */
final String STATIC_CLOSURE_NAME_NAME = @'$name';
+ // TODO(floitsch): make sure the sentinel can't clash with other fields.
+ final String LAZY_INITIALIZATION_SENTINEL = @"$lazySentinel";
static final SourceString CLOSURE_INVOCATION_NAME =
Compiler.CALL_OPERATOR_NAME;
@@ -281,6 +283,16 @@ class Namer {
}
}
+ String getLazyInitializerName(Element element) {
+ // TODO(floitsch): mangle while not conflicting with other statics.
+ assert(Elements.isStaticOrTopLevelField(element));
+ return "get\$${getName(element)}";
+ }
+
+ String getLazyInitializerBailoutName(Element element) {
+ return "${getLazyInitializerName}\$bailout";
+ }
+
String isolatePropertiesAccess(Element element) {
return "$ISOLATE.$ISOLATE_PROPERTIES.${getName(element)}";
}
@@ -297,6 +309,14 @@ class Namer {
return '${isolateAccess(element)}\$bailout';
}
+ String isolateLazyInitializerAccess(Element element) {
+ return "$CURRENT_ISOLATE.${getLazyInitializerName(element)}";
+ }
+
+ String isolateLazyInitializerBailoutAccess(Element element) {
+ return "$CURRENT_ISOLATE.${getLazyInitializerName(element)}\$bailout";
+ }
+
String operatorIs(Element element) {
return 'is\$${getName(element)}';
}

Powered by Google App Engine
This is Rietveld 408576698