当前位置:网站首页>JVM: Runtime Data Area - PC Register (Program Counter)
JVM: Runtime Data Area - PC Register (Program Counter)
2022-08-01 07:02:00 【Gu Gugu】
JVM:Runtime Data Area
1. What is the pc register:
The pc register of the JVM is also called the program counter, which is an abstract virtual of the physical pc register.
It is used to store the address pointing to the next instruction, the instruction code to be executed, and the next instruction is read by the execution engine.
2.pc register features:
Each thread has a pc register, the pc register will store the jvm instruction address of the java method being executed by the current thread: if it is a local method, it is undefined (the local method refers to c orc++ code).
3. javap decompiles the id code, the left is the instruction address, the right is the instruction code, pc register stores the instruction address, the execution engine reads the stored instruction address in the pc registercorresponding command code.
4.Program branch, loop, jump, exception handling, thread recovery, depend on pc register.
When the bytecode interpreter works, it iterates by changing the value of this counter and reads the next bytecode instruction to be executed.
He is the only area that does not have an oom case in the java virtual machine specification.
Method area, heap have gc
Stack and pc registers have no gc
Two questions about the pc register: (eight-legged text)
What is the use of the pc register to store the bytecode instruction address?
The cpu needs to constantly switch threads. After the thread switches back, where to continue execution, it needs the pc register to tell it.
Why use the pc register to record the execution address of the current thread?
The bytecode interpreter needs to change the value of the pc register to know what bytecode instruction should be executed next.
边栏推荐
猜你喜欢

【音视频】srs直播平台搭建

"By sharing" northwestern university life service | | bytes a second interview on three sides by HR

从零开始—仿牛客网讨论社区项目(一)

第5章——以程序方式处理MySQL数据表的数据

Datagrip error "The specified database userpassword combination is rejected..."Solutions

日志导致线程Block的这些坑,你不得不防

Detailed explanation of the crawler framework Scrapy

crypto-js使用

奇葩问题 npm install 报错 gyp ERR

Zero-code website development tool: WordPress
随机推荐
JSON 与 JS 对象的区别
牛客刷SQL---2
LeetCode Question of the Day (309. Best Time to Buy and Sell Stock with Cooldown)
leetcode43 string multiplication
MATLAB program design and application of MATLAB 2.5
Introduction to the basic principles, implementation and problem solving of crawler
datagrip 报错 “The specified database userpassword combination is rejected...”的解决方法
LeetCode 0150. 逆波兰表达式求值
Classwork (7) - #598. remainder operation (mod)
2022年牛客多校第四场补题
问下 mysql向pg同步多个表的话 有什么好的方案吗?
戴尔PowerEdge服务器R450 RAID配置步骤
Dbeaver connect the MySQL database and error Connection refusedconnect processing
响应式织梦模板园林景观类网站
阿里三面:MQ 消息丢失、重复、积压问题,该如何解决?
Dell PowerEdge Server R450 RAID Configuration Steps
NIO programming
mysql中添加字段的相关问题
爬虫基本原理介绍、实现以及问题解决
Golang:go连接和使用mysql