当前位置:网站首页>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.
边栏推荐
- Motion analysis and parameter optimization of crank-slider mechanism
- Causes and solutions of lock table
- 阿里三面:MQ 消息丢失、重复、积压问题,该如何解决?
- torch
- Dialogue with the father of MySQL: One excellent programmer is worth 5 ordinary programmers
- return;代表含义
- Talk about the bugs in using for in to traverse the array in js
- The Bean's life cycle
- datagrip 报错 “The specified database userpassword combination is rejected...”的解决方法
- 问下 mysql向pg同步多个表的话 有什么好的方案吗?
猜你喜欢

2022.7.26 Mock Competition

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

Using FiddlerScript caught poly FiddlerScript 】 【 download

「面经分享」西北大学 | 字节 生活服务 | 一面二面三面 HR 面

leetcode43 string multiplication

Offer brush questions - 1

MVVM项目开发(商品管理系统一)

LeetCode 0149. Maximum number of points on a line

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

戴尔PowerEdge服务器R450 RAID配置步骤
随机推荐
Dart exception details
爆肝3万字,最硬核丨Mysql 知识体系、命令全集 【建议收藏 】
Three aspects of Ali: How to solve the problem of MQ message loss, duplication and backlog?
爬虫基本原理介绍、实现以及问题解决
爬虫框架 Scrapy 详解
支付宝如何生成及配置公钥证书
「游戏引擎 浅入浅出」4.1 Unity Shader和OpenGL Shader
牛客刷SQL---2
MVVM项目开发(商品管理系统一)
小白的0基础教程SQL: 安装MYSQL 03
拳头游戏免版权音乐下载,英雄联盟无版权音乐,可用于视频创作、直播
数据湖:数据同步工具NiFi
Practical training Navicat Chinese and English mode switching
torch
datagrip 报错 “The specified database userpassword combination is rejected...”的解决方法
说说js中使用for in遍历数组存在的bug
小白的0基础教程SQL: 什么是SQL 01
测试工具(四)Jenkins环境搭建与使用
轻量级的VsCode为何越用越大?为什么吃了我C盘10G?如何无痛清理VsCode缓存?手把手教你为C盘瘦身
太厉害了,终于有人能把文件上传漏洞讲的明明白白了