hotspot/src/share/vm/prims/jni.cpp
changeset 360 21d113ecbf6a
parent 1 489c9b5090e2
child 773 01daf7c809b1
child 670 ddf3e9583f2f
equal deleted inserted replaced
357:f4edb0d9f109 360:21d113ecbf6a
   133 
   133 
   134 intptr_t jfieldIDWorkaround::encode_klass_hash(klassOop k, intptr_t offset) {
   134 intptr_t jfieldIDWorkaround::encode_klass_hash(klassOop k, intptr_t offset) {
   135   if (offset <= small_offset_mask) {
   135   if (offset <= small_offset_mask) {
   136     klassOop field_klass = k;
   136     klassOop field_klass = k;
   137     klassOop super_klass = Klass::cast(field_klass)->super();
   137     klassOop super_klass = Klass::cast(field_klass)->super();
   138     while (instanceKlass::cast(super_klass)->contains_field_offset(offset)) {
   138     // With compressed oops the most super class with nonstatic fields would
       
   139     // be the owner of fields embedded in the header.
       
   140     while (instanceKlass::cast(super_klass)->has_nonstatic_fields() &&
       
   141            instanceKlass::cast(super_klass)->contains_field_offset(offset)) {
   139       field_klass = super_klass;   // super contains the field also
   142       field_klass = super_klass;   // super contains the field also
   140       super_klass = Klass::cast(field_klass)->super();
   143       super_klass = Klass::cast(field_klass)->super();
   141     }
   144     }
   142     debug_only(No_Safepoint_Verifier nosafepoint;)
   145     debug_only(No_Safepoint_Verifier nosafepoint;)
   143     uintptr_t klass_hash = field_klass->identity_hash();
   146     uintptr_t klass_hash = field_klass->identity_hash();