OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // Efficient JavaScript based implementation of a linked hash map used as a | 5 // Efficient JavaScript based implementation of a linked hash map used as a |
6 // backing map for constant maps and the [LinkedHashMap] patch | 6 // backing map for constant maps and the [LinkedHashMap] patch |
7 | 7 |
8 part of "js_helper.dart"; | 8 part of "dart:_js_helper"; |
9 | 9 |
10 const _USE_ES6_MAPS = const bool.fromEnvironment("dart2js.use.es6.maps"); | 10 const _USE_ES6_MAPS = const bool.fromEnvironment("dart2js.use.es6.maps"); |
11 | 11 |
12 class JsLinkedHashMap<K, V> implements LinkedHashMap<K, V>, InternalMap { | 12 class JsLinkedHashMap<K, V> implements LinkedHashMap<K, V>, InternalMap { |
13 int _length = 0; | 13 int _length = 0; |
14 | 14 |
15 // The hash map contents are divided into three parts: one part for | 15 // The hash map contents are divided into three parts: one part for |
16 // string keys, one for numeric keys, and one for the rest. String | 16 // string keys, one for numeric keys, and one for the rest. String |
17 // and numeric keys map directly to their linked cells, but the rest | 17 // and numeric keys map directly to their linked cells, but the rest |
18 // of the entries are stored in bucket lists of the form: | 18 // of the entries are stored in bucket lists of the form: |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 } else if (_cell == null) { | 426 } else if (_cell == null) { |
427 _current = null; | 427 _current = null; |
428 return false; | 428 return false; |
429 } else { | 429 } else { |
430 _current = _cell.hashMapCellKey; | 430 _current = _cell.hashMapCellKey; |
431 _cell = _cell._next; | 431 _cell = _cell._next; |
432 return true; | 432 return true; |
433 } | 433 } |
434 } | 434 } |
435 } | 435 } |
OLD | NEW |