| 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 // Patch file for the dart:isolate library. | 5 // Patch file for the dart:isolate library. |
| 6 | 6 |
| 7 /******************************************************** | 7 /******************************************************** |
| 8 Inserted from lib/isolate/serialization.dart | 8 Inserted from lib/isolate/serialization.dart |
| 9 ********************************************************/ | 9 ********************************************************/ |
| 10 | 10 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // TODO(floitsch): we are losing the generic type. | 116 // TODO(floitsch): we are losing the generic type. |
| 117 return ['list', id, jsArray]; | 117 return ['list', id, jsArray]; |
| 118 } | 118 } |
| 119 | 119 |
| 120 visitMap(Map map) { | 120 visitMap(Map map) { |
| 121 int copyId = _visited[map]; | 121 int copyId = _visited[map]; |
| 122 if (copyId != null) return ['ref', copyId]; | 122 if (copyId != null) return ['ref', copyId]; |
| 123 | 123 |
| 124 int id = _nextFreeRefId++; | 124 int id = _nextFreeRefId++; |
| 125 _visited[map] = id; | 125 _visited[map] = id; |
| 126 var keys = _serializeList(map.getKeys()); | 126 var keys = _serializeList(map.keys); |
| 127 var values = _serializeList(map.getValues()); | 127 var values = _serializeList(map.values); |
| 128 // TODO(floitsch): we are losing the generic type. | 128 // TODO(floitsch): we are losing the generic type. |
| 129 return ['map', id, keys, values]; | 129 return ['map', id, keys, values]; |
| 130 } | 130 } |
| 131 | 131 |
| 132 _serializeList(List list) { | 132 _serializeList(List list) { |
| 133 int len = list.length; | 133 int len = list.length; |
| 134 var result = new List(len); | 134 var result = new List(len); |
| 135 for (int i = 0; i < len; i++) { | 135 for (int i = 0; i < len; i++) { |
| 136 result[i] = _dispatch(list[i]); | 136 result[i] = _dispatch(list[i]); |
| 137 } | 137 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 } | 204 } |
| 205 | 205 |
| 206 abstract deserializeSendPort(List x); | 206 abstract deserializeSendPort(List x); |
| 207 | 207 |
| 208 deserializeObject(List x) { | 208 deserializeObject(List x) { |
| 209 // TODO(floitsch): Use real exception (which one?). | 209 // TODO(floitsch): Use real exception (which one?). |
| 210 throw "Unexpected serialized object"; | 210 throw "Unexpected serialized object"; |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 | 213 |
| OLD | NEW |