src/share/vm/opto/library_call.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 7118863 Cdiff src/share/vm/opto/library_call.cpp

src/share/vm/opto/library_call.cpp

Print this page

        

*** 2163,2174 **** float unlikely = PROB_UNLIKELY(0.999); IdealKit ideal(this); #define __ ideal. ! const int reference_type_offset = instanceKlass::reference_type_offset_in_bytes() + ! sizeof(oopDesc); Node* referent_off = __ ConX(java_lang_ref_Reference::referent_offset); __ if_then(offset, BoolTest::eq, referent_off, unlikely); { __ if_then(base_oop, BoolTest::ne, null(), likely); { --- 2163,2173 ---- float unlikely = PROB_UNLIKELY(0.999); IdealKit ideal(this); #define __ ideal. ! const int reference_type_offset = in_bytes(instanceKlass::reference_type_offset()); Node* referent_off = __ ConX(java_lang_ref_Reference::referent_offset); __ if_then(offset, BoolTest::eq, referent_off, unlikely); { __ if_then(base_oop, BoolTest::ne, null(), likely); {
*** 2804,2814 **** if (stopped()) return true; // argument was like int.class // Note: The argument might still be an illegal value like // Serializable.class or Object[].class. The runtime will handle it. // But we must make an explicit check for initialization. ! Node* insp = basic_plus_adr(kls, instanceKlass::init_state_offset_in_bytes() + sizeof(oopDesc)); Node* inst = make_load(NULL, insp, TypeInt::INT, T_INT); Node* bits = intcon(instanceKlass::fully_initialized); Node* test = _gvn.transform( new (C, 3) SubINode(inst, bits) ); // The 'test' is non-zero if we need to take a slow path. --- 2803,2813 ---- if (stopped()) return true; // argument was like int.class // Note: The argument might still be an illegal value like // Serializable.class or Object[].class. The runtime will handle it. // But we must make an explicit check for initialization. ! Node* insp = basic_plus_adr(kls, in_bytes(instanceKlass::init_state_offset())); Node* inst = make_load(NULL, insp, TypeInt::INT, T_INT); Node* bits = intcon(instanceKlass::fully_initialized); Node* test = _gvn.transform( new (C, 3) SubINode(inst, bits) ); // The 'test' is non-zero if we need to take a slow path.
*** 2952,2962 **** } //---------------------------load_mirror_from_klass---------------------------- // Given a klass oop, load its java mirror (a java.lang.Class oop). Node* LibraryCallKit::load_mirror_from_klass(Node* klass) { ! Node* p = basic_plus_adr(klass, Klass::java_mirror_offset_in_bytes() + sizeof(oopDesc)); return make_load(NULL, p, TypeInstPtr::MIRROR, T_OBJECT); } //-----------------------load_klass_from_mirror_common------------------------- // Given a java mirror (a java.lang.Class oop), load its corresponding klass oop. --- 2951,2961 ---- } //---------------------------load_mirror_from_klass---------------------------- // Given a klass oop, load its java mirror (a java.lang.Class oop). Node* LibraryCallKit::load_mirror_from_klass(Node* klass) { ! Node* p = basic_plus_adr(klass, in_bytes(Klass::java_mirror_offset())); return make_load(NULL, p, TypeInstPtr::MIRROR, T_OBJECT); } //-----------------------load_klass_from_mirror_common------------------------- // Given a java mirror (a java.lang.Class oop), load its corresponding klass oop.
*** 2992,3002 **** // Use this for JVM_ACC_INTERFACE, JVM_ACC_IS_CLONEABLE, JVM_ACC_HAS_FINALIZER. // Fall through if (mods & mask) == bits, take the guard otherwise. Node* LibraryCallKit::generate_access_flags_guard(Node* kls, int modifier_mask, int modifier_bits, RegionNode* region) { // Branch around if the given klass has the given modifier bit set. // Like generate_guard, adds a new path onto the region. ! Node* modp = basic_plus_adr(kls, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc)); Node* mods = make_load(NULL, modp, TypeInt::INT, T_INT); Node* mask = intcon(modifier_mask); Node* bits = intcon(modifier_bits); Node* mbit = _gvn.transform( new (C, 3) AndINode(mods, mask) ); Node* cmp = _gvn.transform( new (C, 3) CmpINode(mbit, bits) ); --- 2991,3001 ---- // Use this for JVM_ACC_INTERFACE, JVM_ACC_IS_CLONEABLE, JVM_ACC_HAS_FINALIZER. // Fall through if (mods & mask) == bits, take the guard otherwise. Node* LibraryCallKit::generate_access_flags_guard(Node* kls, int modifier_mask, int modifier_bits, RegionNode* region) { // Branch around if the given klass has the given modifier bit set. // Like generate_guard, adds a new path onto the region. ! Node* modp = basic_plus_adr(kls, in_bytes(Klass::access_flags_offset())); Node* mods = make_load(NULL, modp, TypeInt::INT, T_INT); Node* mask = intcon(modifier_mask); Node* bits = intcon(modifier_bits); Node* mbit = _gvn.transform( new (C, 3) AndINode(mods, mask) ); Node* cmp = _gvn.transform( new (C, 3) CmpINode(mbit, bits) );
*** 3113,3123 **** query_value = gen_instanceof(obj, kls); _sp -= nargs; break; case vmIntrinsics::_getModifiers: ! p = basic_plus_adr(kls, Klass::modifier_flags_offset_in_bytes() + sizeof(oopDesc)); query_value = make_load(NULL, p, TypeInt::INT, T_INT); break; case vmIntrinsics::_isInterface: // (To verify this code sequence, check the asserts in JVM_IsInterface.) --- 3112,3122 ---- query_value = gen_instanceof(obj, kls); _sp -= nargs; break; case vmIntrinsics::_getModifiers: ! p = basic_plus_adr(kls, in_bytes(Klass::modifier_flags_offset())); query_value = make_load(NULL, p, TypeInt::INT, T_INT); break; case vmIntrinsics::_isInterface: // (To verify this code sequence, check the asserts in JVM_IsInterface.)
*** 3153,3163 **** phi->add_req(null()); if (generate_array_guard(kls, region) != NULL) // A guard was added. If the guard is taken, it was an array. phi->add_req(makecon(TypeInstPtr::make(env()->Object_klass()->java_mirror()))); // If we fall through, it's a plain class. Get its _super. ! p = basic_plus_adr(kls, Klass::super_offset_in_bytes() + sizeof(oopDesc)); kls = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeRawPtr::BOTTOM, TypeKlassPtr::OBJECT_OR_NULL) ); null_ctl = top(); kls = null_check_oop(kls, &null_ctl); if (null_ctl != top()) { // If the guard is taken, Object.superClass is null (both klass and mirror). --- 3152,3162 ---- phi->add_req(null()); if (generate_array_guard(kls, region) != NULL) // A guard was added. If the guard is taken, it was an array. phi->add_req(makecon(TypeInstPtr::make(env()->Object_klass()->java_mirror()))); // If we fall through, it's a plain class. Get its _super. ! p = basic_plus_adr(kls, in_bytes(Klass::super_offset())); kls = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeRawPtr::BOTTOM, TypeKlassPtr::OBJECT_OR_NULL) ); null_ctl = top(); kls = null_check_oop(kls, &null_ctl); if (null_ctl != top()) { // If the guard is taken, Object.superClass is null (both klass and mirror).
*** 3171,3189 **** case vmIntrinsics::_getComponentType: if (generate_array_guard(kls, region) != NULL) { // Be sure to pin the oop load to the guard edge just created: Node* is_array_ctrl = region->in(region->req()-1); ! Node* cma = basic_plus_adr(kls, in_bytes(arrayKlass::component_mirror_offset()) + sizeof(oopDesc)); Node* cmo = make_load(is_array_ctrl, cma, TypeInstPtr::MIRROR, T_OBJECT); phi->add_req(cmo); } query_value = null(); // non-array case is null break; case vmIntrinsics::_getClassAccessFlags: ! p = basic_plus_adr(kls, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc)); query_value = make_load(NULL, p, TypeInt::INT, T_INT); break; default: ShouldNotReachHere(); --- 3170,3188 ---- case vmIntrinsics::_getComponentType: if (generate_array_guard(kls, region) != NULL) { // Be sure to pin the oop load to the guard edge just created: Node* is_array_ctrl = region->in(region->req()-1); ! Node* cma = basic_plus_adr(kls, in_bytes(arrayKlass::component_mirror_offset())); Node* cmo = make_load(is_array_ctrl, cma, TypeInstPtr::MIRROR, T_OBJECT); phi->add_req(cmo); } query_value = null(); // non-array case is null break; case vmIntrinsics::_getClassAccessFlags: ! p = basic_plus_adr(kls, in_bytes(Klass::access_flags_offset())); query_value = make_load(NULL, p, TypeInt::INT, T_INT); break; default: ShouldNotReachHere();
*** 4855,4865 **** // Plug failing path into checked_oop_disjoint_arraycopy if (not_subtype_ctrl != top()) { PreserveJVMState pjvms(this); set_control(not_subtype_ctrl); // (At this point we can assume disjoint_bases, since types differ.) ! int ek_offset = objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc); Node* p1 = basic_plus_adr(dest_klass, ek_offset); Node* n1 = LoadKlassNode::make(_gvn, immutable_memory(), p1, TypeRawPtr::BOTTOM); Node* dest_elem_klass = _gvn.transform(n1); Node* cv = generate_checkcast_arraycopy(adr_type, dest_elem_klass, --- 4854,4864 ---- // Plug failing path into checked_oop_disjoint_arraycopy if (not_subtype_ctrl != top()) { PreserveJVMState pjvms(this); set_control(not_subtype_ctrl); // (At this point we can assume disjoint_bases, since types differ.) ! int ek_offset = in_bytes(objArrayKlass::element_klass_offset()); Node* p1 = basic_plus_adr(dest_klass, ek_offset); Node* n1 = LoadKlassNode::make(_gvn, immutable_memory(), p1, TypeRawPtr::BOTTOM); Node* dest_elem_klass = _gvn.transform(n1); Node* cv = generate_checkcast_arraycopy(adr_type, dest_elem_klass,
*** 5306,5316 **** // Pick out the parameters required to perform a store-check // for the target array. This is an optimistic check. It will // look in each non-null element's class, at the desired klass's // super_check_offset, for the desired klass. ! int sco_offset = Klass::super_check_offset_offset_in_bytes() + sizeof(oopDesc); Node* p3 = basic_plus_adr(dest_elem_klass, sco_offset); Node* n3 = new(C, 3) LoadINode(NULL, memory(p3), p3, _gvn.type(p3)->is_ptr()); Node* check_offset = ConvI2X(_gvn.transform(n3)); Node* check_value = dest_elem_klass; --- 5305,5315 ---- // Pick out the parameters required to perform a store-check // for the target array. This is an optimistic check. It will // look in each non-null element's class, at the desired klass's // super_check_offset, for the desired klass. ! int sco_offset = in_bytes(Klass::super_check_offset_offset()); Node* p3 = basic_plus_adr(dest_elem_klass, sco_offset); Node* n3 = new(C, 3) LoadINode(NULL, memory(p3), p3, _gvn.type(p3)->is_ptr()); Node* check_offset = ConvI2X(_gvn.transform(n3)); Node* check_value = dest_elem_klass;
src/share/vm/opto/library_call.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File