| 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 // These values are allowed to be passed directly over the wire. | 7 // These values are allowed to be passed directly over the wire. |
| 8 bool isSimpleValue(var value) { | 8 bool isSimpleValue(var value) { |
| 9 return (value === null || value is num || value is String || value is bool); | 9 return (value === null || value is num || value is String || value is bool); |
| 10 } | 10 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 // The IsolateMirror for the current isolate. | 95 // The IsolateMirror for the current isolate. |
| 96 static IsolateMirror localIsolateMirror() { | 96 static IsolateMirror localIsolateMirror() { |
| 97 if (_localIsolateMirror === null) { | 97 if (_localIsolateMirror === null) { |
| 98 _localIsolateMirror = makeLocalIsolateMirror(); | 98 _localIsolateMirror = makeLocalIsolateMirror(); |
| 99 } | 99 } |
| 100 return _localIsolateMirror; | 100 return _localIsolateMirror; |
| 101 } | 101 } |
| 102 | 102 |
| 103 // Creates a new local IsolateMirror. | 103 // Creates a new local IsolateMirror. |
| 104 static bool makeLocalIsolateMirror() | 104 static IsolateMirror makeLocalIsolateMirror() |
| 105 native 'Mirrors_makeLocalIsolateMirror'; | 105 native 'Mirrors_makeLocalIsolateMirror'; |
| 106 | 106 |
| 107 static Future<IsolateMirror> isolateMirrorOf(SendPort port) { | 107 static Future<IsolateMirror> isolateMirrorOf(SendPort port) { |
| 108 Completer<IsolateMirror> completer = new Completer<IsolateMirror>(); | 108 Completer<IsolateMirror> completer = new Completer<IsolateMirror>(); |
| 109 if (isLocalPort(port)) { | 109 if (isLocalPort(port)) { |
| 110 // Make a local isolate mirror. | 110 // Make a local isolate mirror. |
| 111 completer.complete(localIsolateMirror()); | 111 completer.complete(localIsolateMirror()); |
| 112 } else { | 112 } else { |
| 113 // Make a remote isolate mirror. | 113 // Make a remote isolate mirror. |
| 114 throw new NotImplementedException('Remote mirrors not yet implemented'); | 114 throw new NotImplementedException('Remote mirrors not yet implemented'); |
| 115 } | 115 } |
| 116 return completer.future; | 116 return completer.future; |
| 117 } | 117 } |
| 118 } | 118 } |
| OLD | NEW |