Skip to content

Commit 1cbe03e

Browse files
committed
[GR-44537] Relax access checks for generated foreign type mapping proxies.
PullRequest: graal/13935
2 parents 1cd0908 + 06fbe43 commit 1cbe03e

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/impl/ObjectKlass.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,6 @@ public Attribute getAttribute(Symbol<Name> attrName) {
169169
return getLinkedKlass().getAttribute(attrName);
170170
}
171171

172-
public ObjectKlass(EspressoContext context, LinkedKlass linkedKlass, ObjectKlass superKlass, ObjectKlass[] superInterfaces, StaticObject classLoader) {
173-
this(context, linkedKlass, superKlass, superInterfaces, classLoader, ClassRegistry.ClassDefinitionInfo.EMPTY);
174-
}
175-
176172
public ObjectKlass(EspressoContext context, LinkedKlass linkedKlass, ObjectKlass superKlass, ObjectKlass[] superInterfaces, StaticObject classLoader, ClassRegistry.ClassDefinitionInfo info) {
177173
super(context, linkedKlass.getName(), linkedKlass.getType(), linkedKlass.getFlags(), info.klassID);
178174

espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/nodes/interop/EspressoForeignProxyGenerator.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -89,9 +89,6 @@ public final class EspressoForeignProxyGenerator extends ClassWriter {
8989
private static final String JLR_UNDECLARED_THROWABLE_EX = "java/lang/reflect/UndeclaredThrowableException";
9090
private static final int VARARGS = 0x00000080;
9191

92-
/* name of the superclass of proxy classes */
93-
private static final String superclassName = "java/lang/Object";
94-
9592
private Meta meta;
9693

9794
/* name of proxy class */
@@ -162,7 +159,7 @@ private static String nextClassName() {
162159
*/
163160
private byte[] generateClassFile() {
164161
visit(V1_8, accessFlags, dotToSlash(className), null,
165-
superclassName, typeNames(interfaces));
162+
meta.sun_reflect_MagicAccessorImpl.getNameAsString(), typeNames(interfaces));
166163

167164
// toString is implemented by interop protocol by means of
168165
// toDisplayString and asString
@@ -272,7 +269,7 @@ private void generateConstructor() {
272269
ctor.visitParameter(null, 0);
273270
ctor.visitCode();
274271
ctor.visitVarInsn(ALOAD, 0);
275-
ctor.visitMethodInsn(INVOKESPECIAL, superclassName, "<init>",
272+
ctor.visitMethodInsn(INVOKESPECIAL, meta.sun_reflect_MagicAccessorImpl.getNameAsString(), "<init>",
276273
"()V", false);
277274
ctor.visitInsn(RETURN);
278275

0 commit comments

Comments
 (0)