当前位置:网站首页>JVM learning notes: three local method interfaces and execution engines
JVM learning notes: three local method interfaces and execution engines
2022-06-12 08:25:00 【lanleihhh】
JVM Learning notes : 3、 ... and Local method interface 、 Execution engine
Local method interface

Local method
- Java Medium native The method of decoration
- native method Namely java Call not java Code interface
- Local methods are provided by the operating system ( from C or C++ To write )
- Definition native Method , No implementation provided , What is called is true or false Java Code implementation
- native Can be divided with abstract Use with identifiers other than
The benefits of using local methods
- Java Can interact with the underlying operating system
Some tasks use Java It's not easy to achieve
Don't worry about implementation details , Just call - Java Data interaction with hardware (
start(),read(),hashCode())
JVM The interpreter for C Realization , Can better interact with the outside
jre For the most part Java Realization , Interact with the outside world through some local methods
for examplejava.lang.ThreadOfsetPriority()The method is to use Java Realized , But it does the calling thing Local methods in this classsetPriority0()

Execution engine
summary
The execution engine is JVM One of the core components of

JVM Load bytecode into memory , Bytecode is not an executable machine code , need The bytecode is interpreted by the execution engine / Compile to machine instructions on the corresponding platform .
The execution engine is in JVM Play a role in translating high-level languages into machine languages
- Front end compilation :.java --> .class
- Back end compilation :.class explain / Compile as machine code
The mechanism of the execution engine
- Interpreter
JVM Startup time , The bytecode is interpreted and executed line by line according to the predefined specification , Translate the bytecode content into the machine code of the corresponding platform for execution . - JIT compiler
Compile bytecode as a whole into machine code , But not immediately
Why? Java It's a semi interpreted, semi compiled language ?
JIT The real-time compiler is Java Later , Originally, it was to explain and implement
- The original simple line by line explanation of bytecode execution is inefficient
- JIT Translate bytecode into machine code , Cached in the method area JIT In the code cache , Improve the efficiency of implementation
- Decide whether to start according to the frequency of code execution JIT The compiler directly compiles the bytecode into the machine code of the corresponding platform
JVM It will be compiled for the frequently used hot code , Cache to method area , High execution efficiency
JIT Why do you need an interpreter when the compiler is efficient ?
JIT Compiler compilation takes time , But efficient execution .
As soon as the program starts , The interpreter responds immediately , To explain the execution .
Combine the two ,JVM After starting , First, explain and execute the code through the interpreter , Then compile and execute with the compiler . Adopt the architecture of simultaneous interpreter and real-time compiler to balance .
边栏推荐
- ctfshow web 1-2
- ctfshow web3
- Special notes on using NAT mode in VM virtual machine
- (p27-p32) callable object, callable object wrapper, callable object binder
- Easyexcel exports excel tables to the browser, and exports excel through postman test [introductory case]
- Vscode download slow solution
- x64dbg 调试 EXCEPTION_ACCESS_VIOLATION C0000005
- Triggers in MySQL
- Installation series of ROS system (I): installation steps
- Record the first step pit of date type
猜你喜欢

This article is required for the popularization of super complete MES system knowledge

MATLAB image processing -- image transformation correction second-order fitting

(p25-p26) three details of non range based for loop and range based for loop

(P15-P16)对模板右尖括号的优化、函数模板的默认模板参数

Vins technical route and code explanation

x64dbg 调试 EXCEPTION_ACCESS_VIOLATION C0000005

ctfshow web 1-2

DUF:Deep Video Super-Resolution Network Using Dynamic Upsampling Filters ... Reading notes

(p40-p41) transfer and forward perfect forwarding of move resources

Instructions spéciales pour l'utilisation du mode nat dans les machines virtuelles VM
随机推荐
vscode 下载慢解决办法
Bean的作用域
Vision transformer | arXiv 2205 - TRT vit vision transformer for tensorrt
At present, MES is widely used. Why are there few APS scheduling systems? Why?
(P13)final关键字的使用
Hands on deep learning -- image classification dataset fashion MNIST
This article is required for the popularization of super complete MES system knowledge
企业上MES系统的驱动力来自哪里?选型又该注意哪些问题?
Why should enterprises implement MES? What are the specific operating procedures?
MATLAB image processing - Otsu threshold segmentation (with code)
只把MES当做工具?看来你错过了最重要的东西
Record the treading pit of grain Mall (I)
Understanding and analysis of state estimation and Kalman filter
超全MES系统知识普及,必读此文
企业为什么要实施MES?具体操作流程有哪些?
(p33-p35) lambda expression syntax, precautions for lambda expression, essence of lambda expression
(P33-P35)lambda表达式语法,lambda表达式注意事项,lambda表达式本质
Callback webrtc underlying logs to the application layer
MATLAB image processing - cosine noise removal in image (with code)
(P25-P26)基于非范围的for循环、基于范围的for循环需要注意的3个细节