java 获取对象指针_java-普通对象指针是HotSpot中的指针还是对象结构?

我正在撰写有关Oracle HotSpot和GC内部构件的文章,但对OOP(普通对象指针)的含义感到困惑.

Oracle documentation声明OOP是指向堆上对象数据结构的32或64位指针:

An “oop”, or ordinary object pointer in Java Hotspot parlance, is a managed pointer to an object. An oop is normally the same size as a native machine pointer

它可以被压缩,但这不是问题.

我想找到有关此数据结构的文章,但随后开始产生混乱.

一些文章说OOP实际上是数据结构本身,而不是指针!

在这一点上,其他一些文章似乎是矛盾的,例如on infoq.com.起初,它指出OOP是一个指针:

An OOP is a genuine pointer in the C/C++++ sense – a machine word which points to a memory location inside the Java heap.

但之后它说:

An OOP consists of two machine words of header, which are called the Mark and the Klass words followed by the member fields of this instance.

那么指针由标头和成员字段组成?那不是真的

最后,我尝试查看Oracle JDK和OpenJDK HotSpot源代码的源代码(因为Oracle HotSpot不是开源的).但是基于此看来,OOP确实是对象数据结构.但是在这种情况下,指针是什么?

所以问题是:HotSpot JVM中的OOP是什么?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值