The Java Virtual Machine does not require any particular internal structure for objects. In Sun's current implementation of the Java Virtual Machine, a reference to a class instance is a pointer to a handle that is itself a pair of pointers: one to a table containing the methods of the object and a pointer to the Class object that represents the type of the object, and the other to the memory allocated from the Java heap for the object data.
In some of Sun's implementations of the Java virtual machine, a reference to a class instance is
a pointer to a handle that is itself a pair of pointers: one to a table containing
the methods of the object and a pointer to the Class object that represents the type of the object, and the other
to the memory allocated from the heap for the object data.
参考:http://docs.oracle.com/javase/specs/jvms/se5.0/html/Overview.doc.html#31069
本文详细解析了Java虚拟机中对象的内部结构及内存布局方式,介绍了引用如何指向对象实例的具体实现细节,包括方法表指针和类型表示等。
5008

被折叠的 条评论
为什么被折叠?



