| 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"; | 7 import "dart:collection"; |
| 8 | 8 |
| 9 // These values are allowed to be passed directly over the wire. | 9 // These values are allowed to be passed directly over the wire. |
| 10 bool _isSimpleValue(var value) { | 10 bool _isSimpleValue(var value) { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 if (_voidType == null) { | 132 if (_voidType == null) { |
| 133 _voidType = new _SpecialTypeMirrorImpl('void'); | 133 _voidType = new _SpecialTypeMirrorImpl('void'); |
| 134 } | 134 } |
| 135 return _voidType; | 135 return _voidType; |
| 136 } | 136 } |
| 137 | 137 |
| 138 String toString() => "MirrorSystem for isolate '${isolate.debugName}'"; | 138 String toString() => "MirrorSystem for isolate '${isolate.debugName}'"; |
| 139 } | 139 } |
| 140 | 140 |
| 141 abstract class _LocalMirrorImpl implements Mirror { | 141 abstract class _LocalMirrorImpl implements Mirror { |
| 142 int get hashCode { | |
| 143 throw new UnimplementedError('Mirror.hashCode is not implemented'); | |
| 144 } | |
| 145 | |
| 146 // Local mirrors always return the same MirrorSystem. This field | 142 // Local mirrors always return the same MirrorSystem. This field |
| 147 // is more interesting once we implement remote mirrors. | 143 // is more interesting once we implement remote mirrors. |
| 148 MirrorSystem get mirrors => _Mirrors.currentMirrorSystem(); | 144 MirrorSystem get mirrors => _Mirrors.currentMirrorSystem(); |
| 149 } | 145 } |
| 150 | 146 |
| 151 class _LocalIsolateMirrorImpl extends _LocalMirrorImpl | 147 class _LocalIsolateMirrorImpl extends _LocalMirrorImpl |
| 152 implements IsolateMirror { | 148 implements IsolateMirror { |
| 153 _LocalIsolateMirrorImpl(this.debugName, this.rootLibrary); | 149 _LocalIsolateMirrorImpl(this.debugName, this.rootLibrary); |
| 154 | 150 |
| 155 final String debugName; | 151 final String debugName; |
| (...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1461 if (typeMirror == null) { | 1457 if (typeMirror == null) { |
| 1462 typeMirror = makeLocalTypeMirror(key); | 1458 typeMirror = makeLocalTypeMirror(key); |
| 1463 _instanitationCache[key] = typeMirror; | 1459 _instanitationCache[key] = typeMirror; |
| 1464 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { | 1460 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { |
| 1465 _declarationCache[key] = typeMirror; | 1461 _declarationCache[key] = typeMirror; |
| 1466 } | 1462 } |
| 1467 } | 1463 } |
| 1468 return typeMirror; | 1464 return typeMirror; |
| 1469 } | 1465 } |
| 1470 } | 1466 } |
| OLD | NEW |