#include <jvalue.h>
This union contains literally a grand union of all Java data types, including both primatives and references types for the purpose of allowing all object instance fields to be stored in object_instance_field_data as an array in an object table entry without special treatment. Static fields may be stored in this the same way in class_static_field_data of a class table entry. (All sub-integer primative data types are store inside of (jint) and cast in/out at runtime.)
The following types are are casts of _jint, thus:
jvalue v; ... a composite value jint i; ... integer primative jbyte b; ... sub-integer primatives jboolean z; jshort s; jchar c; jfloat f; ... float is same size as jint jobjhash o; ... object reference same size jlong l; ... TWO jint words jdouble d; ... TWO jint words (See also spec table 4.6) i = v._jint; b = v._jbyte; z = v._jboolean; s = v._jshort; c = v._jchar; f = v._jfloat; o = v._jobjhash; l = v._jlong; d = v._jlong; and vice versa: v._jint = i; v._jbyte = b; v._jbyte = b; v._jboolean = z; v._jshort = s; v._jchar = c; v._jfloat = f; v._jobjhash = o; v._jlong = l; v._jdouble = d;
Although most of the items in this union are Java primatives, there are also contained herein are two members that are not primatives, namely the object reference hash and the array reference hash. By implementing them here, both primative and reference, all possible Java data types are represented in one data structure, which is very handy for concise object representations without any redundant data structures in different places.
Notice that for CONFIG_WORDWIDTH32 implementations, the (jlong) will be the longest data type, as an 8-byte integer. Notice also that for CONFIG_WORDWIDTH64 implementations, this will not change because there are no types such as pointers that will change sizes here. Since this typedef will be used extensively in the runtime environment, this inherent constraint can help plan maximum heap sizing.
Definition at line 131 of file jvalue.h.
Data Fields | |
jvm_object_hash | _jarray |
Object hash of next lower array dim. | |
jboolean | _jboolean |
Sub-integer primative jboolean. | |
jbyte | _jbyte |
Sub-integer primative jbyte. | |
jchar | _jchar |
Sub-integer primative jchar. | |
jdouble | _jdouble |
Primative jdouble, per tables 4.2/4.6. | |
jfloat | _jfloat |
Primative jfloat, per tables 4.2/4.6. | |
jint | _jint |
Primative jint, per tables 4.2/4.6. | |
jlong | _jlong |
Primative jlong, per tables 4.2/4.6. | |
jvm_object_hash | _jobjhash |
Object hash of an arbitrary object. | |
jshort | _jshort |
Sub-integer primative jshort. | |
jvm_object_hash | _jstring |
Object hash for the quasi-primative java.lang.String . |
|
Sub-integer primative jbyte.
|
|
Sub-integer primative jboolean.
|
|
Sub-integer primative jshort.
|
|
Sub-integer primative jchar.
|
|
Primative jint, per tables 4.2/4.6.
|
|
Primative jlong, per tables 4.2/4.6.
|
|
Primative jfloat, per tables 4.2/4.6.
|
|
Primative jdouble, per tables 4.2/4.6.
|
|
Object hash for the quasi-primative Except for this one item, table 4.6 is a subsest of table 4.2. |
|
Object hash of next lower array dim.
|
|
Object hash of an arbitrary object.
|