Skip to content

Commit 2c4c37b

Browse files
committed
debug
Signed-off-by: Tobi Ajila <[email protected]>
1 parent cf0437b commit 2c4c37b

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

jcl/src/java.base/share/classes/com/ibm/oti/vm/VM.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ public static int markCurrentThreadAsSystem()
631631
* constantpool associated with clazz
632632
*/
633633
public static ConstantPool getConstantPoolFromAnnotationBytes(Class<?> clazz, byte[] array) {
634-
/* Check the cp cache on the Class object first */
634+
/* Check the cp cache on the Class object first. */
635635
ConstantPool cp = VM.getVMLangAccess().getConstantPoolCache(clazz);
636636
if (null != cp) {
637637
return cp;

jcl/src/java.base/share/classes/com/ibm/oti/vm/VMLangAccess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public interface VMLangAccess {
214214
/*[ENDIF] JAVA_SPEC_VERSION >= 11*/
215215

216216
/**
217-
* Returns a cached constantPool Object from a given java.lang.Class
217+
* Returns a cached constantPool Object from a given java.lang.Class.
218218
*
219219
* @param clazz
220220
*

runtime/cmake/platform/toolcfg/gnu.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0
2121
################################################################################
2222

23-
list(APPEND OMR_PLATFORM_COMPILE_OPTIONS -O3 -g -fstack-protector)
23+
list(APPEND OMR_PLATFORM_COMPILE_OPTIONS -O0 -g3 -fstack-protector)
2424
if(OMR_DDR AND NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS 11))
2525
# In gcc 11+ the default is to use DWARF version 5 which is not yet
2626
# supported by ddrgen: tell the compiler to use DWARF version 4.

runtime/jcl/common/com_ibm_oti_vm_VM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ Java_com_ibm_oti_vm_VM_markCurrentThreadAsSystemImpl(JNIEnv *env)
167167
jlong JNICALL
168168
Java_com_ibm_oti_vm_VM_getJ9ConstantPoolFromJ9Class(JNIEnv *env, jclass unused, jlong j9clazz)
169169
{
170-
J9Class *clazz = (J9Class *)JLONG_TO_POINTER(j9clazz);
171-
return JLONG_FROM_POINTER(clazz->ramConstantPool);
170+
J9Class *clazz = (J9Class *)(UDATA)j9clazz;
171+
return (jlong)(UDATA)clazz->ramConstantPool;
172172
}
173173

174174
/**

runtime/jcl/common/java_lang_Access.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ Java_java_lang_Access_getConstantPool(JNIEnv *env, jclass unusedClass, jobject c
6767
vmFunctions->internalEnterVMFromJNI(vmThread);
6868
classObject = J9_JNI_UNWRAP_REFERENCE(classToIntrospect);
6969
if (J9VMJAVALANGCLASS_OR_NULL(vmThread->javaVM) == J9OBJECT_CLAZZ(vmThread, classObject)) {
70-
clazz = J9VM_J9CLASS_FROM_HEAPCLASS(vmThread, classObject);
71-
J9ConstantPool *j9CP = (J9ConstantPool *)clazz->ramConstantPool;
70+
J9ConstantPool *j9CP = NULL;
7271
J9Class *internalConstantPool = J9VMJAVALANGINTERNALCONSTANTPOOL_OR_NULL(vmThread->javaVM);
7372
Assert_JCL_notNull(internalConstantPool);
7473
j9object_t internalConstantPoolObject = gcFunctions->J9AllocateObject(vmThread, internalConstantPool, J9_GC_ALLOCATE_OBJECT_NON_INSTRUMENTABLE);
@@ -77,6 +76,9 @@ Java_java_lang_Access_getConstantPool(JNIEnv *env, jclass unusedClass, jobject c
7776
vmFunctions->internalExitVMToJNI(vmThread);
7877
return NULL;
7978
}
79+
classObject = J9_JNI_UNWRAP_REFERENCE(classToIntrospect);
80+
clazz = J9VM_J9CLASS_FROM_HEAPCLASS(vmThread, classObject);
81+
j9CP = (J9ConstantPool *)clazz->ramConstantPool;
8082
J9VMJAVALANGINTERNALCONSTANTPOOL_SET_VMREF(vmThread, internalConstantPoolObject, j9CP);
8183
J9VMJAVALANGINTERNALCONSTANTPOOL_SET_CLAZZ(vmThread, internalConstantPoolObject, classObject);
8284
classToIntrospect = vmFunctions->j9jni_createLocalRef(env, internalConstantPoolObject);

0 commit comments

Comments
 (0)