comparison src/share/vm/opto/graphKit.cpp @ 4762:069ab3f976d3

7118863: Move sizeof(klassOopDesc) into the *Klass::*_offset_in_bytes() functions Summary: Moved sizeof(klassOopDesc), changed the return type to ByteSize and removed the _in_bytes suffix. Reviewed-by: never, bdelsart, coleenp, jrose
author stefank
date Wed, 07 Dec 2011 11:35:03 +0100
parents f1c12354c3f7
children 1dc233a8c7fe
comparison
equal deleted inserted replaced
4761:65149e74c706 4762:069ab3f976d3
2302 // %%% Possible further optimization: Even if the superklass is not exact, 2302 // %%% Possible further optimization: Even if the superklass is not exact,
2303 // if the subklass is the unique subtype of the superklass, the check 2303 // if the subklass is the unique subtype of the superklass, the check
2304 // will always succeed. We could leave a dependency behind to ensure this. 2304 // will always succeed. We could leave a dependency behind to ensure this.
2305 2305
2306 // First load the super-klass's check-offset 2306 // First load the super-klass's check-offset
2307 Node *p1 = basic_plus_adr( superklass, superklass, sizeof(oopDesc) + Klass::super_check_offset_offset_in_bytes() ); 2307 Node *p1 = basic_plus_adr( superklass, superklass, in_bytes(Klass::super_check_offset_offset()) );
2308 Node *chk_off = _gvn.transform( new (C, 3) LoadINode( NULL, memory(p1), p1, _gvn.type(p1)->is_ptr() ) ); 2308 Node *chk_off = _gvn.transform( new (C, 3) LoadINode( NULL, memory(p1), p1, _gvn.type(p1)->is_ptr() ) );
2309 int cacheoff_con = sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes(); 2309 int cacheoff_con = in_bytes(Klass::secondary_super_cache_offset());
2310 bool might_be_cache = (find_int_con(chk_off, cacheoff_con) == cacheoff_con); 2310 bool might_be_cache = (find_int_con(chk_off, cacheoff_con) == cacheoff_con);
2311 2311
2312 // Load from the sub-klass's super-class display list, or a 1-word cache of 2312 // Load from the sub-klass's super-class display list, or a 1-word cache of
2313 // the secondary superclass list, or a failing value with a sentinel offset 2313 // the secondary superclass list, or a failing value with a sentinel offset
2314 // if the super-klass is an interface or exceptionally deep in the Java 2314 // if the super-klass is an interface or exceptionally deep in the Java
2932 return (Node*) NULL; 2932 return (Node*) NULL;
2933 } 2933 }
2934 } 2934 }
2935 } 2935 }
2936 constant_value = Klass::_lh_neutral_value; // put in a known value 2936 constant_value = Klass::_lh_neutral_value; // put in a known value
2937 Node* lhp = basic_plus_adr(klass_node, klass_node, Klass::layout_helper_offset_in_bytes() + sizeof(oopDesc)); 2937 Node* lhp = basic_plus_adr(klass_node, klass_node, in_bytes(Klass::layout_helper_offset()));
2938 return make_load(NULL, lhp, TypeInt::INT, T_INT); 2938 return make_load(NULL, lhp, TypeInt::INT, T_INT);
2939 } 2939 }
2940 2940
2941 // We just put in an allocate/initialize with a big raw-memory effect. 2941 // We just put in an allocate/initialize with a big raw-memory effect.
2942 // Hook selected additional alias categories on the initialization. 2942 // Hook selected additional alias categories on the initialization.