[VM] Type _CompactIterator/_CompactIterable._table

With the [_table] field being `dynamic` we were unable to eliminate
checks for the [_isModifiedSince] method, since there is a dynamic call
site.

This CL adds a type to [_table] so [_isModifiedSince] does not need to
perform any checks (via package:vm/transf.../no_dynamic_invocations_annotator.dart)

Issue https://github.com/dart-lang/sdk/issues/31798

Change-Id: If773c4b63fab62d1ccdd2e783aa16c19f780000a
Reviewed-on: https://dart-review.googlesource.com/43423
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This commit is contained in:
Martin Kustermann
2018-03-01 14:03:28 +00:00
committed by commit-bot@chromium.org
parent a3b2c5addb
commit acf86bfb22
+5 -3
View File
@@ -115,6 +115,8 @@ abstract class _HashBase implements _HashVMBase {
int get _checkSum => _usedData + _deletedKeys;
bool _isModifiedSince(List oldData, int oldCheckSum) =>
!identical(_data, oldData) || (_checkSum != oldCheckSum);
int get length;
}
class _OperatorEqualsAndHashCode {
@@ -144,7 +146,7 @@ class _InternalLinkedHashMap<K, V> extends _HashVMBase
}
}
abstract class _LinkedHashMapMixin<K, V> implements _HashVMBase {
abstract class _LinkedHashMapMixin<K, V> implements _HashBase {
int _hashCode(e);
bool _equals(e1, e2);
int get _checkSum;
@@ -401,7 +403,7 @@ class _CompactLinkedCustomHashMap<K, V> extends _HashFieldBase
// Iterates through _data[_offset + _step], _data[_offset + 2*_step], ...
// and checks for concurrent modification.
class _CompactIterable<E> extends Iterable<E> {
final _table;
final _HashBase _table;
final List _data;
final int _len;
final int _offset;
@@ -419,7 +421,7 @@ class _CompactIterable<E> extends Iterable<E> {
}
class _CompactIterator<E> implements Iterator<E> {
final _table;
final _HashBase _table;
final List _data;
final int _len;
int _offset;