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

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

Issue 10942028: Support class and typedef literals as expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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/compiler.dart
diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart
index 0f5fa175133601bfff948f08cb1ba97eaa6bcd58..ac228b8c448ba4295aedd79b258333cfd947ecad 100644
--- a/lib/compiler/implementation/compiler.dart
+++ b/lib/compiler/implementation/compiler.dart
@@ -127,6 +127,7 @@ abstract class Compiler implements DiagnosticListener {
ClassElement functionClass;
ClassElement nullClass;
ClassElement listClass;
+ ClassElement typeClass;
ClassElement mapClass;
ClassElement jsInvocationMirrorClass;
Element assertMethod;
@@ -189,10 +190,24 @@ abstract class Compiler implements DiagnosticListener {
static const SourceString START_ROOT_ISOLATE =
const SourceString('startRootIsolate');
bool enabledNoSuchMethod = false;
- bool enabledRuntimeType = false;
bool enabledFunctionApply = false;
bool enabledInvokeOn = false;
+ bool _enabledRuntimeType = false;
+ bool _needsRuntimeTypeCache = false;
+
+ void enableRuntimeTypeFunction() {
ahe 2012/11/01 13:55:27 Why do you need this complexity? What is wrong wit
karlklose 2012/11/01 14:34:20 It is not needed anymore. Before making the runtim
+ _enabledRuntimeType = true;
+ enableRuntimeTypeCache();
+ }
+
+ void enableRuntimeTypeCache() {
+ _needsRuntimeTypeCache = true;
+ }
+
+ bool get enabledRuntimeType => _enabledRuntimeType;
+ bool needsRuntimeTypeCache() => _needsRuntimeTypeCache;
+
Stopwatch progress;
static const int PHASE_SCANNING = 0;
@@ -403,6 +418,7 @@ abstract class Compiler implements DiagnosticListener {
stringClass = lookupSpecialClass(const SourceString('String'));
functionClass = lookupSpecialClass(const SourceString('Function'));
listClass = lookupSpecialClass(const SourceString('List'));
+ typeClass = lookupSpecialClass(const SourceString('Type'));
mapClass = lookupSpecialClass(const SourceString('Map'));
jsInvocationMirrorClass =
lookupSpecialClass(const SourceString('JSInvocationMirror'));

Powered by Google App Engine
This is Rietveld 408576698