• Home
  • Raw
  • Download

Lines Matching full:runtime

16 #include "runtime/include/runtime.h"
39 #include "runtime/core/core_language_context.h"
40 #include "runtime/dprofiler/dprofiler.h"
41 #include "runtime/entrypoints/entrypoints.h"
42 #include "runtime/include/class_linker_extension.h"
43 #include "runtime/include/coretypes/array-inl.h"
44 #include "runtime/include/coretypes/string.h"
45 #include "runtime/include/language_context.h"
46 #include "runtime/include/locks.h"
47 #include "runtime/include/runtime_notification.h"
48 #include "runtime/include/thread.h"
49 #include "runtime/include/thread_scopes.h"
50 #include "runtime/include/tooling/debug_inf.h"
52 #include "runtime/mem/gc/gc_stats.h"
53 #include "runtime/mem/gc/stw-gc/stw-gc.h"
54 #include "runtime/mem/gc/crossing_map_singleton.h"
55 #include "runtime/mem/heap_manager.h"
56 #include "runtime/mem/mem_hooks.h"
57 #include "runtime/mem/memory_manager.h"
58 #include "runtime/mem/internal_allocator-inl.h"
59 #include "runtime/core/core_class_linker_extension.h"
60 #include "runtime/include/panda_vm.h"
61 #include "runtime/tooling/debugger.h"
62 #include "runtime/tooling/pt_lang_ext_private.h"
63 #include "runtime/include/file_manager.h"
76 Runtime *Runtime::instance = nullptr;
77 RuntimeOptions Runtime::options_; // NOLINT(fuchsia-statically-constructed-objects)
78 os::memory::Mutex Runtime::mutex; // NOLINT(fuchsia-statically-constructed-objects)
142 LanguageContext Runtime::GetLanguageContext(panda_file::SourceLang lang) in GetLanguageContext()
149 LanguageContext Runtime::GetLanguageContext(const Method &method) in GetLanguageContext()
166 LanguageContext Runtime::GetLanguageContext(const Class &cls) in GetLanguageContext()
171 LanguageContext Runtime::GetLanguageContext(const BaseClass &cls) in GetLanguageContext()
176 LanguageContext Runtime::GetLanguageContext(panda_file::ClassDataAccessor *cda) in GetLanguageContext()
186 LanguageContext Runtime::GetLanguageContext(const std::string &runtime_type) in GetLanguageContext()
194 LOG(FATAL, RUNTIME) << "Incorrect runtime_type: " << runtime_type; in GetLanguageContext()
199 bool Runtime::CreateInstance(const RuntimeOptions &options, mem::InternalAllocatorPtr internal_allo… in CreateInstance()
218 instance = new Runtime(options, internal_allocator, ctxs); in CreateInstance()
225 bool Runtime::Create(const RuntimeOptions &options, const std::vector<LanguageContextBase *> &ctxs) in Create()
231 trace::ScopedTrace scoped_trace("Runtime::Create"); in Create()
247 LOG(ERROR, RUNTIME) << "Failed to initialize runtime"; in Create()
263 Runtime *Runtime::GetCurrent() in GetCurrent()
269 bool Runtime::DestroyUnderLockHolder() in DestroyUnderLockHolder()
278 LOG(ERROR, RUNTIME) << "Failed to shutdown runtime"; in DestroyUnderLockHolder()
286 * NOTE: Users threads can call log after destroying Runtime. We can't control these in DestroyUnderLockHolder()
300 bool Runtime::Destroy() in Destroy()
306 trace::ScopedTrace scoped_trace("Runtime shutdown"); in Destroy()
317 …verifier::VerificationResultCache::Destroy(Runtime::GetCurrent()->GetVerificationOptions().Cache.U… in Destroy()
325 void Runtime::InitializeVerificationResultCache(const panda::RuntimeOptions &options) in InitializeVerificationResultCache()
345 void Runtime::Halt(int32_t status) in Halt()
347 Runtime *runtime = Runtime::GetCurrent(); in Halt() local
348 if (runtime != nullptr && runtime->exit_ != nullptr) { in Halt()
349 runtime->exit_(status); in Halt()
358 void Runtime::Abort(const char *message /* = nullptr */) in Abort()
360 Runtime *runtime = Runtime::GetCurrent(); in Abort() local
361 if (runtime != nullptr && runtime->abort_ != nullptr) { in Abort()
362 runtime->abort_(); in Abort()
365 std::cerr << "Runtime::Abort: " << (message != nullptr ? message : "") << std::endl; in Abort()
370 Runtime::Runtime(const RuntimeOptions &options, mem::InternalAllocatorPtr internal_allocator, in Runtime() function in panda::Runtime
380 Runtime::options_ = options; in Runtime()
424 Runtime::~Runtime() in ~Runtime()
457 bool Runtime::IsEnableMemoryHooks() const in IsEnableMemoryHooks()
476 PandaVector<PandaString> Runtime::GetBootPandaFiles() in GetBootPandaFiles()
483 PandaVector<PandaString> Runtime::GetPandaFiles() in GetPandaFiles()
490 bool Runtime::LoadBootPandaFiles(panda_file::File::OpenMode open_mode) in LoadBootPandaFiles()
496 LOG(ERROR, RUNTIME) << "Load boot panda file failed: " << name; in LoadBootPandaFiles()
504 mem::GCType Runtime::GetGCType(const RuntimeOptions &options) in GetGCType()
516 bool Runtime::LoadVerificationConfig() in LoadVerificationConfig()
531 bool Runtime::CreatePandaVM(std::string_view runtime_type) in CreatePandaVM()
534 LOG(ERROR, RUNTIME) << "Failed to initialize managed thread"; in CreatePandaVM()
540 LOG(ERROR, RUNTIME) << "Failed to create panda vm"; in CreatePandaVM()
545 if (Runtime::GetOptions().GetRuntimeType() == "ecmascript") { in CreatePandaVM()
552 LOG(ERROR, RUNTIME) << "Failed to load boot panda files"; in CreatePandaVM()
561 bool Runtime::InitializePandaVM() in InitializePandaVM()
564 LOG(ERROR, RUNTIME) << "Failed to initialize class loader"; in InitializePandaVM()
569 LOG(ERROR, RUNTIME) << "Failed to initialize intrinsics"; in InitializePandaVM()
576 LOG(ERROR, RUNTIME) << "Failed to start debugger"; in InitializePandaVM()
582 LOG(ERROR, RUNTIME) << "Failed to initialize panda vm"; in InitializePandaVM()
589 bool Runtime::CheckOptionsConsistency() in CheckOptionsConsistency()
594 void Runtime::SetPandaPath() in SetPandaPath()
605 bool Runtime::Initialize() in Initialize()
607 trace::ScopedTrace scoped_trace("Runtime::Initialize"); in Initialize()
638 LOG(ERROR, RUNTIME) << "Failed to finish panda vm initialization"; in Initialize()
667 Expected<Method *, Runtime::Error> Runtime::ResolveEntryPoint(std::string_view entry_point) in ResolveEntryPoint()
673 LOG(ERROR, RUNTIME) << "Invalid entry point: " << entry_point; in ResolveEntryPoint()
674 return Unexpected(Runtime::Error::INVALID_ENTRY_POINT); in ResolveEntryPoint()
696 LOG(ERROR, RUNTIME) << "Cannot find class '" << class_name << "'"; in ResolveEntryPoint()
697 return Unexpected(Runtime::Error::CLASS_NOT_FOUND); in ResolveEntryPoint()
712 LOG(ERROR, RUNTIME) << "Cannot find method '" << entry_point << "'"; in ResolveEntryPoint()
713 return Unexpected(Runtime::Error::METHOD_NOT_FOUND); in ResolveEntryPoint()
720 PandaString Runtime::GetMemoryStatistics() in GetMemoryStatistics()
725 PandaString Runtime::GetFinalStatistics() in GetFinalStatistics()
730 void Runtime::NotifyAboutLoadedModules() in NotifyAboutLoadedModules()
744 Expected<LanguageContext, Runtime::Error> Runtime::ExtractLanguageContext(const panda_file::File *p… in ExtractLanguageContext()
750 LOG(ERROR, RUNTIME) << "Invalid entry point: " << entry_point; in ExtractLanguageContext()
751 return Unexpected(Runtime::Error::INVALID_ENTRY_POINT); in ExtractLanguageContext()
760 LOG(ERROR, RUNTIME) << "Cannot find class '" << class_name << "'"; in ExtractLanguageContext()
761 return Unexpected(Runtime::Error::CLASS_NOT_FOUND); in ExtractLanguageContext()
778 LOG(ERROR, RUNTIME) << "Cannot find method '" << entry_point << "'"; in ExtractLanguageContext()
779 return Unexpected(Runtime::Error::METHOD_NOT_FOUND); in ExtractLanguageContext()
785 std::optional<Runtime::Error> Runtime::CreateApplicationClassLinkerContext(std::string_view filenam… in CreateApplicationClassLinkerContext()
803 return Runtime::Error::PANDA_FILE_LOAD_ERROR; in CreateApplicationClassLinkerContext()
812 LOG(ERROR, RUNTIME) << "class linker hasn't " << res.Value() << " language extension"; in CreateApplicationClassLinkerContext()
813 return Runtime::Error::CLASS_LINKER_EXTENSION_NOT_FOUND; in CreateApplicationClassLinkerContext()
834 Expected<int, Runtime::Error> Runtime::ExecutePandaFile(std::string_view filename, std::string_view… in ExecutePandaFile()
854 Expected<int, Runtime::Error> Runtime::Execute(std::string_view entry_point, const std::vector<std:… in Execute()
868 void Runtime::RegisterAppInfo(const PandaVector<PandaString> &code_paths, const PandaString &profil… in RegisterAppInfo()
871 LOG(INFO, RUNTIME) << "Code path: " << str; in RegisterAppInfo()
881 int Runtime::StartDProfiler(std::string_view app_name) in StartDProfiler()
884 LOG(ERROR, RUNTIME) << "DProfiller already started"; in StartDProfiler()
888 dprofiler_ = internal_allocator_->New<DProfiler>(app_name, Runtime::GetCurrent()); in StartDProfiler()
892 bool Runtime::StartDebugger(const std::string &library_path) in StartDebugger()
903 LOG(ERROR, RUNTIME) << sym.Error().ToString(); in StartDebugger()
916 LOG(ERROR, RUNTIME) << "StartDebugger has failed"; in StartDebugger()
928 bool Runtime::AttachDebugger() in AttachDebugger()
933 LOG(ERROR, RUNTIME) << "Cannot create PtLangExt"; in AttachDebugger()
942 bool Runtime::Shutdown() in Shutdown()
950 LOG(ERROR, RUNTIME) << sym.Error().ToString(); in Shutdown()
956 LOG(ERROR, RUNTIME) << "StopDebugger has failed"; in Shutdown()
968 coretypes::String *Runtime::ResolveString(PandaVM *vm, const Method &caller, panda_file::File::Enti… in ResolveString()
975 coretypes::String *Runtime::ResolveString(PandaVM *vm, const panda_file::File &pf, panda_file::File… in ResolveString()
986 coretypes::String *Runtime::ResolveString(PandaVM *vm, const uint8_t *mutf8, uint32_t length, Langu… in ResolveString()
991 coretypes::Array *Runtime::ResolveLiteralArray(PandaVM *vm, const Method &caller, panda_file::File:… in ResolveLiteralArray()
998 Class *Runtime::GetClassRootForLiteralTag(const ClassLinkerExtension &ext, panda_file::LiteralTag t… in GetClassRootForLiteralTag()
1036 bool Runtime::GetLiteralTagAndValue(const panda_file::File &pf, panda_file::File::EntityId id, in GetLiteralTagAndValue()
1052 coretypes::Array *Runtime::ResolveLiteralArray(PandaVM *vm, const panda_file::File &pf, panda_file:… in ResolveLiteralArray()
1064 auto ext = Runtime::GetCurrent()->GetClassLinker()->GetExtension(ctx); in ResolveLiteralArray()
1072 … auto str = Runtime::GetCurrent()->ResolveString(vm, pf, panda_file::File::EntityId(str_id), ctx); in ResolveLiteralArray()
1084 void Runtime::UpdateProcessState([[maybe_unused]] int state) in UpdateProcessState()
1086 LOG(INFO, RUNTIME) << __func__ << " is an empty implementation now."; in UpdateProcessState()
1089 void Runtime::RegisterSensitiveThread() const in RegisterSensitiveThread()
1091 LOG(INFO, RUNTIME) << __func__ << " is an empty implementation now."; in RegisterSensitiveThread()
1094 void Runtime::CreateDfxController(const RuntimeOptions &options) in CreateDfxController()
1108 void Runtime::BlockSignals() in BlockSignals()
1113 LOG(ERROR, RUNTIME) << "sigemptyset failed"; in BlockSignals()
1122 LOG(ERROR, RUNTIME) << "sigaddset failed"; in BlockSignals()
1128 LOG(ERROR, RUNTIME) << "PandaThreadSigmask failed"; in BlockSignals()
1133 void Runtime::DumpForSigQuit(std::ostream &os) in DumpForSigQuit()
1156 void Runtime::PreZygoteFork() in PreZygoteFork()
1161 void Runtime::PostZygoteFork() in PostZygoteFork()
1167 bool Runtime::SaveProfileInfo() const in SaveProfileInfo()
1172 Trace *Runtime::CreateTrace([[maybe_unused]] LanguageContext ctx, in CreateTrace()
1176 LOG(FATAL, RUNTIME) << "Method tracing isn't supported at the moment!"; in CreateTrace()