Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Unified Diff: sdk/lib/_internal/compiler/js_lib/collection_patch.dart

Issue 1083733002: Revert "dart2js: use Es6 maps when available." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/js_backend/namer.dart ('k') | sdk/lib/_internal/compiler/js_lib/linked_hash_map.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/js_lib/collection_patch.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/collection_patch.dart b/sdk/lib/_internal/compiler/js_lib/collection_patch.dart
index 463f8c2a14683bef9c844a9199f0de4eaf83152c..9242d392644fff7ec59795c0debf71fa905b9f4b 100644
--- a/sdk/lib/_internal/compiler/js_lib/collection_patch.dart
+++ b/sdk/lib/_internal/compiler/js_lib/collection_patch.dart
@@ -386,7 +386,6 @@ class _CustomHashMap<K, V> extends _HashMap<K, V> {
final _Equality<K> _equals;
final _Hasher<K> _hashCode;
final _Predicate _validKey;
-
_CustomHashMap(this._equals, this._hashCode, bool validKey(potentialKey))
: _validKey = (validKey != null) ? validKey : ((v) => v is K);
@@ -493,7 +492,7 @@ class LinkedHashMap<K, V> {
if (isValidKey == null) {
if (hashCode == null) {
if (equals == null) {
- return new JsLinkedHashMap<K, V>.es6();
+ return new JsLinkedHashMap<K, V>();
}
hashCode = _defaultHashCode;
} else {
@@ -522,17 +521,16 @@ class LinkedHashMap<K, V> {
// Private factory constructor called by generated code for map literals.
@NoInline()
factory LinkedHashMap._literal(List keyValuePairs) {
- return fillLiteralMap(keyValuePairs, new JsLinkedHashMap<K, V>.es6());
+ return fillLiteralMap(keyValuePairs, new JsLinkedHashMap<K, V>());
}
// Private factory constructor called by generated code for map literals.
@NoThrows() @NoInline()
factory LinkedHashMap._empty() {
- return new JsLinkedHashMap<K, V>.es6();
+ return new JsLinkedHashMap<K, V>();
}
}
-// TODO(floitsch): use ES6 Maps when available.
class _LinkedIdentityHashMap<K, V> extends JsLinkedHashMap<K, V> {
int internalComputeHashCode(var key) {
// We force the hash codes to be unsigned 30-bit integers to avoid
@@ -552,12 +550,10 @@ class _LinkedIdentityHashMap<K, V> extends JsLinkedHashMap<K, V> {
}
}
-// TODO(floitsch): use ES6 maps when available.
class _LinkedCustomHashMap<K, V> extends JsLinkedHashMap<K, V> {
final _Equality<K> _equals;
final _Hasher<K> _hashCode;
final _Predicate _validKey;
-
_LinkedCustomHashMap(this._equals, this._hashCode,
bool validKey(potentialKey))
: _validKey = (validKey != null) ? validKey : ((v) => v is K);
« no previous file with comments | « pkg/compiler/lib/src/js_backend/namer.dart ('k') | sdk/lib/_internal/compiler/js_lib/linked_hash_map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698