JVM object model and the corresponding terms and concepts

JVM object model and the corresponding terms and concepts

jvm java object model is OOP-Klass model;

class

klass corresponding to the metadata, including the constant pool, field and method. It is to create instanceKlass loaded class stage. Stored in the method area.

oop

oop corresponding instances of java.
oop oopDesc pointer is a pointer.

// share/vm/oops/oopsHierarchy.hpp
typedef class oopDesc*                            oop; // SimonNote: oop是指向oopDesc的指针

OOPD

instanceOOpDesc ​​contains only data information consists of the following components:

  1. Object header, also called markword. The main storage object record runtime information, such as hashcode, GC generational age, the lock status flags, thread id, timestamp, etc.
  2. Metadata pointer, referred to herein as examples directed to a method instanceKlass region
  3. Examples of data (my understanding of its embodiment acquiring access by the object is to make the head as the base offset relative operation, reference may obj_field_addr method of oop.inline.hpp)
  4. If the object is an array, the array length of more than a

oopDesc structure illustrated: the

first head, behind the head and then the data, then filled after the data thereof; and a mark comprising a metadata header.

oop object pointer ordinary meaning, the object pointer is easy to understand, but the front o ordinary meaning, how to understand this common? See R big explanation

Why GC managed pointer is called oop? Why do not object pointer is a pointer, why should add a "normal" to modify?
There are interesting historical reasons. An understanding of the origins of Smalltalk and HotSpot VM, you would know. Strongtalk VM are described in detail in the documentation: https://code.google.com/p/strongtalk/wiki/VMTypesForSmalltalkObjects
key point is that the object in Smalltalk is managed by GC, and many will use its implementation in the so-called "direct object "the way to achieve some simple value type of object, such as SmallInteger. The so-called "direct object" (immediate object) that is not allocated on the heap object instance in the GC, but there will be a pointer to an object in the object instance content directly. Such pointers are also called "pointer labeled" (tagged pointer).
So in this environment, every time we get a pointer to the object, it had to ask: Are you really a direct object or a pointer? If that is true pointer, it is a "normal" pointer to the object. Such object pointer will have a "normal" and "not common" points.
This context is also considered oop is an acronym for "object oriented pointer" of. Whether it is "ordinary object pointer" or "object oriented pointer", in fact, it is exactly the same thing to say. In particular term confusion before, oop in the end who is the most original of the acronym is not good research.
About tagged pointer, an old post HLLVM group also discussed: http://hllvm.group.iteye.com/group/topic/17840#post-126408

The relationship between

Example:
the Person exemplary ---- ---> ------- Person of instanceKlass ------- ------- -> ---------- - ------ Person's class
instanceOopDesc - ------ JDK8 in metaspace, JDK6 7 in the process zone --------- ------- JDK7 8 in the stack, JDK6 in the method area

Guess you like

Origin www.cnblogs.com/simoncook/p/11804427.html