mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8338532: Speed up the ClassFile API MethodTypeDesc#ofDescriptor
Reviewed-by: redestad, liach
This commit is contained in:
parent
918cf11454
commit
3aeb6733f9
11 changed files with 201 additions and 110 deletions
|
@ -304,21 +304,6 @@ public enum Wrapper {
|
|||
throw newIllegalArgumentException("not primitive: " + type);
|
||||
}
|
||||
|
||||
/** Return the wrapper that corresponds to the provided basic type char.
|
||||
* The basic type char must be for one of the eight primitive types, or void.
|
||||
* @throws IllegalArgumentException for unexpected types
|
||||
*/
|
||||
public static Wrapper forPrimitiveType(char basicTypeChar) {
|
||||
Wrapper w = FROM_CHAR[(basicTypeChar + (basicTypeChar >> 1)) & 0xf];
|
||||
if (w == null || w.basicTypeChar != basicTypeChar) {
|
||||
throw basicTypeError(basicTypeChar);
|
||||
}
|
||||
if (w == OBJECT) {
|
||||
throw newIllegalArgumentException("not primitive: " + basicTypeChar);
|
||||
}
|
||||
return w;
|
||||
}
|
||||
|
||||
/** Return the wrapper that wraps values into the given wrapper type.
|
||||
* If it is {@code Object}, return {@code OBJECT}.
|
||||
* Otherwise, it must be a wrapper type.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue