Skip to content

Commit 62893f9

Browse files
rmacnak-googlecommit-bot@chromium.org
authored andcommitted
Reland "[vm] Check prefix.loadLibrary is called and returns before prefix members are used."
This reverts commit 9a87cf9. Reason for revert: Broken test disabled Original change's description: > Revert "[vm] Check prefix.loadLibrary is called and returns before prefix members are used." > > This reverts commit b0484ec. > > Reason for revert: timeouts on Flutter integration tests > (#42350). > > Original change's description: > > [vm] Check prefix.loadLibrary is called and returns before prefix members are used. > > > > Restore checks against reloading a library with deferred prefixes. > > > > No loading is actually deferred. > > > > Bug: #26878 > > Bug: #41974 > > Change-Id: Iec2662de117453d596cca28dd9481a9751091ce9 > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149613 > > Commit-Queue: Ryan Macnak <[email protected]> > > Reviewed-by: Alexander Markov <[email protected]> > > Reviewed-by: Siva Annamalai <[email protected]> > > [email protected],[email protected],[email protected] > > # Not skipping CQ checks because original CL landed > 1 day ago. > > Bug: #26878, #41974 > Change-Id: I78709650e91d206b84a8ddd9171ef66d6cf1b008 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151169 > Reviewed-by: Alexander Markov <[email protected]> > Commit-Queue: Alexander Markov <[email protected]> [email protected],[email protected],[email protected] # Not skipping CQ checks because this is a reland. Bug: #26878, #41974 Change-Id: Ife76bd51db65ca58e08655a9b8406c8ca483447f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151326 Reviewed-by: Ryan Macnak <[email protected]> Reviewed-by: Alexander Markov <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent ed9112e commit 62893f9

16 files changed

+183
-57
lines changed

runtime/lib/object.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,19 @@ DEFINE_NATIVE_ENTRY(Type_equality, 0, 2) {
196196
return Bool::Get(type.IsEquivalent(other, TypeEquality::kSyntactical)).raw();
197197
}
198198

199+
DEFINE_NATIVE_ENTRY(LibraryPrefix_isLoaded, 0, 1) {
200+
const LibraryPrefix& prefix =
201+
LibraryPrefix::CheckedHandle(zone, arguments->NativeArgAt(0));
202+
return Bool::Get(prefix.is_loaded()).raw();
203+
}
204+
205+
DEFINE_NATIVE_ENTRY(LibraryPrefix_setLoaded, 0, 1) {
206+
const LibraryPrefix& prefix =
207+
LibraryPrefix::CheckedHandle(zone, arguments->NativeArgAt(0));
208+
prefix.set_is_loaded(true);
209+
return Instance::null();
210+
}
211+
199212
DEFINE_NATIVE_ENTRY(Internal_inquireIs64Bit, 0, 0) {
200213
#if defined(ARCH_IS_64_BIT)
201214
return Bool::True().raw();

runtime/vm/bootstrap_natives.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ namespace dart {
3131
V(AbstractType_toString, 1) \
3232
V(Type_getHashCode, 1) \
3333
V(Type_equality, 2) \
34+
V(LibraryPrefix_isLoaded, 1) \
35+
V(LibraryPrefix_setLoaded, 1) \
3436
V(Identical_comparison, 2) \
3537
V(Integer_bitAndFromInteger, 2) \
3638
V(Integer_bitOrFromInteger, 2) \

runtime/vm/clustered_snapshot.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3248,6 +3248,7 @@ class LibraryPrefixDeserializationCluster : public DeserializationCluster {
32483248
ReadFromTo(prefix);
32493249
prefix->ptr()->num_imports_ = d->Read<uint16_t>();
32503250
prefix->ptr()->is_deferred_load_ = d->Read<bool>();
3251+
prefix->ptr()->is_loaded_ = !prefix->ptr()->is_deferred_load_;
32513252
}
32523253
}
32533254
};

