< prev index next >

src/hotspot/share/opto/library_call.cpp

Print this page

        

*** 184,193 **** --- 184,194 ---- } Node* generate_access_flags_guard(Node* kls, int modifier_mask, int modifier_bits, RegionNode* region); Node* generate_interface_guard(Node* kls, RegionNode* region); + Node* generate_hidden_class_guard(Node* kls, RegionNode* region); Node* generate_array_guard(Node* kls, RegionNode* region) { return generate_array_guard_common(kls, region, false, false); } Node* generate_non_array_guard(Node* kls, RegionNode* region) { return generate_array_guard_common(kls, region, false, true);
*** 780,789 **** --- 781,791 ---- case vmIntrinsics::_isInstance: case vmIntrinsics::_getModifiers: case vmIntrinsics::_isInterface: case vmIntrinsics::_isArray: case vmIntrinsics::_isPrimitive: + case vmIntrinsics::_isHiddenClass: case vmIntrinsics::_getSuperclass: case vmIntrinsics::_getClassAccessFlags: return inline_native_Class_query(intrinsic_id()); case vmIntrinsics::_floatToRawIntBits: case vmIntrinsics::_floatToIntBits:
*** 3091,3100 **** --- 3093,3105 ---- return generate_fair_guard(bol, region); } Node* LibraryCallKit::generate_interface_guard(Node* kls, RegionNode* region) { return generate_access_flags_guard(kls, JVM_ACC_INTERFACE, 0, region); } + Node* LibraryCallKit::generate_hidden_class_guard(Node* kls, RegionNode* region) { + return generate_access_flags_guard(kls, JVM_ACC_IS_HIDDEN_CLASS, 0, region); + } //-------------------------inline_native_Class_query------------------- bool LibraryCallKit::inline_native_Class_query(vmIntrinsics::ID id) { const Type* return_type = TypeInt::BOOL; Node* prim_return_value = top(); // what happens if it's a primitive class?
*** 3126,3135 **** --- 3131,3143 ---- break; case vmIntrinsics::_isPrimitive: prim_return_value = intcon(1); expect_prim = true; // obviously break; + case vmIntrinsics::_isHiddenClass: + prim_return_value = intcon(0); + break; case vmIntrinsics::_getSuperclass: prim_return_value = null(); return_type = TypeInstPtr::MIRROR->cast_to_ptr_type(TypePtr::BotPTR); break; case vmIntrinsics::_getClassAccessFlags:
*** 3218,3227 **** --- 3226,3245 ---- case vmIntrinsics::_isPrimitive: query_value = intcon(0); // "normal" path produces false break; + case vmIntrinsics::_isHiddenClass: + // (To verify this code sequence, check the asserts in JVM_IsHiddenClass.) + if (generate_hidden_class_guard(kls, region) != NULL) + // A guard was added. If the guard is taken, it was an hidden class. + phi->add_req(intcon(1)); + // If we fall through, it's a plain class. + query_value = intcon(0); + break; + + case vmIntrinsics::_getSuperclass: // The rules here are somewhat unfortunate, but we can still do better // with random logic than with a JNI call. // Interfaces store null or Object as _super, but must report null. // Arrays store an intermediate super as _super, but must report Object.
< prev index next >