diff --git a/runtime/lib/object.cc b/runtime/lib/object.cc index 096a934c018..4aee1fda1c5 100644 --- a/runtime/lib/object.cc +++ b/runtime/lib/object.cc @@ -196,19 +196,6 @@ DEFINE_NATIVE_ENTRY(Type_equality, 0, 2) { return Bool::Get(type.IsEquivalent(other, TypeEquality::kSyntactical)).raw(); } -DEFINE_NATIVE_ENTRY(LibraryPrefix_isLoaded, 0, 1) { - const LibraryPrefix& prefix = - LibraryPrefix::CheckedHandle(zone, arguments->NativeArgAt(0)); - return Bool::Get(prefix.is_loaded()).raw(); -} - -DEFINE_NATIVE_ENTRY(LibraryPrefix_setLoaded, 0, 1) { - const LibraryPrefix& prefix = - LibraryPrefix::CheckedHandle(zone, arguments->NativeArgAt(0)); - prefix.set_is_loaded(true); - return Instance::null(); -} - DEFINE_NATIVE_ENTRY(Internal_inquireIs64Bit, 0, 0) { #if defined(ARCH_IS_64_BIT) return Bool::True().raw(); diff --git a/runtime/vm/bootstrap_natives.h b/runtime/vm/bootstrap_natives.h index 6ce5668eb48..24608463bb0 100644 --- a/runtime/vm/bootstrap_natives.h +++ b/runtime/vm/bootstrap_natives.h @@ -31,8 +31,6 @@ namespace dart { V(AbstractType_toString, 1) \ V(Type_getHashCode, 1) \ V(Type_equality, 2) \ - V(LibraryPrefix_isLoaded, 1) \ - V(LibraryPrefix_setLoaded, 1) \ V(Identical_comparison, 2) \ V(Integer_bitAndFromInteger, 2) \ V(Integer_bitOrFromInteger, 2) \ diff --git a/runtime/vm/clustered_snapshot.cc b/runtime/vm/clustered_snapshot.cc index c5c894ce987..f213b2b623f 100644 --- a/runtime/vm/clustered_snapshot.cc +++ b/runtime/vm/clustered_snapshot.cc @@ -3248,7 +3248,6 @@ class LibraryPrefixDeserializationCluster : public DeserializationCluster { ReadFromTo(prefix); prefix->ptr()->num_imports_ = d->Read(); prefix->ptr()->is_deferred_load_ = d->Read(); - prefix->ptr()->is_loaded_ = false; } } }; diff --git a/runtime/vm/compiler/backend/il.cc b/runtime/vm/compiler/backend/il.cc index a96d22bb50f..34d0381f498 100644 --- a/runtime/vm/compiler/backend/il.cc +++ b/runtime/vm/compiler/backend/il.cc @@ -1099,8 +1099,7 @@ ConstantInstr::ConstantInstr(const Object& value, TokenPosition token_pos) // tables used for certain character classes are represented as TypedData, // and so those values are also neither immutable (as there are no immutable // TypedData values) or canonical. - ASSERT(value.IsTypeParameter() || value.IsArray() || value.IsTypedData() || - value.IsLibraryPrefix()); + ASSERT(value.IsTypeParameter() || value.IsArray() || value.IsTypedData()); } #endif } diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc index c2b6b21c2fc..121aff8107e 100644 --- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc +++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc @@ -1363,9 +1363,9 @@ Fragment StreamingFlowGraphBuilder::BuildExpression(TokenPosition* position) { case kInstantiation: return BuildPartialTearoffInstantiation(position); case kLoadLibrary: - return BuildLibraryPrefixAction(position, Symbols::LoadLibrary()); case kCheckLibraryIsLoaded: - return BuildLibraryPrefixAction(position, Symbols::CheckLoaded()); + ReadUInt(); // skip library index + return BuildFutureNullValue(position); case kConstStaticInvocation: case kConstConstructorInvocation: case kConstListLiteral: @@ -4067,26 +4067,6 @@ Fragment StreamingFlowGraphBuilder::BuildPartialTearoffInstantiation( return instructions; } -Fragment StreamingFlowGraphBuilder::BuildLibraryPrefixAction( - TokenPosition* position, - const String& selector) { - const intptr_t dependency_index = ReadUInt(); - const Library& current_library = Library::Handle( - Z, Class::Handle(Z, parsed_function()->function().Owner()).library()); - const Array& dependencies = Array::Handle(Z, current_library.dependencies()); - const LibraryPrefix& prefix = - LibraryPrefix::CheckedZoneHandle(Z, dependencies.At(dependency_index)); - const Function& function = - Function::ZoneHandle(Z, Library::Handle(Z, Library::CoreLibrary()) - .LookupFunctionAllowPrivate(selector)); - ASSERT(!function.IsNull()); - Fragment instructions; - instructions += Constant(prefix); - instructions += - StaticCall(TokenPosition::kNoSource, function, 1, ICData::kStatic); - return instructions; -} - Fragment StreamingFlowGraphBuilder::BuildExpressionStatement() { Fragment instructions = BuildExpression(); // read expression. instructions += Drop(); diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h index feb627f053e..d694a83f5f0 100644 --- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h +++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h @@ -335,8 +335,6 @@ class StreamingFlowGraphBuilder : public KernelReaderHelper { Fragment BuildFutureNullValue(TokenPosition* position); Fragment BuildConstantExpression(TokenPosition* position, Tag tag); Fragment BuildPartialTearoffInstantiation(TokenPosition* position); - Fragment BuildLibraryPrefixAction(TokenPosition* position, - const String& selector); Fragment BuildExpressionStatement(); Fragment BuildBlock(); diff --git a/runtime/vm/compiler/runtime_offsets_extracted.h b/runtime/vm/compiler/runtime_offsets_extracted.h index 25e191a59be..bc994c1a930 100644 --- a/runtime/vm/compiler/runtime_offsets_extracted.h +++ b/runtime/vm/compiler/runtime_offsets_extracted.h @@ -442,7 +442,7 @@ static constexpr dart::compiler::target::word Integer_InstanceSize = 4; static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize = 64; static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28; -static constexpr dart::compiler::target::word Library_InstanceSize = 80; +static constexpr dart::compiler::target::word Library_InstanceSize = 76; static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20; static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 28; static constexpr dart::compiler::target::word LocalVarDescriptors_InstanceSize = @@ -927,7 +927,7 @@ static constexpr dart::compiler::target::word Integer_InstanceSize = 8; static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize = 128; static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48; -static constexpr dart::compiler::target::word Library_InstanceSize = 152; +static constexpr dart::compiler::target::word Library_InstanceSize = 144; static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40; static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 56; static constexpr dart::compiler::target::word LocalVarDescriptors_InstanceSize = @@ -1404,7 +1404,7 @@ static constexpr dart::compiler::target::word Integer_InstanceSize = 4; static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize = 64; static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28; -static constexpr dart::compiler::target::word Library_InstanceSize = 80; +static constexpr dart::compiler::target::word Library_InstanceSize = 76; static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20; static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 28; static constexpr dart::compiler::target::word LocalVarDescriptors_InstanceSize = @@ -1890,7 +1890,7 @@ static constexpr dart::compiler::target::word Integer_InstanceSize = 8; static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize = 128; static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48; -static constexpr dart::compiler::target::word Library_InstanceSize = 152; +static constexpr dart::compiler::target::word Library_InstanceSize = 144; static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40; static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 56; static constexpr dart::compiler::target::word LocalVarDescriptors_InstanceSize = @@ -2366,7 +2366,7 @@ static constexpr dart::compiler::target::word Integer_InstanceSize = 4; static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize = 64; static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28; -static constexpr dart::compiler::target::word Library_InstanceSize = 80; +static constexpr dart::compiler::target::word Library_InstanceSize = 76; static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20; static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 28; static constexpr dart::compiler::target::word LocalVarDescriptors_InstanceSize = @@ -2845,7 +2845,7 @@ static constexpr dart::compiler::target::word Integer_InstanceSize = 8; static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize = 128; static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48; -static constexpr dart::compiler::target::word Library_InstanceSize = 152; +static constexpr dart::compiler::target::word Library_InstanceSize = 144; static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40; static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 56; static constexpr dart::compiler::target::word LocalVarDescriptors_InstanceSize = @@ -3316,7 +3316,7 @@ static constexpr dart::compiler::target::word Integer_InstanceSize = 4; static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize = 64; static constexpr dart::compiler::target::word LanguageError_InstanceSize = 28; -static constexpr dart::compiler::target::word Library_InstanceSize = 80; +static constexpr dart::compiler::target::word Library_InstanceSize = 76; static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 20; static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 28; static constexpr dart::compiler::target::word LocalVarDescriptors_InstanceSize = @@ -3796,7 +3796,7 @@ static constexpr dart::compiler::target::word Integer_InstanceSize = 8; static constexpr dart::compiler::target::word KernelProgramInfo_InstanceSize = 128; static constexpr dart::compiler::target::word LanguageError_InstanceSize = 48; -static constexpr dart::compiler::target::word Library_InstanceSize = 152; +static constexpr dart::compiler::target::word Library_InstanceSize = 144; static constexpr dart::compiler::target::word LibraryPrefix_InstanceSize = 40; static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 56; static constexpr dart::compiler::target::word LocalVarDescriptors_InstanceSize = @@ -4307,7 +4307,7 @@ static constexpr dart::compiler::target::word AOT_KernelProgramInfo_InstanceSize = 64; static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize = 28; -static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 76; +static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 72; static constexpr dart::compiler::target::word AOT_LibraryPrefix_InstanceSize = 20; static constexpr dart::compiler::target::word AOT_LinkedHashMap_InstanceSize = @@ -4833,7 +4833,7 @@ static constexpr dart::compiler::target::word AOT_KernelProgramInfo_InstanceSize = 128; static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize = 48; -static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 144; +static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 136; static constexpr dart::compiler::target::word AOT_LibraryPrefix_InstanceSize = 40; static constexpr dart::compiler::target::word AOT_LinkedHashMap_InstanceSize = @@ -5363,7 +5363,7 @@ static constexpr dart::compiler::target::word AOT_KernelProgramInfo_InstanceSize = 128; static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize = 48; -static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 144; +static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 136; static constexpr dart::compiler::target::word AOT_LibraryPrefix_InstanceSize = 40; static constexpr dart::compiler::target::word AOT_LinkedHashMap_InstanceSize = @@ -5880,7 +5880,7 @@ static constexpr dart::compiler::target::word AOT_KernelProgramInfo_InstanceSize = 64; static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize = 28; -static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 76; +static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 72; static constexpr dart::compiler::target::word AOT_LibraryPrefix_InstanceSize = 20; static constexpr dart::compiler::target::word AOT_LinkedHashMap_InstanceSize = @@ -6399,7 +6399,7 @@ static constexpr dart::compiler::target::word AOT_KernelProgramInfo_InstanceSize = 128; static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize = 48; -static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 144; +static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 136; static constexpr dart::compiler::target::word AOT_LibraryPrefix_InstanceSize = 40; static constexpr dart::compiler::target::word AOT_LinkedHashMap_InstanceSize = @@ -6922,7 +6922,7 @@ static constexpr dart::compiler::target::word AOT_KernelProgramInfo_InstanceSize = 128; static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize = 48; -static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 144; +static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 136; static constexpr dart::compiler::target::word AOT_LibraryPrefix_InstanceSize = 40; static constexpr dart::compiler::target::word AOT_LinkedHashMap_InstanceSize = diff --git a/runtime/vm/kernel_loader.cc b/runtime/vm/kernel_loader.cc index 1d0d5437726..7bfd7d76db9 100644 --- a/runtime/vm/kernel_loader.cc +++ b/runtime/vm/kernel_loader.cc @@ -1305,7 +1305,6 @@ void KernelLoader::LoadLibraryImportsAndExports(Library* library, LibraryPrefix& library_prefix = LibraryPrefix::Handle(Z); const intptr_t deps_count = helper_.ReadListLength(); - const Array& deps = Array::Handle(Array::New(deps_count)); for (intptr_t dep = 0; dep < deps_count; ++dep) { LibraryDependencyHelper dependency_helper(&helper_); @@ -1389,21 +1388,12 @@ void KernelLoader::LoadLibraryImportsAndExports(Library* library, } } } - if (FLAG_enable_mirrors && dependency_helper.annotation_count_ > 0) { ASSERT(annotations_kernel_offset > 0); ns.AddMetadata(toplevel_class, TokenPosition::kNoSource, annotations_kernel_offset); } - - if (prefix.IsNull()) { - deps.SetAt(dep, ns); - } else { - deps.SetAt(dep, library_prefix); - } } - - library->set_dependencies(deps); } void KernelLoader::LoadPreliminaryClass(ClassHelper* class_helper, diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc index 940a66acb36..dc60b0136f4 100644 --- a/runtime/vm/object.cc +++ b/runtime/vm/object.cc @@ -11047,6 +11047,27 @@ void ClassDictionaryIterator::MoveToNextClass() { } } +LibraryPrefixIterator::LibraryPrefixIterator(const Library& library) + : DictionaryIterator(library) { + Advance(); +} + +LibraryPrefixPtr LibraryPrefixIterator::GetNext() { + ASSERT(HasNext()); + int ix = next_ix_++; + Object& obj = Object::Handle(array_.At(ix)); + Advance(); + return LibraryPrefix::Cast(obj).raw(); +} + +void LibraryPrefixIterator::Advance() { + Object& obj = Object::Handle(array_.At(next_ix_)); + while (!obj.IsLibraryPrefix() && HasNext()) { + next_ix_++; + obj = array_.At(next_ix_); + } +} + static void ReportTooManyImports(const Library& lib) { const String& url = String::Handle(lib.url()); Report::MessageF(Report::kError, Script::Handle(lib.LookupScript(url)), @@ -12020,10 +12041,6 @@ void Library::set_toplevel_class(const Class& value) const { StorePointer(&raw_ptr()->toplevel_class_, value.raw()); } -void Library::set_dependencies(const Array& deps) const { - StorePointer(&raw_ptr()->dependencies_, deps.raw()); -} - void Library::set_metadata(const GrowableObjectArray& value) const { StorePointer(&raw_ptr()->metadata_, value.raw()); } @@ -12892,7 +12909,6 @@ LibraryPrefixPtr LibraryPrefix::New(const String& name, result.set_num_imports(0); result.set_importer(importer); result.StoreNonPointer(&result.raw_ptr()->is_deferred_load_, deferred_load); - result.StoreNonPointer(&result.raw_ptr()->is_loaded_, false); result.set_imports(Array::Handle(Array::New(kInitialSize))); result.AddImport(import); return result.raw(); @@ -12920,7 +12936,8 @@ void LibraryPrefix::set_importer(const Library& value) const { const char* LibraryPrefix::ToCString() const { const String& prefix = String::Handle(name()); - return prefix.ToCString(); + return OS::SCreate(Thread::Current()->zone(), "LibraryPrefix:'%s'", + prefix.ToCString()); } void Namespace::set_metadata_field(const Field& value) const { diff --git a/runtime/vm/object.h b/runtime/vm/object.h index cea923f7901..903f471af5b 100644 --- a/runtime/vm/object.h +++ b/runtime/vm/object.h @@ -4519,6 +4519,7 @@ class DictionaryIterator : public ValueObject { int next_ix_; // Index of next element. friend class ClassDictionaryIterator; + friend class LibraryPrefixIterator; DISALLOW_COPY_AND_ASSIGN(DictionaryIterator); }; @@ -4549,6 +4550,16 @@ class ClassDictionaryIterator : public DictionaryIterator { DISALLOW_COPY_AND_ASSIGN(ClassDictionaryIterator); }; +class LibraryPrefixIterator : public DictionaryIterator { + public: + explicit LibraryPrefixIterator(const Library& library); + LibraryPrefixPtr GetNext(); + + private: + void Advance(); + DISALLOW_COPY_AND_ASSIGN(LibraryPrefixIterator); +}; + class Library : public Object { public: StringPtr name() const { return raw_ptr()->name_; } @@ -4703,9 +4714,6 @@ class Library : public Object { NamespacePtr ImportAt(intptr_t index) const; LibraryPtr ImportLibraryAt(intptr_t index) const; - ArrayPtr dependencies() const { return raw_ptr()->dependencies_; } - void set_dependencies(const Array& deps) const; - void DropDependenciesAndCaches() const; // Resolving native methods for script loaded in the library. @@ -7311,10 +7319,6 @@ class LibraryPrefix : public Instance { void AddImport(const Namespace& import) const; bool is_deferred_load() const { return raw_ptr()->is_deferred_load_; } - bool is_loaded() const { return raw_ptr()->is_loaded_; } - void set_is_loaded(bool value) const { - return StoreNonPointer(&raw_ptr()->is_loaded_, value); - } static intptr_t InstanceSize() { return RoundedAllocationSize(sizeof(LibraryPrefixLayout)); diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h index e142cb6300a..ff37d6f7844 100644 --- a/runtime/vm/raw_object.h +++ b/runtime/vm/raw_object.h @@ -1305,12 +1305,11 @@ class LibraryLayout : public ObjectLayout { GrowableObjectArrayPtr used_scripts_; ArrayPtr imports_; // List of Namespaces imported without prefix. ArrayPtr exports_; // List of re-exported Namespaces. - ArrayPtr dependencies_; ExternalTypedDataPtr kernel_data_; ObjectPtr* to_snapshot(Snapshot::Kind kind) { switch (kind) { case Snapshot::kFullAOT: - return reinterpret_cast(&dependencies_); + return reinterpret_cast(&exports_); case Snapshot::kFull: case Snapshot::kFullJIT: return reinterpret_cast(&kernel_data_); @@ -2131,7 +2130,6 @@ class LibraryPrefixLayout : public InstanceLayout { } uint16_t num_imports_; // Number of library entries in libraries_. bool is_deferred_load_; - bool is_loaded_; }; class TypeArgumentsLayout : public InstanceLayout { diff --git a/runtime/vm/symbols.h b/runtime/vm/symbols.h index fcd586161e0..46678697482 100644 --- a/runtime/vm/symbols.h +++ b/runtime/vm/symbols.h @@ -44,7 +44,6 @@ class ObjectPointerVisitor; V(Call, "call") \ V(Cancel, "cancel") \ V(CastError, "_CastError") \ - V(CheckLoaded, "_checkLoaded") \ V(Class, "Class") \ V(ClassID, "ClassID") \ V(ClearAsyncThreadStackTrace, "_clearAsyncThreadStackTrace") \ @@ -206,7 +205,6 @@ class ObjectPointerVisitor; V(ListFactory, "List.") \ V(ListFilledFactory, "List.filled") \ V(ListLiteralFactory, "List._fromLiteral") \ - V(LoadLibrary, "_loadLibrary") \ V(LocalVarDescriptors, "LocalVarDescriptors") \ V(Map, "Map") \ V(MapLiteralFactory, "Map._fromLiteral") \ diff --git a/sdk/lib/_internal/vm/lib/lib_prefix.dart b/sdk/lib/_internal/vm/lib/lib_prefix.dart index ccca9726519..00b934c905f 100644 --- a/sdk/lib/_internal/vm/lib/lib_prefix.dart +++ b/sdk/lib/_internal/vm/lib/lib_prefix.dart @@ -13,32 +13,7 @@ class _LibraryPrefix { throw "Unreachable"; } - bool _isLoaded() native "LibraryPrefix_isLoaded"; - void _setLoaded() native "LibraryPrefix_setLoaded"; -} - -class _DeferredNotLoadedError extends Error implements NoSuchMethodError { - _LibraryPrefix prefix; - - _DeferredNotLoadedError(this.prefix); - - String toString() { - return "Deferred library $prefix was not loaded."; - } -} - -@pragma("vm:entry-point") -@pragma("vm:never-inline") -Future _loadLibrary(_LibraryPrefix prefix) { - return new Future(() { - prefix._setLoaded(); - }); -} - -@pragma("vm:entry-point") -@pragma("vm:never-inline") -void _checkLoaded(_LibraryPrefix prefix) { - if (!prefix._isLoaded()) { - throw new _DeferredNotLoadedError(prefix); - } + bool isLoaded() => true; + + loadLibrary() => new Future.value(true); } diff --git a/sdk_nnbd/lib/_internal/vm/lib/lib_prefix.dart b/sdk_nnbd/lib/_internal/vm/lib/lib_prefix.dart index 5974d7f7b17..f588ee33e4f 100644 --- a/sdk_nnbd/lib/_internal/vm/lib/lib_prefix.dart +++ b/sdk_nnbd/lib/_internal/vm/lib/lib_prefix.dart @@ -11,32 +11,7 @@ class _LibraryPrefix { throw "Unreachable"; } - bool _isLoaded() native "LibraryPrefix_isLoaded"; - void _setLoaded() native "LibraryPrefix_setLoaded"; -} - -class _DeferredNotLoadedError extends Error implements NoSuchMethodError { - _LibraryPrefix prefix; - - _DeferredNotLoadedError(this.prefix); - - String toString() { - return "Deferred library $prefix was not loaded."; - } -} - -@pragma("vm:entry-point") -@pragma("vm:never-inline") -Future _loadLibrary(_LibraryPrefix prefix) { - return new Future(() { - prefix._setLoaded(); - }); -} - -@pragma("vm:entry-point") -@pragma("vm:never-inline") -void _checkLoaded(_LibraryPrefix prefix) { - if (!prefix._isLoaded()) { - throw new _DeferredNotLoadedError(prefix); - } + bool isLoaded() => true; + + loadLibrary() => new Future.value(true); }