[dart2bytecode, vm] Adjust bytecode file format

* Switch UInt32 from big-endian to little-endian encoding.
* Reorder object kinds, constant tags, type tags and constant pool tags.
* Reorder field and function flags.
* Cleanup yield point marker from source positions.

TEST=ci

Change-Id: I05ee940b6393a478831af11ac93fee9ec1441c4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384040
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
Alexander Markov
2024-09-10 13:37:29 +00:00
committed by Commit Queue
parent 0e58775986
commit fcdcdeddad
10 changed files with 121 additions and 150 deletions
+4 -2
View File
@@ -52,7 +52,9 @@ class Reader : public ValueObject {
ASSERT((size_ >= 4) && (offset >= 0) && (offset <= size_ - 4));
uint32_t value =
LoadUnaligned(reinterpret_cast<const uint32_t*>(raw_buffer_ + offset));
return Utils::BigEndianToHost32(value);
// All supported platforms are little-endian, so there is no need to
// convert from little-endian to host.
return value;
}
uint32_t ReadUInt32() {
@@ -265,7 +267,7 @@ class BytecodeReaderHelper : public ValueObject {
// pkg/dart2bytecode/lib/declarations.dart.
struct Parameter {
static const int kIsCovariantFlag = 1 << 0;
static const int kIsGenericCovariantImplFlag = 1 << 1;
static const int kIsCovariantByClassFlag = 1 << 1;
static const int kIsFinalFlag = 1 << 2;
static const int kIsRequiredFlag = 1 << 3;
};