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

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

Issue 1232463007: dart2js: Rename "current isolate" to "static state (holder)". (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments. Created 5 years, 5 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/js_backend/namer.dart
diff --git a/pkg/compiler/lib/src/js_backend/namer.dart b/pkg/compiler/lib/src/js_backend/namer.dart
index 9ce0b81c84ef8461f7b45a656acece7e8fba51d7..ad7f725dbb3237f19e8435efc38343afc95837d1 100644
--- a/pkg/compiler/lib/src/js_backend/namer.dart
+++ b/pkg/compiler/lib/src/js_backend/namer.dart
@@ -321,7 +321,7 @@ class Namer {
}
final String asyncPrefix = r"$async$";
- final String currentIsolate = r'$';
+ final String staticStateHolder = r'$';
final String getterPrefix = r'get$';
final String lazyGetterPrefix = r'$get$';
final String setterPrefix = r'set$';
@@ -1313,17 +1313,19 @@ class Namer {
: globalPropertyName(method);
}
- /// Returns true if [element] is stored on current isolate ('$'). We intend
- /// to store only mutable static state in [currentIsolate], constants are
- /// stored in 'C', and functions, accessors, classes, etc. are stored in one
- /// of the other objects in [reservedGlobalObjectNames].
- bool isPropertyOfCurrentIsolate(Element element) {
+ /// Returns true if [element] is stored in the static state holder
+ /// ([staticStateHolder]). We intend to store only mutable static state
+ /// there, whereas constants are stored in 'C'. Functions, accessors,
+ /// classes, etc. are stored in one of the other objects in
+ /// [reservedGlobalObjectNames].
+ bool _isPropertyOfStaticStateHolder(Element element) {
// TODO(ahe): Make sure this method's documentation is always true and
// remove the word "intend".
return
// TODO(ahe): Re-write these tests to be positive (so it only returns
// true for static/top-level mutable fields). Right now, a number of
- // other elements, such as bound closures also live in [currentIsolate].
+ // other elements, such as bound closures also live in
+ // [staticStateHolder].
!element.isAccessor &&
!element.isClass &&
!element.isTypedef &&
@@ -1332,9 +1334,9 @@ class Namer {
!element.isLibrary;
}
- /// Returns [currentIsolate] or one of [reservedGlobalObjectNames].
+ /// Returns [staticStateHolder] or one of [reservedGlobalObjectNames].
String globalObjectFor(Element element) {
- if (isPropertyOfCurrentIsolate(element)) return currentIsolate;
+ if (_isPropertyOfStaticStateHolder(element)) return staticStateHolder;
LibraryElement library = element.library;
if (library == backend.interceptorsLibrary) return 'J';
if (library.isInternalLibrary) return 'H';
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698