runtime/vm/compiler/backend/il.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,11 @@ ConstantInstr::ConstantInstr(const Object& value, TokenPosition token_pos)
10971097
// tables used for certain character classes are represented as TypedData,
10981098
// and so those values are also neither immutable (as there are no immutable
10991099
// TypedData values) or canonical.
1100-
ASSERT(value.IsTypeParameter() || value.IsArray() || value.IsTypedData());
1100+
//
1101+
// LibraryPrefixes are also never canonicalized since their equality is
1102+
// their identity.
1103+
ASSERT(value.IsTypeParameter() || value.IsArray() || value.IsTypedData() ||
1104+
value.IsLibraryPrefix());
11011105
}
11021106
#endif
11031107
}

runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,9 +1363,9 @@ Fragment StreamingFlowGraphBuilder::BuildExpression(TokenPosition* position) {
13631363
case kInstantiation:
13641364
return BuildPartialTearoffInstantiation(position);
13651365
case kLoadLibrary:
1366+
return BuildLibraryPrefixAction(position, Symbols::LoadLibrary());
13661367
case kCheckLibraryIsLoaded:
1367-
ReadUInt(); // skip library index
1368-
return BuildFutureNullValue(position);
1368+
return BuildLibraryPrefixAction(position, Symbols::CheckLoaded());
13691369
case kConstStaticInvocation:
13701370
case kConstConstructorInvocation:
13711371
case kConstListLiteral:
@@ -4068,6 +4068,26 @@ Fragment StreamingFlowGraphBuilder::BuildPartialTearoffInstantiation(
40684068
return instructions;
40694069
}
40704070

4071+
Fragment StreamingFlowGraphBuilder::BuildLibraryPrefixAction(
4072+
TokenPosition* position,
4073+
const String& selector) {
4074+
const intptr_t dependency_index = ReadUInt();
4075+
const Library& current_library = Library::Handle(
4076+
Z, Class::Handle(Z, parsed_function()->function().origin()).library());
4077+
const Array& dependencies = Array::Handle(Z, current_library.dependencies());
4078+
const LibraryPrefix& prefix =
4079+
LibraryPrefix::CheckedZoneHandle(Z, dependencies.At(dependency_index));
4080+
const Function& function =
4081+
Function::ZoneHandle(Z, Library::Handle(Z, Library::CoreLibrary())
4082+
.LookupFunctionAllowPrivate(selector));
4083+
ASSERT(!function.IsNull());
4084+
Fragment instructions;
4085+
instructions += Constant(prefix);
4086+
instructions +=
4087+
StaticCall(TokenPosition::kNoSource, function, 1, ICData::kStatic);
4088+
return instructions;
4089+
}
4090+
40714091
Fragment StreamingFlowGraphBuilder::BuildExpressionStatement() {
40724092
Fragment instructions = BuildExpression(); // read expression.
40734093
instructions += Drop();

runtime/vm/compiler/frontend/kernel_binary_flowgraph.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ class StreamingFlowGraphBuilder : public KernelReaderHelper {
335335
Fragment BuildFutureNullValue(TokenPosition* position);
336336
Fragment BuildConstantExpression(TokenPosition* position, Tag tag);
337337
Fragment BuildPartialTearoffInstantiation(TokenPosition* position);
338+
Fragment BuildLibraryPrefixAction(TokenPosition* position,
339+
const String& selector);
338340

339341
Fragment BuildExpressionStatement();
340342
Fragment BuildBlock();

runtime/vm/compiler/runtime_offsets_extracted.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
450450
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
451451
64;
452452
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
453-
static constexpr dart::compiler::target::word Library_InstanceSize = 76;
453+
static constexpr dart::compiler::target::word Library_InstanceSize = 80;
454454
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
455455
static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 28;
456456
static constexpr dart::compiler::target::word LocalVarDescriptors_InstanceSize =
@@ -944,7 +944,7 @@ static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
944944
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
945945
128;
946946
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
947-
static constexpr dart::compiler::target::word Library_InstanceSize = 144;
947+
static constexpr dart::compiler::target::word Library_InstanceSize = 152;
948948
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
949949
static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 56;
950950
static constexpr dart::compiler::target::word LocalVarDescriptors_InstanceSize =
@@ -1429,7 +1429,7 @@ static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
14291429
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
14301430
64;
14311431
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
1432-
static constexpr dart::compiler::target::word Library_InstanceSize = 76;
1432+
static constexpr dart::compiler::target::word Library_InstanceSize = 80;
14331433
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
14341434
static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 28;
14351435
static constexpr dart::compiler::target::word LocalVarDescriptors_InstanceSize =
@@ -1924,7 +1924,7 @@ static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
19241924
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
19251925
128;
19261926
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
1927-
static constexpr dart::compiler::target::word Library_InstanceSize = 144;
1927+
static constexpr dart::compiler::target::word Library_InstanceSize = 152;
19281928
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
19291929
static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 56;
19301930
static constexpr dart::compiler::target::word LocalVarDescriptors_InstanceSize =
@@ -2408,7 +2408,7 @@ static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
24082408
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
24092409
64;
24102410
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
2411-
static constexpr dart::compiler::target::word Library_InstanceSize = 76;
2411+
static constexpr dart::compiler::target::word Library_InstanceSize = 80;
24122412
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
24132413
static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 28;
24142414
static constexpr dart::compiler::target::word LocalVarDescriptors_InstanceSize =
@@ -2896,7 +2896,7 @@ static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
28962896
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
28972897
128;
28982898
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
2899-
static constexpr dart::compiler::target::word Library_InstanceSize = 144;
2899+
static constexpr dart::compiler::target::word Library_InstanceSize = 152;
29002900
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
29012901
static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 56;
29022902
static constexpr dart::compiler::target::word LocalVarDescriptors_InstanceSize =
@@ -3375,7 +3375,7 @@ static constexpr dart::compiler::target::word Integer_InstanceSize = 4;
33753375
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
33763376
64;
33773377
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28;
3378-
static constexpr dart::compiler::target::word Library_InstanceSize = 76;
3378+
static constexpr dart::compiler::target::word Library_InstanceSize = 80;
33793379
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20;
33803380
static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 28;
33813381
static constexpr dart::compiler::target::word LocalVarDescriptors_InstanceSize =
@@ -3864,7 +3864,7 @@ static constexpr dart::compiler::target::word Integer_InstanceSize = 8;
38643864
static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize =
38653865
128;
38663866
static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48;
3867-
static constexpr dart::compiler::target::word Library_InstanceSize = 144;
3867+
static constexpr dart::compiler::target::word Library_InstanceSize = 152;
38683868
static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40;
38693869
static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 56;
38703870
static constexpr dart::compiler::target::word LocalVarDescriptors_InstanceSize =
@@ -4384,7 +4384,7 @@ static constexpr dart::compiler::target::word
43844384
AOT_KernelProgramInfo_InstanceSize = 64;
43854385
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
43864386
28;
4387-
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 72;
4387+
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 76;
43884388
static constexpr dart::compiler::target::word AOT_LibraryPrefix_InstanceSize =
43894389
20;
43904390
static constexpr dart::compiler::target::word AOT_LinkedHashMap_InstanceSize =
@@ -4919,7 +4919,7 @@ static constexpr dart::compiler::target::word
49194919
AOT_KernelProgramInfo_InstanceSize = 128;
49204920
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
49214921
48;
4922-
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 136;
4922+
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 144;
49234923
static constexpr dart::compiler::target::word AOT_LibraryPrefix_InstanceSize =
49244924
40;
49254925
static constexpr dart::compiler::target::word AOT_LinkedHashMap_InstanceSize =
@@ -5458,7 +5458,7 @@ static constexpr dart::compiler::target::word
54585458
AOT_KernelProgramInfo_InstanceSize = 128;
54595459
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
54605460
48;
5461-
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 136;
5461+
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 144;
54625462
static constexpr dart::compiler::target::word AOT_LibraryPrefix_InstanceSize =
54635463
40;
54645464
static constexpr dart::compiler::target::word AOT_LinkedHashMap_InstanceSize =
@@ -5984,7 +5984,7 @@ static constexpr dart::compiler::target::word
59845984
AOT_KernelProgramInfo_InstanceSize = 64;
59855985
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
59865986
28;
5987-
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 72;
5987+
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 76;
59885988
static constexpr dart::compiler::target::word AOT_LibraryPrefix_InstanceSize =
59895989
20;
59905990
static constexpr dart::compiler::target::word AOT_LinkedHashMap_InstanceSize =
@@ -6512,7 +6512,7 @@ static constexpr dart::compiler::target::word
65126512
AOT_KernelProgramInfo_InstanceSize = 128;
65136513
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
65146514
48;
6515-
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 136;
6515+
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 144;
65166516
static constexpr dart::compiler::target::word AOT_LibraryPrefix_InstanceSize =
65176517
40;
65186518
static constexpr dart::compiler::target::word AOT_LinkedHashMap_InstanceSize =
@@ -7044,7 +7044,7 @@ static constexpr dart::compiler::target::word
70447044
AOT_KernelProgramInfo_InstanceSize = 128;
70457045
static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize =
70467046
48;
7047-
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 136;
7047+
static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 144;
70487048
static constexpr dart::compiler::target::word AOT_LibraryPrefix_InstanceSize =
70497049
40;
70507050
static constexpr dart::compiler::target::word AOT_LinkedHashMap_InstanceSize =

runtime/vm/isolate_reload.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ bool IsolateGroupReloadContext::Reload(bool force_reload,
738738

739739
// Ensure all functions on the stack have unoptimized code.
740740
// Deoptimize all code that had optimizing decisions that are dependent on
741-
// assumptions from field guards or CHA.
741+
// assumptions from field guards or CHA or deferred library prefixes.
742742
// TODO(johnmccutchan): Deoptimizing dependent code here (before the reload)
743743
// is paranoid. This likely can be moved to the commit phase.
744744
ForEachIsolate([&](Isolate* isolate) {
@@ -1312,6 +1312,8 @@ void IsolateReloadContext::DeoptimizeDependentCode() {
13121312
}
13131313

13141314
DeoptimizeTypeTestingStubs();
1315+
1316+
// TODO(rmacnak): Also call LibraryPrefix::InvalidateDependentCode.
13151317
}
13161318

13171319
void IsolateGroupReloadContext::CheckpointSharedClassTable() {

runtime/vm/kernel_loader.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,7 @@ void KernelLoader::LoadLibraryImportsAndExports(Library* library,
13051305
LibraryPrefix& library_prefix = LibraryPrefix::Handle(Z);
13061306

13071307
const intptr_t deps_count = helper_.ReadListLength();
1308+
const Array& deps = Array::Handle(Array::New(deps_count));
13081309
for (intptr_t dep = 0; dep < deps_count; ++dep) {
13091310
LibraryDependencyHelper dependency_helper(&helper_);
13101311

@@ -1388,12 +1389,21 @@ void KernelLoader::LoadLibraryImportsAndExports(Library* library,
13881389
}
13891390
}
13901391
}
1392+
13911393
if (FLAG_enable_mirrors && dependency_helper.annotation_count_ > 0) {
13921394
ASSERT(annotations_kernel_offset > 0);
13931395
ns.AddMetadata(toplevel_class, TokenPosition::kNoSource,
13941396
annotations_kernel_offset);
13951397
}
1398+
1399+
if (prefix.IsNull()) {
1400+
deps.SetAt(dep, ns);
1401+
} else {
1402+
deps.SetAt(dep, library_prefix);
1403+
}
13961404
}
1405+
1406+
library->set_dependencies(deps);
13971407
}
13981408

13991409
void KernelLoader::LoadPreliminaryClass(ClassHelper* class_helper,

runtime/vm/object.cc

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11081,27 +11081,6 @@ void ClassDictionaryIterator::MoveToNextClass() {
1108111081
}
1108211082
}
1108311083

11084-
LibraryPrefixIterator::LibraryPrefixIterator(const Library& library)
11085-
: DictionaryIterator(library) {
11086-
Advance();
11087-
}
11088-
11089-
LibraryPrefixPtr LibraryPrefixIterator::GetNext() {
11090-
ASSERT(HasNext());
11091-
int ix = next_ix_++;
11092-
Object& obj = Object::Handle(array_.At(ix));
11093-
Advance();
11094-
return LibraryPrefix::Cast(obj).raw();
11095-
}
11096-
11097-
void LibraryPrefixIterator::Advance() {
11098-
Object& obj = Object::Handle(array_.At(next_ix_));
11099-
while (!obj.IsLibraryPrefix() && HasNext()) {
11100-
next_ix_++;
11101-
obj = array_.At(next_ix_);
11102-
}
11103-
}
11104-
1110511084
static void ReportTooManyImports(const Library& lib) {
1110611085
const String& url = String::Handle(lib.url());
1110711086
Report::MessageF(Report::kError, Script::Handle(lib.LookupScript(url)),
@@ -12075,6 +12054,10 @@ void Library::set_toplevel_class(const Class& value) const {
1207512054
StorePointer(&raw_ptr()->toplevel_class_, value.raw());
1207612055
}
1207712056

12057+
void Library::set_dependencies(const Array& deps) const {
12058+
StorePointer(&raw_ptr()->dependencies_, deps.raw());
12059+
}
12060+
1207812061
void Library::set_metadata(const GrowableObjectArray& value) const {
1207912062
StorePointer(&raw_ptr()->metadata_, value.raw());
1208012063
}
@@ -12943,6 +12926,7 @@ LibraryPrefixPtr LibraryPrefix::New(const String& name,
1294312926
result.set_num_imports(0);
1294412927
result.set_importer(importer);
1294512928
result.StoreNonPointer(&result.raw_ptr()->is_deferred_load_, deferred_load);
12929+
result.StoreNonPointer(&result.raw_ptr()->is_loaded_, !deferred_load);
1294612930
result.set_imports(Array::Handle(Array::New(kInitialSize)));
1294712931
result.AddImport(import);
1294812932
return result.raw();
@@ -12970,8 +12954,7 @@ void LibraryPrefix::set_importer(const Library& value) const {
1297012954

1297112955
const char* LibraryPrefix::ToCString() const {
1297212956
const String& prefix = String::Handle(name());
12973-
return OS::SCreate(Thread::Current()->zone(), "LibraryPrefix:'%s'",
12974-
prefix.ToCString());
12957+
return prefix.ToCString();
1297512958
}
1297612959

1297712960
void Namespace::set_metadata_field(const Field& value) const {

runtime/vm/object.h

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4543,7 +4543,6 @@ class DictionaryIterator : public ValueObject {
45434543
int next_ix_; // Index of next element.
45444544

45454545
friend class ClassDictionaryIterator;
4546-
friend class LibraryPrefixIterator;
45474546
DISALLOW_COPY_AND_ASSIGN(DictionaryIterator);
45484547
};
45494548

@@ -4574,16 +4573,6 @@ class ClassDictionaryIterator : public DictionaryIterator {
45744573
DISALLOW_COPY_AND_ASSIGN(ClassDictionaryIterator);
45754574
};
45764575

4577-
class LibraryPrefixIterator : public DictionaryIterator {
4578-
public:
4579-
explicit LibraryPrefixIterator(const Library& library);
4580-
LibraryPrefixPtr GetNext();
4581-
4582-
private:
4583-
void Advance();
4584-
DISALLOW_COPY_AND_ASSIGN(LibraryPrefixIterator);
4585-
};
4586-
45874576
class Library : public Object {
45884577
public:
45894578
StringPtr name() const { return raw_ptr()->name_; }
@@ -4738,6 +4727,9 @@ class Library : public Object {
47384727
NamespacePtr ImportAt(intptr_t index) const;
47394728
LibraryPtr ImportLibraryAt(intptr_t index) const;
47404729

4730+
ArrayPtr dependencies() const { return raw_ptr()->dependencies_; }
4731+
void set_dependencies(const Array& deps) const;
4732+
47414733
void DropDependenciesAndCaches() const;
47424734

47434735
// Resolving native methods for script loaded in the library.
@@ -7342,6 +7334,10 @@ class LibraryPrefix : public Instance {
73427334
void AddImport(const Namespace& import) const;
73437335

73447336
bool is_deferred_load() const { return raw_ptr()->is_deferred_load_; }
7337+
bool is_loaded() const { return raw_ptr()->is_loaded_; }
7338+
void set_is_loaded(bool value) const {
7339+
return StoreNonPointer(&raw_ptr()->is_loaded_, value);
7340+
}
73457341

73467342
static intptr_t InstanceSize() {
73477343
return RoundedAllocationSize(sizeof(LibraryPrefixLayout));

0 commit comments

Comments
 (0)