[vm] Cleanup kernel format versioning from the VM
TEST=ci
Change-Id: I9116d0e60aa073733fee3ce523fb5cbc2fb692f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267440
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
diff --git a/pkg/front_end/test/binary_md_vm_tags_and_version_git_test.dart b/pkg/front_end/test/binary_md_vm_tags_and_version_git_test.dart
index fb3e464..c1dae0f 100644
--- a/pkg/front_end/test/binary_md_vm_tags_and_version_git_test.dart
+++ b/pkg/front_end/test/binary_md_vm_tags_and_version_git_test.dart
@@ -20,8 +20,8 @@
import 'utils/io_utils.dart' show computeRepoDir;
-const String maxSupported =
- "static const uint32_t kMaxSupportedKernelFormatVersion = ";
+const String supportedVersion =
+ "static const uint32_t kSupportedKernelFormatVersion = ";
// Match stuff like "V(Nothing, 0)"
final RegExp tagParser = new RegExp(r"V\((\w*),\s*(\d+)\)");
@@ -45,9 +45,9 @@
Map<int, String> vmConstantTagToName = {};
for (int i = 0; i < vmTagLines.length; i++) {
String line = vmTagLines[i];
- if (line.startsWith(maxSupported)) {
+ if (line.startsWith(supportedVersion)) {
vmVersion = int.parse(line
- .substring(line.indexOf(maxSupported) + maxSupported.length)
+ .substring(line.indexOf(supportedVersion) + supportedVersion.length)
.substring(0, 2) // Assume version < 100 for now.
.trim());
} else if (line.startsWith("#define KERNEL_TAG_LIST(V)")) {
diff --git a/runtime/vm/app_snapshot.cc b/runtime/vm/app_snapshot.cc
index 7b3726e..94ecb93 100644
--- a/runtime/vm/app_snapshot.cc
+++ b/runtime/vm/app_snapshot.cc
@@ -1828,7 +1828,6 @@
KernelProgramInfoPtr info = objects_[i];
AutoTraceObject(info);
WriteFromTo(info);
- s->Write<uint32_t>(info->untag()->kernel_binary_version_);
}
}
@@ -1857,7 +1856,6 @@
Deserializer::InitializeHeader(info, kKernelProgramInfoCid,
KernelProgramInfo::InstanceSize());
d.ReadFromTo(info);
- info->untag()->kernel_binary_version_ = d.Read<uint32_t>();
}
}
diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
index f60a8de..5fbc98c 100644
--- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
+++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
@@ -1283,10 +1283,7 @@
}
Variance KernelReaderHelper::ReadVariance() {
- if (translation_helper_.info().kernel_binary_version() >= 34) {
- return reader_.ReadVariance();
- }
- return kCovariant;
+ return reader_.ReadVariance();
}
void StreamingFlowGraphBuilder::loop_depth_inc() {
@@ -3806,11 +3803,7 @@
TokenPosition position = ReadPosition(); // read position.
if (p != nullptr) *p = position;
- if (translation_helper_.info().kernel_binary_version() >= 38) {
- // We do not use the library mode for the type test, which is indicated by
- // the flag kIsExpressionFlagForNonNullableByDefault.
- ReadFlags();
- }
+ ReadFlags();
Fragment instructions = BuildExpression(); // read operand.
diff --git a/runtime/vm/compiler/frontend/kernel_fingerprints.cc b/runtime/vm/compiler/frontend/kernel_fingerprints.cc
index 56d6d70..225fec0 100644
--- a/runtime/vm/compiler/frontend/kernel_fingerprints.cc
+++ b/runtime/vm/compiler/frontend/kernel_fingerprints.cc
@@ -555,9 +555,7 @@
return;
case kIsExpression:
ReadPosition(); // read position.
- if (translation_helper_.info().kernel_binary_version() >= 38) {
- BuildHash(ReadFlags()); // read flags.
- }
+ BuildHash(ReadFlags()); // read flags.
CalculateExpressionFingerprint(); // read operand.
CalculateDartTypeFingerprint(); // read type.
return;
diff --git a/runtime/vm/compiler/frontend/kernel_translation_helper.cc b/runtime/vm/compiler/frontend/kernel_translation_helper.cc
index e955dfb..a343999 100644
--- a/runtime/vm/compiler/frontend/kernel_translation_helper.cc
+++ b/runtime/vm/compiler/frontend/kernel_translation_helper.cc
@@ -2572,10 +2572,8 @@
SkipListOfExpressions(); // read list of expressions.
return;
case kIsExpression:
- ReadPosition(); // read position.
- if (translation_helper_.info().kernel_binary_version() >= 38) {
- SkipFlags(); // read flags.
- }
+ ReadPosition(); // read position.
+ SkipFlags(); // read flags.
SkipExpression(); // read operand.
SkipDartType(); // read type.
return;
@@ -2970,12 +2968,7 @@
return reader_.ReadLineStartsData(line_start_count);
}
-String& KernelReaderHelper::SourceTableImportUriFor(intptr_t index,
- uint32_t binaryVersion) {
- if (binaryVersion < 22) {
- return SourceTableUriFor(index);
- }
-
+String& KernelReaderHelper::SourceTableImportUriFor(intptr_t index) {
AlternativeReadingScope alt(&reader_);
SetOffset(GetOffsetForSourceInfo(index));
SkipBytes(ReadUInt()); // skip uri.
diff --git a/runtime/vm/compiler/frontend/kernel_translation_helper.h b/runtime/vm/compiler/frontend/kernel_translation_helper.h
index a314b8c..95865a9 100644
--- a/runtime/vm/compiler/frontend/kernel_translation_helper.h
+++ b/runtime/vm/compiler/frontend/kernel_translation_helper.h
@@ -833,8 +833,8 @@
kUnsupported = 1 << 4,
};
- explicit LibraryHelper(KernelReaderHelper* helper, uint32_t binary_version)
- : helper_(helper), binary_version_(binary_version), next_read_(kFlags) {}
+ explicit LibraryHelper(KernelReaderHelper* helper)
+ : helper_(helper), next_read_(kFlags) {}
void ReadUntilIncluding(Field field) {
ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
@@ -866,7 +866,6 @@
private:
KernelReaderHelper* helper_;
- uint32_t binary_version_;
intptr_t next_read_;
DISALLOW_COPY_AND_ASSIGN(LibraryHelper);
@@ -1304,7 +1303,7 @@
String& SourceTableUriFor(intptr_t index);
const String& GetSourceFor(intptr_t index);
TypedDataPtr GetLineStartsFor(intptr_t index);
- String& SourceTableImportUriFor(intptr_t index, uint32_t binaryVersion);
+ String& SourceTableImportUriFor(intptr_t index);
ExternalTypedDataPtr GetConstantCoverageFor(intptr_t index);
Zone* zone_;
diff --git a/runtime/vm/compiler/frontend/scope_builder.cc b/runtime/vm/compiler/frontend/scope_builder.cc
index bd25b13..2874980 100644
--- a/runtime/vm/compiler/frontend/scope_builder.cc
+++ b/runtime/vm/compiler/frontend/scope_builder.cc
@@ -838,9 +838,7 @@
}
case kIsExpression:
helper_.ReadPosition(); // read position.
- if (translation_helper_.info().kernel_binary_version() >= 38) {
- helper_.ReadFlags(); // read flags.
- }
+ helper_.ReadFlags(); // read flags.
VisitExpression(); // read operand.
VisitDartType(); // read type.
return;
diff --git a/runtime/vm/compiler/runtime_offsets_extracted.h b/runtime/vm/compiler/runtime_offsets_extracted.h
index 7b61b99..deb2048 100644
--- a/runtime/vm/compiler/runtime_offsets_extracted.h
+++ b/runtime/vm/compiler/runtime_offsets_extracted.h
@@ -623,7 +623,7 @@
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
- 60;
+ 56;
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
@@ -1291,7 +1291,7 @@
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
- 120;
+ 112;
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
@@ -1950,7 +1950,7 @@
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
- 60;
+ 56;
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
@@ -2619,7 +2619,7 @@
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
- 120;
+ 112;
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
@@ -4613,7 +4613,7 @@
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
- 60;
+ 56;
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
@@ -5282,7 +5282,7 @@
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
- 120;
+ 112;
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
@@ -5935,7 +5935,7 @@
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
- 60;
+ 56;
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
@@ -6595,7 +6595,7 @@
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
- 120;
+ 112;
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
@@ -7246,7 +7246,7 @@
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
- 60;
+ 56;
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
@@ -7907,7 +7907,7 @@
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
- 120;
+ 112;
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
@@ -9877,7 +9877,7 @@
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
- 60;
+ 56;
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
@@ -10538,7 +10538,7 @@
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
- 120;
+ 112;
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
@@ -11263,7 +11263,7 @@
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Integer_InstanceSize = 4;
static constexpr dart::compiler::target::word
- AOT_KernelProgramInfo_InstanceSize = 60;
+ AOT_KernelProgramInfo_InstanceSize = 56;
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
28;
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 84;
@@ -12001,7 +12001,7 @@
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Integer_InstanceSize = 8;
static constexpr dart::compiler::target::word
- AOT_KernelProgramInfo_InstanceSize = 120;
+ AOT_KernelProgramInfo_InstanceSize = 112;
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
48;
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
@@ -12743,7 +12743,7 @@
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Integer_InstanceSize = 8;
static constexpr dart::compiler::target::word
- AOT_KernelProgramInfo_InstanceSize = 120;
+ AOT_KernelProgramInfo_InstanceSize = 112;
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
48;
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
@@ -14955,7 +14955,7 @@
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Integer_InstanceSize = 4;
static constexpr dart::compiler::target::word
- AOT_KernelProgramInfo_InstanceSize = 60;
+ AOT_KernelProgramInfo_InstanceSize = 56;
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
28;
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 84;
@@ -15694,7 +15694,7 @@
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Integer_InstanceSize = 8;
static constexpr dart::compiler::target::word
- AOT_KernelProgramInfo_InstanceSize = 120;
+ AOT_KernelProgramInfo_InstanceSize = 112;
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
48;
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
@@ -16420,7 +16420,7 @@
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Integer_InstanceSize = 4;
static constexpr dart::compiler::target::word
- AOT_KernelProgramInfo_InstanceSize = 60;
+ AOT_KernelProgramInfo_InstanceSize = 56;
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
28;
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 84;
@@ -17149,7 +17149,7 @@
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Integer_InstanceSize = 8;
static constexpr dart::compiler::target::word
- AOT_KernelProgramInfo_InstanceSize = 120;
+ AOT_KernelProgramInfo_InstanceSize = 112;
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
48;
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
@@ -17882,7 +17882,7 @@
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Integer_InstanceSize = 8;
static constexpr dart::compiler::target::word
- AOT_KernelProgramInfo_InstanceSize = 120;
+ AOT_KernelProgramInfo_InstanceSize = 112;
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
48;
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
@@ -20067,7 +20067,7 @@
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Integer_InstanceSize = 4;
static constexpr dart::compiler::target::word
- AOT_KernelProgramInfo_InstanceSize = 60;
+ AOT_KernelProgramInfo_InstanceSize = 56;
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
28;
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 84;
@@ -20797,7 +20797,7 @@
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Integer_InstanceSize = 8;
static constexpr dart::compiler::target::word
- AOT_KernelProgramInfo_InstanceSize = 120;
+ AOT_KernelProgramInfo_InstanceSize = 112;
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
48;
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
diff --git a/runtime/vm/kernel.h b/runtime/vm/kernel.h
index bb496ef..c48c811 100644
--- a/runtime/vm/kernel.h
+++ b/runtime/vm/kernel.h
@@ -85,7 +85,6 @@
const ExternalTypedData& typed_data, const char** error = nullptr);
bool is_single_program() { return single_program_; }
- uint32_t binary_version() { return binary_version_; }
NameIndex main_method() { return main_method_reference_; }
intptr_t source_table_offset() const { return source_table_offset_; }
intptr_t string_table_offset() const { return string_table_offset_; }
@@ -110,7 +109,6 @@
Program() : binary_() {}
bool single_program_;
- uint32_t binary_version_;
NameIndex main_method_reference_; // Procedure.
NNBDCompiledMode compilation_mode_;
intptr_t library_count_;
diff --git a/runtime/vm/kernel_binary.cc b/runtime/vm/kernel_binary.cc
index 0e4cc79..4029608 100644
--- a/runtime/vm/kernel_binary.cc
+++ b/runtime/vm/kernel_binary.cc
@@ -121,9 +121,8 @@
return nullptr;
}
- uint32_t formatVersion = reader->ReadUInt32();
- if ((formatVersion < kMinSupportedKernelFormatVersion) ||
- (formatVersion > kMaxSupportedKernelFormatVersion)) {
+ const uint32_t format_version = reader->ReadUInt32();
+ if (format_version != kSupportedKernelFormatVersion) {
if (error != nullptr) {
*error = kKernelInvalidBinaryFormatVersion;
}
@@ -143,7 +142,6 @@
}
std::unique_ptr<Program> program(new Program());
- program->binary_version_ = formatVersion;
program->binary_.typed_data = reader->typed_data();
program->binary_.kernel_data = reader->buffer();
program->binary_.kernel_data_size = reader->size();
diff --git a/runtime/vm/kernel_binary.h b/runtime/vm/kernel_binary.h
index c4a4136..cab66fd 100644
--- a/runtime/vm/kernel_binary.h
+++ b/runtime/vm/kernel_binary.h
@@ -18,10 +18,7 @@
// package:kernel/binary.md.
static const uint32_t kMagicProgramFile = 0x90ABCDEFu;
-
-// Both version numbers are inclusive.
-static const uint32_t kMinSupportedKernelFormatVersion = 87;
-static const uint32_t kMaxSupportedKernelFormatVersion = 87;
+static const uint32_t kSupportedKernelFormatVersion = 87;
// Keep in sync with package:kernel/lib/binary/tag.dart
#define KERNEL_TAG_LIST(V) \
diff --git a/runtime/vm/kernel_loader.cc b/runtime/vm/kernel_loader.cc
index 2cc824b..b4285d8 100644
--- a/runtime/vm/kernel_loader.cc
+++ b/runtime/vm/kernel_loader.cc
@@ -147,9 +147,8 @@
return loader_->LookupClass(library_lookup_handle_, klass);
}
-LibraryIndex::LibraryIndex(const ExternalTypedData& kernel_data,
- uint32_t binary_version)
- : reader_(kernel_data), binary_version_(binary_version) {
+LibraryIndex::LibraryIndex(const ExternalTypedData& kernel_data)
+ : reader_(kernel_data) {
intptr_t data_size = reader_.size();
procedure_count_ = reader_.ReadUInt32At(data_size - 4);
@@ -193,7 +192,6 @@
patch_classes_(Array::ZoneHandle(zone_)),
active_class_(),
library_kernel_offset_(-1), // Set to the correct value in LoadLibrary
- kernel_binary_version_(program->binary_version()),
correction_offset_(-1), // Set to the correct value in LoadLibrary
loading_native_wrappers_library_(false),
library_kernel_data_(ExternalTypedData::ZoneHandle(zone_)),
@@ -443,8 +441,7 @@
offsets, data, names, metadata_payloads, metadata_mappings,
constants_table, scripts, libraries_cache, classes_cache,
program_->typed_data() == nullptr ? Object::null_object()
- : *program_->typed_data(),
- program_->binary_version());
+ : *program_->typed_data());
H.InitFromKernelProgramInfo(kernel_program_info_);
@@ -457,15 +454,13 @@
KernelLoader::KernelLoader(const Script& script,
const ExternalTypedData& kernel_data,
- intptr_t data_program_offset,
- uint32_t kernel_binary_version)
+ intptr_t data_program_offset)
: program_(NULL),
thread_(Thread::Current()),
zone_(thread_->zone()),
no_active_isolate_scope_(),
patch_classes_(Array::ZoneHandle(zone_)),
library_kernel_offset_(data_program_offset),
- kernel_binary_version_(kernel_binary_version),
correction_offset_(0),
loading_native_wrappers_library_(false),
library_kernel_data_(ExternalTypedData::ZoneHandle(zone_)),
@@ -821,7 +816,7 @@
for (intptr_t i = 0; i < length; i++) {
intptr_t kernel_offset = library_offset(i);
helper_.SetOffset(kernel_offset);
- LibraryHelper library_helper(&helper_, kernel_binary_version_);
+ LibraryHelper library_helper(&helper_);
library_helper.ReadUntilIncluding(LibraryHelper::kCanonicalName);
lib = LookupLibraryOrNull(library_helper.canonical_name_);
if (!lib.IsNull() && !lib.is_dart_scheme()) {
@@ -832,7 +827,7 @@
intptr_t library_end = library_offset(i + 1);
library_kernel_data_ =
helper_.reader_.ExternalDataFromTo(kernel_offset, library_end);
- LibraryIndex library_index(library_kernel_data_, kernel_binary_version_);
+ LibraryIndex library_index(library_kernel_data_);
num_classes += library_index.class_count();
num_procedures += library_index.procedure_count();
}
@@ -905,7 +900,7 @@
// offset.
helper_.SetOffset(library_kernel_offset_);
- LibraryHelper library_helper(&helper_, kernel_binary_version_);
+ LibraryHelper library_helper(&helper_);
library_helper.ReadUntilIncluding(LibraryHelper::kCanonicalName);
if (!FLAG_precompiled_mode && !IG->should_load_vmservice()) {
StringIndex lib_name_index =
@@ -954,7 +949,7 @@
library.set_kernel_data(library_kernel_data_);
library.set_kernel_offset(library_kernel_offset_);
- LibraryIndex library_index(library_kernel_data_, kernel_binary_version_);
+ LibraryIndex library_index(library_kernel_data_);
intptr_t class_count = library_index.class_count();
library_helper.ReadUntilIncluding(LibraryHelper::kName);
@@ -1071,60 +1066,58 @@
helper_.SetOffset(library_index.ClassOffset(library_index.class_count()) +
correction);
- if (kernel_binary_version_ >= 30) {
- const intptr_t extension_count = helper_.ReadListLength();
- for (intptr_t i = 0; i < extension_count; ++i) {
- helper_.ReadTag(); // read tag.
- helper_.SkipCanonicalNameReference(); // skip canonical name.
- helper_.SkipStringReference(); // skip name.
- helper_.SkipListOfExpressions(); // skip annotations.
- helper_.ReadUInt(); // read source uri index.
- helper_.ReadPosition(); // read file offset.
- helper_.ReadByte(); // skip flags.
- helper_.SkipTypeParametersList(); // skip type parameter list.
- helper_.SkipDartType(); // skip on-type.
- Tag tag = helper_.ReadTag();
- if (tag != kNothing) {
- helper_.SkipListOfDartTypes(); // skip shown types.
- helper_.SkipListOfCanonicalNameReferences(); // skip shown members.
- helper_.SkipListOfCanonicalNameReferences(); // skip shown getters.
- helper_.SkipListOfCanonicalNameReferences(); // skip shown setters.
- helper_.SkipListOfCanonicalNameReferences(); // skip shown operators.
- helper_.SkipListOfDartTypes(); // skip hidden types.
- helper_.SkipListOfCanonicalNameReferences(); // skip hidden members.
- helper_.SkipListOfCanonicalNameReferences(); // skip hidden getters.
- helper_.SkipListOfCanonicalNameReferences(); // skip hidden setters.
- helper_.SkipListOfCanonicalNameReferences(); // skip hidden operators.
- }
-
- const intptr_t extension_member_count = helper_.ReadListLength();
- for (intptr_t j = 0; j < extension_member_count; ++j) {
- helper_.SkipName(); // skip name.
- helper_.ReadByte(); // read kind.
- helper_.ReadByte(); // read flags.
- helper_.SkipCanonicalNameReference(); // skip member reference
- }
+ const intptr_t extension_count = helper_.ReadListLength();
+ for (intptr_t i = 0; i < extension_count; ++i) {
+ helper_.ReadTag(); // read tag.
+ helper_.SkipCanonicalNameReference(); // skip canonical name.
+ helper_.SkipStringReference(); // skip name.
+ helper_.SkipListOfExpressions(); // skip annotations.
+ helper_.ReadUInt(); // read source uri index.
+ helper_.ReadPosition(); // read file offset.
+ helper_.ReadByte(); // skip flags.
+ helper_.SkipTypeParametersList(); // skip type parameter list.
+ helper_.SkipDartType(); // skip on-type.
+ Tag tag = helper_.ReadTag();
+ if (tag != kNothing) {
+ helper_.SkipListOfDartTypes(); // skip shown types.
+ helper_.SkipListOfCanonicalNameReferences(); // skip shown members.
+ helper_.SkipListOfCanonicalNameReferences(); // skip shown getters.
+ helper_.SkipListOfCanonicalNameReferences(); // skip shown setters.
+ helper_.SkipListOfCanonicalNameReferences(); // skip shown operators.
+ helper_.SkipListOfDartTypes(); // skip hidden types.
+ helper_.SkipListOfCanonicalNameReferences(); // skip hidden members.
+ helper_.SkipListOfCanonicalNameReferences(); // skip hidden getters.
+ helper_.SkipListOfCanonicalNameReferences(); // skip hidden setters.
+ helper_.SkipListOfCanonicalNameReferences(); // skip hidden operators.
}
- const intptr_t view_count = helper_.ReadListLength();
- for (intptr_t i = 0; i < view_count; ++i) {
- helper_.ReadTag(); // read tag.
- helper_.SkipCanonicalNameReference(); // skip canonical name.
- helper_.SkipStringReference(); // skip name.
- helper_.SkipListOfExpressions(); // skip annotations.
- helper_.ReadUInt(); // read source uri index.
- helper_.ReadPosition(); // read file offset.
- helper_.ReadByte(); // skip flags.
- helper_.SkipTypeParametersList(); // skip type parameter list.
- helper_.SkipDartType(); // skip representation-type.
+ const intptr_t extension_member_count = helper_.ReadListLength();
+ for (intptr_t j = 0; j < extension_member_count; ++j) {
+ helper_.SkipName(); // skip name.
+ helper_.ReadByte(); // read kind.
+ helper_.ReadByte(); // read flags.
+ helper_.SkipCanonicalNameReference(); // skip member reference
+ }
+ }
- const intptr_t view_member_count = helper_.ReadListLength();
- for (intptr_t j = 0; j < view_member_count; ++j) {
- helper_.SkipName(); // skip name.
- helper_.ReadByte(); // read kind.
- helper_.ReadByte(); // read flags.
- helper_.SkipCanonicalNameReference(); // skip member reference
- }
+ const intptr_t view_count = helper_.ReadListLength();
+ for (intptr_t i = 0; i < view_count; ++i) {
+ helper_.ReadTag(); // read tag.
+ helper_.SkipCanonicalNameReference(); // skip canonical name.
+ helper_.SkipStringReference(); // skip name.
+ helper_.SkipListOfExpressions(); // skip annotations.
+ helper_.ReadUInt(); // read source uri index.
+ helper_.ReadPosition(); // read file offset.
+ helper_.ReadByte(); // skip flags.
+ helper_.SkipTypeParametersList(); // skip type parameter list.
+ helper_.SkipDartType(); // skip representation-type.
+
+ const intptr_t view_member_count = helper_.ReadListLength();
+ for (intptr_t j = 0; j < view_member_count; ++j) {
+ helper_.SkipName(); // skip name.
+ helper_.ReadByte(); // read kind.
+ helper_.ReadByte(); // read flags.
+ helper_.SkipCanonicalNameReference(); // skip member reference
}
}
@@ -1776,12 +1769,9 @@
const intptr_t library_kernel_offset = library.kernel_offset();
ASSERT(library_kernel_offset > 0);
- const KernelProgramInfo& info =
- KernelProgramInfo::Handle(zone, script.kernel_program_info());
-
- KernelLoader kernel_loader(script, library_kernel_data, library_kernel_offset,
- info.kernel_binary_version());
- LibraryIndex library_index(library_kernel_data, info.kernel_binary_version());
+ KernelLoader kernel_loader(script, library_kernel_data,
+ library_kernel_offset);
+ LibraryIndex library_index(library_kernel_data);
if (klass.IsTopLevel()) {
ASSERT(klass.ptr() == toplevel_class.ptr());
@@ -2111,8 +2101,7 @@
ScriptPtr KernelLoader::LoadScriptAt(intptr_t index,
UriToSourceTable* uri_to_source_table) {
const String& uri_string = helper_.SourceTableUriFor(index);
- const String& import_uri_string =
- helper_.SourceTableImportUriFor(index, program_->binary_version());
+ const String& import_uri_string = helper_.SourceTableImportUriFor(index);
#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
ExternalTypedData& constant_coverage =
ExternalTypedData::Handle(Z, helper_.GetConstantCoverageFor(index));
diff --git a/runtime/vm/kernel_loader.h b/runtime/vm/kernel_loader.h
index 595ff2b..2e29b9b 100644
--- a/runtime/vm/kernel_loader.h
+++ b/runtime/vm/kernel_loader.h
@@ -82,8 +82,7 @@
class LibraryIndex {
public:
// |kernel_data| is the kernel data for one library alone.
- explicit LibraryIndex(const ExternalTypedData& kernel_data,
- uint32_t binary_version);
+ explicit LibraryIndex(const ExternalTypedData& kernel_data);
intptr_t class_count() const { return class_count_; }
intptr_t procedure_count() const { return procedure_count_; }
@@ -111,7 +110,6 @@
private:
Reader reader_;
- uint32_t binary_version_;
intptr_t source_references_offset_;
intptr_t class_index_offset_;
intptr_t class_count_;
@@ -238,8 +236,7 @@
KernelLoader(const Script& script,
const ExternalTypedData& kernel_data,
- intptr_t data_program_offset,
- uint32_t kernel_binary_version);
+ intptr_t data_program_offset);
void InitializeFields(
DirectChainedHashMap<UriToSourceTableTrait>* uri_to_source_table);
@@ -376,7 +373,6 @@
// This is the offset of the current library within
// the whole kernel program.
intptr_t library_kernel_offset_;
- uint32_t kernel_binary_version_;
// This is the offset by which offsets, which are set relative
// to their library's kernel data, have to be corrected.
intptr_t correction_offset_;
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 10554d0..da1b9d5 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -14440,8 +14440,7 @@
const Array& scripts,
const Array& libraries_cache,
const Array& classes_cache,
- const Object& retained_kernel_blob,
- const uint32_t binary_version) {
+ const Object& retained_kernel_blob) {
const KernelProgramInfo& info =
KernelProgramInfo::Handle(KernelProgramInfo::New());
info.untag()->set_string_offsets(string_offsets.ptr());
@@ -14454,7 +14453,6 @@
info.untag()->set_libraries_cache(libraries_cache.ptr());
info.untag()->set_classes_cache(classes_cache.ptr());
info.untag()->set_retained_kernel_blob(retained_kernel_blob.ptr());
- info.set_kernel_binary_version(binary_version);
return info.ptr();
}
@@ -14476,10 +14474,6 @@
untag()->set_constants(constants.ptr());
}
-void KernelProgramInfo::set_kernel_binary_version(uint32_t version) const {
- StoreNonPointer(&untag()->kernel_binary_version_, version);
-}
-
void KernelProgramInfo::set_constants_table(
const ExternalTypedData& value) const {
untag()->set_constants_table(value.ptr());
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 4b56934..e8617c0 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -5161,8 +5161,7 @@
const Array& scripts,
const Array& libraries_cache,
const Array& classes_cache,
- const Object& retained_kernel_blob,
- const uint32_t binary_version);
+ const Object& retained_kernel_blob);
static intptr_t InstanceSize() {
return RoundedAllocationSize(sizeof(UntaggedKernelProgramInfo));
@@ -5194,11 +5193,6 @@
ArrayPtr constants() const { return untag()->constants(); }
void set_constants(const Array& constants) const;
- uint32_t kernel_binary_version() const {
- return untag()->kernel_binary_version_;
- }
- void set_kernel_binary_version(uint32_t version) const;
-
// If we load a kernel blob with evaluated constants, then we delay setting
// the native names of [Function] objects until we've read the constant table
// (since native names are encoded as constants).
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index b10b177..aab8fbc 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -1694,8 +1694,6 @@
COMPRESSED_POINTER_FIELD(ObjectPtr, retained_kernel_blob)
VISIT_TO(retained_kernel_blob)
- uint32_t kernel_binary_version_;
-
CompressedObjectPtr* to_snapshot(Snapshot::Kind kind) {
return reinterpret_cast<CompressedObjectPtr*>(&constants_table_);
}