我正在撰写有关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是什么?