diff --git a/jcl/src/java.base/share/classes/java/lang/Class.java b/jcl/src/java.base/share/classes/java/lang/Class.java index 8577348f84b..4ac24cf3a05 100644 --- a/jcl/src/java.base/share/classes/java/lang/Class.java +++ b/jcl/src/java.base/share/classes/java/lang/Class.java @@ -2631,14 +2631,6 @@ public boolean isInterface() { public native boolean isPrimitive(); /*[IF INLINE-TYPES]*/ -/** - * Answers true if the receiver represents a primitive class type. Array classes - * return false. - * - * @return true if receiver is primitive class type, and false otherwise. - */ -native boolean isPrimitiveClass(); - /** * Answers true if the receiver represents a value class type. Array classes * return false. @@ -2676,26 +2668,6 @@ int getClassFileVersion() { return thisObject.getClassFileVersion0(); } private native int getClassFileVersion0(); - -/** - * ToDo: add comments for public methods - https://github.com/eclipse-openj9/openj9/issues/13615 - */ -Class asPrimaryType() { - // ToDo: this is a temporary implementation - https://github.com/eclipse-openj9/openj9/issues/13615 - return this; -} -Class asValueType() { - // ToDo: this is a temporary implementation - https://github.com/eclipse-openj9/openj9/issues/13615 - return this; -} -boolean isPrimaryType() { - // ToDo: this is a temporary implementation - https://github.com/eclipse-openj9/openj9/issues/13615 - return true; -} -boolean isPrimitiveValueType() { - // ToDo: this is a temporary implementation - https://github.com/eclipse-openj9/openj9/issues/13615 - return isPrimitiveClass(); -} /*[ENDIF] INLINE-TYPES */ /** diff --git a/runtime/compiler/codegen/J9RecognizedMethodsEnum.hpp b/runtime/compiler/codegen/J9RecognizedMethodsEnum.hpp index 295398dbde3..115dda7c16d 100644 --- a/runtime/compiler/codegen/J9RecognizedMethodsEnum.hpp +++ b/runtime/compiler/codegen/J9RecognizedMethodsEnum.hpp @@ -59,7 +59,6 @@ java_lang_Class_isArray, java_lang_Class_isPrimitive, java_lang_Class_isValue, - java_lang_Class_isPrimitiveClass, java_lang_Class_isIdentity, java_lang_Class_getComponentType, java_lang_Class_getModifiersImpl, diff --git a/runtime/compiler/env/VMJ9.cpp b/runtime/compiler/env/VMJ9.cpp index b7b2e374a89..7991f4d8b94 100644 --- a/runtime/compiler/env/VMJ9.cpp +++ b/runtime/compiler/env/VMJ9.cpp @@ -2889,12 +2889,6 @@ TR_J9VMBase::testIsClassValueType(TR::Node *j9ClassRefNode) return testAreSomeClassFlagsSet(j9ClassRefNode, J9ClassIsValueType); } -TR::Node * -TR_J9VMBase::testIsClassPrimitiveValueType(TR::Node *j9ClassRefNode) - { - return testAreSomeClassFlagsSet(j9ClassRefNode, J9ClassIsPrimitiveValueType); - } - TR::Node * TR_J9VMBase::testIsClassIdentityType(TR::Node *j9ClassRefNode) { diff --git a/runtime/compiler/env/VMJ9.h b/runtime/compiler/env/VMJ9.h index 94efd663522..2c1d58b3159 100644 --- a/runtime/compiler/env/VMJ9.h +++ b/runtime/compiler/env/VMJ9.h @@ -1261,15 +1261,6 @@ class TR_J9VMBase : public TR_FrontEnd */ TR::Node * testIsClassValueType(TR::Node *j9ClassRefNode); - /** - * \brief Load class flags field of the specified class and test whether the primitive value type - * flag is set. - * \param j9ClassRefNode A node representing a reference to a \ref J9Class - * \return \ref TR::Node that evaluates to a non-zero integer if the class is a primitive value type, - * or zero otherwise - */ - TR::Node * testIsClassPrimitiveValueType(TR::Node *j9ClassRefNode); - /** * \brief Load class flags field of the specified class and test whether the hasIdentity * flag is set. diff --git a/runtime/compiler/env/j9method.cpp b/runtime/compiler/env/j9method.cpp index 45b9d9acac4..b0c68be4a07 100644 --- a/runtime/compiler/env/j9method.cpp +++ b/runtime/compiler/env/j9method.cpp @@ -2101,7 +2101,6 @@ void TR_ResolvedJ9Method::construct() {x(TR::java_lang_Class_isArray, "isArray", "()Z")}, {x(TR::java_lang_Class_isPrimitive, "isPrimitive", "()Z")}, {x(TR::java_lang_Class_isValue, "isValue", "()Z")}, - {x(TR::java_lang_Class_isPrimitiveClass, "isPrimitiveClass", "()Z")}, {x(TR::java_lang_Class_isIdentity, "isIdentity", "()Z")}, {x(TR::java_lang_Class_getComponentType, "getComponentType", "()Ljava/lang/Class;")}, {x(TR::java_lang_Class_getModifiersImpl, "getModifiersImpl", "()I")}, diff --git a/runtime/compiler/optimizer/J9ValuePropagation.cpp b/runtime/compiler/optimizer/J9ValuePropagation.cpp index cb9dd51ab28..558b3d9d36b 100644 --- a/runtime/compiler/optimizer/J9ValuePropagation.cpp +++ b/runtime/compiler/optimizer/J9ValuePropagation.cpp @@ -1675,14 +1675,13 @@ J9::ValuePropagation::constrainRecognizedMethod(TR::Node *node) break; } case TR::java_lang_Class_isValue: - case TR::java_lang_Class_isPrimitiveClass: case TR::java_lang_Class_isIdentity: { TR::Node *classChild = node->getLastChild(); bool classChildGlobal; TR::VPConstraint *classChildConstraint = getConstraint(classChild, classChildGlobal); - // If the class is known for a call to Class.isValue, Class.isPrimitiveClass or + // If the class is known for a call to Class.isValue or // Class.isIdentity, fold it at compile-time. Otherwise, inline a test of the // class flags // @@ -1695,7 +1694,6 @@ J9::ValuePropagation::constrainRecognizedMethod(TR::Node *node) TR_OpaqueClassBlock *thisClass = classChildConstraint->getClass(); const int queryResult = ((rm == TR::java_lang_Class_isValue) && TR::Compiler->cls.isValueTypeClass(thisClass)) - || ((rm == TR::java_lang_Class_isPrimitiveClass) && TR::Compiler->cls.isPrimitiveValueTypeClass(thisClass)) || ((rm == TR::java_lang_Class_isIdentity) && TR::Compiler->cls.classHasIdentity(thisClass)); transformCallToIconstInPlaceOrInDelayedTransformations(_curTree, queryResult, classChildGlobal, true, false); TR::DebugCounter::incStaticDebugCounter(comp(), TR::DebugCounter::debugCounterName(comp(), "constrainCall/(%s)", signature)); @@ -1736,11 +1734,6 @@ J9::ValuePropagation::constrainRecognizedMethod(TR::Node *node) testFlagsNode = comp()->fej9()->testIsClassValueType(classOperand); break; } - case TR::java_lang_Class_isPrimitiveClass: - { - testFlagsNode = comp()->fej9()->testIsClassPrimitiveValueType(classOperand); - break; - } case TR::java_lang_Class_isIdentity: { testFlagsNode = comp()->fej9()->testIsClassIdentityType(classOperand); diff --git a/runtime/oti/VMHelpers.hpp b/runtime/oti/VMHelpers.hpp index 679a17139f0..c630b49c834 100644 --- a/runtime/oti/VMHelpers.hpp +++ b/runtime/oti/VMHelpers.hpp @@ -75,9 +75,6 @@ typedef enum { J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_ASSIGNABLE_FROM, J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_ARRAY, J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_PRIMITIVE, -#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) - J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_PRIMITIVE_CLASS, -#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */ #if defined(J9VM_OPT_VALHALLA_VALUE_TYPES) J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_VALUE, J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_IDENTITY, diff --git a/runtime/vm/BytecodeInterpreter.hpp b/runtime/vm/BytecodeInterpreter.hpp index 6dc3c1eeef9..f50362d164c 100644 --- a/runtime/vm/BytecodeInterpreter.hpp +++ b/runtime/vm/BytecodeInterpreter.hpp @@ -2886,18 +2886,6 @@ class INTERPRETER_CLASS return EXECUTE_BYTECODE; } -#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) - /* java.lang.Class: public native boolean isPrimitiveClass(); */ - VMINLINE VM_BytecodeAction - inlClassIsPrimitiveClass(REGISTER_ARGS_LIST) - { - J9Class *receiverClazz = J9VM_J9CLASS_FROM_HEAPCLASS(_currentThread, *(j9object_t*)_sp); - bool isPrimitiveClass = J9_IS_J9CLASS_PRIMITIVE_VALUETYPE(receiverClazz); - returnSingleFromINL(REGISTER_ARGS, (isPrimitiveClass ? 1 : 0), 1); - return EXECUTE_BYTECODE; - } -#endif /* J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES */ - #if defined(J9VM_OPT_VALHALLA_VALUE_TYPES) /* java.lang.Class: public native boolean isValue(); */ VMINLINE VM_BytecodeAction @@ -10336,9 +10324,6 @@ class INTERPRETER_CLASS JUMP_TABLE_ENTRY(J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_ASSIGNABLE_FROM), JUMP_TABLE_ENTRY(J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_ARRAY), JUMP_TABLE_ENTRY(J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_PRIMITIVE), -#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) - JUMP_TABLE_ENTRY(J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_PRIMITIVE_CLASS), -#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */ #if defined(J9VM_OPT_VALHALLA_VALUE_TYPES) JUMP_TABLE_ENTRY(J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_VALUE), JUMP_TABLE_ENTRY(J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_IDENTITY), @@ -10871,10 +10856,6 @@ runMethod: { PERFORM_ACTION(inlClassIsArray(REGISTER_ARGS)); JUMP_TARGET(J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_PRIMITIVE): PERFORM_ACTION(inlClassIsPrimitive(REGISTER_ARGS)); -#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) - JUMP_TARGET(J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_PRIMITIVE_CLASS): - PERFORM_ACTION(inlClassIsPrimitiveClass(REGISTER_ARGS)); -#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */ #if defined(J9VM_OPT_VALHALLA_VALUE_TYPES) JUMP_TARGET(J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_VALUE): PERFORM_ACTION(inlClassIsValue(REGISTER_ARGS)); diff --git a/runtime/vm/FastJNI_java_lang_Class.cpp b/runtime/vm/FastJNI_java_lang_Class.cpp index bafd12143b5..82186db5bc5 100644 --- a/runtime/vm/FastJNI_java_lang_Class.cpp +++ b/runtime/vm/FastJNI_java_lang_Class.cpp @@ -131,17 +131,6 @@ Fast_java_lang_Class_isPrimitive(J9VMThread *currentThread, j9object_t classObje return J9ROMCLASS_IS_PRIMITIVE_TYPE(receiverClazz->romClass) ? JNI_TRUE : JNI_FALSE; } -#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) -/* java.lang.Class: private native boolean isPrimitiveClass(); */ -jboolean JNICALL -Fast_java_lang_Class_isPrimitiveClass(J9VMThread *currentThread, j9object_t classObject) -{ - J9Class *receiverClazz = J9VM_J9CLASS_FROM_HEAPCLASS(currentThread, classObject); - bool isPrimitiveClass = J9_IS_J9CLASS_PRIMITIVE_VALUETYPE(receiverClazz); - return isPrimitiveClass ? JNI_TRUE : JNI_FALSE; -} -#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */ - #if defined(J9VM_OPT_VALHALLA_VALUE_TYPES) /* java.lang.Class: private native boolean isIdentity(); */ jboolean JNICALL @@ -262,11 +251,6 @@ J9_FAST_JNI_METHOD_TABLE(java_lang_Class) J9_FAST_JNI_METHOD("isPrimitive", "()Z", Fast_java_lang_Class_isPrimitive, J9_FAST_JNI_RETAIN_VM_ACCESS | J9_FAST_JNI_NOT_GC_POINT | J9_FAST_JNI_NO_NATIVE_METHOD_FRAME | J9_FAST_JNI_NO_EXCEPTION_THROW | J9_FAST_JNI_NO_SPECIAL_TEAR_DOWN | J9_FAST_JNI_DO_NOT_WRAP_OBJECTS) -#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) - J9_FAST_JNI_METHOD("isPrimitiveClass", "()Z", Fast_java_lang_Class_isPrimitiveClass, - J9_FAST_JNI_RETAIN_VM_ACCESS | J9_FAST_JNI_NOT_GC_POINT | J9_FAST_JNI_NO_NATIVE_METHOD_FRAME | J9_FAST_JNI_NO_EXCEPTION_THROW | - J9_FAST_JNI_NO_SPECIAL_TEAR_DOWN | J9_FAST_JNI_DO_NOT_WRAP_OBJECTS) -#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */ #if defined(J9VM_OPT_VALHALLA_VALUE_TYPES) J9_FAST_JNI_METHOD("isIdentity", "()Z", Fast_java_lang_Class_isIdentity, J9_FAST_JNI_RETAIN_VM_ACCESS | J9_FAST_JNI_NOT_GC_POINT | J9_FAST_JNI_NO_NATIVE_METHOD_FRAME | J9_FAST_JNI_NO_EXCEPTION_THROW | diff --git a/runtime/vm/bindnatv.cpp b/runtime/vm/bindnatv.cpp index a62cf59b527..8cd601794cd 100644 --- a/runtime/vm/bindnatv.cpp +++ b/runtime/vm/bindnatv.cpp @@ -85,9 +85,6 @@ static inlMapping mappings[] = { { "Java_java_lang_Class_isAssignableFrom__Ljava_lang_Class_2", J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_ASSIGNABLE_FROM }, { "Java_java_lang_Class_isArray__", J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_ARRAY }, { "Java_java_lang_Class_isPrimitive__", J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_PRIMITIVE }, -#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) - { "Java_java_lang_Class_isPrimitiveClass__", J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_PRIMITIVE_CLASS }, -#endif /* J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES */ #if defined(J9VM_OPT_VALHALLA_VALUE_TYPES) { "Java_java_lang_Class_isValue__", J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_VALUE }, { "Java_java_lang_Class_isIdentity__", J9_BCLOOP_SEND_TARGET_INL_CLASS_IS_IDENTITY },