当前位置:网站首页>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;
边栏推荐
- Hj16 shopping list
- [untitled]
- Ultrasonic sensor flash | LEGO eV3 Teaching
- Multi sensor fusion of imu/ optical mouse / wheel encoder (nonlinear Kalman filter)
- Common model making instructions
- C Primer Plus Chapter 9 question 10 binary conversion
- 派对的最大快乐值
- Three. JS VR house viewing
- SPSS analysis of employment problems of college graduates
- Double pointer of linked list (fast and slow pointer, sequential pointer, head and tail pointer)
猜你喜欢

一文搞定class的微观结构和指令

Usage Summary of scriptable object in unity

CJ mccullem autograph: to dear Portland

数据库基础知识(面试)

Sum of two numbers, sum of three numbers (sort + double pointer)

2022 G3 boiler water treatment simulation examination and G3 boiler water treatment simulation examination question bank

Hcip day 11 (BGP agreement)

两数之和、三数之和(排序+双指针)

Three.JS VR看房

Leetcode weekly The 280 game of the week is still difficult for the special game of the week's beauty team ~ simple simulation + hash parity count + sorting simulation traversal
随机推荐
Paddy serving v0.9.0 heavy release multi machine multi card distributed reasoning framework
Leetcode buys and sells stocks
Tiktok__ ac_ signature
Tensor attribute statistics
并查集实践
leecode-学习笔记
Realize reverse proxy client IP transparent transmission
Global and Chinese market of networked refrigerators 2022-2028: Research Report on technology, participants, trends, market size and share
My experience and summary of the new Zhongtai model
判斷二叉樹是否為完全二叉樹
Selenium+pytest automated test framework practice
Global and Chinese markets for welding products 2022-2028: Research Report on technology, participants, trends, market size and share
SPSS analysis of employment problems of college graduates
How to quickly understand complex businesses and systematically think about problems?
Nail error code Encyclopedia
Metasploit (MSF) uses MS17_ 010 (eternal blue) encoding:: undefined conversionerror problem
C Primer Plus Chapter 9 question 9 POW function
2022 G3 boiler water treatment simulation examination and G3 boiler water treatment simulation examination question bank
Boring boring
Lesson 1: serpentine matrix



