jdk8u源码分析
openjdk8u源码解读
johnjoe.xie
物来顺应,未来不迎,当时不杂,既过不恋。--曾国藩
展开
-
《jdk8u源码分析》sun.misc.Launcher
sun.misc.Launcher.java@see: 8.LoadJavaVM调用JNI_CreateJavaVM时,加载属性 sun.boot.class.path 配置的包.private static String bootClassPath = System.getProperty("sun.boot.class.path"); private static cl...原创 2019-03-22 16:09:19 · 1329 阅读 · 0 评论 -
《jdk8u源码分析》JNI_CreateJavaVM & DestroyJavaVM 详解
摘录自《Java性能优化权威指南》第3章 JVM概览3.2 HotSpot VM运行时3.2.2 VM生命周期 HotSpot VM 启动时JNI_CreateJavaVM方法将执行以下一系列操作。 (1)确保只有一个线程调用这个方法并且确保只创建一个HotSpot VM实例。因为HotSpot VM创建的静态数据结构无法再次初始化,所以一旦初始化到达某个确定点后,进程空间里就只能...转载 2019-03-20 15:41:37 · 3440 阅读 · 0 评论 -
《jdk8u源码分析》14.SetJavaLauncherProp
src/share/bin/java.c::SetJavaLauncherProp/* * JVM would like to know if it's created by a standard Sun launcher, or by * user native application, the following property indicates the former. */vo...原创 2019-03-20 14:37:43 · 158 阅读 · 0 评论 -
《jdk8u源码分析》jvm.dll接口列表
通过命令行工具 VS2012 ARM Cross Tools Command Prompt 执行命令:dumpbin /exports "C:\Tools\Java\jre1.8.0_191\bin\server\jvm.dll">>D:\jvmdll.txtjvmdll.txtMicrosoft (R) COFF/PE Dumper Version 11.00.51106.1...原创 2019-03-20 14:40:04 · 29498 阅读 · 0 评论 -
《jdk8u源码分析》16.2.10.CreateApplicationArgs
src/solaris/bin/java_md_common.c::CreateApplicationArgsjobjectArrayCreateApplicationArgs(JNIEnv *env, char **strv, int argc){ return NewPlatformStringArray(env, strv, argc);}src/windows/bin/...原创 2019-03-20 14:42:20 · 168 阅读 · 0 评论 -
《jdk8u源码分析》16.2.9.PostJVMInit
src/solaris/bin/java_md_solinux.c::PostJVMInit (linux)voidPostJVMInit(JNIEnv *env, jstring mainClass, JavaVM *vm){ // stubbed out for windows and *nixes.}src/windows/bin/java_md.c::PostJVMIn...原创 2019-03-20 14:42:12 · 199 阅读 · 0 评论 -
《jdk8u源码分析》16.2.8.GetApplicationClass
src/share/bin/java.c::GetApplicationClassstatic jclassGetApplicationClass(JNIEnv *env){ jmethodID mid; jobject result; jclass cls = GetLauncherHelperClass(env); NULL_CHECK0(cls); ...原创 2019-03-20 14:42:06 · 128 阅读 · 0 评论 -
《jdk8u源码分析》16.2.7.LoadMainClass
src/share/bin/java.c::LoadMainClass/* * Loads a class and verifies that the main class is present and it is ok to * call it for more details refer to the java implementation. */static jclassLoad...原创 2019-03-20 14:41:59 · 299 阅读 · 0 评论 -
《jdk8u源码分析》16.2.6.FreeKnownVMs
src/share/bin/java.c::FreeKnownVMsstatic voidFreeKnownVMs(){ int i; for (i = 0; i < knownVMsCount; i++) { JLI_MemFree(knownVMs[i].name); knownVMs[i].name = NULL; } ...原创 2019-03-20 14:41:53 · 125 阅读 · 0 评论 -
《jdk8u源码分析》16.2.5.PrintUsage
src/share/bin/java.c::PrintUsage/* * Prints default usage or the Xusage message, see sun.launcher.LauncherHelper.java */static voidPrintUsage(JNIEnv* env, jboolean doXUsage){ jmethodID initHel...原创 2019-03-20 14:41:45 · 203 阅读 · 0 评论 -
《jdk8u源码分析》16.2.4.PrintJavaVersion
src/share/bin/java.c::PrintJavaVersion/* * Prints the version information from the java.version and other properties. */static voidPrintJavaVersion(JNIEnv *env, jboolean extraLF){ jclass ver...原创 2019-03-20 14:41:35 · 133 阅读 · 0 评论 -
《jdk8u源码分析》16.2.3.ShowSettings
src/share/bin/java.c::ShowSettings/* * Prints all the Java settings, see the java implementation for more details. */static voidShowSettings(JNIEnv *env, char *optString){ jmethodID showSett...原创 2019-03-20 14:41:27 · 347 阅读 · 0 评论 -
《jdk8u源码分析》16.2.2.InitializeJVM
src/share/bin/java.c::InitializeJVM/* * Initializes the Java Virtual Machine. Also frees options array when * finished. */static jbooleanInitializeJVM(JavaVM **pvm, JNIEnv **penv, InvocationFunc...原创 2019-03-20 14:41:16 · 195 阅读 · 0 评论 -
《jdk8u源码分析》16.2.1.RegisterThread
src/solaris/bin/java_md_solinux.c::RegisterThreadvoidRegisterThread(){ // stubbed out for windows and *nixes.}src/windows/bin/java_md.c::RegisterThreadvoidRegisterThread(){ // stubbed...原创 2019-03-20 14:41:06 · 359 阅读 · 0 评论 -
《jdk8u源码分析》16.2.ContinueInNewThread
src/share/bin/java.c::ContinueInNewThreadintContinueInNewThread(InvocationFunctions* ifn, jlong threadStackSize, int argc, char **argv, int mode, char *what, ...原创 2019-03-20 14:42:31 · 442 阅读 · 0 评论 -
《jdk8u源码分析》11.SetClassPath
src/share/bin/java.c::SetClassPathstatic voidSetClassPath(const char *s){ char *def; const char *orig = s; static const char format[] = "-Djava.class.path=%s"; /* * usually we ...原创 2019-03-20 14:32:58 · 122 阅读 · 0 评论 -
《jdk8u源码分析》16.1.ShowSplashScreen
src/share/bin/java.c::ShowSplashScreen/* * Displays the splash screen according to the jar file name * and image file names stored in environment variables */voidShowSplashScreen(){ const c...原创 2019-03-20 14:40:38 · 199 阅读 · 0 评论 -
《jdk8u源码分析》16.JVMInit
src/solaris/bin/java_md_solinux.c::JVMInitintJVMInit(InvocationFunctions* ifn, jlong threadStackSize, int argc, char **argv, int mode, char *what, int ret){ ShowSplashScreen();...原创 2019-03-20 14:40:26 · 216 阅读 · 0 评论 -
《jdk8u源码分析》15.SetJavaLauncherPlatformProps
src/windows/bin/java_md.c::SetJavaLauncherPlatformProps(linux)void SetJavaLauncherPlatformProps() { /* Linux only */#ifdef __linux__ const char *substr = "-Dsun.java.launcher.pid="; char ...原创 2019-03-20 14:39:35 · 128 阅读 · 0 评论 -
《jdk8u源码分析》13.SetJavaCommandLineProp
src/share/bin/java.c::SetJavaCommandLineProp/* * inject the -Dsun.java.command pseudo property into the args structure * this pseudo property is used in the HotSpot VM to expose the * Java class n...原创 2019-03-20 14:36:50 · 132 阅读 · 0 评论 -
《jdk8u源码分析》12.ParseArguments
src/share/bin/java.c::SetClassPathstatic voidSetClassPath(const char *s){ char *def; const char *orig = s; static const char format[] = &quot;-Djava.class.path=%s&quot;; /* * usually we ...原创 2019-03-20 14:35:28 · 189 阅读 · 0 评论 -
《jdk8u源码分析》10.AddApplicationOptions
src/share/bin/java.c::AddApplicationOptions/* * For our tools, we try to add 3 VM options: * -Denv.class.path=&lt;envcp&gt; * -Dapplication.home=&lt;apphome&gt; * -Djava.class.path...原创 2019-03-20 14:32:45 · 199 阅读 · 0 评论 -
《jdk8u源码分析》9.1.JLI_WildcardExpandClasspath
src/share/bin/wildcard.c::JLI_WildcardExpandClasspathconst char *JLI_WildcardExpandClasspath(const char *classpath){ char *expanded; FileList fl; if (JLI_StrChr(classpath, '*') == NULL...原创 2019-03-20 14:32:32 · 202 阅读 · 0 评论 -
《jdk8u源码分析》9.TranslateApplicationArgs
src/share/bin/java.c::TranslateApplicationArgs/* * For tools, convert command line args thus: * javac -cp foo:foo/&quot;*&quot; -J-ms32m ... * java -ms32m -cp JLI_WildcardExpandClasspath(foo:foo/&quot;*&quot;) .....原创 2019-03-20 14:32:11 · 296 阅读 · 0 评论 -
《jdk8u源码分析》8.LoadJavaVM
src/windows/bin/java_md.c::LoadJavaVM/* * Load a jvm from &quot;jvmpath&quot; and initialize the invocation functions. */jbooleanLoadJavaVM(const char *jvmpath, InvocationFunctions *ifn){ HINSTANCE ha...原创 2019-03-20 14:31:55 · 377 阅读 · 0 评论 -
《jdk8u源码分析》_JAVA_LAUNCHER_DEBUG日志
D:\workdir\study\out\artifacts\test&amp;gt;java -jar test.jarWindows original main args:wwwd_args[0] = javawwwd_args[1] = -jarwwwd_args[2] = test.jar----_JAVA_LAUNCHER_DEBUG----Launcher state: ...原创 2019-03-20 14:26:17 · 399 阅读 · 0 评论 -
《jdk8u源码分析》mpi.h
src/share/native/sun/security/ec/impl/mpi.h/* * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * * This library is free software; ...原创 2019-03-20 14:21:56 · 377 阅读 · 0 评论 -
《jdk8u源码分析》jli_util.c
src/share/bin/jli_util.c/* * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free sof...原创 2019-03-20 14:21:30 · 328 阅读 · 0 评论 -
《jdk8u源码分析》jli_util.h
src/share/bin/jli_util.h/* * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free sof...原创 2019-03-20 14:22:29 · 317 阅读 · 0 评论 -
《jdk8u源码分析》7.SetJvmEnvironment
src/share/bin/java.c::SetJvmEnvironment/* * static void SetJvmEnvironment(int argc, char **argv); * Is called just before the JVM is loaded. We can set env variables * that are consumed by th...原创 2019-03-20 14:31:45 · 149 阅读 · 0 评论 -
《jdk8u源码分析》6.4.GetJVMPath
src/windows/bin/java_md.c::GetJVMPath/* * Given a JRE location and a JVM type, construct what the name the * JVM shared library will be. Return true, if such a library * exists, false otherwise....原创 2019-03-20 14:31:24 · 168 阅读 · 0 评论 -
《jdk8u源码分析》6.3.CheckJvmType ergo
src/share/bin/java.c::CheckJvmType/* * Checks the command line options to find which JVM type was * specified. If no command line option was given for the JVM type, * the default type is used. T...原创 2019-03-20 14:31:12 · 240 阅读 · 0 评论 -
《jdk8u源码分析》6.2.ReadKnownVMs
src/share/bin/java.c::ReadKnownVMs/* * Read the jvm.cfg file and fill the knownJVMs[] array. * * The functionality of the jvm.cfg file is subject to change without * notice and the mechanism will...原创 2019-03-20 14:30:20 · 311 阅读 · 0 评论 -
《jdk8u源码分析》6.1.GetJREPath
src/windows/bin/java_md.c::GetJREPath/* * Find path to JRE based on .exe's location or registry settings. */jbooleanGetJREPath(char *path, jint pathsize){ char javadll[MAXPATHLEN]; struc...原创 2019-03-20 14:29:59 · 364 阅读 · 0 评论 -
《jdk8u源码分析》5.4.ExecJRE
src/windows/bin/java_md.c::ExecJRE/* * Given a path to a jre to execute, this routine checks if this process * is indeed that jre. If not, it exec's that jre. * * We want to actually check the p...原创 2019-03-20 14:28:21 · 273 阅读 · 0 评论 -
《jdk8u源码分析》5.3.LocateJRE
src/windows/bin/java_md.c::LocateJRE/* * This is the global entry point. It examines the host for the optimal * JRE to be used by scanning a set of registry entries. This set of entries * is hard...原创 2019-03-20 14:27:53 · 284 阅读 · 0 评论 -
《jdk8u源码分析》5.2.JLI_ValidVersionString
src/share/bin/version_comp.c::JLI_ValidVersionString/* * Validates a version string by the extended JSR 56 grammar. */intJLI_ValidVersionString(char *version_string){ char *vs; ...原创 2019-03-20 14:27:25 · 236 阅读 · 0 评论 -
《jdk8u源码分析》5.1.JLI_ParseManifest
src/share/bin/parse_manifest.c::JLI_ParseManifest/* * Read the manifest from the specified jar file and fill in the manifest_info * structure with the information found within. * * Error returns ...原创 2019-03-20 14:27:10 · 307 阅读 · 0 评论 -
《jdk8u源码分析》5.SelectVersion
src/share/bin/java.c::SelectVersion/* * The SelectVersion() routine ensures that an appropriate version of * the JRE is running. The specification for the appropriate version * is obtained from e...原创 2019-03-20 14:26:45 · 323 阅读 · 0 评论 -
《jdk8u源码分析》4.DumpState
src/share/bin/java.c::DumpStatestatic voidDumpState(){ if (!JLI_IsTraceLauncher()) return ; printf(&amp;quot;Launcher state:\n&amp;quot;); printf(&amp;quot;\tdebug:%s\n&amp;quot;, (JLI_IsTraceLauncher() == JNI原创 2019-03-20 14:25:35 · 319 阅读 · 0 评论