8238358: Implementation of JEP 371: Hidden Classes

Co-authored-by: Lois Foltan <lois.foltan@oracle.com>
Co-authored-by: David Holmes <david.holmes@oracle.com>
Co-authored-by: Harold Seigel <harold.seigel@oracle.com>
Co-authored-by: Serguei Spitsyn <serguei.spitsyn@oracle.com>
Co-authored-by: Alex Buckley <alex.buckley@oracle.com>
Co-authored-by: Jamsheed Mohammed C M <jamsheed.c.m@oracle.com>
Co-authored-by: Jan Lahoda <jan.lahoda@oracle.com>
Co-authored-by: Amy Lu <amy.lu@oracle.com>
Reviewed-by: alanb, cjplummer, coleenp, dholmes, dlong, forax, jlahoda, psandoz, plevart, sspitsyn, vromero
This commit is contained in:
Mandy Chung 2020-04-21 06:55:38 -07:00
parent 642041adbc
commit 7cc1371059
198 changed files with 9526 additions and 1575 deletions

View file

@ -1115,6 +1115,29 @@ public abstract class ClassLoader {
int off, int len, ProtectionDomain pd,
String source);
/**
* Defines a class of the given flags via Lookup.defineClass.
*
* @param loader the defining loader
* @param lookup nest host of the Class to be defined
* @param name the binary name or {@code null} if not findable
* @param b class bytes
* @param off the start offset in {@code b} of the class bytes
* @param len the length of the class bytes
* @param pd protection domain
* @param initialize initialize the class
* @param flags flags
* @param classData class data
*/
static native Class<?> defineClass0(ClassLoader loader,
Class<?> lookup,
String name,
byte[] b, int off, int len,
ProtectionDomain pd,
boolean initialize,
int flags,
Object classData);
// true if the name is null or has the potential to be a valid binary name
private boolean checkName(String name) {
if ((name == null) || (name.isEmpty()))