< prev index next > src/hotspot/share/opto/memnode.cpp
Print this page
* questions.
*
*/
#include "classfile/javaClasses.hpp"
+ #include "code/aotCodeCache.hpp"
#include "compiler/compileLog.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/c2/barrierSetC2.hpp"
#include "gc/shared/tlab_globals.hpp"
#include "memory/allocation.inline.hpp"
// Helper to recognize certain Klass fields which are invariant across
// some group of array types (e.g., int[] or all T[] where T < Object).
const Type*
LoadNode::load_array_final_field(const TypeKlassPtr *tkls,
ciKlass* klass) const {
! assert(!UseCompactObjectHeaders || tkls->offset() != in_bytes(Klass::prototype_header_offset()),
"must not happen");
if (tkls->offset() == in_bytes(Klass::access_flags_offset())) {
// The field is Klass::_access_flags. Return its (constant) value.
// (Folds up the 2nd indirection in Reflection.getClassAccessFlags(aClassConstant).)
assert(Opcode() == Op_LoadUS, "must load an unsigned short from _access_flags");
// Helper to recognize certain Klass fields which are invariant across
// some group of array types (e.g., int[] or all T[] where T < Object).
const Type*
LoadNode::load_array_final_field(const TypeKlassPtr *tkls,
ciKlass* klass) const {
! assert(!UseCompactObjectHeaders ||
+ AOTCodeCache::is_on_for_dump() ||
+ tkls->offset() != in_bytes(Klass::prototype_header_offset()),
"must not happen");
if (tkls->offset() == in_bytes(Klass::access_flags_offset())) {
// The field is Klass::_access_flags. Return its (constant) value.
// (Folds up the 2nd indirection in Reflection.getClassAccessFlags(aClassConstant).)
assert(Opcode() == Op_LoadUS, "must load an unsigned short from _access_flags");
// The field is Klass::_super_check_offset. Return its (constant) value.
// (Folds up type checking code.)
assert(Opcode() == Op_LoadI, "must load an int from _super_check_offset");
return TypeInt::make(klass->super_check_offset());
}
! if (UseCompactObjectHeaders) {
if (tkls->offset() == in_bytes(Klass::prototype_header_offset())) {
// The field is Klass::_prototype_header. Return its (constant) value.
assert(this->Opcode() == Op_LoadX, "must load a proper type from _prototype_header");
return TypeX::make(klass->prototype_header());
}
// The field is Klass::_super_check_offset. Return its (constant) value.
// (Folds up type checking code.)
assert(Opcode() == Op_LoadI, "must load an int from _super_check_offset");
return TypeInt::make(klass->super_check_offset());
}
! // Class encoding in prototype header may change between runs.
+ // Force loading prototype header when AOT code is generated.
+ if (UseCompactObjectHeaders && !AOTCodeCache::is_on_for_dump()) {
if (tkls->offset() == in_bytes(Klass::prototype_header_offset())) {
// The field is Klass::_prototype_header. Return its (constant) value.
assert(this->Opcode() == Op_LoadX, "must load a proper type from _prototype_header");
return TypeX::make(klass->prototype_header());
}
< prev index next >