[kernel] Shift up specialized kernel tags

Before this CL kernel tags had specialized tags that was marked by the
single high bit, then using the three lowest bits for a value:

128 + value = 0b10000xxx
136 + value = 0b10001xxx
144 + value = 0b10010xxx

So the numbers from 128 to 151 is taken by this scheme, but because of
the high bit marking stuff being special we can't really use 152-256.

This CL shifts the specialized tags up so it instead uses the 3 highest
bits as a marker while still using the lower 3 bits for the value:

224 + value = 0b11100xxx
232 + value = 0b11101xxx
240 + value = 0b11110xxx

This takes up 224-247 and leave 248-255 unused. It would let us use
128-223 though.
(If we eventually need more we can probably remove one of the
specialized ranges (SpecializedVariableSet isn't used very much in
previously sampled dill files) and use 4 bits for tagging).

Additionally, a tool to print free tags has been added (via binary.md),
and the "binary version is in sync with VM" test has been prepared
for version > 99.

TEST=Existing tests.

Change-Id: If77b12cee6fc3801628dd67dc40afbb018ec8a61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284302
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This commit is contained in:
Jens Johansen 2023-02-21 15:21:38 +00:00 committed by Commit Queue
parent 4d07dc0199
commit 39b8f7bef4
9 changed files with 159 additions and 130 deletions

View file

