当前位置:网站首页>Shangsilicon Valley JVM Chapter 1 class loading subsystem
Shangsilicon Valley JVM Chapter 1 class loading subsystem
2022-07-07 03:13:00 【A lazy bug】
1、 Virtual machine introduction
The so-called virtual machine (Virtual Machine), It's just one
Virtual computers. It's aSoftware, Used to execute a series of virtual computer instructions . Broadly , Virtual machines can be divided intoSystem virtual machineandProgram virtual machine.
- big-name Virtual Box,VMware It belongs to the system virtual machine , They are all simulations of physical computers , It provides a software platform that can run a complete operating system .
- A typical example of a program virtual machine is Java virtual machine , It's designed to execute a single computer program , stay Java The instructions executed in the virtual machine are called Java Bytecode instruction .
- Whether it's a system virtual machine or a program virtual machine , The software running on it is limited to the resources provided by the virtual machine .
2、Java virtual machine
- Java A virtual machine is an execution machine Java Bytecode virtual computer , It has an independent operating mechanism , It runs Java Bytecode may not be created by Java Language compilation .
- JVM Various languages of the platform can be shared Java The cross platform nature of virtual machine 、 Excellent garbage collector , And a reliable just in time compiler .
- Java The core of technology is Java virtual machine (JVM,Java Virtual Machine), Because of all the Java The program is running in Java Inside the virtual machine .
- Java Virtual machine is the running environment of binary bytecode , Responsible for loading bytecode into its interior , explain / Compile to execute machine instructions on the corresponding platform . Every one of them Java Instructions ,Java There are detailed definitions in the virtual machine specification , How to get the operands , How to deal with operands , Where is the result of the treatment .
3、JVM Overall structure
HotSpot VMIt is one of the representative works of high performance virtual machine on the market .- It uses an interpreter and just in time compiler architecture .
- In today's ,Java The performance of the program has been completely changed , Have reached the point where you can and C/C++ The program is higher and lower .
- The execution engine consists of three parts :
Interpreter,Just in time compiler,Garbage collector

4、JVM Architectural model
Java The flow of instructions input by the compiler is basically a Stack based instruction set architecture , Another instruction set architecture is Register based instruction set architecture . say concretely : The difference between the two architectures :
Based on the characteristics of plank structure
- Simpler design and Implementation , For systems with limited resources
- Avoid the problem of register allocation : Use zero address instruction to assign
- Most of the instructions in the instruction stream are zero address instructions , Its execution depends on Stack operation . The instruction set is smaller , The compiler is easy to implement
- No hardware support required , Better portability , Better Cross platform implementation
Based on the characteristics of register architecture
- The typical application is x86 The binary instruction set of : Like traditional PC as well as Android Of Davlik virtual machine .
- Instruction set architecture Rely entirely on hardware , High coupling with hardware , Poor portability
- Better performance and more efficient execution
- Spend less instruction to complete an operation
- In most cases , The instruction set based on register architecture usually uses one address instruction 、 Two address instructions and three address instructions are the main , The instruction set based on the stack architecture is mainly zero address instruction
5、 summary
- Because of the cross platform design ,Java The instructions of are designed according to the stack . Different platforms CPU Different architectures , So it can't be designed as register based . The advantage is cross platform , Instruction set is small , The compiler is easy to implement , The disadvantage is that the performance is reduced , More instructions are needed to implement the same function
- today , Although embedded platforms are no longer Java The mainstream running platform of the program ( To be exact, it should be HotSpot VM Our host environment is no longer limited to embedded platforms ), So why not change the architecture to register based architecture ?
- Because stack based architecture Good cross platform 、 Instruction set is small , Although compared with register based architecture , Stack based architecture compiles more instructions , The execution performance is not as good as register based architecture , But considering its Cross platform and portability , We still choose the stack architecture
边栏推荐
- Kubernetes源码分析(二)----资源Resource
- The version control of 2021 version is missing. Handling method
- 首届“量子计算+金融科技应用”研讨会在京成功举办
- 杰理之发射端在接收端关机之后假死机【篇】
- Domcontentloaded and window onload
- Cryptography series: detailed explanation of online certificate status protocol OCSP
- 【达梦数据库】备份恢复后要执行两个sql语句
- Oauth2协议中如何对accessToken进行校验
- [swift] learning notes (I) -- familiar with basic data types, coding styles, tuples, propositions
- 【Swift】学习笔记(一)——熟知 基础数据类型,编码风格,元组,主张
猜你喜欢

ERROR: Could not find a version that satisfies the requirement xxxxx (from versions: none)解决办法

杰理之播内置 flash 提示音控制播放暂停【篇】

「小样本深度学习图像识别」最新2022综述

Redis Getting started tutoriel complet: positionnement et optimisation des problèmes

Redis getting started complete tutorial: replication configuration

Qt蓝牙:QBluetoothDeviceInfo

Redis getting started complete tutorial: client management

A complete tutorial for getting started with redis: problem location and optimization

PSINS中19维组合导航模块sinsgps详解(时间同步部分)

Es6中Promise的使用
随机推荐
Kubernetes source code analysis (II) -- resource
How to analyze fans' interests?
Jericho turns on the display icon of the classic Bluetooth hid mobile phone to set the keyboard [chapter]
HDU 4337 King Arthur's Knights 它输出一个哈密顿电路
Matlab Error (Matrix dimensions must agree)
Es6中Promise的使用
存储过程与函数(MySQL)
[cpk-ra6m4 development board environment construction based on RT thread studio]
又一百万量子比特!以色列光量子初创公司完成1500万美元融资
Babbitt | metauniverse daily must read: is IP authorization the way to break the circle of NFT? What are the difficulties? How should holder choose the cooperation platform
Starting from 1.5, build a micro Service Framework -- log tracking traceid
leetcode-02(链表题)
CVPR 2022 最佳论文候选 | PIP: 6个惯性传感器实现全身动捕和受力估计
Detailed explanation of 19 dimensional integrated navigation module sinsgps in psins (initial assignment part)
Netperf and network performance measurement
mos管實現主副電源自動切換電路,並且“零”壓降,靜態電流20uA
Jerry's broadcast has built-in flash prompt tone to control playback pause [chapter]
安装 torch 0.4.1
How-PIL-to-Tensor
Redis入门完整教程:客户端管理