Reland "[vm/compiler] Use pragmas instead of separately-maintained lists for inlining."

This closes https://github.com/dart-lang/sdk/issues/36571.

Change-Id: I14c623aba6b7183191ae93e294e26af9f4dcf34f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110441
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This commit is contained in:
Teagan Strickland 2019-07-30 13:14:57 +00:00 committed by commit-bot@chromium.org
parent e147c3e0c8
commit 4932ee6d80
22 changed files with 158 additions and 184 deletions

View file

@ -7,6 +7,7 @@
@pragma("vm:entry-point")
class _List<E> extends FixedLengthListBase<E> {
@pragma("vm:exact-result-type", _List)
@pragma("vm:prefer-inline")
factory _List(length) native "List_allocate";
E operator [](int index) native "List_getIndexed";
@ -18,8 +19,10 @@ class _List<E> extends FixedLengthListBase<E> {
void _setIndexed(int index, E value) native "List_setIndexed";
@pragma("vm:exact-result-type", "dart:core#_Smi")
@pragma("vm:prefer-inline")
int get length native "List_getLength";
@pragma("vm:prefer-inline")
List _slice(int start, int count, bool needsTypeArgument) {
if (count <= 64) {
final result = needsTypeArgument ? new _List<E>(count) : new _List(count);
@ -100,6 +103,7 @@ class _List<E> extends FixedLengthListBase<E> {
// Iterable interface.
@pragma("vm:prefer-inline")
void forEach(f(E element)) {
final length = this.length;
for (int i = 0; i < length; i++) {
@ -107,6 +111,7 @@ class _List<E> extends FixedLengthListBase<E> {
}
}
@pragma("vm:prefer-inline")
Iterator<E> get iterator {
return new _FixedSizeArrayIterator<E>(this);
}
@ -161,6 +166,7 @@ class _ImmutableList<E> extends UnmodifiableListBase<E> {
E operator [](int index) native "List_getIndexed";
@pragma("vm:exact-result-type", "dart:core#_Smi")
@pragma("vm:prefer-inline")
int get length native "List_getLength";
List<E> sublist(int start, [int end]) {
@ -178,6 +184,7 @@ class _ImmutableList<E> extends UnmodifiableListBase<E> {
// Collection interface.
@pragma("vm:prefer-inline")
void forEach(f(E element)) {
final length = this.length;
for (int i = 0; i < length; i++) {
@ -185,6 +192,7 @@ class _ImmutableList<E> extends UnmodifiableListBase<E> {
}
}
@pragma("vm:prefer-inline")
Iterator<E> get iterator {
return new _FixedSizeArrayIterator<E>(this);
}
@ -237,6 +245,7 @@ class _FixedSizeArrayIterator<E> implements Iterator<E> {
E get current => _current;
@pragma("vm:prefer-inline")
bool moveNext() {
if (_index >= _length) {
_current = null;

View file

@ -542,6 +542,7 @@ class _BigIntImpl implements BigInt {
/// Does *not* clear digits below ds.
///
/// Note: This function may be intrinsified.
@pragma("vm:never-inline")
static void _lsh(
Uint32List xDigits, int xUsed, int n, Uint32List resultDigits) {
assert(xUsed > 0);
@ -617,6 +618,7 @@ class _BigIntImpl implements BigInt {
/// resultDigits[0..resultUsed-1] = xDigits[0..xUsed-1] >> n.
///
/// Note: This function may be intrinsified.
@pragma("vm:never-inline")
static void _rsh(
Uint32List xDigits, int xUsed, int n, Uint32List resultDigits) {
assert(xUsed > 0);
@ -744,6 +746,7 @@ class _BigIntImpl implements BigInt {
/// used >= otherUsed > 0.
///
/// Note: This function may be intrinsified.
@pragma("vm:never-inline")
static void _absAdd(Uint32List digits, int used, Uint32List otherDigits,
int otherUsed, Uint32List resultDigits) {
assert(used >= otherUsed && otherUsed > 0);
@ -765,6 +768,7 @@ class _BigIntImpl implements BigInt {
/// used >= otherUsed > 0.
///
/// Note: This function may be intrinsified.
@pragma("vm:never-inline")
static void _absSub(Uint32List digits, int used, Uint32List otherDigits,
int otherUsed, Uint32List resultDigits) {
assert(used >= otherUsed && otherUsed > 0);
@ -1094,6 +1098,7 @@ class _BigIntImpl implements BigInt {
/// Note: This function may be intrinsified. Intrinsics on 64-bit platforms
/// process digit pairs at even indices and returns 2.
@pragma("vm:exact-result-type", "dart:core#_Smi")
@pragma("vm:never-inline")
static int _mulAdd(
Uint32List xDigits,
int xIndex,
@ -1145,6 +1150,7 @@ class _BigIntImpl implements BigInt {
/// Note: This function may be intrinsified. Intrinsics on 64-bit platforms
/// process digit pairs at even indices and returns 2.
@pragma("vm:exact-result-type", "dart:core#_Smi")
@pragma("vm:never-inline")
static int _sqrAdd(
Uint32List xDigits, int i, Uint32List acculumatorDigits, int used) {
int x = xDigits[i];
@ -1266,6 +1272,7 @@ class _BigIntImpl implements BigInt {
/// args[_divisorLowTopDigit.._divisorTopDigit]`.
/// Returns 2.
@pragma("vm:exact-result-type", "dart:core#_Smi")
@pragma("vm:never-inline")
static int _estimateQuotientDigit(Uint32List args, Uint32List digits, int i) {
// Verify that digit pairs are accessible for 64-bit processing.
assert(digits.length >= 4);
@ -2606,6 +2613,7 @@ class _BigIntMontgomeryReduction implements _BigIntReduction {
// args[_rhoDigit.._rhoHighDigit] * digits[i..i+1] mod _digitBase^2.
// Returns 2.
@pragma("vm:exact-result-type", "dart:core#_Smi")
@pragma("vm:never-inline")
static int _mulMod(Uint32List args, Uint32List digits, int i) {
var rhol = args[_rhoDigit] & _BigIntImpl._halfDigitMask;
var rhoh = args[_rhoDigit] >> _BigIntImpl._halfDigitBits;

View file

@ -47,23 +47,33 @@ abstract class _HashFieldBase {
// Base class for VM-internal classes; keep in sync with _HashFieldBase.
abstract class _HashVMBase {
@pragma("vm:exact-result-type", "dart:typed_data#_Uint32List")
@pragma("vm:prefer-inline")
Uint32List get _index native "LinkedHashMap_getIndex";
@pragma("vm:prefer-inline")
void set _index(Uint32List value) native "LinkedHashMap_setIndex";
@pragma("vm:exact-result-type", "dart:core#_Smi")
@pragma("vm:prefer-inline")
int get _hashMask native "LinkedHashMap_getHashMask";
@pragma("vm:prefer-inline")
void set _hashMask(int value) native "LinkedHashMap_setHashMask";
@pragma("vm:exact-result-type", "dart:core#_List")
@pragma("vm:prefer-inline")
List get _data native "LinkedHashMap_getData";
@pragma("vm:prefer-inline")
void set _data(List value) native "LinkedHashMap_setData";
@pragma("vm:exact-result-type", "dart:core#_Smi")
@pragma("vm:prefer-inline")
int get _usedData native "LinkedHashMap_getUsedData";
@pragma("vm:prefer-inline")
void set _usedData(int value) native "LinkedHashMap_setUsedData";
@pragma("vm:exact-result-type", "dart:core#_Smi")
@pragma("vm:prefer-inline")
int get _deletedKeys native "LinkedHashMap_getDeletedKeys";
@pragma("vm:prefer-inline")
void set _deletedKeys(int value) native "LinkedHashMap_setDeletedKeys";
}

View file

@ -13,6 +13,7 @@ class _Double implements double {
int get _identityHashCode native "Double_hashCode";
@pragma("vm:exact-result-type", _Double)
@pragma("vm:never-inline")
double operator +(num other) {
return _add(other.toDouble());
}
@ -21,6 +22,7 @@ class _Double implements double {
double _add(double other) native "Double_add";
@pragma("vm:exact-result-type", _Double)
@pragma("vm:never-inline")
double operator -(num other) {
return _sub(other.toDouble());
}
@ -29,6 +31,7 @@ class _Double implements double {
double _sub(double other) native "Double_sub";
@pragma("vm:exact-result-type", _Double)
@pragma("vm:never-inline")
double operator *(num other) {
return _mul(other.toDouble());
}
@ -44,6 +47,7 @@ class _Double implements double {
int _trunc_div(double other) native "Double_trunc_div";
@pragma("vm:exact-result-type", _Double)
@pragma("vm:never-inline")
double operator /(num other) {
return _div(other.toDouble());
}
@ -68,6 +72,7 @@ class _Double implements double {
double operator -() native "Double_flipSignBit";
@pragma("vm:exact-result-type", bool)
@pragma("vm:never-inline")
bool operator ==(Object other) {
return (other is num) && _equal(other.toDouble());
}
@ -78,11 +83,13 @@ class _Double implements double {
bool _equalToInteger(int other) native "Double_equalToInteger";
@pragma("vm:exact-result-type", bool)
@pragma("vm:never-inline")
bool operator <(num other) {
return other > this;
}
@pragma("vm:exact-result-type", bool)
@pragma("vm:never-inline")
bool operator >(num other) {
return _greaterThan(other.toDouble());
}
@ -91,11 +98,13 @@ class _Double implements double {
bool _greaterThan(double other) native "Double_greaterThan";
@pragma("vm:exact-result-type", bool)
@pragma("vm:never-inline")
bool operator >=(num other) {
return (this == other) || (this > other);
}
@pragma("vm:exact-result-type", bool)
@pragma("vm:never-inline")
bool operator <=(num other) {
return (this == other) || (this < other);
}

View file

@ -108,9 +108,11 @@ class _GrowableList<T> extends ListBase<T> {
factory _GrowableList.withData(_List data) native "GrowableList_allocate";
@pragma("vm:exact-result-type", "dart:core#_Smi")
@pragma("vm:prefer-inline")
int get _capacity native "GrowableList_getCapacity";
@pragma("vm:exact-result-type", "dart:core#_Smi")
@pragma("vm:prefer-inline")
int get length native "GrowableList_getLength";
void set length(int new_length) {
@ -151,6 +153,7 @@ class _GrowableList<T> extends ListBase<T> {
void _setIndexed(int index, T value) native "GrowableList_setIndexed";
@pragma("vm:entry-point", "call")
@pragma("vm:prefer-inline")
void add(T value) {
var len = length;
if (len == _capacity) {
@ -204,6 +207,7 @@ class _GrowableList<T> extends ListBase<T> {
} while (true);
}
@pragma("vm:prefer-inline")
T removeLast() {
var len = length - 1;
var elem = this[len];
@ -272,6 +276,7 @@ class _GrowableList<T> extends ListBase<T> {
// Iterable interface.
@pragma("vm:prefer-inline")
void forEach(f(T element)) {
int initialLength = length;
for (int i = 0; i < length; i++) {
@ -363,6 +368,7 @@ class _GrowableList<T> extends ListBase<T> {
String toString() => ListBase.listToString(this);
@pragma("vm:prefer-inline")
Iterator<T> get iterator {
return new ListIterator<T>(this);
}

View file

@ -6,13 +6,17 @@
abstract class _IntegerImplementation implements int {
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
num operator +(num other) => other._addFromInteger(this);
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
num operator -(num other) => other._subFromInteger(this);
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
num operator *(num other) => other._mulFromInteger(this);
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
int operator ~/(num other) {
if ((other is int) && (other == 0)) {
throw const IntegerDivisionByZeroException();
@ -33,15 +37,19 @@ abstract class _IntegerImplementation implements int {
}
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
int operator -() {
return 0 - this;
}
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
int operator &(int other) => other._bitAndFromInteger(this);
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
int operator |(int other) => other._bitOrFromInteger(this);
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
int operator ^(int other) => other._bitXorFromInteger(this);
num remainder(num other) {
@ -75,26 +83,32 @@ abstract class _IntegerImplementation implements int {
}
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
int operator >>(int other) => other._shrFromInteger(this);
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
int operator <<(int other) => other._shlFromInteger(this);
@pragma("vm:exact-result-type", bool)
@pragma("vm:never-inline")
bool operator <(num other) {
return other > this;
}
@pragma("vm:exact-result-type", bool)
@pragma("vm:never-inline")
bool operator >(num other) {
return other._greaterThanFromInteger(this);
}
@pragma("vm:exact-result-type", bool)
@pragma("vm:never-inline")
bool operator >=(num other) {
return (this == other) || (this > other);
}
@pragma("vm:exact-result-type", bool)
@pragma("vm:never-inline")
bool operator <=(num other) {
return (this == other) || (this < other);
}
@ -104,6 +118,7 @@ abstract class _IntegerImplementation implements int {
native "Integer_greaterThanFromInteger";
@pragma("vm:exact-result-type", bool)
@pragma("vm:never-inline")
bool operator ==(Object other) {
if (other is num) {
return other._equalToInteger(this);

View file

@ -70,12 +70,14 @@ bool _inquireIs64Bit() native "Internal_inquireIs64Bit";
@pragma("vm:entry-point", "call")
@pragma("vm:exact-result-type", bool)
@pragma("vm:prefer-inline")
bool _classRangeCheck(int cid, int lowerLimit, int upperLimit) {
return cid >= lowerLimit && cid <= upperLimit;
}
// Utility class now only used by the VM.
class Lists {
@pragma("vm:prefer-inline")
static void copy(List src, int srcStart, List dst, int dstStart, int count) {
if (srcStart < dstStart) {
for (int i = srcStart + count - 1, j = dstStart + count - 1;

View file

@ -14,6 +14,7 @@ import "dart:typed_data" show Uint32List;
/// There are no parts of this patch library.
@patch
@pragma("vm:prefer-inline")
T min<T extends num>(T a, T b) {
// These partially redundant type checks improve code quality for dart2js.
// Most of the improvement is at call sites from the inferred non-null num
@ -43,6 +44,7 @@ T min<T extends num>(T a, T b) {
}
@patch
@pragma("vm:prefer-inline")
T max<T extends num>(T a, T b) {
// These partially redundant type checks improve code quality for dart2js.
// Most of the improvement is at call sites from the inferred non-null num
@ -76,6 +78,7 @@ T max<T extends num>(T a, T b) {
// If [x] is an [int] and [exponent] is a non-negative [int], the result is
// an [int], otherwise the result is a [double].
@patch
@pragma("vm:prefer-inline")
num pow(num x, num exponent) {
if ((x is int) && (exponent is int) && (exponent >= 0)) {
return _intPow(x, exponent);
@ -127,31 +130,41 @@ int _intPow(int base, int exponent) {
@patch
@pragma("vm:exact-result-type", "dart:core#_Double")
@pragma("vm:never-inline")
double atan2(num a, num b) => _atan2(a.toDouble(), b.toDouble());
@patch
@pragma("vm:exact-result-type", "dart:core#_Double")
@pragma("vm:never-inline")
double sin(num radians) => _sin(radians.toDouble());
@patch
@pragma("vm:exact-result-type", "dart:core#_Double")
@pragma("vm:never-inline")
double cos(num radians) => _cos(radians.toDouble());
@patch
@pragma("vm:exact-result-type", "dart:core#_Double")
@pragma("vm:never-inline")
double tan(num radians) => _tan(radians.toDouble());
@patch
@pragma("vm:exact-result-type", "dart:core#_Double")
@pragma("vm:never-inline")
double acos(num x) => _acos(x.toDouble());
@patch
@pragma("vm:exact-result-type", "dart:core#_Double")
@pragma("vm:never-inline")
double asin(num x) => _asin(x.toDouble());
@patch
@pragma("vm:exact-result-type", "dart:core#_Double")
@pragma("vm:never-inline")
double atan(num x) => _atan(x.toDouble());
@patch
@pragma("vm:exact-result-type", "dart:core#_Double")
@pragma("vm:never-inline")
double sqrt(num x) => _sqrt(x.toDouble());
@patch
@pragma("vm:prefer-inline")
double exp(num x) => _exp(x.toDouble());
@patch
@pragma("vm:prefer-inline")
double log(num x) => _log(x.toDouble());
double _atan2(double a, double b) native "Math_atan2";

View file

@ -14,6 +14,7 @@ class Object {
// The VM has its own implementation of equals.
@patch
@pragma("vm:exact-result-type", bool)
@pragma("vm:prefer-inline")
bool operator ==(other) native "Object_equals";
// Helpers used to implement hashCode. If a hashCode is used, we remember it

View file

@ -248,6 +248,7 @@ abstract class _StringBase implements String {
int codeUnitAt(int index); // Implemented in the subclasses.
@pragma("vm:exact-result-type", "dart:core#_Smi")
@pragma("vm:prefer-inline")
int get length native "String_getLength";
@pragma("vm:exact-result-type", bool)

View file

@ -2056,6 +2056,7 @@ abstract class _TypedList extends _TypedListBase {
// Methods implementing the collection interface.
@pragma("vm:exact-result-type", "dart:core#_Smi")
@pragma("vm:prefer-inline")
int get length native "TypedData_length";
// Internal utility methods.
@ -3709,12 +3710,15 @@ abstract class _TypedListView extends _TypedListBase implements TypedData {
}
@pragma("vm:non-nullable-result-type")
@pragma("vm:prefer-inline")
_TypedList get _typedData native "TypedDataView_typedData";
@pragma("vm:exact-result-type", "dart:core#_Smi")
@pragma("vm:prefer-inline")
int get offsetInBytes native "TypedDataView_offsetInBytes";
@pragma("vm:exact-result-type", "dart:core#_Smi")
@pragma("vm:prefer-inline")
int get length native "TypedDataView_length";
}
@ -3728,6 +3732,7 @@ class _Int8ArrayView extends _TypedListView
native "TypedDataView_Int8ArrayView_new";
// Method(s) implementing List interface.
@pragma("vm:prefer-inline")
int operator [](int index) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -3736,6 +3741,7 @@ class _Int8ArrayView extends _TypedListView
._getInt8(offsetInBytes + (index * Int8List.bytesPerElement));
}
@pragma("vm:prefer-inline")
void operator []=(int index, int value) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -3765,6 +3771,7 @@ class _Uint8ArrayView extends _TypedListView
native "TypedDataView_Uint8ArrayView_new";
// Method(s) implementing List interface.
@pragma("vm:prefer-inline")
int operator [](int index) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -3773,6 +3780,7 @@ class _Uint8ArrayView extends _TypedListView
._getUint8(offsetInBytes + (index * Uint8List.bytesPerElement));
}
@pragma("vm:prefer-inline")
void operator []=(int index, int value) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -3802,6 +3810,7 @@ class _Uint8ClampedArrayView extends _TypedListView
int length) native "TypedDataView_Uint8ClampedArrayView_new";
// Method(s) implementing List interface.
@pragma("vm:prefer-inline")
int operator [](int index) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -3810,6 +3819,7 @@ class _Uint8ClampedArrayView extends _TypedListView
._getUint8(offsetInBytes + (index * Uint8List.bytesPerElement));
}
@pragma("vm:prefer-inline")
void operator []=(int index, int value) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -3839,6 +3849,7 @@ class _Int16ArrayView extends _TypedListView
native "TypedDataView_Int16ArrayView_new";
// Method(s) implementing List interface.
@pragma("vm:prefer-inline")
int operator [](int index) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -3847,6 +3858,7 @@ class _Int16ArrayView extends _TypedListView
._getInt16(offsetInBytes + (index * Int16List.bytesPerElement));
}
@pragma("vm:prefer-inline")
void operator []=(int index, int value) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -3888,6 +3900,7 @@ class _Uint16ArrayView extends _TypedListView
native "TypedDataView_Uint16ArrayView_new";
// Method(s) implementing List interface.
@pragma("vm:prefer-inline")
int operator [](int index) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -3896,6 +3909,7 @@ class _Uint16ArrayView extends _TypedListView
._getUint16(offsetInBytes + (index * Uint16List.bytesPerElement));
}
@pragma("vm:prefer-inline")
void operator []=(int index, int value) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -3938,6 +3952,7 @@ class _Int32ArrayView extends _TypedListView
native "TypedDataView_Int32ArrayView_new";
// Method(s) implementing List interface.
@pragma("vm:prefer-inline")
int operator [](int index) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -3946,6 +3961,7 @@ class _Int32ArrayView extends _TypedListView
._getInt32(offsetInBytes + (index * Int32List.bytesPerElement));
}
@pragma("vm:prefer-inline")
void operator []=(int index, int value) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -3975,6 +3991,7 @@ class _Uint32ArrayView extends _TypedListView
native "TypedDataView_Uint32ArrayView_new";
// Method(s) implementing List interface.
@pragma("vm:prefer-inline")
int operator [](int index) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -3983,6 +4000,7 @@ class _Uint32ArrayView extends _TypedListView
._getUint32(offsetInBytes + (index * Uint32List.bytesPerElement));
}
@pragma("vm:prefer-inline")
void operator []=(int index, int value) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -4012,6 +4030,7 @@ class _Int64ArrayView extends _TypedListView
native "TypedDataView_Int64ArrayView_new";
// Method(s) implementing List interface.
@pragma("vm:prefer-inline")
int operator [](int index) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -4020,6 +4039,7 @@ class _Int64ArrayView extends _TypedListView
._getInt64(offsetInBytes + (index * Int64List.bytesPerElement));
}
@pragma("vm:prefer-inline")
void operator []=(int index, int value) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -4049,6 +4069,7 @@ class _Uint64ArrayView extends _TypedListView
native "TypedDataView_Uint64ArrayView_new";
// Method(s) implementing List interface.
@pragma("vm:prefer-inline")
int operator [](int index) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -4057,6 +4078,7 @@ class _Uint64ArrayView extends _TypedListView
._getUint64(offsetInBytes + (index * Uint64List.bytesPerElement));
}
@pragma("vm:prefer-inline")
void operator []=(int index, int value) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -4086,6 +4108,7 @@ class _Float32ArrayView extends _TypedListView
native "TypedDataView_Float32ArrayView_new";
// Method(s) implementing List interface.
@pragma("vm:prefer-inline")
double operator [](int index) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -4094,6 +4117,7 @@ class _Float32ArrayView extends _TypedListView
._getFloat32(offsetInBytes + (index * Float32List.bytesPerElement));
}
@pragma("vm:prefer-inline")
void operator []=(int index, double value) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -4123,6 +4147,7 @@ class _Float64ArrayView extends _TypedListView
native "TypedDataView_Float64ArrayView_new";
// Method(s) implementing List interface.
@pragma("vm:prefer-inline")
double operator [](int index) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -4131,6 +4156,7 @@ class _Float64ArrayView extends _TypedListView
._getFloat64(offsetInBytes + (index * Float64List.bytesPerElement));
}
@pragma("vm:prefer-inline")
void operator []=(int index, double value) {
if (index < 0 || index >= length) {
throw new RangeError.index(index, this, "index");
@ -4282,6 +4308,7 @@ class _ByteDataView implements ByteData {
// Method(s) implementing ByteData interface.
@pragma("vm:prefer-inline")
int getInt8(int byteOffset) {
if (byteOffset < 0 || byteOffset >= length) {
throw new RangeError.index(byteOffset, this, "byteOffset");
@ -4289,6 +4316,7 @@ class _ByteDataView implements ByteData {
return _typedData._getInt8(offsetInBytes + byteOffset);
}
@pragma("vm:prefer-inline")
void setInt8(int byteOffset, int value) {
if (byteOffset < 0 || byteOffset >= length) {
throw new RangeError.index(byteOffset, this, "byteOffset");
@ -4296,6 +4324,7 @@ class _ByteDataView implements ByteData {
_typedData._setInt8(offsetInBytes + byteOffset, value);
}
@pragma("vm:prefer-inline")
int getUint8(int byteOffset) {
if (byteOffset < 0 || byteOffset >= length) {
throw new RangeError.index(byteOffset, this, "byteOffset");
@ -4303,6 +4332,7 @@ class _ByteDataView implements ByteData {
return _typedData._getUint8(offsetInBytes + byteOffset);
}
@pragma("vm:prefer-inline")
void setUint8(int byteOffset, int value) {
if (byteOffset < 0 || byteOffset >= length) {
throw new RangeError.index(byteOffset, this, "byteOffset");
@ -4310,6 +4340,7 @@ class _ByteDataView implements ByteData {
_typedData._setUint8(offsetInBytes + byteOffset, value);
}
@pragma("vm:prefer-inline")
int getInt16(int byteOffset, [Endian endian = Endian.big]) {
if (byteOffset < 0 || byteOffset + 1 >= length) {
throw new RangeError.range(byteOffset, 0, length - 2, "byteOffset");
@ -4321,6 +4352,7 @@ class _ByteDataView implements ByteData {
return _byteSwap16(result).toSigned(16);
}
@pragma("vm:prefer-inline")
void setInt16(int byteOffset, int value, [Endian endian = Endian.big]) {
if (byteOffset < 0 || byteOffset + 1 >= length) {
throw new RangeError.range(byteOffset, 0, length - 2, "byteOffset");
@ -4329,6 +4361,7 @@ class _ByteDataView implements ByteData {
identical(endian, Endian.host) ? value : _byteSwap16(value));
}
@pragma("vm:prefer-inline")
int getUint16(int byteOffset, [Endian endian = Endian.big]) {
if (byteOffset < 0 || byteOffset + 1 >= length) {
throw new RangeError.range(byteOffset, 0, length - 2, "byteOffset");
@ -4340,6 +4373,7 @@ class _ByteDataView implements ByteData {
return _byteSwap16(result);
}
@pragma("vm:prefer-inline")
void setUint16(int byteOffset, int value, [Endian endian = Endian.big]) {
if (byteOffset < 0 || byteOffset + 1 >= length) {
throw new RangeError.range(byteOffset, 0, length - 2, "byteOffset");
@ -4348,6 +4382,7 @@ class _ByteDataView implements ByteData {
identical(endian, Endian.host) ? value : _byteSwap16(value));
}
@pragma("vm:prefer-inline")
int getInt32(int byteOffset, [Endian endian = Endian.big]) {
if (byteOffset < 0 || byteOffset + 3 >= length) {
throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset");
@ -4359,6 +4394,7 @@ class _ByteDataView implements ByteData {
return _byteSwap32(result).toSigned(32);
}
@pragma("vm:prefer-inline")
void setInt32(int byteOffset, int value, [Endian endian = Endian.big]) {
if (byteOffset < 0 || byteOffset + 3 >= length) {
throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset");
@ -4367,6 +4403,7 @@ class _ByteDataView implements ByteData {
identical(endian, Endian.host) ? value : _byteSwap32(value));
}
@pragma("vm:prefer-inline")
int getUint32(int byteOffset, [Endian endian = Endian.big]) {
if (byteOffset < 0 || byteOffset + 3 >= length) {
throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset");
@ -4378,6 +4415,7 @@ class _ByteDataView implements ByteData {
return _byteSwap32(result);
}
@pragma("vm:prefer-inline")
void setUint32(int byteOffset, int value, [Endian endian = Endian.big]) {
if (byteOffset < 0 || byteOffset + 3 >= length) {
throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset");
@ -4386,6 +4424,7 @@ class _ByteDataView implements ByteData {
identical(endian, Endian.host) ? value : _byteSwap32(value));
}
@pragma("vm:prefer-inline")
int getInt64(int byteOffset, [Endian endian = Endian.big]) {
if (byteOffset < 0 || byteOffset + 7 >= length) {
throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset");
@ -4397,6 +4436,7 @@ class _ByteDataView implements ByteData {
return _byteSwap64(result).toSigned(64);
}
@pragma("vm:prefer-inline")
void setInt64(int byteOffset, int value, [Endian endian = Endian.big]) {
if (byteOffset < 0 || byteOffset + 7 >= length) {
throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset");
@ -4405,6 +4445,7 @@ class _ByteDataView implements ByteData {
identical(endian, Endian.host) ? value : _byteSwap64(value));
}
@pragma("vm:prefer-inline")
int getUint64(int byteOffset, [Endian endian = Endian.big]) {
if (byteOffset < 0 || byteOffset + 7 >= length) {
throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset");
@ -4416,6 +4457,7 @@ class _ByteDataView implements ByteData {
return _byteSwap64(result);
}
@pragma("vm:prefer-inline")
void setUint64(int byteOffset, int value, [Endian endian = Endian.big]) {
if (byteOffset < 0 || byteOffset + 7 >= length) {
throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset");
@ -4424,6 +4466,7 @@ class _ByteDataView implements ByteData {
identical(endian, Endian.host) ? value : _byteSwap64(value));
}
@pragma("vm:prefer-inline")
double getFloat32(int byteOffset, [Endian endian = Endian.big]) {
if (byteOffset < 0 || byteOffset + 3 >= length) {
throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset");
@ -4436,6 +4479,7 @@ class _ByteDataView implements ByteData {
return _convF32[0];
}
@pragma("vm:prefer-inline")
void setFloat32(int byteOffset, double value, [Endian endian = Endian.big]) {
if (byteOffset < 0 || byteOffset + 3 >= length) {
throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset");
@ -4448,6 +4492,7 @@ class _ByteDataView implements ByteData {
_typedData._setUint32(offsetInBytes + byteOffset, _byteSwap32(_convU32[0]));
}
@pragma("vm:prefer-inline")
double getFloat64(int byteOffset, [Endian endian = Endian.big]) {
if (byteOffset < 0 || byteOffset + 7 >= length) {
throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset");
@ -4460,6 +4505,7 @@ class _ByteDataView implements ByteData {
return _convF64[0];
}
@pragma("vm:prefer-inline")
void setFloat64(int byteOffset, double value, [Endian endian = Endian.big]) {
if (byteOffset < 0 || byteOffset + 7 >= length) {
throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset");
@ -4490,25 +4536,31 @@ class _ByteDataView implements ByteData {
}
@pragma("vm:non-nullable-result-type")
@pragma("vm:prefer-inline")
_TypedList get _typedData native "TypedDataView_typedData";
@pragma("vm:exact-result-type", "dart:core#_Smi")
@pragma("vm:prefer-inline")
int get offsetInBytes native "TypedDataView_offsetInBytes";
@pragma("vm:exact-result-type", "dart:core#_Smi")
@pragma("vm:prefer-inline")
int get length native "TypedDataView_length";
}
@pragma("vm:prefer-inline")
int _byteSwap16(int value) {
return ((value & 0xFF00) >> 8) | ((value & 0x00FF) << 8);
}
@pragma("vm:prefer-inline")
int _byteSwap32(int value) {
value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8);
value = ((value & 0xFFFF0000) >> 16) | ((value & 0x0000FFFF) << 16);
return value;
}
@pragma("vm:prefer-inline")
int _byteSwap64(int value) {
return (_byteSwap32(value) << 32) | _byteSwap32(value >> 32);
}
@ -4519,16 +4571,19 @@ final _convF32 = new Float32List.view(_convU32.buffer);
final _convF64 = new Float64List.view(_convU32.buffer);
// Top level utility methods.
@pragma("vm:prefer-inline")
int _toInt(int value, int mask) {
value &= mask;
if (value > (mask >> 1)) value -= mask + 1;
return value;
}
@pragma("vm:prefer-inline")
int _toInt8(int value) {
return _toInt(value, 0xFF);
}
@pragma("vm:prefer-inline")
int _toUint8(int value) {
return value & 0xFF;
}
@ -4540,18 +4595,22 @@ int _toClampedUint8(int value) {
return value;
}
@pragma("vm:prefer-inline")
int _toInt16(int value) {
return _toInt(value, 0xFFFF);
}
@pragma("vm:prefer-inline")
int _toUint16(int value) {
return value & 0xFFFF;
}
@pragma("vm:prefer-inline")
int _toInt32(int value) {
return _toInt(value, 0xFFFFFFFF);
}
@pragma("vm:prefer-inline")
int _toUint32(int value) {
return value & 0xFFFFFFFF;
}

View file

@ -35,19 +35,19 @@ List<String> stops = [];
List<String> expected = [
"$file:${LINE + 0}:17", // on "Foo" (in "new Foo()")
"$file:${LINE + 1}:11", // on "="
"list.dart:100:24", // on parameter to "contains"
"list.dart:101:23", // on "length" in "this.length"
"list.dart:102:16", // on "=" in "i = 0"
"list.dart:102:23", // on "<" in "i < length"
"list.dart:103:15", // on "[" in "this[i]"
"list.dart:101:24", // on parameter to "contains"
"list.dart:102:23", // on "length" in "this.length"
"list.dart:103:16", // on "=" in "i = 0"
"list.dart:103:23", // on "<" in "i < length"
"list.dart:104:15", // on "[" in "this[i]"
"$file:${LINE + 13}:23", // on parameter in "operator []"
"$file:${LINE + 14}:5", // on "return"
"list.dart:103:19", // on "=="
"list.dart:104:26", // on "length" in "this.length"
"list.dart:104:18", // on "!="
"list.dart:102:34", // on "++" in "i++"
"list.dart:102:23", // on "<" in "i < length"
"list.dart:108:5", // on "return"
"list.dart:104:19", // on "=="
"list.dart:105:26", // on "length" in "this.length"
"list.dart:105:18", // on "!="
"list.dart:103:34", // on "++" in "i++"
"list.dart:103:23", // on "<" in "i < length"
"list.dart:109:5", // on "return"
"$file:${LINE + 4}:5", // on "print"
"$file:${LINE + 6}:1" // on ending '}'
];

View file

@ -1248,7 +1248,8 @@ bool AotCallSpecializer::TryReplaceInstanceOfWithRangeCheck(
const Function& target = Function::ZoneHandle(
Z, dart_internal.LookupFunctionAllowPrivate(target_name));
ASSERT(!target.IsNull());
ASSERT(target.IsRecognized() && target.always_inline());
ASSERT(target.IsRecognized());
ASSERT(FlowGraphInliner::FunctionHasPreferInlinePragma(target));
const intptr_t kTypeArgsLen = 0;
StaticCallInstr* new_call = new (Z) StaticCallInstr(

View file

@ -2587,8 +2587,6 @@ void Obfuscator::InitializeRenamingMap(Isolate* isolate) {
PreventRenaming(#class_name); \
PreventRenaming(#function_name); \
} while (0);
INLINE_WHITE_LIST(PREVENT_RENAMING)
INLINE_BLACK_LIST(PREVENT_RENAMING)
POLYMORPHIC_TARGET_LIST(PREVENT_RENAMING)
#undef PREVENT_RENAMING

View file

@ -509,14 +509,16 @@ static bool IsSmallLeaf(FlowGraph* graph) {
} else if (current->IsStaticCall()) {
const Function& function = current->AsStaticCall()->function();
const intptr_t inl_size = function.optimized_instruction_count();
const bool always_inline =
FlowGraphInliner::FunctionHasPreferInlinePragma(function);
// Accept a static call is always inlined in some way and add the
// cached size to the total instruction count. A reasonable guess
// is made if the count has not been collected yet (listed methods
// are never very large).
if (!function.always_inline() && !function.IsRecognized()) {
if (!always_inline && !function.IsRecognized()) {
return false;
}
if (!function.always_inline()) {
if (!always_inline) {
static constexpr intptr_t kAvgListedMethodSize = 20;
instruction_count +=
(inl_size == 0 ? kAvgListedMethodSize : inl_size);
@ -863,6 +865,11 @@ class CallSiteInliner : public ValueObject {
return false;
}
if (FlowGraphInliner::FunctionHasNeverInlinePragma(function)) {
TRACE_INLINING(THR_Print(" Bailout: vm:never-inline pragma\n"));
return false;
}
// Don't inline any intrinsified functions in precompiled mode
// to reduce code size and make sure we use the intrinsic code.
if (FLAG_precompiled_mode && function.is_intrinsic() &&
@ -901,11 +908,6 @@ class CallSiteInliner : public ValueObject {
return false;
}
if (FlowGraphInliner::FunctionHasNeverInlinePragma(function)) {
TRACE_INLINING(THR_Print(" Bailout: vm:never-inline pragma\n"));
return false;
}
// Apply early heuristics. For a specialized case
// (constants_arg_counts > 0), don't use a previously
// estimate of the call site and instruction counts.
@ -2302,7 +2304,7 @@ bool FlowGraphInliner::AlwaysInline(const Function& function) {
return true;
}
}
return MethodRecognizer::AlwaysInline(function);
return false;
}
int FlowGraphInliner::Inline() {

View file

@ -15,10 +15,6 @@ MethodRecognizer::Kind MethodRecognizer::RecognizeKind(
return function.recognized_kind();
}
bool MethodRecognizer::AlwaysInline(const Function& function) {
return function.always_inline();
}
bool MethodRecognizer::PolymorphicTarget(const Function& function) {
return function.is_polymorphic_target();
}
@ -219,22 +215,13 @@ void MethodRecognizer::InitializeState() {
UNREACHABLE(); \
}
#define SET_IS_ALWAYS_INLINE(class_name, function_name, dest, fp) \
SET_FUNCTION_BIT(class_name, function_name, dest, fp, set_always_inline, true)
#define SET_IS_NEVER_INLINE(class_name, function_name, dest, fp) \
SET_FUNCTION_BIT(class_name, function_name, dest, fp, set_is_inlinable, false)
#define SET_IS_POLYMORPHIC_TARGET(class_name, function_name, dest, fp) \
SET_FUNCTION_BIT(class_name, function_name, dest, fp, \
set_is_polymorphic_target, true)
INLINE_WHITE_LIST(SET_IS_ALWAYS_INLINE);
INLINE_BLACK_LIST(SET_IS_NEVER_INLINE);
POLYMORPHIC_TARGET_LIST(SET_IS_POLYMORPHIC_TARGET);
#undef SET_RECOGNIZED_KIND
#undef SET_IS_ALWAYS_INLINE
#undef SET_IS_POLYMORPHIC_TARGET
#undef SET_FUNCTION_BIT
}

View file

@ -35,7 +35,6 @@ class MethodRecognizer : public AllStatic {
};
static Kind RecognizeKind(const Function& function);
static bool AlwaysInline(const Function& function);
static bool PolymorphicTarget(const Function& function);
static intptr_t NumArgsCheckedForStaticCall(const Function& function);

View file

@ -367,149 +367,6 @@ namespace dart {
ALL_INTRINSICS_LIST(V) \
GRAPH_INTRINSICS_LIST(V)
// A list of core function that should always be inlined.
#define INLINE_WHITE_LIST(V) \
V(Object, ==, ObjectEquals, 0x7b32a55a) \
V(_List, get:length, ObjectArrayLength, 0x25952390) \
V(_ImmutableList, get:length, ImmutableArrayLength, 0x25952390) \
V(_TypedListView, get:offsetInBytes, TypedDataViewOffsetInBytes, 0x0) \
V(_TypedListView, get:_typedData, TypedDataViewTypedData, 0x0) \
V(_TypedList, get:length, TypedListLength, 0x0) \
V(_TypedListView, get:length, TypedListViewLength, 0x0) \
V(_ByteDataView, get:length, ByteDataViewLength, 0x0) \
V(_GrowableList, get:length, GrowableArrayLength, 0x18dd86b4) \
V(_GrowableList, get:_capacity, GrowableArrayCapacity, 0x2e04be60) \
V(_GrowableList, add, GrowableListAdd, 0x40b490b8) \
V(_GrowableList, removeLast, GrowableListRemoveLast, 0x007855e5) \
V(_StringBase, get:length, StringBaseLength, 0x2a2d03d1) \
V(ListIterator, moveNext, ListIteratorMoveNext, 0x2dca30ce) \
V(_FixedSizeArrayIterator, moveNext, FixedListIteratorMoveNext, 0x324eb20b) \
V(_GrowableList, get:iterator, GrowableArrayIterator, 0x5bd2ef37) \
V(_GrowableList, forEach, GrowableArrayForEach, 0x74900bb8) \
V(_List, ., ObjectArrayAllocate, 0x2121902f) \
V(ListMixin, get:isEmpty, ListMixinIsEmpty, 0x7be74d04) \
V(_List, get:iterator, ObjectArrayIterator, 0x6c851c55) \
V(_List, forEach, ObjectArrayForEach, 0x11406b13) \
V(_List, _slice, ObjectArraySlice, 0x4c865d1d) \
V(_ImmutableList, get:iterator, ImmutableArrayIterator, 0x6c851c55) \
V(_ImmutableList, forEach, ImmutableArrayForEach, 0x11406b13) \
V(_Int8ArrayView, [], Int8ArrayViewGetIndexed, 0x7e5a8458) \
V(_Int8ArrayView, []=, Int8ArrayViewSetIndexed, 0x62f615e4) \
V(_Uint8ArrayView, [], Uint8ArrayViewGetIndexed, 0x7d308247) \
V(_Uint8ArrayView, []=, Uint8ArrayViewSetIndexed, 0x65ba546e) \
V(_Uint8ClampedArrayView, [], Uint8ClampedArrayViewGetIndexed, 0x7d308247) \
V(_Uint8ClampedArrayView, []=, Uint8ClampedArrayViewSetIndexed, 0x65ba546e) \
V(_Uint16ArrayView, [], Uint16ArrayViewGetIndexed, 0xe96836dd) \
V(_Uint16ArrayView, []=, Uint16ArrayViewSetIndexed, 0x15b02947) \
V(_Int16ArrayView, [], Int16ArrayViewGetIndexed, 0x1b24a48b) \
V(_Int16ArrayView, []=, Int16ArrayViewSetIndexed, 0xb91ec2e6) \
V(_Uint32ArrayView, [], Uint32ArrayViewGetIndexed, 0x8a4f93b3) \
V(_Uint32ArrayView, []=, Uint32ArrayViewSetIndexed, 0xf54918b5) \
V(_Int32ArrayView, [], Int32ArrayViewGetIndexed, 0x85040819) \
V(_Int32ArrayView, []=, Int32ArrayViewSetIndexed, 0xaec8c6f5) \
V(_Uint64ArrayView, [], Uint64ArrayViewGetIndexed, 0xd0c44fe7) \
V(_Uint64ArrayView, []=, Uint64ArrayViewSetIndexed, 0x402712b7) \
V(_Int64ArrayView, [], Int64ArrayViewGetIndexed, 0xf3090b95) \
V(_Int64ArrayView, []=, Int64ArrayViewSetIndexed, 0xca07e497) \
V(_Float32ArrayView, [], Float32ArrayViewGetIndexed, 0xef967533) \
V(_Float32ArrayView, []=, Float32ArrayViewSetIndexed, 0xc9b691bd) \
V(_Float64ArrayView, [], Float64ArrayViewGetIndexed, 0x9d83f585) \
V(_Float64ArrayView, []=, Float64ArrayViewSetIndexed, 0x3c1adabd) \
V(_ByteDataView, get:length, ByteDataViewLength, 0x0) \
V(_ByteDataView, get:offsetInBytes, ByteDataViewOffsetInBytes, 0x0) \
V(_ByteDataView, get:_typedData, ByteDataViewTypedData, 0x0) \
V(_ByteDataView, setInt8, ByteDataViewSetInt8, 0x6395293e) \
V(_ByteDataView, setUint8, ByteDataViewSetUint8, 0x79979d1f) \
V(_ByteDataView, setInt16, ByteDataViewSetInt16, 0x525ec534) \
V(_ByteDataView, setUint16, ByteDataViewSetUint16, 0x48eda263) \
V(_ByteDataView, setInt32, ByteDataViewSetInt32, 0x523666fa) \
V(_ByteDataView, setUint32, ByteDataViewSetUint32, 0x5a4683da) \
V(_ByteDataView, setInt64, ByteDataViewSetInt64, 0x4283a650) \
V(_ByteDataView, setUint64, ByteDataViewSetUint64, 0x687a1892) \
V(_ByteDataView, setFloat32, ByteDataViewSetFloat32, 0x7d5784fd) \
V(_ByteDataView, setFloat64, ByteDataViewSetFloat64, 0x00101e3f) \
V(_ByteDataView, getInt8, ByteDataViewGetInt8, 0x68448b4d) \
V(_ByteDataView, getUint8, ByteDataViewGetUint8, 0x5d68cbf2) \
V(_ByteDataView, getInt16, ByteDataViewGetInt16, 0x691b5ead) \
V(_ByteDataView, getUint16, ByteDataViewGetUint16, 0x78b744d8) \
V(_ByteDataView, getInt32, ByteDataViewGetInt32, 0x3a0f4efa) \
V(_ByteDataView, getUint32, ByteDataViewGetUint32, 0x583261be) \
V(_ByteDataView, getInt64, ByteDataViewGetInt64, 0x77de471c) \
V(_ByteDataView, getUint64, ByteDataViewGetUint64, 0x0ffadc4b) \
V(_ByteDataView, getFloat32, ByteDataViewGetFloat32, 0x6a205749) \
V(_ByteDataView, getFloat64, ByteDataViewGetFloat64, 0x69f58d27) \
V(::, exp, MathExp, 0x32ab9efa) \
V(::, log, MathLog, 0x1ee8f9fc) \
V(::, max, MathMax, 0x377e8889) \
V(::, min, MathMin, 0x32ebc57d) \
V(::, pow, MathPow, 0x79efc5a2) \
V(::, _classRangeCheck, ClassRangeCheck, 0x2ae76b84) \
V(::, _toInt, ConvertMaskedInt, 0x713908fd) \
V(::, _toInt8, ConvertIntToInt8, 0x7484a780) \
V(::, _toUint8, ConvertIntToUint8, 0x0a15b522) \
V(::, _toInt16, ConvertIntToInt16, 0x0a83fcc6) \
V(::, _toUint16, ConvertIntToUint16, 0x6087d1af) \
V(::, _toInt32, ConvertIntToInt32, 0x62b451b9) \
V(::, _toUint32, ConvertIntToUint32, 0x17a8e085) \
V(::, _byteSwap16, ByteSwap16, 0x44f173be) \
V(::, _byteSwap32, ByteSwap32, 0x6219333b) \
V(::, _byteSwap64, ByteSwap64, 0x9abe57e0) \
V(Lists, copy, ListsCopy, 0x40e974f6) \
V(_HashVMBase, get:_index, LinkedHashMap_getIndex, 0x02477157) \
V(_HashVMBase, set:_index, LinkedHashMap_setIndex, 0x4fc8d5e0) \
V(_HashVMBase, get:_data, LinkedHashMap_getData, 0x2d7a70ac) \
V(_HashVMBase, set:_data, LinkedHashMap_setData, 0x0ec032e8) \
V(_HashVMBase, get:_usedData, LinkedHashMap_getUsedData, 0x088599ed) \
V(_HashVMBase, set:_usedData, LinkedHashMap_setUsedData, 0x5f42ca86) \
V(_HashVMBase, get:_hashMask, LinkedHashMap_getHashMask, 0x32f3b13b) \
V(_HashVMBase, set:_hashMask, LinkedHashMap_setHashMask, 0x7219c45b) \
V(_HashVMBase, get:_deletedKeys, LinkedHashMap_getDeletedKeys, 0x558481c2) \
V(_HashVMBase, set:_deletedKeys, LinkedHashMap_setDeletedKeys, 0x5aa9888d) \
// A list of core function that should never be inlined.
#define INLINE_BLACK_LIST(V) \
V(::, asin, MathAsin, 0x2ecc2fcd) \
V(::, acos, MathAcos, 0x08cf2212) \
V(::, atan, MathAtan, 0x1e2731d5) \
V(::, atan2, MathAtan2, 0x39f1fa41) \
V(::, cos, MathCos, 0x459bf5fe) \
V(::, sin, MathSin, 0x6b7bd98c) \
V(::, sqrt, MathSqrt, 0x70482cf3) \
V(::, tan, MathTan, 0x3bcd772a) \
V(_BigIntImpl, _lsh, Bigint_lsh, 0x5b6cfc8b) \
V(_BigIntImpl, _rsh, Bigint_rsh, 0x6ff14a49) \
V(_BigIntImpl, _absAdd, Bigint_absAdd, 0x5bf14238) \
V(_BigIntImpl, _absSub, Bigint_absSub, 0x1de5bd32) \
V(_BigIntImpl, _mulAdd, Bigint_mulAdd, 0x6f277966) \
V(_BigIntImpl, _sqrAdd, Bigint_sqrAdd, 0x68e4c8ea) \
V(_BigIntImpl, _estimateQuotientDigit, Bigint_estimateQuotientDigit, \
0x35456d91) \
V(_BigIntMontgomeryReduction, _mulMod, Montgomery_mulMod, 0x0f7b0375) \
V(_Double, >, Double_greaterThan, 0x4f1375a3) \
V(_Double, >=, Double_greaterEqualThan, 0x4260c184) \
V(_Double, <, Double_lessThan, 0x365d1eba) \
V(_Double, <=, Double_lessEqualThan, 0x74b5eb64) \
V(_Double, ==, Double_equal, 0x613492fc) \
V(_Double, +, Double_add, 0x53994370) \
V(_Double, -, Double_sub, 0x3b69d466) \
V(_Double, *, Double_mul, 0x2bb9bd5d) \
V(_Double, /, Double_div, 0x483eee28) \
V(_IntegerImplementation, +, Integer_add, 0x43d53af7) \
V(_IntegerImplementation, -, Integer_sub, 0x2dc22e03) \
V(_IntegerImplementation, *, Integer_mul, 0x4e7a1c24) \
V(_IntegerImplementation, ~/, Integer_truncDivide, 0x4efb2d39) \
V(_IntegerImplementation, unary-, Integer_negate, 0x428bf6fa) \
V(_IntegerImplementation, &, Integer_bitAnd, 0x5ab35f30) \
V(_IntegerImplementation, |, Integer_bitOr, 0x267fa107) \
V(_IntegerImplementation, ^, Integer_bitXor, 0x0c7b0230) \
V(_IntegerImplementation, >, Integer_greaterThan, 0x6599a6e1) \
V(_IntegerImplementation, ==, Integer_equal, 0x58abc487) \
V(_IntegerImplementation, <, Integer_lessThan, 0x365d1eba) \
V(_IntegerImplementation, <=, Integer_lessEqualThan, 0x74b5eb64) \
V(_IntegerImplementation, >=, Integer_greaterEqualThan, 0x4260c184) \
V(_IntegerImplementation, <<, Integer_shl, 0x371c45fa) \
V(_IntegerImplementation, >>, Integer_sar, 0x2b630578) \
// A list of core functions that internally dispatch based on received id.
#define POLYMORPHIC_TARGET_LIST(V) \
V(_StringBase, [], StringBaseCharAt, 0x7cbb8603) \

View file

@ -7295,7 +7295,6 @@ RawFunction* Function::New(const String& name,
result.set_is_redirecting(false);
result.set_is_generated_body(false);
result.set_has_pragma(false);
result.set_always_inline(false);
result.set_is_polymorphic_target(false);
result.set_is_no_such_method_forwarder(false);
NOT_IN_PRECOMPILED(result.set_state_bits(0));
@ -12530,8 +12529,6 @@ void Library::CheckFunctionFingerprints() {
all_libs.Add(&Library::ZoneHandle(Library::CollectionLibrary()));
all_libs.Add(&Library::ZoneHandle(Library::InternalLibrary()));
OTHER_RECOGNIZED_LIST(CHECK_FINGERPRINTS2);
INLINE_WHITE_LIST(CHECK_FINGERPRINTS);
INLINE_BLACK_LIST(CHECK_FINGERPRINTS);
POLYMORPHIC_TARGET_LIST(CHECK_FINGERPRINTS);
all_libs.Clear();

View file

@ -3030,7 +3030,6 @@ class Function : public Object {
// external: Just a declaration that expects to be defined in another patch
// file.
// generated_body: Has a generated body.
// always_inline: Should always be inlined.
// polymorphic_target: A polymorphic method.
// has_pragma: Has a @pragma decoration.
// no_such_method_forwarder: A stub method that just calls noSuchMethod.
@ -3048,7 +3047,6 @@ class Function : public Object {
V(Redirecting, is_redirecting) \
V(External, is_external) \
V(GeneratedBody, is_generated_body) \
V(AlwaysInline, always_inline) \
V(PolymorphicTarget, is_polymorphic_target) \
V(HasPragma, has_pragma) \
V(IsNoSuchMethodForwarder, is_no_such_method_forwarder)

View file

@ -67,6 +67,7 @@ abstract class ListMixin<E> implements List<E> {
}
}
@pragma("vm:prefer-inline")
bool get isEmpty => length == 0;
bool get isNotEmpty => !isEmpty;

View file

@ -331,6 +331,7 @@ class ListIterator<E> implements Iterator<E> {
E get current => _current;
@pragma("vm:prefer-inline")
bool moveNext() {
int length = _iterable.length;
if (_length != length) {