@ -359,17 +359,17 @@ class BinaryMdDillReader {
if (s.trim().startsWith("Byte tag = ")) {
String tag = s.trim().substring("Byte tag = ".length);
if (tag.endsWith(";")) tag = tag.substring(0, tag.length - 1);
if (tag == "128 + N; // Where 0 <= N < 8.") {
if (tag == "224 + N; // Where 0 <= N < 8.") {
for (int n = 0; n < 8; ++n) {
tagToName[128 + n] = _binaryMdCurrentClass;
tagToName[224 + n] = _binaryMdCurrentClass;
}
} else if (tag == "136 + N; // Where 0 <= N < 8.") {
} else if (tag == "232 + N; // Where 0 <= N < 8.") {
for (int n = 0; n < 8; ++n) {
tagToName[136 + n] = _binaryMdCurrentClass;
tagToName[232 + n] = _binaryMdCurrentClass;
}
} else if (tag == "144 + N; // Where 0 <= N < 8.") {
} else if (tag == "240 + N; // Where 0 <= N < 8.") {
for (int n = 0; n < 8; ++n) {
tagToName[144 + n] = _binaryMdCurrentClass;
tagToName[240 + n] = _binaryMdCurrentClass;
}
} else {
if (tag.contains("; // Note: tag is out of order")) {

View file

@ -45,11 +45,11 @@ Future<void> main() async {
Map<int, String> vmConstantTagToName = {};
for (int i = 0; i < vmTagLines.length; i++) {
String line = vmTagLines[i];
if (line.startsWith(supportedVersion)) {
vmVersion = int.parse(line
.substring(line.indexOf(supportedVersion) + supportedVersion.length)
.substring(0, 2) // Assume version < 100 for now.
.trim());
if (line.contains(supportedVersion)) {
int supportedVersionIndex = line.indexOf(supportedVersion);
int start = supportedVersionIndex + supportedVersion.length;
int end = line.indexOf(";", supportedVersionIndex);
vmVersion = int.parse(line.substring(start, end).trim());
} else if (line.startsWith("#define KERNEL_TAG_LIST(V)")) {
while (true) {
RegExpMatch? match = tagParser.firstMatch(line);
@ -111,7 +111,7 @@ Future<void> main() async {
for (Field f in compareMe.tagClass.fields) {
// Class doesn't only contain tag stuff.
if (f.name.text.endsWith("Mask")) continue;
if (f.name.text.endsWith("HighBit")) continue;
if (f.name.text.endsWith("HighBits")) continue;
if (f.name.text.endsWith("Bias")) continue;
if (f.name.text == "ComponentFile") continue;
ConstantExpression value = f.initializer as ConstantExpression;

View file

@ -0,0 +1,26 @@
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:io' show File;
import '../test/binary_md_dill_reader.dart' show BinaryMdDillReader;
import '../test/utils/io_utils.dart' show computeRepoDir;
void main() {
File binaryMd = new File("$repoDir/pkg/kernel/binary.md");
String binaryMdContent = binaryMd.readAsStringSync();
BinaryMdDillReader binaryMdReader =
new BinaryMdDillReader(binaryMdContent, []);
binaryMdReader.setup();
for (int i = 0; i < 256; i++) {
if (!binaryMdReader.tagToName.containsKey(i)) {
print("Tag $i is free.");
}
}
}
final String repoDir = computeRepoDir();

View file

@ -154,9 +154,9 @@ class WrappedBinaryBuilder extends BinaryBuilder {
@override
Expression readExpression() {
int tagByte = peekByte();
int tag = tagByte & Tag.SpecializedTagHighBit == 0
? tagByte
: (tagByte & Tag.SpecializedTagMask);
int tag = tagByte & Tag.SpecializedTagHighBits == Tag.SpecializedTagHighBits
? (tagByte & Tag.SpecializedTagMask)
: tagByte;
expressionTypes[tag]++;
return super.readExpression();
}

View file

@ -147,7 +147,7 @@ type CanonicalName {
type ComponentFile {
UInt32 magic = 0x90ABCDEF;
UInt32 formatVersion = 93;
UInt32 formatVersion = 94;
Byte[10] shortSdkHash;
List<String> problemsAsJson; // Described in problems.md.
Library[] libraries;
@ -604,7 +604,7 @@ type VariableGet extends Expression {
}
type SpecializedVariableGet extends Expression {
Byte tag = 128 + N; // Where 0 <= N < 8.
Byte tag = 224 + N; // Where 0 <= N < 8.
// Equivalent to a VariableGet with index N.
FileOffset fileOffset;
// Byte offset in the binary for the variable declaration (without tag).
@ -621,7 +621,7 @@ type VariableSet extends Expression {
}
type SpecializedVariableSet extends Expression {
Byte tag = 136 + N; // Where 0 <= N < 8.
Byte tag = 232 + N; // Where 0 <= N < 8.
FileOffset fileOffset;
// Byte offset in the binary for the variable declaration (without tag).
UInt variableDeclarationPosition;
@ -1030,7 +1030,7 @@ type StringLiteral extends Expression {
type IntegerLiteral extends Expression {}
type SpecializedIntLiteral extends IntegerLiteral {
Byte tag = 144 + N; // Where 0 <= N < 8.
Byte tag = 240 + N; // Where 0 <= N < 8.
// Integer literal with value (N - 3), that is, an integer in range -3..4.
}

View file

@ -2153,9 +2153,9 @@ class BinaryBuilder {
Expression readExpression() {
int tagByte = readByte();
int tag = tagByte & Tag.SpecializedTagHighBit == 0
? tagByte
: (tagByte & Tag.SpecializedTagMask);
int tag = tagByte & Tag.SpecializedTagHighBits == Tag.SpecializedTagHighBits
? (tagByte & Tag.SpecializedTagMask)
: tagByte;
switch (tag) {
// 18.57% (13.56% - 23.28%).
case Tag.SpecializedVariableGet:

View file

@ -180,13 +180,14 @@ class Tag {
// 126 is occupied by [FunctionTearOff] (expression).
// 127 is occupied by [LocalFunctionInvocation] (expression).
static const int SpecializedTagHighBit = 0x80; // 10000000
static const int SpecializedTagMask = 0xF8; // 11111000
static const int SpecializedPayloadMask = 0x7; // 00000111
static const int SpecializedTagHighBits = 0xE0; // 0b11100000
static const int SpecializedTagMask = 0xF8; // 0b11111000
static const int SpecializedPayloadMask = 0x7; // 0b00000111
static const int SpecializedVariableGet = 128;
static const int SpecializedVariableSet = 136;
static const int SpecializedIntLiteral = 144;
static const int SpecializedVariableGet = 224; // 0b11100000
static const int SpecializedVariableSet = 232; // 0b11101000
static const int SpecializedIntLiteral = 240; // 0b11110000
// TODO: There's space for another special here (248, 0b11111000)
static const int SpecializedIntLiteralBias = 3;
@ -195,7 +196,7 @@ class Tag {
/// Internal version of kernel binary format.
/// Bump it when making incompatible changes in kernel binaries.
/// Keep in sync with runtime/vm/kernel_binary.h, pkg/kernel/binary.md.
static const int BinaryFormatVersion = 93;
static const int BinaryFormatVersion = 94;
}
abstract class ConstantTag {

View file

@ -16,9 +16,9 @@ namespace dart {
V(ClassID, getID, ClassIDgetID, 0xdc8b888a) \
V(Object, Object., ObjectConstructor, 0xab6d6cfa) \
V(_List, ., ObjectArrayAllocate, 0x4c9d39e2) \
V(_List, []=, ObjectArraySetIndexed, 0x050cd2ba) \
V(_List, []=, ObjectArraySetIndexed, 0x3a40deba) \
V(_GrowableList, ._withData, GrowableArrayAllocateWithData, 0x1947d8a1) \
V(_GrowableList, []=, GrowableArraySetIndexed, 0x050cd2ba) \
V(_GrowableList, []=, GrowableArraySetIndexed, 0x3a40deba) \
V(_Record, get:_fieldNames, Record_fieldNames, 0x68e5459d) \
V(_Record, get:_numFields, Record_numFields, 0x7bc20792) \
V(_Record, get:_shape, Record_shape, 0x70e120f3) \
@ -49,7 +49,7 @@ namespace dart {
V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 0x38c6295a) \
V(_TypedList, _setFloat64x2, ByteArrayBaseSetFloat64x2, 0xbaead73f) \
V(_TypedList, _setInt32x4, ByteArrayBaseSetInt32x4, 0x5ce9025b) \
V(ByteData, ., ByteDataFactory, 0x91f05063) \
V(ByteData, ., ByteDataFactory, 0x45f72003) \
V(_ByteDataView, get:offsetInBytes, ByteDataViewOffsetInBytes, 0x60cef22c) \
V(_ByteDataView, get:_typedData, ByteDataViewTypedData, 0xb9d15ffa) \
V(_TypedListView, get:offsetInBytes, TypedDataViewOffsetInBytes, 0x60cef22c) \
@ -114,10 +114,10 @@ namespace dart {
V(Float32x4List, ., TypedData_Float32x4Array_factory, 0x0a7d7b88) \
V(Int32x4List, ., TypedData_Int32x4Array_factory, 0x5a17b46e) \
V(Float64x2List, ., TypedData_Float64x2Array_factory, 0xeccaff6a) \
V(::, _toClampedUint8, ConvertIntToClampedUint8, 0x00fc4650) \
V(::, _toClampedUint8, ConvertIntToClampedUint8, 0xd0f3aeb0) \
V(::, copyRangeFromUint8ListToOneByteString, \
CopyRangeFromUint8ListToOneByteString, 0x19a1bf41) \
V(_StringBase, _interpolate, StringBaseInterpolate, 0x7da2a580) \
CopyRangeFromUint8ListToOneByteString, 0xcc5158c1) \
V(_StringBase, _interpolate, StringBaseInterpolate, 0x7c74b060) \
V(_SuspendState, get:_functionData, SuspendState_getFunctionData, \
0x7290026e) \
V(_SuspendState, set:_functionData, SuspendState_setFunctionData, \
@ -132,9 +132,9 @@ namespace dart {
0xc40903ac) \
V(_SuspendState, _clone, SuspendState_clone, 0xae1a40a0) \
V(_SuspendState, _createAsyncCallbacks, SuspendState_createAsyncCallbacks, \
0x967521b1) \
0x5e84c091) \
V(_SuspendState, _createAsyncStarCallback, \
SuspendState_createAsyncStarCallback, 0xa50f923c) \
SuspendState_createAsyncStarCallback, 0x98fb897c) \
V(_SuspendState, _resume, SuspendState_resume, 0x5d7a8489) \
V(_IntegerImplementation, toDouble, IntegerToDouble, 0x97728b46) \
V(_Double, _add, DoubleAdd, 0xea666327) \
@ -149,10 +149,10 @@ namespace dart {
V(_Double, roundToDouble, DoubleRoundToDouble, 0x5649ca00) \
V(_Double, toInt, DoubleToInteger, 0x676f20a9) \
V(_Double, truncateToDouble, DoubleTruncateToDouble, 0x62d48659) \
V(::, min, MathMin, 0xd0ef27f3) \
V(::, max, MathMax, 0xbbfa2f8c) \
V(::, _doublePow, MathDoublePow, 0x989f3334) \
V(::, _intPow, MathIntPow, 0xb9afc09a) \
V(::, min, MathMin, 0x82e75ed3) \
V(::, max, MathMax, 0x4b2fa26c) \
V(::, _doublePow, MathDoublePow, 0xaec8f454) \
V(::, _intPow, MathIntPow, 0xab56ffda) \
V(::, _sin, MathSin, 0x17daca03) \
V(::, _cos, MathCos, 0xf4947d45) \
V(::, _tan, MathTan, 0xeb1a5537) \
@ -266,7 +266,7 @@ namespace dart {
V(_WeakProperty, set:value, WeakProperty_setValue, 0x8b2bafab) \
V(_WeakReference, get:target, WeakReference_getTarget, 0xc990118a) \
V(_WeakReference, set:_target, WeakReference_setTarget, 0xc729697a) \
V(::, _classRangeCheck, ClassRangeCheck, 0x09f5fc7a) \
V(::, _classRangeCheck, ClassRangeCheck, 0xef3a447a) \
V(::, _abi, FfiAbi, 0x7c4ab3b4) \
V(::, _asFunctionInternal, FfiAsFunctionInternal, 0x631b1071) \
V(::, _nativeCallbackFunction, FfiNativeCallbackFunction, 0x3ff5ae9c) \
@ -315,11 +315,11 @@ namespace dart {
V(::, _asExternalTypedDataDouble, FfiAsExternalTypedDataDouble, 0x40cdd9e1) \
V(::, _getNativeField, GetNativeField, 0xa0139b85) \
V(::, reachabilityFence, ReachabilityFence, 0x730f2b7f) \
V(_Utf8Decoder, _scan, Utf8DecoderScan, 0xf296c901) \
V(_Future, timeout, FutureTimeout, 0xbc736ef8) \
V(Future, wait, FutureWait, 0x764434e5) \
V(_RootZone, runUnary, RootZoneRunUnary, 0x7168b20b) \
V(_FutureListener, handleValue, FutureListenerHandleValue, 0x25b39832) \
V(_Utf8Decoder, _scan, Utf8DecoderScan, 0xb99d2ee1) \
V(_Future, timeout, FutureTimeout, 0xe21f0bf8) \
V(Future, wait, FutureWait, 0xec000425) \
V(_RootZone, runUnary, RootZoneRunUnary, 0x64397ecb) \
V(_FutureListener, handleValue, FutureListenerHandleValue, 0xbf5d3892) \
V(::, has63BitSmis, Has63BitSmis, 0xf61b56f1) \
V(::, get:extensionStreamHasListener, ExtensionStreamHasListener, 0xfab46343)\
V(_Smi, get:hashCode, Smi_hashCode, 0x75e0ccd2) \
@ -331,28 +331,28 @@ namespace dart {
// (class-name, function-name, intrinsification method, fingerprint).
#define CORE_LIB_INTRINSIC_LIST(V) \
V(_Smi, get:bitLength, Smi_bitLength, 0x7ab50ceb) \
V(_BigIntImpl, _lsh, Bigint_lsh, 0x7a954122) \
V(_BigIntImpl, _rsh, Bigint_rsh, 0xb1f1cc5f) \
V(_BigIntImpl, _absAdd, Bigint_absAdd, 0x967b4d71) \
V(_BigIntImpl, _absSub, Bigint_absSub, 0x1cb6b94b) \
V(_BigIntImpl, _mulAdd, Bigint_mulAdd, 0xdc3298bd) \
V(_BigIntImpl, _sqrAdd, Bigint_sqrAdd, 0x6936f745) \
V(_BigIntImpl, _lsh, Bigint_lsh, 0x3fe316e2) \
V(_BigIntImpl, _rsh, Bigint_rsh, 0xde13d61f) \
V(_BigIntImpl, _absAdd, Bigint_absAdd, 0x2ac27a31) \
V(_BigIntImpl, _absSub, Bigint_absSub, 0x710dc9ab) \
V(_BigIntImpl, _mulAdd, Bigint_mulAdd, 0xa63c77fd) \
V(_BigIntImpl, _sqrAdd, Bigint_sqrAdd, 0x16a81645) \
V(_BigIntImpl, _estimateQuotientDigit, Bigint_estimateQuotientDigit, \
0xa5ad65a8) \
V(_BigIntMontgomeryReduction, _mulMod, Montgomery_mulMod, 0x9bcfdaf4) \
V(_Double, >, Double_greaterThan, 0x9872cc67) \
V(_Double, >=, Double_greaterEqualThan, 0xfecba6b3) \
V(_Double, <, Double_lessThan, 0xf07a87d4) \
V(_Double, <=, Double_lessEqualThan, 0xb6764495) \
V(_Double, ==, Double_equal, 0xa91c918f) \
V(_Double, +, Double_add, 0xc54725bf) \
V(_Double, -, Double_sub, 0xb8343210) \
V(_Double, *, Double_mul, 0xf9bb3c0d) \
V(_Double, /, Double_div, 0xefe9ca49) \
0x16d58948) \
V(_BigIntMontgomeryReduction, _mulMod, Montgomery_mulMod, 0xdc9e8f54) \
V(_Double, >, Double_greaterThan, 0x7b10d007) \
V(_Double, >=, Double_greaterEqualThan, 0x4abd1f73) \
V(_Double, <, Double_lessThan, 0xd3188b74) \
V(_Double, <=, Double_lessEqualThan, 0x0267bd55) \
V(_Double, ==, Double_equal, 0x2782d9ef) \
V(_Double, +, Double_add, 0xa7e5295f) \
V(_Double, -, Double_sub, 0x9ad235b0) \
V(_Double, *, Double_mul, 0xdc593fad) \
V(_Double, /, Double_div, 0xd287cde9) \
V(_Double, get:isNaN, Double_getIsNaN, 0xd4890713) \
V(_Double, get:isInfinite, Double_getIsInfinite, 0xc4facbd2) \
V(_Double, get:isNegative, Double_getIsNegative, 0xd4715091) \
V(_Double, _mulFromInteger, Double_mulFromInteger, 0x0a50d2cf) \
V(_Double, _mulFromInteger, Double_mulFromInteger, 0xeceed66f) \
V(_Double, .fromInteger, DoubleFromInteger, 0x7d0fd999) \
V(_RegExp, _ExecuteMatch, RegExp_ExecuteMatch, 0x9911d549) \
V(_RegExp, _ExecuteMatchSticky, RegExp_ExecuteMatchSticky, 0x91dd880f) \
@ -361,14 +361,14 @@ namespace dart {
V(Object, _haveSameRuntimeType, ObjectHaveSameRuntimeType, 0xce4e6295) \
V(_StringBase, get:hashCode, String_getHashCode, 0x75e0d454) \
V(_StringBase, get:_identityHashCode, String_identityHash, 0x47a56912) \
V(_StringBase, get:isEmpty, StringBaseIsEmpty, 0xfecd3cf3) \
V(_StringBase, _substringMatches, StringBaseSubstringMatches, 0x74e77732) \
V(_StringBase, get:isEmpty, StringBaseIsEmpty, 0x9876dd53) \
V(_StringBase, _substringMatches, StringBaseSubstringMatches, 0x853d4272) \
V(_StringBase, [], StringBaseCharAt, 0xd06fc6bf) \
V(_OneByteString, get:hashCode, OneByteString_getHashCode, 0x75e0d454) \
V(_OneByteString, _substringUncheckedNative, \
OneByteString_substringUnchecked, 0x9b18195e) \
V(_OneByteString, ==, OneByteString_equality, 0xb5003d69) \
V(_TwoByteString, ==, TwoByteString_equality, 0xb5003d69) \
V(_OneByteString, ==, OneByteString_equality, 0x4ea9ddc9) \
V(_TwoByteString, ==, TwoByteString_equality, 0x4ea9ddc9) \
V(_AbstractType, get:hashCode, AbstractType_getHashCode, 0x75e0d454) \
V(_AbstractType, ==, AbstractType_equality, 0x465868ae) \
V(_Type, get:hashCode, Type_getHashCode, 0x75e0d454) \
@ -376,50 +376,50 @@ namespace dart {
V(::, _getHash, Object_getHash, 0xc60ff758) \
#define CORE_INTEGER_LIB_INTRINSIC_LIST(V) \
V(_IntegerImplementation, >, Integer_greaterThan, 0xf741693b) \
V(_IntegerImplementation, ==, Integer_equal, 0xa8aba26a) \
V(_IntegerImplementation, >, Integer_greaterThan, 0xd9df6cdb) \
V(_IntegerImplementation, ==, Integer_equal, 0xe96bfe0a) \
V(_IntegerImplementation, _equalToInteger, Integer_equalToInteger, \
0x710f18c2) \
V(_IntegerImplementation, <, Integer_lessThan, 0xf07a87d4) \
V(_IntegerImplementation, <=, Integer_lessEqualThan, 0xb6764495) \
V(_IntegerImplementation, >=, Integer_greaterEqualThan, 0xfecba6b3) \
V(_IntegerImplementation, <<, Integer_shl, 0x4a95c65b) \
V(_IntegerImplementation, <, Integer_lessThan, 0xd3188b74) \
V(_IntegerImplementation, <=, Integer_lessEqualThan, 0x0267bd55) \
V(_IntegerImplementation, >=, Integer_greaterEqualThan, 0x4abd1f73) \
V(_IntegerImplementation, <<, Integer_shl, 0x2d33c9fb) \
#define GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \
V(_Int8List, [], Int8ArrayGetIndexed, 0x3cf7f9ce) \
V(_Int8List, []=, Int8ArraySetIndexed, 0xf6867b8f) \
V(_Uint8List, [], Uint8ArrayGetIndexed, 0xa2707d8e) \
V(_Uint8List, []=, Uint8ArraySetIndexed, 0x43158753) \
V(_ExternalUint8Array, [], ExternalUint8ArrayGetIndexed, 0xa2707d8e) \
V(_ExternalUint8Array, []=, ExternalUint8ArraySetIndexed, 0x43158753) \
V(_Uint8ClampedList, [], Uint8ClampedArrayGetIndexed, 0xa2707d8e) \
V(_Uint8ClampedList, []=, Uint8ClampedArraySetIndexed, 0x39153cf3) \
V(_Int8List, [], Int8ArrayGetIndexed, 0xb8b9bd6e) \
V(_Int8List, []=, Int8ArraySetIndexed, 0xd840a10f) \
V(_Uint8List, [], Uint8ArrayGetIndexed, 0x1e32412e) \
V(_Uint8List, []=, Uint8ArraySetIndexed, 0x24cfacd3) \
V(_ExternalUint8Array, [], ExternalUint8ArrayGetIndexed, 0x1e32412e) \
V(_ExternalUint8Array, []=, ExternalUint8ArraySetIndexed, 0x24cfacd3) \
V(_Uint8ClampedList, [], Uint8ClampedArrayGetIndexed, 0x1e32412e) \
V(_Uint8ClampedList, []=, Uint8ClampedArraySetIndexed, 0x1acf6273) \
V(_ExternalUint8ClampedArray, [], ExternalUint8ClampedArrayGetIndexed, \
0xa2707d8e) \
0x1e32412e) \
V(_ExternalUint8ClampedArray, []=, ExternalUint8ClampedArraySetIndexed, \
0x39153cf3) \
V(_Int16List, [], Int16ArrayGetIndexed, 0x1cf6592e) \
V(_Int16List, []=, Int16ArraySetIndexed, 0x87063f1a) \
V(_Uint16List, [], Uint16ArrayGetIndexed, 0x00cf352e) \
V(_Uint16List, []=, Uint16ArraySetIndexed, 0x6f48e691) \
V(_Int32List, [], Int32ArrayGetIndexed, 0x1e93fecd) \
V(_Int32List, []=, Int32ArraySetIndexed, 0x653abbb9) \
V(_Uint32List, [], Uint32ArrayGetIndexed, 0x6de6646d) \
V(_Uint32List, []=, Uint32ArraySetIndexed, 0x50de3039) \
V(_Int64List, [], Int64ArrayGetIndexed, 0x575c590d) \
V(_Int64List, []=, Int64ArraySetIndexed, 0x905d6bcf) \
V(_Uint64List, [], Uint64ArrayGetIndexed, 0x9420be8d) \
V(_Uint64List, []=, Uint64ArraySetIndexed, 0x5bbedd07) \
V(_Float64List, [], Float64ArrayGetIndexed, 0x91192954) \
V(_Float64List, []=, Float64ArraySetIndexed, 0x8f1ba92d) \
V(_Float32List, [], Float32ArrayGetIndexed, 0x67172a74) \
V(_Float32List, []=, Float32ArraySetIndexed, 0xea6a065b) \
V(_Float32x4List, [], Float32x4ArrayGetIndexed, 0x68d7290d) \
V(_Float32x4List, []=, Float32x4ArraySetIndexed, 0x6eb9f208) \
V(_Int32x4List, [], Int32x4ArrayGetIndexed, 0x7e4ff185) \
V(_Int32x4List, []=, Int32x4ArraySetIndexed, 0x58084e98) \
V(_Float64x2List, [], Float64x2ArrayGetIndexed, 0xb2996c37) \
V(_Float64x2List, []=, Float64x2ArraySetIndexed, 0x5e8f97b0) \
0x1acf6273) \
V(_Int16List, [], Int16ArrayGetIndexed, 0x98b81cce) \
V(_Int16List, []=, Int16ArraySetIndexed, 0x68c0649a) \
V(_Uint16List, [], Uint16ArrayGetIndexed, 0x7c90f8ce) \
V(_Uint16List, []=, Uint16ArraySetIndexed, 0x51030c11) \
V(_Int32List, [], Int32ArrayGetIndexed, 0x9a55c26d) \
V(_Int32List, []=, Int32ArraySetIndexed, 0x46f4e139) \
V(_Uint32List, [], Uint32ArrayGetIndexed, 0xe9a8280d) \
V(_Uint32List, []=, Uint32ArraySetIndexed, 0x329855b9) \
V(_Int64List, [], Int64ArrayGetIndexed, 0xd31e1cad) \
V(_Int64List, []=, Int64ArraySetIndexed, 0xa7a99b0f) \
V(_Uint64List, [], Uint64ArrayGetIndexed, 0x0fe2822d) \
V(_Uint64List, []=, Uint64ArraySetIndexed, 0x730b0c47) \
V(_Float64List, [], Float64ArrayGetIndexed, 0x0cdaecf4) \
V(_Float64List, []=, Float64ArraySetIndexed, 0xa667d86d) \
V(_Float32List, [], Float32ArrayGetIndexed, 0xe2d8ee14) \
V(_Float32List, []=, Float32ArraySetIndexed, 0x01b6359b) \
V(_Float32x4List, [], Float32x4ArrayGetIndexed, 0xe498ecad) \
V(_Float32x4List, []=, Float32x4ArraySetIndexed, 0x86062148) \
V(_Int32x4List, [], Int32x4ArrayGetIndexed, 0xfa11b525) \
V(_Int32x4List, []=, Int32x4ArraySetIndexed, 0x6f547dd8) \
V(_Float64x2List, [], Float64x2ArrayGetIndexed, 0x2e5b2fd7) \
V(_Float64x2List, []=, Float64x2ArraySetIndexed, 0x75dbc6f0) \
V(_TypedListBase, get:length, TypedListBaseLength, 0x5850f06b) \
V(_ByteDataView, get:length, ByteDataViewLength, 0x5850f06b) \
V(_Float32x4, get:x, Float32x4GetX, 0x3a398530) \
@ -453,17 +453,17 @@ namespace dart {
V(_ExternalTwoByteString, codeUnitAt, ExternalTwoByteStringCodeUnitAt, \
0x17f90910) \
V(_Smi, ~, Smi_bitNegate, 0x8254f8dc) \
V(_IntegerImplementation, +, Integer_add, 0x8c775aac) \
V(_IntegerImplementation, -, Integer_sub, 0x8080699d) \
V(_IntegerImplementation, *, Integer_mul, 0x63efbe3a) \
V(_IntegerImplementation, %, Integer_mod, 0x93a8d914) \
V(_IntegerImplementation, ~/, Integer_truncDivide, 0x4c5b2b80) \
V(_IntegerImplementation, unary-, Integer_negate, 0xaec000b3) \
V(_IntegerImplementation, &, Integer_bitAnd, 0x5fc441a9) \
V(_IntegerImplementation, |, Integer_bitOr, 0x636ebb61) \
V(_IntegerImplementation, ^, Integer_bitXor, 0xac5f8468) \
V(_IntegerImplementation, >>, Integer_sar, 0x67468100) \
V(_IntegerImplementation, >>>, Integer_shr, 0x48bcbd62) \
V(_IntegerImplementation, +, Integer_add, 0x6f155e4c) \
V(_IntegerImplementation, -, Integer_sub, 0x631e6d3d) \
V(_IntegerImplementation, *, Integer_mul, 0x468dc1da) \
V(_IntegerImplementation, %, Integer_mod, 0xd45663f4) \
V(_IntegerImplementation, ~/, Integer_truncDivide, 0x8d08b660) \
V(_IntegerImplementation, unary-, Integer_negate, 0x915e0453) \
V(_IntegerImplementation, &, Integer_bitAnd, 0x42624549) \
V(_IntegerImplementation, |, Integer_bitOr, 0x460cbf01) \
V(_IntegerImplementation, ^, Integer_bitXor, 0x8efd8808) \
V(_IntegerImplementation, >>, Integer_sar, 0x49e484a0) \
V(_IntegerImplementation, >>>, Integer_shr, 0x2b5ac102) \
V(_Double, unary-, DoubleFlipSignBit, 0x3d39082b) \
#define GRAPH_INTRINSICS_LIST(V) \
@ -530,14 +530,14 @@ namespace dart {
// result-cid, fingerprint).
#define RECOGNIZED_LIST_FACTORY_LIST(V) \
V(_ListFactory, _List, ., kArrayCid, 0x4c9d39e2) \
V(_ListFilledFactory, _List, .filled, kArrayCid, 0xe23ae9b1) \
V(_ListGenerateFactory, _List, .generate, kArrayCid, 0xa7c3f2ee) \
V(_ListFilledFactory, _List, .filled, kArrayCid, 0x9283f611) \
V(_ListGenerateFactory, _List, .generate, kArrayCid, 0x429324ae) \
V(_GrowableListFactory, _GrowableList, ., kGrowableObjectArrayCid, \
0xf210216d) \
0x3c9eec4d) \
V(_GrowableListFilledFactory, _GrowableList, .filled, \
kGrowableObjectArrayCid, 0x3aa70b31) \
kGrowableObjectArrayCid, 0xeaf01791) \
V(_GrowableListGenerateFactory, _GrowableList, .generate, \
kGrowableObjectArrayCid, 0xe123f46e) \
kGrowableObjectArrayCid, 0x7bf3262e) \
V(_GrowableListWithData, _GrowableList, ._withData, kGrowableObjectArrayCid, \
0x1947d8a1) \
V(_Int8ArrayFactory, Int8List, ., kTypedDataInt8ArrayCid, 0x660dd888) \

View file

@ -18,7 +18,7 @@ namespace kernel {
// package:kernel/binary.md.
static const uint32_t kMagicProgramFile = 0x90ABCDEFu;
static const uint32_t kSupportedKernelFormatVersion = 93;
static const uint32_t kSupportedKernelFormatVersion = 94;
// Keep in sync with package:kernel/lib/binary/tag.dart
#define KERNEL_TAG_LIST(V) \
@ -147,11 +147,11 @@ static const uint32_t kSupportedKernelFormatVersion = 93;
V(FunctionInvocation, 125) \
V(FunctionTearOff, 126) \
V(LocalFunctionInvocation, 127) \
V(SpecializedVariableGet, 128) \
V(SpecializedVariableSet, 136) \
V(SpecializedIntLiteral, 144)
V(SpecializedVariableGet, 224) \
V(SpecializedVariableSet, 232) \
V(SpecializedIntLiteral, 240)
static const intptr_t kSpecializedTagHighBit = 0x80;
static const intptr_t kSpecializedTagHighBits = 0xe0;
static const intptr_t kSpecializedTagMask = 0xf8;
static const intptr_t kSpecializedPayloadMask = 0x7;
@ -379,7 +379,8 @@ class Reader : public ValueObject {
Tag ReadTag(uint8_t* payload = NULL) {
uint8_t byte = ReadByte();
bool has_payload = (byte & kSpecializedTagHighBit) != 0;
bool has_payload =
(byte & kSpecializedTagHighBits) == kSpecializedTagHighBits;
if (has_payload) {
if (payload != NULL) {
*payload = byte & kSpecializedPayloadMask;
@ -392,7 +393,8 @@ class Reader : public ValueObject {
Tag PeekTag(uint8_t* payload = NULL) {
uint8_t byte = PeekByte();
bool has_payload = (byte & kSpecializedTagHighBit) != 0;
bool has_payload =
(byte & kSpecializedTagHighBits) == kSpecializedTagHighBits;
if (has_payload) {
if (payload != NULL) {
*payload = byte & kSpecializedPayloadMask;