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

Side by Side Diff: test/dart_codegen/expect/collection/hash_map.dart

Issue 1055923002: Don't call dinvoke on Object methods (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Refactor dynamic target logic 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 unified diff | Download patch
OLDNEW
1 part of dart.collection; 1 part of dart.collection;
2 bool _defaultEquals(a, b) => a == b; 2 bool _defaultEquals(a, b) => a == b;
3 int _defaultHashCode(a) => DEVC$RT.cast(a.hashCode, dynamic, int, "DynamicCast" , """line 10, column 28 of dart:collection/hash_map.dart: """, a.hashCode is int , true); 3 int _defaultHashCode(a) => a.hashCode;
4 typedef bool _Equality<K>(K a, K b); 4 typedef bool _Equality<K>(K a, K b);
5 typedef int _Hasher<K>(K object); 5 typedef int _Hasher<K>(K object);
6 abstract class HashMap<K, V> implements Map<K, V> {external factory HashMap({ 6 abstract class HashMap<K, V> implements Map<K, V> {external factory HashMap({
7 bool equals(K key1, K key2), int hashCode(K key), bool isValidKey(potentialKey )} 7 bool equals(K key1, K key2), int hashCode(K key), bool isValidKey(potentialKey )}
8 ); 8 );
9 external factory HashMap.identity(); 9 external factory HashMap.identity();
10 factory HashMap.from(Map other) { 10 factory HashMap.from(Map other) {
11 HashMap<K, V> result = new HashMap<K, V>(); 11 HashMap<K, V> result = new HashMap<K, V>();
12 other.forEach((k, v) { 12 other.forEach((k, v) {
13 result[k] = DEVC$RT.cast(v, dynamic, V, "CompositeCast", """line 87, column 40 of dart:collection/hash_map.dart: """, v is V, false); 13 result[k] = DEVC$RT.cast(v, dynamic, V, "CompositeCast", """line 87, column 40 of dart:collection/hash_map.dart: """, v is V, false);
14 } 14 }
15 ); 15 );
16 return result; 16 return result;
17 } 17 }
18 factory HashMap.fromIterable(Iterable iterable, { 18 factory HashMap.fromIterable(Iterable iterable, {
19 K key(element), V value(element)} 19 K key(element), V value(element)}
20 ) { 20 ) {
21 HashMap<K, V> map = new HashMap<K, V>(); 21 HashMap<K, V> map = new HashMap<K, V>();
22 Maps._fillMapWithMappedIterable(map, iterable, key, value); 22 Maps._fillMapWithMappedIterable(map, iterable, key, value);
23 return map; 23 return map;
24 } 24 }
25 factory HashMap.fromIterables(Iterable<K> keys, Iterable<V> values) { 25 factory HashMap.fromIterables(Iterable<K> keys, Iterable<V> values) {
26 HashMap<K, V> map = new HashMap<K, V>(); 26 HashMap<K, V> map = new HashMap<K, V>();
27 Maps._fillMapWithIterables(map, keys, values); 27 Maps._fillMapWithIterables(map, keys, values);
28 return map; 28 return map;
29 } 29 }
30 } 30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698