Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

whats the difference between a "symbolic reference" and direct reference ?

843811Jun 14 2005 — edited Jun 20 2005
i read " inside JVM " book...
In that they have explained the process of loading, linking and initializing process ...

Here they have mentioned about replacing "symbolic reference" with "direct reference" ... but they haven't explained how "symbolic reference" and direct reference looks like ? and what was the difference between them...

Comments

843811
A symbolic reference is a character string that gives the name and possibly other information about the referenced item -- enough information to uniquely identify a class, field, or method. Thus, symbolic references to other classes give the full name of the class. Symbolic references to the fields of other classes give the class name, field name, and field descriptor. Symbolic references to the methods of other classes give the class name, method name, and method descriptor.

When a class file is loaded, it contains symbolic references to other classes and their fields and methods. Dynamic linking is the process of resolving symbolic references into direct references. As the JVM executes bytecodes and encounters an opcode that, for the first time, uses a symbolic reference to another class, the virtual machine must resolve the symbolic reference. The virtual machine performs two basic tasks during resolution:
- It finds the class being referenced (loading it if necessary).
- It replaces the symbolic reference with a direct reference, such as a pointer or offset, to the class, field, or method.
The virtual machine remembers the direct reference so that if it encounters the same reference again later, it can immediately use the direct reference without needing to spend time resolving the symbolic reference again.
1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 18 2005
Added on Jun 14 2005
1 comment
2,445 views