current position:Home>Two pronged approach, Tsinghua Professor Pro code JDK and hotspot source code notes, one-time learning to understand

Two pronged approach, Tsinghua Professor Pro code JDK and hotspot source code notes, one-time learning to understand

2022-01-27 02:00:50 littlejava_

Indexes

The historical reason is ,OpenJDK yes JDK Open source version of ,OpenJDK yes Sun stay 2006 At the end of the year Java Open source projects , there “ Open source ” It's usually open source , That is, the source code can be reused , for example IcedTea、UltraViolet from OpenJDK Source derived distribution .

Put these JRL License form Sun/OracleJDK Source code and corresponding version OpenJDK Compare the source code , In addition to the copyright note in the file header , The rest of the code is basically the same , Only the font rendering part is a little different ,Oracle JDK It's a commercial implementation , and OpenJDK It's open source FreeType. Of course ,“ identical ” It is based on the common components of the two ,Oracle JDK There will be some Open JDK There is no the 、 Commercial closed source function .

HotSpot history

HotSpot yes Sun JDK and OpenJDK The virtual machine in , It is also the most widely used Java virtual machine . But not everyone knows that , This looks like “ Pure blood ” In the beginning, the virtual machine of Sun Companies to develop , But by a family called “Longview Technologies” Designed by a small company ; Even this virtual machine was not originally for Java Developed by language , It comes from Strongtalk VM, And a lot of technology in this virtual machine comes from a support Self Language implementation “ achieve C Language 50% The above implementation efficiency ” The goal of virtual machine design , Sun The company noticed that the virtual machine is in JIT There are many excellent ideas and practical effects in compiling , stay 1997 Years acquired Longview Technologies company , So we get HotSpot VM.

SUN Of JDK Version from 1.3.1 Start using HotSpot virtual machine , 2006 Open source at the end of the year , The main use of C++ Realization ,JNI For the interface part C Realization .

HotSpot It's newer Java virtual machine , Used in place of JIT(Just in Time), Can be greatly improved Java Performance of operation .

Java Originally, the source code was compiled into bytecode and executed in the virtual machine , This is slow to execute . and HotSpot Compile some common code into local ( Native ,native) Code , This significantly improves performance .

Let's share the personal code of Professor Tsinghua JDK and HotSpot Source code :

JDK Source code manual

In addition to the contents of the first chapter , We'll start from Chapter 2, bottom-up , From simple to complex, learn the whole in depth in order Concurrent package

Semaphore(Semaphore That's the semaphore , Provides concurrent access control of the number of resources )

HotSpot Source code manual

This manual is mainly about HotSpot Source code of basic function module , This manual will be a good supplement to your foundation , At the same time, the manual will be explained with a large number of examples , In this way, it will be easier for the audience to accept and absorb .

HandleArea、Area And Chunk

klassVtable class

Space class

Generation Class is implemented based on Space Class ,Space Class is responsible for actual memory management

Last

If you need this note, you can pay attention to it + After likes , Just send a private message on the home page

copyright notice
author[littlejava_],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201270200481973.html

guess what you like

Random recommended