As the Java Virtual Machine is a stack-based machine, almost all of its instructions involve the
operand stack in some way. Most instructions push values, pop values, or both as they perform
their functions.
Java 虚拟机是基于栈的(
stack-based machine
)。几乎所有的 java 虚拟机的指令,都与操作数栈(
operand
stack
)有关.绝大多数指令都会在执行自己功能的时候进行入栈、出栈操作。
1 Java 体系结构介绍
Javaís architecture arises out of four distinct but interrelated technologies, each of which is
defined by a separate specification from Sun Microsystems:
1.1 Java 体系结构包括哪几部分?
Java 体系结构包括 4 个独立但相关的技术
the Java programming language 程序设计语言
the Java class file format 字节码文件格式
the Java Application Programming Interface应用编程接口
the Java Virtual Machine 虚拟机
1.2 什么是 JVM
java 虚拟机和 java API 组成了 java 运行时。
1.3 JVM 的主要任务。
Java 虚拟机的主要任务是装载 class 文件并执行其中的字节码。
Java 虚拟机包含了一个类装载器。
类装载器的体系结构
二种类装载器
启动类装载器
用户定义的类装载器
启动类装载器是
JVM 实现的一部分
当被装载的类引用另外一个类时,
JVM 就是使用装载第一个类的类装载器装载被引用的类。