Mercurial > hg > graal-compiler
comparison agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java @ 7620:e94ed1591b42
8006403: Regression: jstack failed due to the FieldInfo regression in SA
Reviewed-by: sla, dholmes
Contributed-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
author | sla |
---|---|
date | Wed, 16 Jan 2013 16:30:04 +0100 |
parents | 4a916f2ce331 |
children | 6bd680e9ea35 |
comparison
equal
deleted
inserted
replaced
7591:c793367610c1 | 7620:e94ed1591b42 |
---|---|
51 private static int INITVAL_INDEX_OFFSET; | 51 private static int INITVAL_INDEX_OFFSET; |
52 private static int LOW_OFFSET; | 52 private static int LOW_OFFSET; |
53 private static int HIGH_OFFSET; | 53 private static int HIGH_OFFSET; |
54 private static int FIELD_SLOTS; | 54 private static int FIELD_SLOTS; |
55 private static short FIELDINFO_TAG_SIZE; | 55 private static short FIELDINFO_TAG_SIZE; |
56 private static short FIELDINFO_TAG_MASK; | |
56 private static short FIELDINFO_TAG_OFFSET; | 57 private static short FIELDINFO_TAG_OFFSET; |
57 | 58 |
58 // ClassState constants | 59 // ClassState constants |
59 private static int CLASS_STATE_ALLOCATED; | 60 private static int CLASS_STATE_ALLOCATED; |
60 private static int CLASS_STATE_LOADED; | 61 private static int CLASS_STATE_LOADED; |
100 INITVAL_INDEX_OFFSET = db.lookupIntConstant("FieldInfo::initval_index_offset").intValue(); | 101 INITVAL_INDEX_OFFSET = db.lookupIntConstant("FieldInfo::initval_index_offset").intValue(); |
101 LOW_OFFSET = db.lookupIntConstant("FieldInfo::low_packed_offset").intValue(); | 102 LOW_OFFSET = db.lookupIntConstant("FieldInfo::low_packed_offset").intValue(); |
102 HIGH_OFFSET = db.lookupIntConstant("FieldInfo::high_packed_offset").intValue(); | 103 HIGH_OFFSET = db.lookupIntConstant("FieldInfo::high_packed_offset").intValue(); |
103 FIELD_SLOTS = db.lookupIntConstant("FieldInfo::field_slots").intValue(); | 104 FIELD_SLOTS = db.lookupIntConstant("FieldInfo::field_slots").intValue(); |
104 FIELDINFO_TAG_SIZE = db.lookupIntConstant("FIELDINFO_TAG_SIZE").shortValue(); | 105 FIELDINFO_TAG_SIZE = db.lookupIntConstant("FIELDINFO_TAG_SIZE").shortValue(); |
106 FIELDINFO_TAG_MASK = db.lookupIntConstant("FIELDINFO_TAG_MASK").shortValue(); | |
105 FIELDINFO_TAG_OFFSET = db.lookupIntConstant("FIELDINFO_TAG_OFFSET").shortValue(); | 107 FIELDINFO_TAG_OFFSET = db.lookupIntConstant("FIELDINFO_TAG_OFFSET").shortValue(); |
106 | 108 |
107 // read ClassState constants | 109 // read ClassState constants |
108 CLASS_STATE_ALLOCATED = db.lookupIntConstant("InstanceKlass::allocated").intValue(); | 110 CLASS_STATE_ALLOCATED = db.lookupIntConstant("InstanceKlass::allocated").intValue(); |
109 CLASS_STATE_LOADED = db.lookupIntConstant("InstanceKlass::loaded").intValue(); | 111 CLASS_STATE_LOADED = db.lookupIntConstant("InstanceKlass::loaded").intValue(); |
319 | 321 |
320 public int getFieldOffset(int index) { | 322 public int getFieldOffset(int index) { |
321 U2Array fields = getFields(); | 323 U2Array fields = getFields(); |
322 short lo = fields.at(index * FIELD_SLOTS + LOW_OFFSET); | 324 short lo = fields.at(index * FIELD_SLOTS + LOW_OFFSET); |
323 short hi = fields.at(index * FIELD_SLOTS + HIGH_OFFSET); | 325 short hi = fields.at(index * FIELD_SLOTS + HIGH_OFFSET); |
324 if ((lo & FIELDINFO_TAG_SIZE) == FIELDINFO_TAG_OFFSET) { | 326 if ((lo & FIELDINFO_TAG_MASK) == FIELDINFO_TAG_OFFSET) { |
325 return VM.getVM().buildIntFromShorts(lo, hi) >> FIELDINFO_TAG_SIZE; | 327 return VM.getVM().buildIntFromShorts(lo, hi) >> FIELDINFO_TAG_SIZE; |
326 } | 328 } |
327 throw new RuntimeException("should not reach here"); | 329 throw new RuntimeException("should not reach here"); |
328 } | 330 } |
329 | 331 |