MCPcopy Create free account
hub / github.com/ReadyTalk/avian / loadLibrary

Method loadLibrary

src/classpath-openjdk.cpp:1985–2047  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1983extern "C" AVIAN_EXPORT jint JNICALL management_JNI_OnLoad(JavaVM*, void*);
1984
1985void JNICALL loadLibrary(Thread* t, object, uintptr_t* arguments)
1986{
1987 Thread::LibraryLoadStack stack(
1988 t,
1989 cast<GcJclass>(t, reinterpret_cast<object>(arguments[0]))
1990 ->vmClass()
1991 ->loader());
1992
1993 GcString* name = cast<GcString>(t, reinterpret_cast<object>(arguments[1]));
1994 THREAD_RUNTIME_ARRAY(t, char, n, name->length(t) + 1);
1995 stringChars(t, name, RUNTIME_ARRAY_BODY(n));
1996
1997 bool absolute = arguments[2];
1998
1999 if (not absolute) {
2000 if (strcmp(RUNTIME_ARRAY_BODY(n), "net") == 0) {
2001 bool ran;
2002
2003 {
2004 ACQUIRE(t, t->m->classLock);
2005
2006 local::MyClasspath* c
2007 = static_cast<local::MyClasspath*>(t->m->classpath);
2008
2009 ran = c->ranNetOnLoad;
2010 c->ranNetOnLoad = true;
2011 }
2012
2013 if (not ran) {
2014 net_JNI_OnLoad(t->m, 0);
2015 }
2016
2017 return;
2018 } else if (strcmp(RUNTIME_ARRAY_BODY(n), "management") == 0) {
2019 bool ran;
2020
2021 {
2022 ACQUIRE(t, t->m->classLock);
2023
2024 local::MyClasspath* c
2025 = static_cast<local::MyClasspath*>(t->m->classpath);
2026
2027 ran = c->ranManagementOnLoad;
2028 c->ranManagementOnLoad = true;
2029 }
2030
2031 if (not ran) {
2032 management_JNI_OnLoad(t->m, 0);
2033 }
2034
2035 return;
2036 } else if (strcmp(RUNTIME_ARRAY_BODY(n), "zip") == 0
2037 or strcmp(RUNTIME_ARRAY_BODY(n), "nio") == 0) {
2038 return;
2039 }
2040 }
2041
2042 loadLibrary(t,

Callers

nothing calls this directly

Calls 6

strcmpFunction · 0.85
net_JNI_OnLoadFunction · 0.85
management_JNI_OnLoadFunction · 0.85
vmClassMethod · 0.80
stringCharsFunction · 0.70
loadLibraryFunction · 0.70

Tested by

no test coverage detected