mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 11:18:49 +00:00
[vm] Remove complex logic in kernel loader for dealing with annotations
Instead of peeking into constant table and then delaying scanning of constants by putting it in an array, which is walked again in some future point, we simply read the annotation constants entirely without requiring const evaluation. This works fine for pragma annotations the VM is interested in - as there's no user-defined classes involved. -> Loading kernel will no longer require constant evaluation to work. Motivation for this is that [0] wants to make this delayed annotation scanning logic even more complicated, so I prefer to remove it entirely. [0] https://dart-review.googlesource.com/c/sdk/+/289027 TEST=ci Change-Id: Ib859480107b6cf119d66035e66ec161ed11ddb32 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290502 Reviewed-by: Slava Egorov <vegorov@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>
This commit is contained in:
parent
94c165d189
commit
f20e6d3fa0
|
@ -25,6 +25,79 @@ ConstantReader::ConstantReader(KernelReaderHelper* helper,
|
||||||
script_(helper->script()),
|
script_(helper->script()),
|
||||||
result_(Object::Handle(zone_)) {}
|
result_(Object::Handle(zone_)) {}
|
||||||
|
|
||||||
|
bool ConstantReader::IsPragmaInstanceConstant(
|
||||||
|
intptr_t constant_index,
|
||||||
|
intptr_t* pragma_name_constant_index,
|
||||||
|
intptr_t* pragma_options_constant_index) {
|
||||||
|
KernelReaderHelper reader(Z, &H, script_, H.constants_table(), 0);
|
||||||
|
NavigateToIndex(&reader, constant_index);
|
||||||
|
|
||||||
|
if (reader.ReadByte() == kInstanceConstant) {
|
||||||
|
NameIndex index = reader.ReadCanonicalNameReference();
|
||||||
|
if (H.IsRoot(index) ||
|
||||||
|
!H.StringEquals(H.CanonicalNameString(index), "pragma")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
index = H.CanonicalNameParent(index);
|
||||||
|
if (H.IsRoot(index) ||
|
||||||
|
!H.StringEquals(H.CanonicalNameString(index), "dart:core")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const intptr_t num_type_args = reader.ReadUInt();
|
||||||
|
if (num_type_args != 0) return false;
|
||||||
|
|
||||||
|
const intptr_t num_fields = reader.ReadUInt();
|
||||||
|
if (num_fields != 2) return false;
|
||||||
|
|
||||||
|
const NameIndex field0_name = reader.ReadCanonicalNameReference();
|
||||||
|
if (H.IsRoot(field0_name) ||
|
||||||
|
!H.StringEquals(H.CanonicalNameString(field0_name), "name")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const intptr_t name_index = reader.ReadUInt();
|
||||||
|
if (pragma_name_constant_index != nullptr) {
|
||||||
|
*pragma_name_constant_index = name_index;
|
||||||
|
}
|
||||||
|
|
||||||
|
const NameIndex field1_name = reader.ReadCanonicalNameReference();
|
||||||
|
if (H.IsRoot(field1_name) ||
|
||||||
|
!H.StringEquals(H.CanonicalNameString(field1_name), "options")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const intptr_t options_index = reader.ReadUInt();
|
||||||
|
if (pragma_options_constant_index != nullptr) {
|
||||||
|
*pragma_options_constant_index = options_index;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ConstantReader::IsStringConstant(intptr_t constant_index,
|
||||||
|
const char* name) {
|
||||||
|
KernelReaderHelper reader(Z, &H, script_, H.constants_table(), 0);
|
||||||
|
NavigateToIndex(&reader, constant_index);
|
||||||
|
|
||||||
|
if (reader.ReadByte() == kStringConstant) {
|
||||||
|
const StringIndex index = reader.ReadStringReference();
|
||||||
|
return H.StringEquals(index, name);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ConstantReader::GetStringConstant(intptr_t constant_index,
|
||||||
|
String* out_value) {
|
||||||
|
KernelReaderHelper reader(Z, &H, script_, H.constants_table(), 0);
|
||||||
|
NavigateToIndex(&reader, constant_index);
|
||||||
|
|
||||||
|
if (reader.ReadByte() == kStringConstant) {
|
||||||
|
const StringIndex index = reader.ReadStringReference();
|
||||||
|
*out_value = H.DartSymbolPlain(index).ptr();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
InstancePtr ConstantReader::ReadConstantInitializer() {
|
InstancePtr ConstantReader::ReadConstantInitializer() {
|
||||||
Tag tag = helper_->ReadTag(); // read tag.
|
Tag tag = helper_->ReadTag(); // read tag.
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
|
|
|
@ -23,6 +23,12 @@ class ConstantReader {
|
||||||
|
|
||||||
virtual ~ConstantReader() {}
|
virtual ~ConstantReader() {}
|
||||||
|
|
||||||
|
bool IsPragmaInstanceConstant(intptr_t constant_index,
|
||||||
|
intptr_t* pragma_name_constant_index,
|
||||||
|
intptr_t* pragma_options_constant_index);
|
||||||
|
bool IsStringConstant(intptr_t constant_index, const char* name);
|
||||||
|
bool GetStringConstant(intptr_t constant_index, String* out_value);
|
||||||
|
|
||||||
InstancePtr ReadConstantInitializer();
|
InstancePtr ReadConstantInitializer();
|
||||||
InstancePtr ReadConstantExpression();
|
InstancePtr ReadConstantExpression();
|
||||||
ObjectPtr ReadAnnotations();
|
ObjectPtr ReadAnnotations();
|
||||||
|
|
|
@ -785,16 +785,6 @@ FlowGraph* FlowGraphBuilder::BuildGraph() {
|
||||||
const Function& function = parsed_function_->function();
|
const Function& function = parsed_function_->function();
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
// If we attached the native name to the function after it's creation (namely
|
|
||||||
// after reading the constant table from the kernel blob), we must have done
|
|
||||||
// so before building flow graph for the functions (since FGB depends needs
|
|
||||||
// the native name to be there).
|
|
||||||
const Script& script = Script::Handle(Z, function.script());
|
|
||||||
const KernelProgramInfo& info =
|
|
||||||
KernelProgramInfo::Handle(script.kernel_program_info());
|
|
||||||
ASSERT(info.IsNull() ||
|
|
||||||
info.potential_natives() == GrowableObjectArray::null());
|
|
||||||
|
|
||||||
// Check that all functions that are explicitly marked as recognized with the
|
// Check that all functions that are explicitly marked as recognized with the
|
||||||
// vm:recognized annotation are in fact recognized. The check can't be done on
|
// vm:recognized annotation are in fact recognized. The check can't be done on
|
||||||
// function creation, since the recognized status isn't set until later.
|
// function creation, since the recognized status isn't set until later.
|
||||||
|
|
|
@ -87,33 +87,6 @@ void TranslationHelper::InitFromKernelProgramInfo(
|
||||||
SetKernelProgramInfo(info);
|
SetKernelProgramInfo(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
GrowableObjectArrayPtr TranslationHelper::EnsurePotentialPragmaFunctions() {
|
|
||||||
auto& funcs =
|
|
||||||
GrowableObjectArray::Handle(Z, info_.potential_pragma_functions());
|
|
||||||
if (funcs.IsNull()) {
|
|
||||||
funcs = GrowableObjectArray::New(16, Heap::kNew);
|
|
||||||
info_.set_potential_pragma_functions(funcs);
|
|
||||||
}
|
|
||||||
return funcs.ptr();
|
|
||||||
}
|
|
||||||
|
|
||||||
void TranslationHelper::AddPotentialExtensionLibrary(const Library& library) {
|
|
||||||
if (potential_extension_libraries_ == nullptr) {
|
|
||||||
potential_extension_libraries_ =
|
|
||||||
&GrowableObjectArray::Handle(Z, GrowableObjectArray::New());
|
|
||||||
}
|
|
||||||
potential_extension_libraries_->Add(library);
|
|
||||||
}
|
|
||||||
|
|
||||||
GrowableObjectArrayPtr TranslationHelper::GetPotentialExtensionLibraries() {
|
|
||||||
if (potential_extension_libraries_ != nullptr) {
|
|
||||||
GrowableObjectArray* result = potential_extension_libraries_;
|
|
||||||
potential_extension_libraries_ = nullptr;
|
|
||||||
return result->ptr();
|
|
||||||
}
|
|
||||||
return GrowableObjectArray::null();
|
|
||||||
}
|
|
||||||
|
|
||||||
void TranslationHelper::SetStringOffsets(const TypedData& string_offsets) {
|
void TranslationHelper::SetStringOffsets(const TypedData& string_offsets) {
|
||||||
ASSERT(string_offsets_.IsNull());
|
ASSERT(string_offsets_.IsNull());
|
||||||
string_offsets_ = string_offsets.ptr();
|
string_offsets_ = string_offsets.ptr();
|
||||||
|
|
|
@ -73,11 +73,6 @@ class TranslationHelper {
|
||||||
|
|
||||||
KernelProgramInfo& info() { return info_; }
|
KernelProgramInfo& info() { return info_; }
|
||||||
|
|
||||||
GrowableObjectArrayPtr EnsurePotentialPragmaFunctions();
|
|
||||||
|
|
||||||
void AddPotentialExtensionLibrary(const Library& library);
|
|
||||||
GrowableObjectArrayPtr GetPotentialExtensionLibraries();
|
|
||||||
|
|
||||||
void SetKernelProgramInfo(const KernelProgramInfo& info);
|
void SetKernelProgramInfo(const KernelProgramInfo& info);
|
||||||
const KernelProgramInfo& GetKernelProgramInfo() const { return info_; }
|
const KernelProgramInfo& GetKernelProgramInfo() const { return info_; }
|
||||||
|
|
||||||
|
|
|
@ -643,7 +643,7 @@ static constexpr dart::compiler::target::word InstructionsTable_InstanceSize =
|
||||||
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
||||||
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
|
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
|
||||||
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
||||||
56;
|
48;
|
||||||
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
|
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
|
||||||
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
|
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
|
||||||
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
|
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
|
||||||
|
@ -1331,7 +1331,7 @@ static constexpr dart::compiler::target::word InstructionsTable_InstanceSize =
|
||||||
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
||||||
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
||||||
112;
|
96;
|
||||||
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
|
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
|
||||||
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
|
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
|
||||||
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
|
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
|
||||||
|
@ -2010,7 +2010,7 @@ static constexpr dart::compiler::target::word InstructionsTable_InstanceSize =
|
||||||
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
||||||
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
|
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
|
||||||
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
||||||
56;
|
48;
|
||||||
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
|
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
|
||||||
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
|
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
|
||||||
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
|
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
|
||||||
|
@ -2699,7 +2699,7 @@ static constexpr dart::compiler::target::word InstructionsTable_InstanceSize =
|
||||||
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
||||||
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
||||||
112;
|
96;
|
||||||
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
|
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
|
||||||
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
|
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
|
||||||
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
|
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
|
||||||
|
@ -3386,7 +3386,7 @@ static constexpr dart::compiler::target::word InstructionsTable_InstanceSize =
|
||||||
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
||||||
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
||||||
64;
|
56;
|
||||||
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 32;
|
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 32;
|
||||||
static constexpr dart::compiler::target::word Library_InstanceSize = 112;
|
static constexpr dart::compiler::target::word Library_InstanceSize = 112;
|
||||||
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 24;
|
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 24;
|
||||||
|
@ -4074,7 +4074,7 @@ static constexpr dart::compiler::target::word InstructionsTable_InstanceSize =
|
||||||
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
||||||
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
||||||
64;
|
56;
|
||||||
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 32;
|
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 32;
|
||||||
static constexpr dart::compiler::target::word Library_InstanceSize = 112;
|
static constexpr dart::compiler::target::word Library_InstanceSize = 112;
|
||||||
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 24;
|
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 24;
|
||||||
|
@ -4755,7 +4755,7 @@ static constexpr dart::compiler::target::word InstructionsTable_InstanceSize =
|
||||||
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
||||||
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
|
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
|
||||||
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
||||||
56;
|
48;
|
||||||
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
|
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
|
||||||
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
|
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
|
||||||
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
|
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
|
||||||
|
@ -5444,7 +5444,7 @@ static constexpr dart::compiler::target::word InstructionsTable_InstanceSize =
|
||||||
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
||||||
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
||||||
112;
|
96;
|
||||||
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
|
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
|
||||||
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
|
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
|
||||||
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
|
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
|
||||||
|
@ -6117,7 +6117,7 @@ static constexpr dart::compiler::target::word InstructionsTable_InstanceSize =
|
||||||
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
||||||
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
|
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
|
||||||
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
||||||
56;
|
48;
|
||||||
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
|
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
|
||||||
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
|
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
|
||||||
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
|
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
|
||||||
|
@ -6797,7 +6797,7 @@ static constexpr dart::compiler::target::word InstructionsTable_InstanceSize =
|
||||||
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
||||||
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
||||||
112;
|
96;
|
||||||
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
|
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
|
||||||
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
|
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
|
||||||
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
|
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
|
||||||
|
@ -7468,7 +7468,7 @@ static constexpr dart::compiler::target::word InstructionsTable_InstanceSize =
|
||||||
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
||||||
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
|
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
|
||||||
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
||||||
56;
|
48;
|
||||||
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
|
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
|
||||||
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
|
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
|
||||||
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
|
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
|
||||||
|
@ -8149,7 +8149,7 @@ static constexpr dart::compiler::target::word InstructionsTable_InstanceSize =
|
||||||
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
||||||
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
||||||
112;
|
96;
|
||||||
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
|
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
|
||||||
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
|
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
|
||||||
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
|
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
|
||||||
|
@ -8828,7 +8828,7 @@ static constexpr dart::compiler::target::word InstructionsTable_InstanceSize =
|
||||||
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
||||||
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
||||||
64;
|
56;
|
||||||
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 32;
|
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 32;
|
||||||
static constexpr dart::compiler::target::word Library_InstanceSize = 112;
|
static constexpr dart::compiler::target::word Library_InstanceSize = 112;
|
||||||
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 24;
|
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 24;
|
||||||
|
@ -9508,7 +9508,7 @@ static constexpr dart::compiler::target::word InstructionsTable_InstanceSize =
|
||||||
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
||||||
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
||||||
64;
|
56;
|
||||||
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 32;
|
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 32;
|
||||||
static constexpr dart::compiler::target::word Library_InstanceSize = 112;
|
static constexpr dart::compiler::target::word Library_InstanceSize = 112;
|
||||||
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 24;
|
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 24;
|
||||||
|
@ -10181,7 +10181,7 @@ static constexpr dart::compiler::target::word InstructionsTable_InstanceSize =
|
||||||
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
||||||
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
|
static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
|
||||||
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
||||||
56;
|
48;
|
||||||
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
|
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
|
||||||
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
|
static constexpr dart::compiler::target::word Library_InstanceSize = 88;
|
||||||
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
|
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
|
||||||
|
@ -10862,7 +10862,7 @@ static constexpr dart::compiler::target::word InstructionsTable_InstanceSize =
|
||||||
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
|
||||||
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
|
||||||
112;
|
96;
|
||||||
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
|
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
|
||||||
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
|
static constexpr dart::compiler::target::word Library_InstanceSize = 168;
|
||||||
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
|
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
|
||||||
|
@ -11610,7 +11610,7 @@ static constexpr dart::compiler::target::word
|
||||||
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
|
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_Integer_InstanceSize = 4;
|
||||||
static constexpr dart::compiler::target::word
|
static constexpr dart::compiler::target::word
|
||||||
AOT_KernelProgramInfo_InstanceSize = 56;
|
AOT_KernelProgramInfo_InstanceSize = 48;
|
||||||
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
||||||
28;
|
28;
|
||||||
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 84;
|
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 84;
|
||||||
|
@ -12371,7 +12371,7 @@ static constexpr dart::compiler::target::word
|
||||||
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
|
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_Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word
|
static constexpr dart::compiler::target::word
|
||||||
AOT_KernelProgramInfo_InstanceSize = 112;
|
AOT_KernelProgramInfo_InstanceSize = 96;
|
||||||
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
||||||
48;
|
48;
|
||||||
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
|
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
|
||||||
|
@ -13136,7 +13136,7 @@ static constexpr dart::compiler::target::word
|
||||||
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
|
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_Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word
|
static constexpr dart::compiler::target::word
|
||||||
AOT_KernelProgramInfo_InstanceSize = 112;
|
AOT_KernelProgramInfo_InstanceSize = 96;
|
||||||
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
||||||
48;
|
48;
|
||||||
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
|
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
|
||||||
|
@ -13898,7 +13898,7 @@ static constexpr dart::compiler::target::word
|
||||||
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
|
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_Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word
|
static constexpr dart::compiler::target::word
|
||||||
AOT_KernelProgramInfo_InstanceSize = 64;
|
AOT_KernelProgramInfo_InstanceSize = 56;
|
||||||
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
||||||
32;
|
32;
|
||||||
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 104;
|
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 104;
|
||||||
|
@ -14661,7 +14661,7 @@ static constexpr dart::compiler::target::word
|
||||||
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
|
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_Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word
|
static constexpr dart::compiler::target::word
|
||||||
AOT_KernelProgramInfo_InstanceSize = 64;
|
AOT_KernelProgramInfo_InstanceSize = 56;
|
||||||
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
||||||
32;
|
32;
|
||||||
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 104;
|
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 104;
|
||||||
|
@ -15419,7 +15419,7 @@ static constexpr dart::compiler::target::word
|
||||||
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
|
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_Integer_InstanceSize = 4;
|
||||||
static constexpr dart::compiler::target::word
|
static constexpr dart::compiler::target::word
|
||||||
AOT_KernelProgramInfo_InstanceSize = 56;
|
AOT_KernelProgramInfo_InstanceSize = 48;
|
||||||
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
||||||
28;
|
28;
|
||||||
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 84;
|
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 84;
|
||||||
|
@ -16181,7 +16181,7 @@ static constexpr dart::compiler::target::word
|
||||||
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
|
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_Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word
|
static constexpr dart::compiler::target::word
|
||||||
AOT_KernelProgramInfo_InstanceSize = 112;
|
AOT_KernelProgramInfo_InstanceSize = 96;
|
||||||
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
||||||
48;
|
48;
|
||||||
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
|
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
|
||||||
|
@ -16930,7 +16930,7 @@ static constexpr dart::compiler::target::word
|
||||||
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
|
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_Integer_InstanceSize = 4;
|
||||||
static constexpr dart::compiler::target::word
|
static constexpr dart::compiler::target::word
|
||||||
AOT_KernelProgramInfo_InstanceSize = 56;
|
AOT_KernelProgramInfo_InstanceSize = 48;
|
||||||
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
||||||
28;
|
28;
|
||||||
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 84;
|
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 84;
|
||||||
|
@ -17682,7 +17682,7 @@ static constexpr dart::compiler::target::word
|
||||||
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
|
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_Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word
|
static constexpr dart::compiler::target::word
|
||||||
AOT_KernelProgramInfo_InstanceSize = 112;
|
AOT_KernelProgramInfo_InstanceSize = 96;
|
||||||
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
||||||
48;
|
48;
|
||||||
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
|
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
|
||||||
|
@ -18438,7 +18438,7 @@ static constexpr dart::compiler::target::word
|
||||||
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
|
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_Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word
|
static constexpr dart::compiler::target::word
|
||||||
AOT_KernelProgramInfo_InstanceSize = 112;
|
AOT_KernelProgramInfo_InstanceSize = 96;
|
||||||
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
||||||
48;
|
48;
|
||||||
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
|
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
|
||||||
|
@ -19191,7 +19191,7 @@ static constexpr dart::compiler::target::word
|
||||||
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
|
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_Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word
|
static constexpr dart::compiler::target::word
|
||||||
AOT_KernelProgramInfo_InstanceSize = 64;
|
AOT_KernelProgramInfo_InstanceSize = 56;
|
||||||
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
||||||
32;
|
32;
|
||||||
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 104;
|
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 104;
|
||||||
|
@ -19945,7 +19945,7 @@ static constexpr dart::compiler::target::word
|
||||||
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
|
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_Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word
|
static constexpr dart::compiler::target::word
|
||||||
AOT_KernelProgramInfo_InstanceSize = 64;
|
AOT_KernelProgramInfo_InstanceSize = 56;
|
||||||
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
||||||
32;
|
32;
|
||||||
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 104;
|
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 104;
|
||||||
|
@ -20694,7 +20694,7 @@ static constexpr dart::compiler::target::word
|
||||||
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
|
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_Integer_InstanceSize = 4;
|
||||||
static constexpr dart::compiler::target::word
|
static constexpr dart::compiler::target::word
|
||||||
AOT_KernelProgramInfo_InstanceSize = 56;
|
AOT_KernelProgramInfo_InstanceSize = 48;
|
||||||
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
||||||
28;
|
28;
|
||||||
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 84;
|
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 84;
|
||||||
|
@ -21447,7 +21447,7 @@ static constexpr dart::compiler::target::word
|
||||||
static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 24;
|
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_Integer_InstanceSize = 8;
|
||||||
static constexpr dart::compiler::target::word
|
static constexpr dart::compiler::target::word
|
||||||
AOT_KernelProgramInfo_InstanceSize = 112;
|
AOT_KernelProgramInfo_InstanceSize = 96;
|
||||||
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
|
||||||
48;
|
48;
|
||||||
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
|
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 160;
|
||||||
|
|
|
@ -207,8 +207,6 @@ KernelLoader::KernelLoader(Program* program,
|
||||||
&active_class_,
|
&active_class_,
|
||||||
/* finalize= */ false),
|
/* finalize= */ false),
|
||||||
inferred_type_metadata_helper_(&helper_, &constant_reader_),
|
inferred_type_metadata_helper_(&helper_, &constant_reader_),
|
||||||
annotation_list_(GrowableObjectArray::Handle(Z)),
|
|
||||||
potential_pragma_functions_(GrowableObjectArray::Handle(Z)),
|
|
||||||
static_field_value_(Object::Handle(Z)),
|
static_field_value_(Object::Handle(Z)),
|
||||||
pragma_class_(Class::Handle(Z)),
|
pragma_class_(Class::Handle(Z)),
|
||||||
pragma_name_field_(Field::Handle(Z)),
|
pragma_name_field_(Field::Handle(Z)),
|
||||||
|
@ -474,8 +472,6 @@ KernelLoader::KernelLoader(const Script& script,
|
||||||
&active_class_,
|
&active_class_,
|
||||||
/* finalize= */ false),
|
/* finalize= */ false),
|
||||||
inferred_type_metadata_helper_(&helper_, &constant_reader_),
|
inferred_type_metadata_helper_(&helper_, &constant_reader_),
|
||||||
annotation_list_(GrowableObjectArray::Handle(Z)),
|
|
||||||
potential_pragma_functions_(GrowableObjectArray::Handle(Z)),
|
|
||||||
static_field_value_(Object::Handle(Z)),
|
static_field_value_(Object::Handle(Z)),
|
||||||
pragma_class_(Class::Handle(Z)),
|
pragma_class_(Class::Handle(Z)),
|
||||||
pragma_name_field_(Field::Handle(Z)),
|
pragma_name_field_(Field::Handle(Z)),
|
||||||
|
@ -488,102 +484,6 @@ KernelLoader::KernelLoader(const Script& script,
|
||||||
H.InitFromKernelProgramInfo(kernel_program_info_);
|
H.InitFromKernelProgramInfo(kernel_program_info_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KernelLoader::EvaluateDelayedPragmas() {
|
|
||||||
potential_pragma_functions_ =
|
|
||||||
kernel_program_info_.potential_pragma_functions();
|
|
||||||
if (potential_pragma_functions_.IsNull()) return;
|
|
||||||
|
|
||||||
Function& function = Function::Handle();
|
|
||||||
Library& library = Library::Handle();
|
|
||||||
Class& klass = Class::Handle();
|
|
||||||
for (int i = 0; i < potential_pragma_functions_.Length(); ++i) {
|
|
||||||
function ^= potential_pragma_functions_.At(i);
|
|
||||||
klass = function.Owner();
|
|
||||||
library = klass.library();
|
|
||||||
library.GetMetadata(function);
|
|
||||||
}
|
|
||||||
|
|
||||||
potential_pragma_functions_ = GrowableObjectArray::null();
|
|
||||||
kernel_program_info_.set_potential_pragma_functions(
|
|
||||||
GrowableObjectArray::Handle(Z));
|
|
||||||
}
|
|
||||||
|
|
||||||
void KernelLoader::AnnotateProcedures() {
|
|
||||||
annotation_list_ = kernel_program_info_.potential_natives();
|
|
||||||
const intptr_t length =
|
|
||||||
!annotation_list_.IsNull() ? annotation_list_.Length() : 0;
|
|
||||||
if (length == 0) return;
|
|
||||||
|
|
||||||
// Prepare lazy constant reading.
|
|
||||||
ConstantReader constant_reader(&helper_, &active_class_);
|
|
||||||
|
|
||||||
// Ensure `pragma` class is available before evaluating the annotations.
|
|
||||||
EnsurePragmaClassIsLookedUp();
|
|
||||||
|
|
||||||
Instance& constant = Instance::Handle(Z);
|
|
||||||
String& pragma_name = String::Handle(Z);
|
|
||||||
Object& pragma_options = Object::Handle(Z);
|
|
||||||
|
|
||||||
// Start scanning all candidates in [potential_natives] for the annotation
|
|
||||||
// constant. If the annotation is found, flag the [Function] as native and
|
|
||||||
// attach the native name to it.
|
|
||||||
Function& function = Function::Handle(Z);
|
|
||||||
for (intptr_t i = 0; i < length; ++i) {
|
|
||||||
function ^= annotation_list_.At(i);
|
|
||||||
|
|
||||||
helper_.SetOffset(function.KernelDataProgramOffset() +
|
|
||||||
function.kernel_offset());
|
|
||||||
if (function.IsGenerativeConstructor()) {
|
|
||||||
ConstructorHelper constructor_helper(&helper_);
|
|
||||||
constructor_helper.ReadUntilExcluding(ConstructorHelper::kAnnotations);
|
|
||||||
} else {
|
|
||||||
ProcedureHelper procedure_helper(&helper_);
|
|
||||||
procedure_helper.ReadUntilExcluding(ProcedureHelper::kAnnotations);
|
|
||||||
}
|
|
||||||
|
|
||||||
const intptr_t annotation_count = helper_.ReadListLength();
|
|
||||||
for (intptr_t j = 0; j < annotation_count; ++j) {
|
|
||||||
const intptr_t tag = helper_.PeekTag();
|
|
||||||
if (tag == kConstantExpression) {
|
|
||||||
helper_.ReadByte(); // Skip the tag.
|
|
||||||
helper_.ReadPosition(); // Skip fileOffset.
|
|
||||||
helper_.SkipDartType(); // Skip type.
|
|
||||||
|
|
||||||
const intptr_t constant_table_index = helper_.ReadUInt();
|
|
||||||
if (constant_reader.IsInstanceConstant(constant_table_index,
|
|
||||||
pragma_class_)) {
|
|
||||||
constant = constant_reader.ReadConstant(constant_table_index);
|
|
||||||
ASSERT(constant.clazz() == pragma_class_.ptr());
|
|
||||||
|
|
||||||
pragma_name ^= constant.GetField(pragma_name_field_);
|
|
||||||
|
|
||||||
if (pragma_name.ptr() == Symbols::vm_invisible().ptr()) {
|
|
||||||
function.set_is_visible(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// We found the annotation, let's flag the function as native and
|
|
||||||
// set the native name!
|
|
||||||
if (pragma_name.ptr() == Symbols::vm_external_name().ptr()) {
|
|
||||||
pragma_options = constant.GetField(pragma_options_field_);
|
|
||||||
if (pragma_options.IsString()) {
|
|
||||||
function.set_is_native(true);
|
|
||||||
function.set_native_name(String::Cast(pragma_options));
|
|
||||||
function.set_is_external(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
helper_.SkipExpression();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clear out the list of [Function] objects which might need their native
|
|
||||||
// name to be set after reading the constant table from the kernel blob.
|
|
||||||
annotation_list_ = GrowableObjectArray::null();
|
|
||||||
kernel_program_info_.set_potential_natives(annotation_list_);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool KernelLoader::IsClassName(NameIndex name,
|
bool KernelLoader::IsClassName(NameIndex name,
|
||||||
const String& library,
|
const String& library,
|
||||||
const String& klass) {
|
const String& klass) {
|
||||||
|
@ -643,8 +543,6 @@ ObjectPtr KernelLoader::LoadProgram(bool process_pending_classes) {
|
||||||
}
|
}
|
||||||
kernel_program_info_.set_constants(array);
|
kernel_program_info_.set_constants(array);
|
||||||
H.SetConstants(array); // for caching
|
H.SetConstants(array); // for caching
|
||||||
AnnotateProcedures();
|
|
||||||
EvaluateDelayedPragmas();
|
|
||||||
|
|
||||||
NameIndex main = program_->main_method();
|
NameIndex main = program_->main_method();
|
||||||
if (main != -1) {
|
if (main != -1) {
|
||||||
|
@ -980,12 +878,8 @@ LibraryPtr KernelLoader::LoadLibrary(intptr_t index) {
|
||||||
library_helper.ReadUntilExcluding(LibraryHelper::kAnnotations);
|
library_helper.ReadUntilExcluding(LibraryHelper::kAnnotations);
|
||||||
intptr_t annotations_kernel_offset =
|
intptr_t annotations_kernel_offset =
|
||||||
helper_.ReaderOffset() - correction_offset_;
|
helper_.ReaderOffset() - correction_offset_;
|
||||||
intptr_t annotation_count = helper_.ReadListLength(); // read list length.
|
const intptr_t annotation_count =
|
||||||
if (annotation_count > 0) {
|
helper_.ReadListLength(); // read list length.
|
||||||
// This must wait until we can evaluate constants.
|
|
||||||
// So put on the "pending" list.
|
|
||||||
H.AddPotentialExtensionLibrary(library);
|
|
||||||
}
|
|
||||||
for (intptr_t i = 0; i < annotation_count; ++i) {
|
for (intptr_t i = 0; i < annotation_count; ++i) {
|
||||||
helper_.SkipExpression(); // read ith annotation.
|
helper_.SkipExpression(); // read ith annotation.
|
||||||
}
|
}
|
||||||
|
@ -1150,7 +1044,6 @@ void KernelLoader::FinishTopLevelClassLoading(
|
||||||
intptr_t annotation_count = helper_.ReadListLength();
|
intptr_t annotation_count = helper_.ReadListLength();
|
||||||
bool has_pragma_annotation;
|
bool has_pragma_annotation;
|
||||||
ReadVMAnnotations(library, annotation_count, /*native_name=*/nullptr,
|
ReadVMAnnotations(library, annotation_count, /*native_name=*/nullptr,
|
||||||
/*scan_annotations_lazy=*/nullptr,
|
|
||||||
/*is_invisible_function=*/nullptr,
|
/*is_invisible_function=*/nullptr,
|
||||||
&has_pragma_annotation);
|
&has_pragma_annotation);
|
||||||
field_helper.SetJustRead(FieldHelper::kAnnotations);
|
field_helper.SetJustRead(FieldHelper::kAnnotations);
|
||||||
|
@ -1464,7 +1357,6 @@ void KernelLoader::LoadClass(const Library& library,
|
||||||
intptr_t annotation_count = helper_.ReadListLength();
|
intptr_t annotation_count = helper_.ReadListLength();
|
||||||
bool has_pragma_annotation = false;
|
bool has_pragma_annotation = false;
|
||||||
ReadVMAnnotations(library, annotation_count, /*native_name=*/nullptr,
|
ReadVMAnnotations(library, annotation_count, /*native_name=*/nullptr,
|
||||||
/*scan_annotations_lazy=*/nullptr,
|
|
||||||
/*is_invisible_function=*/nullptr, &has_pragma_annotation);
|
/*is_invisible_function=*/nullptr, &has_pragma_annotation);
|
||||||
if (has_pragma_annotation) {
|
if (has_pragma_annotation) {
|
||||||
out_class->set_has_pragma(true);
|
out_class->set_has_pragma(true);
|
||||||
|
@ -1544,7 +1436,6 @@ void KernelLoader::FinishClassLoading(const Class& klass,
|
||||||
intptr_t annotation_count = helper_.ReadListLength();
|
intptr_t annotation_count = helper_.ReadListLength();
|
||||||
bool has_pragma_annotation;
|
bool has_pragma_annotation;
|
||||||
ReadVMAnnotations(library, annotation_count, /*native_name=*/nullptr,
|
ReadVMAnnotations(library, annotation_count, /*native_name=*/nullptr,
|
||||||
/*scan_annotations_lazy=*/nullptr,
|
|
||||||
/*is_invisible_function=*/nullptr,
|
/*is_invisible_function=*/nullptr,
|
||||||
&has_pragma_annotation);
|
&has_pragma_annotation);
|
||||||
field_helper.SetJustRead(FieldHelper::kAnnotations);
|
field_helper.SetJustRead(FieldHelper::kAnnotations);
|
||||||
|
@ -1669,12 +1560,10 @@ void KernelLoader::FinishClassLoading(const Class& klass,
|
||||||
ConstructorHelper constructor_helper(&helper_);
|
ConstructorHelper constructor_helper(&helper_);
|
||||||
constructor_helper.ReadUntilExcluding(ConstructorHelper::kAnnotations);
|
constructor_helper.ReadUntilExcluding(ConstructorHelper::kAnnotations);
|
||||||
intptr_t annotation_count = helper_.ReadListLength();
|
intptr_t annotation_count = helper_.ReadListLength();
|
||||||
bool scan_annotations_lazy;
|
|
||||||
bool has_pragma_annotation;
|
bool has_pragma_annotation;
|
||||||
bool is_invisible_function;
|
bool is_invisible_function;
|
||||||
ReadVMAnnotations(library, annotation_count, /*native_name=*/nullptr,
|
ReadVMAnnotations(library, annotation_count, /*native_name=*/nullptr,
|
||||||
&scan_annotations_lazy, &is_invisible_function,
|
&is_invisible_function, &has_pragma_annotation);
|
||||||
&has_pragma_annotation);
|
|
||||||
constructor_helper.SetJustRead(ConstructorHelper::kAnnotations);
|
constructor_helper.SetJustRead(ConstructorHelper::kAnnotations);
|
||||||
constructor_helper.ReadUntilExcluding(ConstructorHelper::kFunction);
|
constructor_helper.ReadUntilExcluding(ConstructorHelper::kFunction);
|
||||||
|
|
||||||
|
@ -1705,12 +1594,6 @@ void KernelLoader::FinishClassLoading(const Class& klass,
|
||||||
function.set_has_pragma(has_pragma_annotation);
|
function.set_has_pragma(has_pragma_annotation);
|
||||||
function.set_is_visible(!is_invisible_function);
|
function.set_is_visible(!is_invisible_function);
|
||||||
|
|
||||||
if (scan_annotations_lazy) {
|
|
||||||
// Cannot be processed right now, so put on "pending" list.
|
|
||||||
EnsureAnnotationList();
|
|
||||||
annotation_list_.Add(function);
|
|
||||||
}
|
|
||||||
|
|
||||||
FunctionNodeHelper function_node_helper(&helper_);
|
FunctionNodeHelper function_node_helper(&helper_);
|
||||||
function_node_helper.ReadUntilExcluding(
|
function_node_helper.ReadUntilExcluding(
|
||||||
FunctionNodeHelper::kTypeParameters);
|
FunctionNodeHelper::kTypeParameters);
|
||||||
|
@ -1826,9 +1709,6 @@ void KernelLoader::FinishLoading(const Class& klass) {
|
||||||
//
|
//
|
||||||
// Output parameters:
|
// Output parameters:
|
||||||
//
|
//
|
||||||
// `has_annotations_of_interest`: true if there may be annotations of
|
|
||||||
// interest and we need to re-try after reading the constants table.
|
|
||||||
//
|
|
||||||
// `is_invisible_function`: if `@pragma('vm:invisible)` was found.
|
// `is_invisible_function`: if `@pragma('vm:invisible)` was found.
|
||||||
//
|
//
|
||||||
// `native_name`: set if @pragma('vm:external-name)` was identified.
|
// `native_name`: set if @pragma('vm:external-name)` was identified.
|
||||||
|
@ -1839,12 +1719,8 @@ void KernelLoader::FinishLoading(const Class& klass) {
|
||||||
void KernelLoader::ReadVMAnnotations(const Library& library,
|
void KernelLoader::ReadVMAnnotations(const Library& library,
|
||||||
intptr_t annotation_count,
|
intptr_t annotation_count,
|
||||||
String* native_name,
|
String* native_name,
|
||||||
bool* has_annotations_of_interest,
|
|
||||||
bool* is_invisible_function,
|
bool* is_invisible_function,
|
||||||
bool* has_pragma_annotation) {
|
bool* has_pragma_annotation) {
|
||||||
if (has_annotations_of_interest != nullptr) {
|
|
||||||
*has_annotations_of_interest = false;
|
|
||||||
}
|
|
||||||
if (is_invisible_function != nullptr) {
|
if (is_invisible_function != nullptr) {
|
||||||
*is_invisible_function = false;
|
*is_invisible_function = false;
|
||||||
}
|
}
|
||||||
|
@ -1853,102 +1729,32 @@ void KernelLoader::ReadVMAnnotations(const Library& library,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Array& constant_table_array =
|
|
||||||
Array::Handle(Z, kernel_program_info_.constants());
|
|
||||||
const bool have_read_constant_table = !constant_table_array.IsNull();
|
|
||||||
|
|
||||||
Instance& constant = Instance::Handle(Z);
|
|
||||||
String& pragma_name = String::Handle(Z);
|
|
||||||
Object& pragma_options = Object::Handle(Z);
|
|
||||||
for (intptr_t i = 0; i < annotation_count; ++i) {
|
for (intptr_t i = 0; i < annotation_count; ++i) {
|
||||||
const intptr_t tag = helper_.PeekTag();
|
const intptr_t tag = helper_.PeekTag();
|
||||||
if (tag == kConstantExpression) {
|
if (tag == kConstantExpression) {
|
||||||
if (!have_read_constant_table) {
|
helper_.ReadByte(); // Skip the tag.
|
||||||
// We can only read in the constant table once all classes have been
|
helper_.ReadPosition(); // Skip fileOffset.
|
||||||
// finalized (otherwise we can't create instances of the classes!).
|
helper_.SkipDartType(); // Skip type.
|
||||||
//
|
const intptr_t index_in_constant_table = helper_.ReadUInt();
|
||||||
// We therefore delay the scanning for `@pragma('vm:external-name')`
|
|
||||||
// constants in the annotation list to later.
|
// Prepare lazy constant reading.
|
||||||
if (has_annotations_of_interest != nullptr) {
|
ConstantReader constant_reader(&helper_, &active_class_);
|
||||||
*has_annotations_of_interest = true;
|
|
||||||
|
intptr_t name_index = -1;
|
||||||
|
intptr_t options_index = -1;
|
||||||
|
if (constant_reader.IsPragmaInstanceConstant(
|
||||||
|
index_in_constant_table, &name_index, &options_index)) {
|
||||||
|
*has_pragma_annotation = true;
|
||||||
|
|
||||||
|
if (is_invisible_function != nullptr) {
|
||||||
|
if (constant_reader.IsStringConstant(name_index, "vm:invisible")) {
|
||||||
|
*is_invisible_function = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (native_name != nullptr) {
|
||||||
ASSERT(kernel_program_info_.constants_table() !=
|
if (constant_reader.IsStringConstant(name_index,
|
||||||
ExternalTypedData::null());
|
"vm:external-name")) {
|
||||||
|
constant_reader.GetStringConstant(options_index, native_name);
|
||||||
// For pragma annotations, we seek into the constants table and peek
|
|
||||||
// into the Kernel representation of the constant.
|
|
||||||
helper_.ReadByte(); // Skip the tag.
|
|
||||||
helper_.ReadPosition(); // Skip fileOffset.
|
|
||||||
helper_.SkipDartType(); // Skip type.
|
|
||||||
const intptr_t index_in_constant_table = helper_.ReadUInt();
|
|
||||||
|
|
||||||
AlternativeReadingScopeWithNewData scope(
|
|
||||||
&helper_.reader_,
|
|
||||||
&ExternalTypedData::Handle(Z,
|
|
||||||
kernel_program_info_.constants_table()),
|
|
||||||
0);
|
|
||||||
|
|
||||||
// Seek into the position within the constant table where we can inspect
|
|
||||||
// this constant's Kernel representation.
|
|
||||||
|
|
||||||
// Get the length of the constants (at the end of the mapping).
|
|
||||||
helper_.SetOffset(helper_.ReaderSize() - 4);
|
|
||||||
const intptr_t num_constants = helper_.ReadUInt32();
|
|
||||||
|
|
||||||
// Get the binary offset of the constant at the wanted index.
|
|
||||||
helper_.SetOffset(helper_.ReaderSize() - 4 - (num_constants * 4) +
|
|
||||||
(index_in_constant_table * 4));
|
|
||||||
const intptr_t constant_offset = helper_.ReadUInt32();
|
|
||||||
|
|
||||||
helper_.SetOffset(constant_offset);
|
|
||||||
|
|
||||||
uint8_t tag = helper_.ReadTag();
|
|
||||||
if (tag == kInstanceConstant) {
|
|
||||||
*has_pragma_annotation =
|
|
||||||
*has_pragma_annotation ||
|
|
||||||
IsClassName(helper_.ReadCanonicalNameReference(),
|
|
||||||
Symbols::DartCore(), Symbols::Pragma());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Prepare lazy constant reading.
|
|
||||||
const dart::Class& toplevel_class =
|
|
||||||
Class::Handle(Z, library.toplevel_class());
|
|
||||||
ActiveClassScope active_class_scope(&active_class_, &toplevel_class);
|
|
||||||
ConstantReader constant_reader(&helper_, &active_class_);
|
|
||||||
|
|
||||||
helper_.ReadByte(); // Skip the tag.
|
|
||||||
|
|
||||||
// Obtain `dart:_internal::pragma`.
|
|
||||||
EnsurePragmaClassIsLookedUp();
|
|
||||||
|
|
||||||
if (tag == kConstantExpression) {
|
|
||||||
helper_.ReadPosition(); // Skip fileOffset.
|
|
||||||
helper_.SkipDartType(); // Skip type.
|
|
||||||
}
|
|
||||||
const intptr_t constant_table_index = helper_.ReadUInt();
|
|
||||||
// We have a candidate. Let's look if it's an instance of the
|
|
||||||
// `pragma` class.
|
|
||||||
if (constant_reader.IsInstanceConstant(constant_table_index,
|
|
||||||
pragma_class_)) {
|
|
||||||
*has_pragma_annotation = true;
|
|
||||||
if (native_name != nullptr || is_invisible_function != nullptr) {
|
|
||||||
constant = constant_reader.ReadConstant(constant_table_index);
|
|
||||||
ASSERT(constant.clazz() == pragma_class_.ptr());
|
|
||||||
pragma_name ^= constant.GetField(pragma_name_field_);
|
|
||||||
|
|
||||||
if (is_invisible_function != nullptr &&
|
|
||||||
pragma_name.ptr() == Symbols::vm_invisible().ptr()) {
|
|
||||||
*is_invisible_function = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (native_name != nullptr &&
|
|
||||||
pragma_name.ptr() == Symbols::vm_external_name().ptr()) {
|
|
||||||
pragma_options = constant.GetField(pragma_options_field_);
|
|
||||||
if (pragma_options.IsString()) {
|
|
||||||
*native_name ^= pragma_options.ptr();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1986,15 +1792,11 @@ void KernelLoader::LoadProcedure(const Library& library,
|
||||||
bool is_extension_member = procedure_helper.IsExtensionMember();
|
bool is_extension_member = procedure_helper.IsExtensionMember();
|
||||||
bool is_synthetic = procedure_helper.IsSynthetic();
|
bool is_synthetic = procedure_helper.IsSynthetic();
|
||||||
String& native_name = String::Handle(Z);
|
String& native_name = String::Handle(Z);
|
||||||
bool scan_annotations_lazy;
|
|
||||||
bool has_pragma_annotation;
|
bool has_pragma_annotation;
|
||||||
bool is_invisible_function;
|
bool is_invisible_function;
|
||||||
const intptr_t annotation_count = helper_.ReadListLength();
|
const intptr_t annotation_count = helper_.ReadListLength();
|
||||||
ReadVMAnnotations(library, annotation_count, &native_name,
|
ReadVMAnnotations(library, annotation_count, &native_name,
|
||||||
&scan_annotations_lazy, &is_invisible_function,
|
&is_invisible_function, &has_pragma_annotation);
|
||||||
&has_pragma_annotation);
|
|
||||||
// If this is a potential native, we'll unset is_external in
|
|
||||||
// AnnotateProcedures instead.
|
|
||||||
is_external = is_external && native_name.IsNull();
|
is_external = is_external && native_name.IsNull();
|
||||||
procedure_helper.SetJustRead(ProcedureHelper::kAnnotations);
|
procedure_helper.SetJustRead(ProcedureHelper::kAnnotations);
|
||||||
const Object& script_class =
|
const Object& script_class =
|
||||||
|
@ -2067,11 +1869,6 @@ void KernelLoader::LoadProcedure(const Library& library,
|
||||||
if (!native_name.IsNull()) {
|
if (!native_name.IsNull()) {
|
||||||
function.set_native_name(native_name);
|
function.set_native_name(native_name);
|
||||||
}
|
}
|
||||||
if (scan_annotations_lazy) {
|
|
||||||
// Cannot be processed right now, so put on "pending" list.
|
|
||||||
EnsureAnnotationList();
|
|
||||||
annotation_list_.Add(function);
|
|
||||||
}
|
|
||||||
|
|
||||||
function_node_helper.ReadUntilExcluding(FunctionNodeHelper::kTypeParameters);
|
function_node_helper.ReadUntilExcluding(FunctionNodeHelper::kTypeParameters);
|
||||||
T.SetupFunctionParameters(owner, function, is_method,
|
T.SetupFunctionParameters(owner, function, is_method,
|
||||||
|
@ -2086,17 +1883,6 @@ void KernelLoader::LoadProcedure(const Library& library,
|
||||||
if (annotation_count > 0) {
|
if (annotation_count > 0) {
|
||||||
library.AddMetadata(function, procedure_offset);
|
library.AddMetadata(function, procedure_offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (has_pragma_annotation) {
|
|
||||||
if (kernel_program_info_.constants() == Array::null()) {
|
|
||||||
// Any potential pragma function before point at which
|
|
||||||
// constant table could be loaded goes to "pending".
|
|
||||||
EnsurePotentialPragmaFunctions();
|
|
||||||
potential_pragma_functions_.Add(function);
|
|
||||||
} else {
|
|
||||||
library.GetMetadata(function);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const Object& KernelLoader::ClassForScriptAt(const Class& klass,
|
const Object& KernelLoader::ClassForScriptAt(const Class& klass,
|
||||||
|
|
|
@ -224,13 +224,9 @@ class KernelLoader : public ValueObject {
|
||||||
|
|
||||||
bool IsClassName(NameIndex name, const String& library, const String& klass);
|
bool IsClassName(NameIndex name, const String& library, const String& klass);
|
||||||
|
|
||||||
void AnnotateProcedures();
|
|
||||||
void EvaluateDelayedPragmas();
|
|
||||||
|
|
||||||
void ReadVMAnnotations(const Library& library,
|
void ReadVMAnnotations(const Library& library,
|
||||||
intptr_t annotation_count,
|
intptr_t annotation_count,
|
||||||
String* native_name,
|
String* native_name,
|
||||||
bool* has_annotations_of_interest,
|
|
||||||
bool* is_invisible_function,
|
bool* is_invisible_function,
|
||||||
bool* has_pragma_annotation);
|
bool* has_pragma_annotation);
|
||||||
|
|
||||||
|
@ -348,21 +344,6 @@ class KernelLoader : public ValueObject {
|
||||||
ASSERT(pragma_class_.is_declaration_loaded());
|
ASSERT(pragma_class_.is_declaration_loaded());
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnsureAnnotationList() {
|
|
||||||
annotation_list_ = kernel_program_info_.potential_natives();
|
|
||||||
if (annotation_list_.IsNull()) {
|
|
||||||
// To avoid too many grows in this array, we'll set it's initial size to
|
|
||||||
// something close to the actual number of potential native functions.
|
|
||||||
annotation_list_ = GrowableObjectArray::New(100, Heap::kNew);
|
|
||||||
kernel_program_info_.set_potential_natives(annotation_list_);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void EnsurePotentialPragmaFunctions() {
|
|
||||||
potential_pragma_functions_ =
|
|
||||||
translation_helper_.EnsurePotentialPragmaFunctions();
|
|
||||||
}
|
|
||||||
|
|
||||||
Program* program_;
|
Program* program_;
|
||||||
|
|
||||||
Thread* thread_;
|
Thread* thread_;
|
||||||
|
@ -388,8 +369,6 @@ class KernelLoader : public ValueObject {
|
||||||
TypeTranslator type_translator_;
|
TypeTranslator type_translator_;
|
||||||
InferredTypeMetadataHelper inferred_type_metadata_helper_;
|
InferredTypeMetadataHelper inferred_type_metadata_helper_;
|
||||||
|
|
||||||
GrowableObjectArray& annotation_list_;
|
|
||||||
GrowableObjectArray& potential_pragma_functions_;
|
|
||||||
Object& static_field_value_;
|
Object& static_field_value_;
|
||||||
|
|
||||||
Class& pragma_class_;
|
Class& pragma_class_;
|
||||||
|
|
|
@ -14933,16 +14933,6 @@ void KernelProgramInfo::set_constants_table(
|
||||||
untag()->set_constants_table(value.ptr());
|
untag()->set_constants_table(value.ptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void KernelProgramInfo::set_potential_natives(
|
|
||||||
const GrowableObjectArray& candidates) const {
|
|
||||||
untag()->set_potential_natives(candidates.ptr());
|
|
||||||
}
|
|
||||||
|
|
||||||
void KernelProgramInfo::set_potential_pragma_functions(
|
|
||||||
const GrowableObjectArray& candidates) const {
|
|
||||||
untag()->set_potential_pragma_functions(candidates.ptr());
|
|
||||||
}
|
|
||||||
|
|
||||||
void KernelProgramInfo::set_libraries_cache(const Array& cache) const {
|
void KernelProgramInfo::set_libraries_cache(const Array& cache) const {
|
||||||
untag()->set_libraries_cache(cache.ptr());
|
untag()->set_libraries_cache(cache.ptr());
|
||||||
}
|
}
|
||||||
|
|
|
@ -5260,22 +5260,6 @@ class KernelProgramInfo : public Object {
|
||||||
ArrayPtr constants() const { return untag()->constants(); }
|
ArrayPtr constants() const { return untag()->constants(); }
|
||||||
void set_constants(const Array& constants) const;
|
void set_constants(const Array& constants) 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).
|
|
||||||
//
|
|
||||||
// This array will hold the functions which might need their native name set.
|
|
||||||
GrowableObjectArrayPtr potential_natives() const {
|
|
||||||
return untag()->potential_natives();
|
|
||||||
}
|
|
||||||
void set_potential_natives(const GrowableObjectArray& candidates) const;
|
|
||||||
|
|
||||||
GrowableObjectArrayPtr potential_pragma_functions() const {
|
|
||||||
return untag()->potential_pragma_functions();
|
|
||||||
}
|
|
||||||
void set_potential_pragma_functions(
|
|
||||||
const GrowableObjectArray& candidates) const;
|
|
||||||
|
|
||||||
ScriptPtr ScriptAt(intptr_t index) const;
|
ScriptPtr ScriptAt(intptr_t index) const;
|
||||||
|
|
||||||
ArrayPtr libraries_cache() const { return untag()->libraries_cache(); }
|
ArrayPtr libraries_cache() const { return untag()->libraries_cache(); }
|
||||||
|
|
|
@ -1694,8 +1694,6 @@ class UntaggedKernelProgramInfo : public UntaggedObject {
|
||||||
COMPRESSED_POINTER_FIELD(ExternalTypedDataPtr, metadata_mappings)
|
COMPRESSED_POINTER_FIELD(ExternalTypedDataPtr, metadata_mappings)
|
||||||
COMPRESSED_POINTER_FIELD(ArrayPtr, scripts)
|
COMPRESSED_POINTER_FIELD(ArrayPtr, scripts)
|
||||||
COMPRESSED_POINTER_FIELD(ArrayPtr, constants)
|
COMPRESSED_POINTER_FIELD(ArrayPtr, constants)
|
||||||
COMPRESSED_POINTER_FIELD(GrowableObjectArrayPtr, potential_natives)
|
|
||||||
COMPRESSED_POINTER_FIELD(GrowableObjectArrayPtr, potential_pragma_functions)
|
|
||||||
COMPRESSED_POINTER_FIELD(ExternalTypedDataPtr, constants_table)
|
COMPRESSED_POINTER_FIELD(ExternalTypedDataPtr, constants_table)
|
||||||
COMPRESSED_POINTER_FIELD(ArrayPtr, libraries_cache)
|
COMPRESSED_POINTER_FIELD(ArrayPtr, libraries_cache)
|
||||||
COMPRESSED_POINTER_FIELD(ArrayPtr, classes_cache)
|
COMPRESSED_POINTER_FIELD(ArrayPtr, classes_cache)
|
||||||
|
|
|
@ -80,8 +80,6 @@ namespace dart {
|
||||||
F(KernelProgramInfo, metadata_mappings_) \
|
F(KernelProgramInfo, metadata_mappings_) \
|
||||||
F(KernelProgramInfo, scripts_) \
|
F(KernelProgramInfo, scripts_) \
|
||||||
F(KernelProgramInfo, constants_) \
|
F(KernelProgramInfo, constants_) \
|
||||||
F(KernelProgramInfo, potential_natives_) \
|
|
||||||
F(KernelProgramInfo, potential_pragma_functions_) \
|
|
||||||
F(KernelProgramInfo, constants_table_) \
|
F(KernelProgramInfo, constants_table_) \
|
||||||
F(KernelProgramInfo, libraries_cache_) \
|
F(KernelProgramInfo, libraries_cache_) \
|
||||||
F(KernelProgramInfo, classes_cache_) \
|
F(KernelProgramInfo, classes_cache_) \
|
||||||
|
|
Loading…
Reference in a new issue