Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
wagyourtail committed Sep 25, 2024
2 parents 5748450 + a7cd603 commit 8e855cb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package xyz.wagyourtail.jvmdg.j9.stub.java_base;

import xyz.wagyourtail.jvmdg.version.Stub;

public class J_L_StackTraceElement {

@Stub
public static String getClassLoaderName(StackTraceElement element) {
return null;
}

@Stub
public static String getModuleName(StackTraceElement element) {
return null;
}

@Stub
public static String getModuleVersion(StackTraceElement element) {
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,8 @@ private void createAccessors(ClassNode clazz, Map<String, Object> fields) {

} else {

// create new package-private method to call private method
MethodVisitor mv = clazz.visitMethod(isStatic ? Opcodes.ACC_STATIC : 0, "jvmdowngrader$nest$" + clazz.name.replace("/", "_") + "$" + name, desc, null, null);
// create new method to call private method
MethodVisitor mv = clazz.visitMethod((isStatic ? Opcodes.ACC_STATIC : 0) | Opcodes.ACC_PUBLIC, "jvmdowngrader$nest$" + clazz.name.replace("/", "_") + "$" + name, desc, null, null);
mv.visitCode();
if (!isStatic) {
mv.visitVarInsn(Opcodes.ALOAD, 0);
Expand Down Expand Up @@ -426,8 +426,8 @@ private void createAccessors(ClassNode clazz, Map<String, Object> fields) {
throw new RuntimeException("not field?");
}

// create new package-private method to get field
MethodVisitor mv = clazz.visitMethod(isStatic ? Opcodes.ACC_STATIC : 0, "jvmdowngrader$nest$" + clazz.name.replace("/", "_") + "$get$" + field, "()" + desc, null, null);
// create new method to get field
MethodVisitor mv = clazz.visitMethod((isStatic ? Opcodes.ACC_STATIC : 0) | Opcodes.ACC_PUBLIC, "jvmdowngrader$nest$" + clazz.name.replace("/", "_") + "$get$" + field, "()" + desc, null, null);
mv.visitCode();
if (!isStatic) {
mv.visitVarInsn(Opcodes.ALOAD, 0);
Expand All @@ -436,8 +436,8 @@ private void createAccessors(ClassNode clazz, Map<String, Object> fields) {
mv.visitInsn(fieldType.getOpcode(Opcodes.IRETURN));
mv.visitEnd();

// create new package-private method to set field
mv = clazz.visitMethod(isStatic ? Opcodes.ACC_STATIC : 0, "jvmdowngrader$nest$" + clazz.name.replace("/", "_") + "$set$" + field, "(" + desc + ")V", null, null);
// create new method to set field
mv = clazz.visitMethod((isStatic ? Opcodes.ACC_STATIC : 0) | Opcodes.ACC_PUBLIC, "jvmdowngrader$nest$" + clazz.name.replace("/", "_") + "$set$" + field, "(" + desc + ")V", null, null);
mv.visitCode();
if (!isStatic) {
mv.visitVarInsn(Opcodes.ALOAD, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void init() {
stub(J_L_Runtime.class);
stub(J_L_Runtime.Version.class);
stub(J_L_Short.class);
// StackTraceElement
stub(J_L_StackTraceElement.class);
stub(J_L_StackWalker.class);
stub(J_L_StrictMath.class);
// String -- handled by CharSequence
Expand Down

0 comments on commit 8e855cb

Please sign in to comment.