comparison src/share/vm/ci/ciInstanceKlass.cpp @ 165:437d03ea40b1

6703888: Compressed Oops: use the 32-bits gap after klass in a object Summary: Use the gap also for a narrow oop field and a boxing object value. Reviewed-by: coleenp, never
author kvn
date Wed, 21 May 2008 16:31:35 -0700
parents ba764ed4b6f2
children d1605aabd0a1
comparison
equal deleted inserted replaced
164:c436414a719e 165:437d03ea40b1
390 return 0; 390 return 0;
391 } 391 }
392 assert(!is_java_lang_Object(), "bootstrap OK"); 392 assert(!is_java_lang_Object(), "bootstrap OK");
393 393
394 // Size in bytes of my fields, including inherited fields. 394 // Size in bytes of my fields, including inherited fields.
395 int fsize = nonstatic_field_size() * wordSize; 395 int fsize = nonstatic_field_size() * heapOopSize;
396 396
397 ciInstanceKlass* super = this->super(); 397 ciInstanceKlass* super = this->super();
398 GrowableArray<ciField*>* super_fields = NULL; 398 GrowableArray<ciField*>* super_fields = NULL;
399 if (super != NULL && super->has_nonstatic_fields()) { 399 if (super != NULL && super->has_nonstatic_fields()) {
400 int super_fsize = super->nonstatic_field_size() * wordSize; 400 int super_fsize = super->nonstatic_field_size() * heapOopSize;
401 int super_flen = super->nof_nonstatic_fields(); 401 int super_flen = super->nof_nonstatic_fields();
402 super_fields = super->_nonstatic_fields; 402 super_fields = super->_nonstatic_fields;
403 assert(super_flen == 0 || super_fields != NULL, "first get nof_fields"); 403 assert(super_flen == 0 || super_fields != NULL, "first get nof_fields");
404 // See if I am no larger than my super; if so, I can use his fields. 404 // See if I am no larger than my super; if so, I can use his fields.
405 if (fsize == super_fsize) { 405 if (fsize == super_fsize) {
436 // Note: Two consecutive T_BYTE fields will be separated by wordSize-1 436 // Note: Two consecutive T_BYTE fields will be separated by wordSize-1
437 // padding bytes if one of them is declared by a superclass. 437 // padding bytes if one of them is declared by a superclass.
438 // This is a minor inefficiency classFileParser.cpp. 438 // This is a minor inefficiency classFileParser.cpp.
439 last_offset = offset + size; 439 last_offset = offset + size;
440 } 440 }
441 assert(last_offset <= (int)sizeof(oopDesc) + fsize, "no overflow"); 441 assert(last_offset <= (int)instanceOopDesc::base_offset_in_bytes() + fsize, "no overflow");
442 #endif 442 #endif
443 443
444 _nonstatic_fields = fields; 444 _nonstatic_fields = fields;
445 return flen; 445 return flen;
446 } 446 }