| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // VM-specific implementation of the dart:mirrors library. | 5 // VM-specific implementation of the dart:mirrors library. |
| 6 | 6 |
| 7 import "dart:collection" show UnmodifiableListView, UnmodifiableMapView; | 7 import "dart:collection" show UnmodifiableListView, UnmodifiableMapView; |
| 8 import "dart:async" show Future; | 8 import "dart:async" show Future; |
| 9 | 9 |
| 10 var dirty = false; | 10 var dirty = false; |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 219 |
| 220 class _LocalMirrorSystem extends MirrorSystem { | 220 class _LocalMirrorSystem extends MirrorSystem { |
| 221 final TypeMirror dynamicType = new _SpecialTypeMirror('dynamic'); | 221 final TypeMirror dynamicType = new _SpecialTypeMirror('dynamic'); |
| 222 final TypeMirror voidType = new _SpecialTypeMirror('void'); | 222 final TypeMirror voidType = new _SpecialTypeMirror('void'); |
| 223 | 223 |
| 224 var _libraries; | 224 var _libraries; |
| 225 Map<Uri, LibraryMirror> get libraries { | 225 Map<Uri, LibraryMirror> get libraries { |
| 226 if ((_libraries == null) || dirty) { | 226 if ((_libraries == null) || dirty) { |
| 227 _libraries = new Map<Uri, LibraryMirror>.fromIterable( | 227 _libraries = new Map<Uri, LibraryMirror>.fromIterable( |
| 228 _computeLibraries(), key: (e) => e.uri); | 228 _computeLibraries(), key: (e) => e.uri); |
| 229 dirty = false; |
| 229 } | 230 } |
| 230 return _libraries; | 231 return _libraries; |
| 231 } | 232 } |
| 232 static _computeLibraries() native "MirrorSystem_libraries"; | 233 static _computeLibraries() native "MirrorSystem_libraries"; |
| 233 | 234 |
| 234 var _isolate; | 235 var _isolate; |
| 235 IsolateMirror get isolate { | 236 IsolateMirror get isolate { |
| 236 if (_isolate == null) { | 237 if (_isolate == null) { |
| 237 _isolate = _computeIsolate(); | 238 _isolate = _computeIsolate(); |
| 238 } | 239 } |
| (...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1669 if (typeMirror == null) { | 1670 if (typeMirror == null) { |
| 1670 typeMirror = makeLocalTypeMirror(key); | 1671 typeMirror = makeLocalTypeMirror(key); |
| 1671 _instantiationCache[key] = typeMirror; | 1672 _instantiationCache[key] = typeMirror; |
| 1672 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { | 1673 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { |
| 1673 _declarationCache[key] = typeMirror; | 1674 _declarationCache[key] = typeMirror; |
| 1674 } | 1675 } |
| 1675 } | 1676 } |
| 1676 return typeMirror; | 1677 return typeMirror; |
| 1677 } | 1678 } |
| 1678 } | 1679 } |
| OLD | NEW |