当前位置:网站首页>3:第一章:认识JVM规范2:JVM规范,简介;
3:第一章:认识JVM规范2:JVM规范,简介;
2022-07-05 22:53:00 【小枯林】
说明:
(1)简单介绍JVM规范,了解JVM规范是什么东西;
目录
2.JVM规范,涵盖了哪些内容;(PS:虚拟机规范没必要过于深究,了解即可)
虚拟机一定要有规范(或称标准),比如class文件如果没有一定的规范的话,虚拟机就无法认识这个class;
1.JVM规范,简介;
(1)虚拟机不认识.java文件,其只认识.class文件;
● 我们编写.java程序的时候,我们需要遵守java的语法规范;
● 我们往虚拟机中仍.class文件的时候,这个.class文件要符合虚拟机的规范;
(2)只要一个文件是一个【符合虚拟机的规范的.class文件】,虚拟机都可以装载并运行;
● 那么此时,就变相提供了开发语言的无关性;
● 比如,我们使用java语言开发的程序可以编译为【符合虚拟机的规范的.class文件】;;;我们使用jRuby语言开发的程序也可以编译为【符合虚拟机的规范的.class文件】;
● 即,只要某个语言写的代码,可以被编译为【符合虚拟机的规范的.class文件】,这些.class都是可以被虚拟机装载并运行的;
● 甚至,我们什么语言都不用,而是直接写.class文件(比如ASM,CGLib等技术;;这些技术在Spring框架中,都有大规模的应用);
● PS:虚拟机不仅仅有针对.class的规范,还有很多其他规范;
(3)JVM的规范指出,JVM可以用【软件模拟并运行于各种现存计算机系统】来实现,也可以使用硬件来实现;(我们一般不考虑硬件实现)
……………………………………………………
(4)JVM的规范,只是规定了该做什么;其并没有规定我们该如何是具体实现;
● 所以,针对这同一份虚拟机规范,不同的虚拟机厂商都有自己的实现方式;
● 那么,如此一来,同一个程序,放到不同厂商的虚拟机中跑的话,执行的过程与细节并不会完全一样;
2.JVM规范,涵盖了哪些内容;(PS:虚拟机规范没必要过于深究,了解即可)
(1)字节码指令集(相当于中央处理器CPU);
(2)Class文件的格式;
(3)数据类型和值;
● 比如这些值的类型、范围、基本实现方式的要求;
(4)运行时数据区;
● 我们写的java程序,跑起来的时候,肯定要操作一些数据;
(5)栈帧;
(6)特殊方法;(规范规定的,虚拟机要提供的一些特殊方法的实现)
(7)类库;(要求虚拟机要支持一些类库,以提供一些基本的功能,或者说应用程序无法提供的功能;;;比如对JNI的支持,跟硬件的交互;;;如果虚拟机不提供这些功能的话,应用程序是搞不定的;)
(8)异常的一些处理;
(9)虚拟机的启动、加载、链接和初始化等;
……
在Oracle的官网【Java SE Specifications】就有可以去下载每个版本的虚拟机的规范;
也可以在【Java Downloads | Oracle】上去下载JDK;
边栏推荐
- 30 optimization skills about mysql, super practical
- Global and Chinese market of water treatment technology 2022-2028: Research Report on technology, participants, trends, market size and share
- The maximum happiness of the party
- Double pointeur de liste liée (pointeur rapide et lent, pointeur séquentiel, pointeur de tête et de queue)
- 查看网页最后修改时间方法以及原理简介
- VIM tail head intercept file import
- Roman numeral to integer
- 一文搞定JVM的内存结构
- Three. JS VR house viewing
- How to quickly understand complex businesses and systematically think about problems?
猜你喜欢
Three. Js-01 getting started
2022 R2 mobile pressure vessel filling review simulation examination and R2 mobile pressure vessel filling examination questions
Selenium+Pytest自动化测试框架实战
数据库基础知识(面试)
Lesson 1: serpentine matrix
Nangou Gili hard Kai font TTF Download with installation tutorial
Expectation, variance and covariance
Use of grpc interceptor
openresty ngx_lua请求响应
Getting started stm32--gpio (running lantern) (nanny level)
随机推荐
Global and Chinese markets for reciprocating seal compressors 2022-2028: Research Report on technology, participants, trends, market size and share
Commonly used probability distributions: Bernoulli distribution, binomial distribution, polynomial distribution, Gaussian distribution, exponential distribution, Laplace distribution and Dirac delta d
Vision Transformer (ViT)
Selenium+pytest automated test framework practice
2022 registration examination for safety management personnel of hazardous chemical business units and simulated reexamination examination for safety management personnel of hazardous chemical busines
[digital signal denoising] improved wavelet modulus maxima digital signal denoising based on MATLAB [including Matlab source code 1710]
audiopolicy
Common JVM tools and optimization strategies
Editor extensions in unity
Metasploit (MSF) uses MS17_ 010 (eternal blue) encoding:: undefined conversionerror problem
audiopolicy
Simple and beautiful method of PPT color matching
Sum of two numbers, sum of three numbers (sort + double pointer)
Double pointer of linked list (fast and slow pointer, sequential pointer, head and tail pointer)
PLC编程基础之数据类型、变量声明、全局变量和I/O映射(CODESYS篇 )
LeetCode102. Sequence traversal of binary tree (output by layer and unified output)
使用rewrite规则实现将所有到a域名的访问rewrite到b域名
基于STM32的ADC采样序列频谱分析
Hcip day 12 (BGP black hole, anti ring, configuration)
Judge whether the binary tree is a complete binary tree