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

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: Fix tests. 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 83b3c52f24576234bd8000821419f1b9bcf2a0cd..494c8b94ce77bc44784e5961bdceda3d60373c44 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";
final SourceString CLOSURE_INVOCATION_NAME = Compiler.CALL_OPERATOR_NAME;
@@ -280,6 +282,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)}";
}
@@ -296,6 +308,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