/ark/runtime_core/runtime/ |
D | class_initializer.cpp | 47 static void ThrowNoClassDefFoundError(ManagedThread *thread, Class *klass) in ThrowNoClassDefFoundError() argument 49 LanguageContext ctx = Runtime::GetCurrent()->GetLanguageContext(*klass); in ThrowNoClassDefFoundError() 50 auto name = klass->GetName(); in ThrowNoClassDefFoundError() 54 static void ThrowEarlierInitializationException(ManagedThread *thread, Class *klass) in ThrowEarlierInitializationException() argument 56 ASSERT(klass->IsErroneous()); in ThrowEarlierInitializationException() 58 ThrowNoClassDefFoundError(thread, klass); in ThrowEarlierInitializationException() 62 bool ClassInitializer::Initialize(ClassLinker *class_linker, ManagedThread *thread, Class *klass) in Initialize() argument 64 if (klass->IsInitialized()) { in Initialize() 69 VMHandle<ObjectHeader> managed_class_obj_handle(thread, klass->GetManagedObject()); in Initialize() 73 if (klass->IsInitialized()) { in Initialize() [all …]
|
D | class_linker.cpp | 344 …void LoadMethod(Method *method, panda_file::MethodDataAccessor *method_data_accessor, Class *klass, in LoadMethod() argument 361 …InitializeMemory(method, klass, &pf, method_data_accessor->GetMethodId(), panda_file::File::Entity… in LoadMethod() 370 …InitializeMemory(method, klass, &pf, method_data_accessor->GetMethodId(), code_id.value(), access_… in LoadMethod() 376 bool ClassLinker::LoadMethods(Class *klass, ClassInfo *class_info, panda_file::ClassDataAccessor *d… in LoadMethods() argument 381 uint32_t num_vmethods = klass->GetNumVirtualMethods(); in LoadMethods() 395 LanguageContext ctx = Runtime::GetCurrent()->GetLanguageContext(*klass); in LoadMethods() 400 data_accessor->EnumerateMethods([klass, &smethod_idx, &vmethod_idx, &methods, ctx, ext, in LoadMethods() 403 LoadMethod(method, &method_data_accessor, klass, ctx, ext); in LoadMethods() 414 klass->SetMethods(methods, num_vmethods, num_smethods); in LoadMethods() 419 bool ClassLinker::LoadFields(Class *klass, panda_file::ClassDataAccessor *data_accessor, in LoadFields() argument [all …]
|
D | class_linker_extension.cpp | 112 boot_context_.EnumerateClasses([&klasses](Class *klass) { in Initialize() argument 113 if (!klass->IsLoaded()) { in Initialize() 114 klasses.push_back(klass); in Initialize() 119 for (auto *klass : klasses) { in Initialize() local 120 if (klass->IsLoaded()) { in Initialize() 124 InitializeClass(klass); in Initialize() 125 klass->SetState(Class::State::LOADED); in Initialize() 134 for (auto *klass : class_roots_) { in InitializeRoots() local 135 if (klass == nullptr) { in InitializeRoots() 139 if (!class_linker_->InitializeClass(thread, klass)) { in InitializeRoots() [all …]
|
D | imtable_builder.cpp | 63 void IMTableBuilder::UpdateClass(Class *klass) in UpdateClass() argument 65 if (klass->IsInterface() || klass->IsAbstract()) { in UpdateClass() 69 auto imtable_size = klass->GetIMTSize(); in UpdateClass() 76 auto itable = klass->GetITable(); in UpdateClass() 77 auto imtable = klass->GetIMT(); in UpdateClass() 86 auto itf_method_id = klass->GetIMTableIndex(itf_methods[j].GetFileId().GetOffset()); in UpdateClass() 95 DumpIMTable(klass); in UpdateClass() 113 void IMTableBuilder::DumpIMTable(Class *klass) in DumpIMTable() argument 115 LOG(DEBUG, CLASS_LINKER) << "imtable of class " << klass->GetName() << ":"; in DumpIMTable() 116 auto imtable = klass->GetIMT(); in DumpIMTable() [all …]
|
D | object_header.cpp | 30 ObjectHeader *ObjectHeader::CreateObject(panda::BaseClass *klass, bool non_movable) in CreateObject() argument 33 if (!klass->IsDynamicClass()) { in CreateObject() 34 auto cls = static_cast<panda::Class *>(klass); in CreateObject() 41 size_t size = klass->GetObjectSize(); in CreateObject() 46 obj = heap_manager->AllocateObject(klass, size); in CreateObject() 48 obj = heap_manager->AllocateNonMovableObject(klass, size); in CreateObject() 54 ObjectHeader *ObjectHeader::Create(BaseClass *klass) in Create() argument 56 return CreateObject(klass, false); in Create() 60 ObjectHeader *ObjectHeader::CreateNonMovable(BaseClass *klass) in CreateNonMovable() argument 62 return CreateObject(klass, true); in CreateNonMovable() [all …]
|
D | class_linker_context.h | 58 Class *InsertClass(Class *klass) in InsertClass() argument 61 auto *other_klass = FindClass(klass->GetDescriptor()); in InsertClass() 66 ASSERT(klass->GetSourceLang() == lang_); in InsertClass() 67 loaded_classes_.insert({klass->GetDescriptor(), klass}); in InsertClass() 69 new_classes_.push_back(klass); in InsertClass() 74 void RemoveClass(Class *klass) in RemoveClass() argument 77 loaded_classes_.erase(klass->GetDescriptor()); in RemoveClass() 94 for (const auto klass : new_classes_) { variable 95 if ((klass != nullptr) && (!cb(klass))) {
|
D | class_initializer.h | 27 static bool Initialize(ClassLinker *class_linker, ManagedThread *thread, Class *klass); 29 static bool InitializeFields(Class *klass); 34 static bool VerifyClass(Class *klass);
|
D | dyn_class_linker_extension.cpp | 170 auto *klass = res->GetRuntimeClass(); in CreateClass() local 171 klass->SetManagedObject(res); in CreateClass() 172 klass->SetSourceLang(GetLanguage()); in CreateClass() 173 return klass; in CreateClass() 176 void DynamicClassLinkerExtension::FreeClass(Class *klass) in FreeClass() argument 180 auto *cls = coretypes::Class::FromRuntimeClass(klass); in FreeClass()
|
/ark/runtime_core/runtime/include/ |
D | class_linker-inl.h | 29 Class *klass = caller.GetPandaFile()->GetPandaCache()->GetClassFromCache(id); in GetClass() local 30 if (klass != nullptr) { in GetClass() 31 return klass; in GetClass() 36 klass = ext->GetClass(*caller.GetPandaFile(), id, caller.GetClass()->GetLoadContext(), in GetClass() 38 if (LIKELY(klass != nullptr)) { in GetClass() 39 caller.GetPandaFile()->GetPandaCache()->SetClassCache(id, klass); in GetClass() 41 return klass; in GetClass() 44 inline void ClassLinker::AddClassRoot(ClassRoot root, Class *klass) in AddClassRoot() argument 46 LanguageContext ctx = Runtime::GetCurrent()->GetLanguageContext(*klass); in AddClassRoot() 49 ext->SetClassRoot(root, klass); in AddClassRoot() [all …]
|
D | vtable_builder.h | 208 void UpdateClass(Class *klass) const in UpdateClass() argument 210 auto vtable = klass->GetVTable(); in UpdateClass() 215 method = &klass->GetVirtualMethods()[method_info.GetIndex()]; in UpdateClass() 218 method = &klass->GetCopiedMethods()[method_info.GetIndex()]; in UpdateClass() 227 DumpVTable(klass); in UpdateClass() 230 static void DumpVTable([[maybe_unused]] Class *klass) in DumpVTable() argument 233 LOG(DEBUG, CLASS_LINKER) << "vtable of class " << klass->GetName() << ":"; in DumpVTable() 234 auto vtable = klass->GetVTable(); in DumpVTable() 267 virtual void UpdateClass(Class *klass) const = 0; 287 void UpdateClass(Class *klass) const override;
|
D | class_linker_extension.h | 62 virtual void FreeClass(Class *klass) = 0; 64 virtual void InitializeClass(Class *klass) = 0; 84 void SetClassRoot(ClassRoot root, Class *klass) in SetClassRoot() argument 86 class_roots_[ToIndex(root)] = klass; in SetClassRoot() 87 boot_context_.InsertClass(klass); in SetClassRoot() 183 void OnClassPrepared(Class *klass); 199 Class *AddClass(Class *klass); 202 void AddCreatedClass(Class *klass); 205 void RemoveCreatedClass(Class *klass);
|
D | itable_builder.h | 34 virtual void Resolve(Class *klass) = 0; 36 virtual void UpdateClass(Class *klass) = 0; 38 virtual void DumpITable(Class *klass) = 0;
|
D | class_linker.h | 190 bool InitializeClass(ManagedThread *thread, Class *klass); 229 void AddClassRoot(ClassRoot root, Class *klass); 291 void RemoveCreatedClassInExtension(Class *klass); 304 Field *GetFieldById(Class *klass, const panda_file::FieldDataAccessor &field_data_accessor, 307 … Field *GetFieldBySignature(Class *klass, const panda_file::FieldDataAccessor &field_data_accessor, 310 … Method *GetMethod(const Class *klass, const panda_file::MethodDataAccessor &method_data_accessor, 313 bool LinkBootClass(Class *klass); 331 bool LinkFields(Class *klass, ClassLinkerErrorHandler *error_handler); 333 …bool LoadFields(Class *klass, panda_file::ClassDataAccessor *data_accessor, ClassLinkerErrorHandle… 335 bool LinkMethods(Class *klass, ClassInfo *class_info, ClassLinkerErrorHandler *error_handler); [all …]
|
/ark/runtime_core/runtime/interpreter/ |
D | runtime_interface.cpp | 23 ObjectHeader *RuntimeInterface::CreateObject(Class *klass) in CreateObject() argument 25 ASSERT(!klass->IsArrayClass()); in CreateObject() 27 if (klass->IsStringClass()) { in CreateObject() 28 LanguageContext ctx = Runtime::GetCurrent()->GetLanguageContext(*klass); in CreateObject() 32 if (LIKELY(klass->IsInstantiable())) { in CreateObject() 33 return ObjectHeader::Create(klass); in CreateObject() 36 const auto &name = klass->GetName(); in CreateObject()
|
D | runtime_interface.h | 56 auto *klass = method->GetClass(); in ResolveMethod() local 57 if (!klass->IsInitialized() && !class_linker->InitializeClass(thread, klass)) { in ResolveMethod() 101 auto *klass = field->GetClass(); in ResolveField() local 102 if (!klass->IsInitialized() && !class_linker->InitializeClass(thread, field->GetClass())) { in ResolveField() 114 Class *klass = class_linker->GetClass(caller, resolved_id); in ResolveClass() local 116 if (klass == nullptr) { in ResolveClass() 122 if (!klass->IsInitialized() && !klass_linker->InitializeClass(thread, klass)) { in ResolveClass() 127 return klass; in ResolveClass() 155 static coretypes::Array *CreateArray(Class *klass, coretypes::array_size_t length) in CreateArray() argument 157 return coretypes::Array::Create(klass, length); in CreateArray() [all …]
|
/ark/runtime_core/runtime/tests/ |
D | class_linker_test.cpp | 100 Class *klass = nullptr; in TEST_F() local 105 …klass = ext->GetClass(ClassHelper::GetDescriptor(utf::CStringAsMutf8("_GLOBAL"), descriptor.get())… in TEST_F() 110 …EXPECT_EQ(klass, ext->GetClass(ClassHelper::GetDescriptor(utf::CStringAsMutf8("_GLOBAL"), &descrip… in TEST_F() 111 EXPECT_EQ(klass->GetBase(), ext->GetClassRoot(ClassRoot::OBJECT)); in TEST_F() 112 EXPECT_EQ(klass->GetPandaFile(), pf_ptr); in TEST_F() 113 EXPECT_EQ(klass->GetMethods().size(), 1U); in TEST_F() 114 EXPECT_EQ(klass->GetComponentSize(), 0U); in TEST_F() 188 Class *klass = class_linker_ext.GetClassRoot(class_root); in TestPrimitiveClassRoot() local 189 ASSERT_NE(klass, nullptr) << msg; in TestPrimitiveClassRoot() 190 EXPECT_EQ(klass->GetBase(), nullptr) << msg; in TestPrimitiveClassRoot() [all …]
|
D | method_test.cpp | 94 …Class *klass = extension->GetClass(ClassHelper::GetDescriptor(utf::CStringAsMutf8("_GLOBAL"), &des… in VerifyLineNumber() local 95 ASSERT_NE(klass, nullptr); in VerifyLineNumber() 97 Method *method = klass->GetDirectMethod(utf::CStringAsMutf8("foo")); in VerifyLineNumber() 157 …Class *klass = extension->GetClass(ClassHelper::GetDescriptor(utf::CStringAsMutf8("_GLOBAL"), &des… in TEST_F() local 158 ASSERT_NE(klass, nullptr); in TEST_F() 160 Method *main_method = klass->GetDirectMethod(utf::CStringAsMutf8("main")); in TEST_F() 163 Method *f_method = klass->GetDirectMethod(utf::CStringAsMutf8("f")); in TEST_F() 166 Method *g_method = klass->GetDirectMethod(utf::CStringAsMutf8("g")); in TEST_F() 218 …Class *klass = extension->GetClass(ClassHelper::GetDescriptor(utf::CStringAsMutf8("_GLOBAL"), &des… in TEST_F() local 219 ASSERT_NE(klass, nullptr); in TEST_F() [all …]
|
D | class_linker_test_extension.h | 86 auto *klass = res->GetRuntimeClass(); in CreateClass() local 87 klass->SetManagedObject(res); in CreateClass() 88 klass->SetSourceLang(GetLanguage()); in CreateClass() 89 AddCreatedClass(klass); in CreateClass() 90 return klass; in CreateClass() 93 void FreeClass(Class *klass) override in FreeClass() argument 95 RemoveCreatedClass(klass); in FreeClass()
|
D | array_test.cpp | 48 static size_t GetArrayObjectSize(panda::Class *klass, size_t n) in GetArrayObjectSize() argument 50 return sizeof(Array) + klass->GetComponentSize() * n; in GetArrayObjectSize() 59 …auto *klass = Runtime::GetCurrent()->GetClassLinker()->GetExtension(ctx)->GetClassRoot(class_root); in TestArrayObjectSize() local 61 Array *array = Array::Create(klass, n); in TestArrayObjectSize() 64 ASSERT_EQ(array->ObjectSize(), GetArrayObjectSize(klass, n)) << msg; in TestArrayObjectSize()
|
/ark/runtime_core/verification/debug/options/ |
D | method_options.h | 68 void SetMsgClass(VerifierMessagesEnum msg_num, MethodOption::MsgClass klass) in SetMsgClass() argument 70 msg_classes[msg_num][klass] = true; in SetMsgClass() 74 void SetMsgClass(Validator validator, size_t msg_num, MethodOption::MsgClass klass) in SetMsgClass() argument 77 msg_classes[static_cast<VerifierMessagesEnum>(msg_num)][klass] = true; in SetMsgClass() 91 bool IsInMsgClass(VerifierMessagesEnum msg_num, MethodOption::MsgClass klass) const in IsInMsgClass() argument 94 return msg_classes.at(msg_num)[klass]; in IsInMsgClass() 98 return up.get().IsInMsgClass(msg_num, klass); in IsInMsgClass() 105 …void IfInMsgClassThen(VerifierMessagesEnum msg_num, MethodOption::MsgClass klass, Handler &&handle… in IfInMsgClassThen() argument 107 if (IsInMsgClass(msg_num, klass)) { in IfInMsgClassThen() 113 …void IfNotInMsgClassThen(VerifierMessagesEnum msg_num, MethodOption::MsgClass klass, Handler &&han… in IfNotInMsgClassThen() argument [all …]
|
/ark/runtime_core/verification/absint/ |
D | panda_types.cpp | 203 Type PandaTypes::TypeOfArray(const PandaTypes::CachedClass &klass) in TypeOfArray() argument 205 ASSERT(klass.flags[CachedClass::Flag::ARRAY_CLASS]); in TypeOfArray() 208 const auto &component = klass.GetArrayComponent(); in TypeOfArray() 218 if (klass.flags[CachedClass::Flag::OBJECT_ARRAY_CLASS]) { in TypeOfArray() 225 Type PandaTypes::TypeOf(const PandaTypes::CachedClass &klass) in TypeOf() argument 227 auto id = klass.id; in TypeOf() 234 for (const auto &ancestor : klass.ancestors) { in TypeOf() 241 bool is_primitive = klass.flags[CachedClass::Flag::PRIMITIVE]; in TypeOf() 242 bool is_string = klass.flags[CachedClass::Flag::STRING_CLASS]; in TypeOf() 244 auto class_name = klass.GetName(); in TypeOf() [all …]
|
/ark/js_runtime/ecmascript/ |
D | ecma_class_linker_extension.cpp | 77 auto *klass = res->GetRuntimeClass(); in NewClass() local 78 klass->SetManagedObject(res); in NewClass() 79 klass->SetSourceLang(GetLanguage()); in NewClass() 80 return klass; in NewClass() 97 void EcmaClassLinkerExtension::FreeClass([[maybe_unused]] Class *klass) in FreeClass() argument 104 auto *cls = coretypes::Class::FromRuntimeClass(klass); in FreeClass()
|
/ark/runtime_core/verification/verifier/ |
D | verifier.cpp | 73 Class *klass = nullptr; in VerifierProcessFile() local 82 klass = class_linker.GetExtension(ctx)->GetClass(*file, class_id); in VerifierProcessFile() 85 if (klass != nullptr) { in VerifierProcessFile() 86 auto *panda_file = klass->GetPandaFile(); in VerifierProcessFile() 92 ctx = Runtime::GetCurrent()->GetLanguageContext(*klass); in VerifierProcessFile() 95 for (auto &method : klass->GetMethods()) { in VerifierProcessFile()
|
/ark/runtime_core/docs/ |
D | runtime-class.md | 43 auto *managed_class_obj = coretypes::Class::FromRuntimeClass(klass); 64 static Class *FromRuntimeClass(panda::Class *klass) { 65 … return reinterpret_cast<Class *>(reinterpret_cast<uintptr_t>(klass) - GetRuntimeClassOffset()); 76 auto *managed_class_obj = klass->GetManagedObject(); 84 switch (klass->GetSourceLang()) { 86 managed_class_obj = coretypes::Class::FromRuntimeClass(klass); 90 managed_class_obj = java::JClass::FromRuntimeClass(klass);
|
/ark/runtime_core/runtime/core/ |
D | core_itable_builder.h | 34 void Resolve([[maybe_unused]] Class *klass) override {}; in Resolve() argument 36 void UpdateClass([[maybe_unused]] Class *klass) override {}; in UpdateClass() argument 38 void DumpITable([[maybe_unused]] Class *klass) override {}; in DumpITable() argument
|