[ddc] Fix literal hex values

Change-Id: I3f5a0f5de5ac365e5a99dcedc9f4d87b32ebf87f
Issue: https://github.com/dart-lang/language/issues/2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230900
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This commit is contained in:
Nicholas Shahan 2022-02-01 22:59:15 +00:00 committed by Commit Bot
parent 8df763f266
commit ae4529a450
4 changed files with 43 additions and 43 deletions

View file

@ -181,7 +181,7 @@ class _HashSet<E> extends _InternalSet<E>
dart.identityEquals)) {
@notNull
Object? k = key;
var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, k.hashCode);
var buckets = JS('', '#.get(# & 0x3fffffff)', _keyMap, k.hashCode);
if (buckets != null) {
for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
k = JS('', '#[#]', buckets, i);
@ -199,7 +199,7 @@ class _HashSet<E> extends _InternalSet<E>
dart.identityEquals)) {
@notNull
Object? k = key;
var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, k.hashCode);
var buckets = JS('', '#.get(# & 0x3fffffff)', _keyMap, k.hashCode);
if (buckets != null) {
for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
k = JS('', '#[#]', buckets, i);
@ -222,7 +222,7 @@ class _HashSet<E> extends _InternalSet<E>
var keyMap = _keyMap;
@notNull
var k = key;
int hash = JS('!', '# & 0x3ffffff', k.hashCode);
int hash = JS('!', '# & 0x3fffffff', k.hashCode);
var buckets = JS('', '#.get(#)', keyMap, hash);
if (buckets == null) {
JS('', '#.set(#, [#])', keyMap, hash, key);
@ -237,7 +237,7 @@ class _HashSet<E> extends _InternalSet<E>
return false;
}
JS('', '#.add(#)', map, key);
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
return true;
}
@ -255,7 +255,7 @@ class _HashSet<E> extends _InternalSet<E>
JS('', '#.add(#)', map, key);
}
if (length != JS<int>('!', '#.size', map)) {
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
}
}
@ -267,7 +267,7 @@ class _HashSet<E> extends _InternalSet<E>
dart.identityEquals)) {
@notNull
Object? k = key;
int hash = JS('!', '# & 0x3ffffff', k.hashCode);
int hash = JS('!', '# & 0x3fffffff', k.hashCode);
var buckets = JS('', '#.get(#)', _keyMap, hash);
if (buckets == null) return false; // not found
for (int i = 0, n = JS('!', '#.length', buckets);;) {
@ -286,7 +286,7 @@ class _HashSet<E> extends _InternalSet<E>
}
var map = _map;
if (JS<bool>('!', '#.delete(#)', map, key)) {
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
return true;
}
return false;
@ -297,7 +297,7 @@ class _HashSet<E> extends _InternalSet<E>
if (JS<int>('!', '#.size', map) > 0) {
JS('', '#.clear()', map);
JS('', '#.clear()', _keyMap);
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
}
}
}
@ -356,7 +356,7 @@ class _IdentityHashSet<E> extends _InternalSet<E>
var map = _map;
if (JS<bool>('!', '#.has(#)', map, element)) return false;
JS('', '#.add(#)', map, element);
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
return true;
}
@ -367,13 +367,13 @@ class _IdentityHashSet<E> extends _InternalSet<E>
JS('', '#.add(#)', map, key);
}
if (length != JS<int>('!', '#.size', map)) {
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
}
}
bool remove(Object? element) {
if (JS<bool>('!', '#.delete(#)', _map, element)) {
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
return true;
}
return false;
@ -383,7 +383,7 @@ class _IdentityHashSet<E> extends _InternalSet<E>
var map = _map;
if (JS<int>('!', '#.size', map) > 0) {
JS('', '#.clear()', map);
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
}
}
}
@ -449,7 +449,7 @@ class _CustomHashSet<E> extends _InternalSet<E>
bool contains(Object? key) {
if (key is E) {
var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, _hashCode(key));
var buckets = JS('', '#.get(# & 0x3fffffff)', _keyMap, _hashCode(key));
if (buckets != null) {
var equals = _equals;
for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
@ -463,7 +463,7 @@ class _CustomHashSet<E> extends _InternalSet<E>
E? lookup(Object? key) {
if (key is E) {
var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, _hashCode(key));
var buckets = JS('', '#.get(# & 0x3fffffff)', _keyMap, _hashCode(key));
if (buckets != null) {
var equals = _equals;
for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
@ -477,7 +477,7 @@ class _CustomHashSet<E> extends _InternalSet<E>
bool add(E key) {
var keyMap = _keyMap;
var hash = JS<int>('!', '# & 0x3ffffff', _hashCode(key));
var hash = JS<int>('!', '# & 0x3fffffff', _hashCode(key));
var buckets = JS('', '#.get(#)', keyMap, hash);
if (buckets == null) {
JS('', '#.set(#, [#])', keyMap, hash, key);
@ -490,7 +490,7 @@ class _CustomHashSet<E> extends _InternalSet<E>
JS('', '#.push(#)', buckets, key);
}
JS('', '#.add(#)', _map, key);
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
return true;
}
@ -501,7 +501,7 @@ class _CustomHashSet<E> extends _InternalSet<E>
bool remove(Object? key) {
if (key is E) {
var hash = JS<int>('!', '# & 0x3ffffff', _hashCode(key));
var hash = JS<int>('!', '# & 0x3fffffff', _hashCode(key));
var keyMap = _keyMap;
var buckets = JS('', '#.get(#)', keyMap, hash);
if (buckets == null) return false; // not found
@ -515,7 +515,7 @@ class _CustomHashSet<E> extends _InternalSet<E>
JS('', '#.splice(#, 1)', buckets, i);
}
JS('', '#.delete(#)', _map, k);
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
return true;
}
}
@ -528,7 +528,7 @@ class _CustomHashSet<E> extends _InternalSet<E>
if (JS<int>('!', '#.size', map) > 0) {
JS('', '#.clear()', map);
JS('', '#.clear()', _keyMap);
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
}
}
}

View file

@ -69,7 +69,7 @@ class CustomHashMap<K, V> extends InternalMap<K, V> {
@notNull
bool containsKey(Object? key) {
if (key is K) {
var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, _hashCode(key));
var buckets = JS('', '#.get(# & 0x3fffffff)', _keyMap, _hashCode(key));
if (buckets != null) {
var equals = _equals;
for (int i = 0, n = JS<int>('!', '#.length', buckets); i < n; i++) {
@ -96,7 +96,7 @@ class CustomHashMap<K, V> extends InternalMap<K, V> {
V? operator [](Object? key) {
if (key is K) {
var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, _hashCode(key));
var buckets = JS('', '#.get(# & 0x3fffffff)', _keyMap, _hashCode(key));
if (buckets != null) {
var equals = _equals;
for (int i = 0, n = JS<int>('!', '#.length', buckets); i < n; i++) {
@ -113,7 +113,7 @@ class CustomHashMap<K, V> extends InternalMap<K, V> {
void operator []=(K key, V value) {
var keyMap = _keyMap;
int hash = JS('!', '# & 0x3ffffff', _hashCode(key));
int hash = JS('!', '# & 0x3fffffff', _hashCode(key));
var buckets = JS('', '#.get(#)', keyMap, hash);
if (buckets == null) {
JS('', '#.set(#, [#])', keyMap, hash, key);
@ -132,12 +132,12 @@ class CustomHashMap<K, V> extends InternalMap<K, V> {
}
}
JS('', '#.set(#, #)', _map, key, value);
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
}
V putIfAbsent(K key, V ifAbsent()) {
var keyMap = _keyMap;
int hash = JS('!', '# & 0x3ffffff', _hashCode(key));
int hash = JS('!', '# & 0x3fffffff', _hashCode(key));
var buckets = JS('', '#.get(#)', keyMap, hash);
if (buckets == null) {
JS('', '#.set(#, [#])', keyMap, hash, key);
@ -152,13 +152,13 @@ class CustomHashMap<K, V> extends InternalMap<K, V> {
V value = ifAbsent();
if (value == null) JS('', '# = null', value); // coerce undefined to null.
JS('', '#.set(#, #)', _map, key, value);
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
return value;
}
V? remove(Object? key) {
if (key is K) {
int hash = JS('!', '# & 0x3ffffff', _hashCode(key));
int hash = JS('!', '# & 0x3fffffff', _hashCode(key));
var keyMap = _keyMap;
var buckets = JS('', '#.get(#)', keyMap, hash);
if (buckets == null) return null; // not found
@ -174,7 +174,7 @@ class CustomHashMap<K, V> extends InternalMap<K, V> {
var map = _map;
V value = JS('', '#.get(#)', map, k);
JS('', '#.delete(#)', map, k);
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
return value == null ? null : value; // coerce undefined to null.
}
}
@ -187,7 +187,7 @@ class CustomHashMap<K, V> extends InternalMap<K, V> {
if (JS<int>('!', '#.size', map) > 0) {
JS('', '#.clear()', map);
JS('', '#.clear()', _keyMap);
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
}
}
}

View file

@ -50,7 +50,7 @@ class IdentityMap<K, V> extends InternalMap<K, V> {
other.forEach((key, value) {
JS('', '#.set(#, #)', map, key, value);
});
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
}
}
@ -64,7 +64,7 @@ class IdentityMap<K, V> extends InternalMap<K, V> {
int length = JS('!', '#.size', map);
JS('', '#.set(#, #)', map, key, value);
if (length != JS<int>('!', '#.size', map)) {
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
}
}
@ -75,14 +75,14 @@ class IdentityMap<K, V> extends InternalMap<K, V> {
V value = ifAbsent();
if (value == null) JS('', '# = null', value);
JS('', '#.set(#, #)', _map, key, value);
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
return value;
}
V? remove(Object? key) {
V value = JS('', '#.get(#)', _map, key);
if (JS<bool>('!', '#.delete(#)', _map, key)) {
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
}
return value == null ? null : value; // coerce undefined to null.
}
@ -90,7 +90,7 @@ class IdentityMap<K, V> extends InternalMap<K, V> {
void clear() {
if (JS<int>('!', '#.size', _map) > 0) {
JS('', '#.clear()', _map);
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
}
}
}

View file

@ -99,7 +99,7 @@ class LinkedMap<K, V> extends InternalMap<K, V> {
key = JS('', 'null');
} else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
dart.identityEquals)) {
var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, key.hashCode);
var buckets = JS('', '#.get(# & 0x3fffffff)', _keyMap, key.hashCode);
if (buckets != null) {
for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
K k = JS('', '#[#]', buckets, i);
@ -131,7 +131,7 @@ class LinkedMap<K, V> extends InternalMap<K, V> {
JS('', '#.set(#, #)', _map, key, value);
});
if (length != JS<int>('!', '#.size', map)) {
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
}
}
@ -140,7 +140,7 @@ class LinkedMap<K, V> extends InternalMap<K, V> {
key = JS('', 'null');
} else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
dart.identityEquals)) {
var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, key.hashCode);
var buckets = JS('', '#.get(# & 0x3fffffff)', _keyMap, key.hashCode);
if (buckets != null) {
for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
K k = JS('', '#[#]', buckets, i);
@ -164,7 +164,7 @@ class LinkedMap<K, V> extends InternalMap<K, V> {
int length = JS('', '#.size', map);
JS('', '#.set(#, #)', map, key, value);
if (length != JS<int>('!', '#.size', map)) {
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
}
}
@ -177,7 +177,7 @@ class LinkedMap<K, V> extends InternalMap<K, V> {
dart.identityEquals)) {
@notNull
K k = key;
var hash = JS<int>('!', '# & 0x3ffffff', k.hashCode);
var hash = JS<int>('!', '# & 0x3fffffff', k.hashCode);
var buckets = JS('', '#.get(#)', _keyMap, hash);
if (buckets == null) {
JS('', '#.set(#, [#])', _keyMap, hash, key);
@ -196,7 +196,7 @@ class LinkedMap<K, V> extends InternalMap<K, V> {
value = JS('', 'null');
}
JS('', '#.set(#, #)', map, key, value);
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
return value;
}
@ -206,7 +206,7 @@ class LinkedMap<K, V> extends InternalMap<K, V> {
} else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
dart.identityEquals)) {
@notNull
var hash = JS<int>('!', '# & 0x3ffffff', key.hashCode);
var hash = JS<int>('!', '# & 0x3fffffff', key.hashCode);
var buckets = JS('', '#.get(#)', _keyMap, hash);
if (buckets == null) return null; // not found
for (int i = 0, n = JS('!', '#.length', buckets);;) {
@ -226,7 +226,7 @@ class LinkedMap<K, V> extends InternalMap<K, V> {
var map = _map;
V value = JS('', '#.get(#)', map, key);
if (JS<bool>('!', '#.delete(#)', map, key)) {
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
}
return value == null ? null : value; // coerce undefined to null.
}
@ -236,14 +236,14 @@ class LinkedMap<K, V> extends InternalMap<K, V> {
if (JS<int>('!', '#.size', map) > 0) {
JS('', '#.clear()', map);
JS('', '#.clear()', _keyMap);
_modifications = (_modifications + 1) & 0x3ffffff;
_modifications = (_modifications + 1) & 0x3fffffff;
}
}
}
@NoReifyGeneric()
K putLinkedMapKey<K>(@notNull K key, keyMap) {
var hash = JS<int>('!', '# & 0x3ffffff', key.hashCode);
var hash = JS<int>('!', '# & 0x3fffffff', key.hashCode);
var buckets = JS('', '#.get(#)', keyMap, hash);
if (buckets == null) {
JS('', '#.set(#, [#])', keyMap, hash, key);