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

Function JNI_CreateJavaVM

src/jnienv.cpp:3610–3786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3608}
3609
3610extern "C" AVIAN_EXPORT jint JNICALL
3611 JNI_CreateJavaVM(Machine** m, Thread** t, void* args)
3612{
3613 local::JavaVMInitArgs* a = static_cast<local::JavaVMInitArgs*>(args);
3614
3615 unsigned heapLimit = 0;
3616 unsigned stackLimit = 0;
3617 const char* bootLibraries = 0;
3618 const char* classpath = 0;
3619 const char* javaHome = AVIAN_JAVA_HOME;
3620 const char* embedPrefix = AVIAN_EMBED_PREFIX;
3621 const char* bootClasspathPrepend = "";
3622 const char* bootClasspath = 0;
3623 const char* bootClasspathAppend = "";
3624 const char* crashDumpDirectory = 0;
3625
3626 unsigned propertyCount = 0;
3627
3628 for (int i = 0; i < a->nOptions; ++i) {
3629 if (strncmp(a->options[i].optionString, "-X", 2) == 0) {
3630 const char* p = a->options[i].optionString + 2;
3631 if (strncmp(p, "mx", 2) == 0) {
3632 heapLimit = local::parseSize(p + 2);
3633 } else if (strncmp(p, "ss", 2) == 0) {
3634 stackLimit = local::parseSize(p + 2);
3635 } else if (strncmp(p,
3636 BOOTCLASSPATH_PREPEND_OPTION ":",
3637 sizeof(BOOTCLASSPATH_PREPEND_OPTION)) == 0) {
3638 bootClasspathPrepend = p + sizeof(BOOTCLASSPATH_PREPEND_OPTION);
3639 } else if (strncmp(
3640 p, BOOTCLASSPATH_OPTION ":", sizeof(BOOTCLASSPATH_OPTION))
3641 == 0) {
3642 bootClasspath = p + sizeof(BOOTCLASSPATH_OPTION);
3643 } else if (strncmp(p,
3644 BOOTCLASSPATH_APPEND_OPTION ":",
3645 sizeof(BOOTCLASSPATH_APPEND_OPTION)) == 0) {
3646 bootClasspathAppend = p + sizeof(BOOTCLASSPATH_APPEND_OPTION);
3647 }
3648 } else if (strncmp(a->options[i].optionString, "-D", 2) == 0) {
3649 const char* p = a->options[i].optionString + 2;
3650 if (strncmp(p, BOOTSTRAP_PROPERTY "=", sizeof(BOOTSTRAP_PROPERTY)) == 0) {
3651 bootLibraries = p + sizeof(BOOTSTRAP_PROPERTY);
3652 } else if (strncmp(p,
3653 JAVA_COMMAND_PROPERTY "=",
3654 sizeof(JAVA_COMMAND_PROPERTY)) == 0
3655 or strncmp(p,
3656 JAVA_LAUNCHER_PROPERTY "=",
3657 sizeof(JAVA_LAUNCHER_PROPERTY)) == 0) {
3658 // this means we're being invoked via the javac or java
3659 // command, so the bootstrap library should be e.g. libjvm.so
3660 bootLibraries = SO_PREFIX "jvm" SO_SUFFIX;
3661 } else if (strncmp(p, CRASHDIR_PROPERTY "=", sizeof(CRASHDIR_PROPERTY))
3662 == 0) {
3663 crashDumpDirectory = p + sizeof(CRASHDIR_PROPERTY);
3664 } else if (strncmp(p, CLASSPATH_PROPERTY "=", sizeof(CLASSPATH_PROPERTY))
3665 == 0) {
3666 classpath = p + sizeof(CLASSPATH_PROPERTY);
3667 } else if (strncmp(p, JAVA_HOME_PROPERTY "=", sizeof(JAVA_HOME_PROPERTY))

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls 14

parseSizeFunction · 0.85
makeHeapFunction · 0.85
makeFinderFunction · 0.85
freeFunction · 0.85
enterFunction · 0.85
makeClasspathFunction · 0.70
appendFunction · 0.70
makeProcessorFunction · 0.70
allocateMethod · 0.65
makeSystemFunction · 0.50
runFunction · 0.50
bootClasspathMethod · 0.45

Tested by

no test coverage detected