Skip to content
Permalink
Browse files
8138732: Rename @HotSpotIntrinsicCandidate to @IntrinsicCandidate and…
… move it to the jdk.internal.vm.annotation package

Reviewed-by: dholmes, alanb, psandoz, kvn, egahlin
  • Loading branch information
marschall authored and Vladimir Kozlov committed Sep 30, 2020
1 parent 4b16f8a commit 2a406f3ce5e200af9909ce051fdeed0cc059fea0
Show file tree
Hide file tree
Showing 64 changed files with 488 additions and 488 deletions.
@@ -25,7 +25,7 @@

package java.lang;

import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;

/** The CharacterData class encapsulates the large tables found in
Java.lang.Character. */
@@ -80,18 +80,18 @@ class CharacterDataLatin1 extends CharacterData {
return props;
}

@HotSpotIntrinsicCandidate
@IntrinsicCandidate
boolean isDigit(int ch) {
return '0' <= ch && ch <= '9';
}

@HotSpotIntrinsicCandidate
@IntrinsicCandidate
boolean isLowerCase(int ch) {
int props = getProperties(ch);
return (props & $$maskType) == Character.LOWERCASE_LETTER;
}

@HotSpotIntrinsicCandidate
@IntrinsicCandidate
boolean isUpperCase(int ch) {
int props = getProperties(ch);
return (props & $$maskType) == Character.UPPERCASE_LETTER;
@@ -232,7 +232,7 @@ class CharacterDataLatin1 extends CharacterData {
return retval;
}

@HotSpotIntrinsicCandidate
@IntrinsicCandidate
boolean isWhitespace(int ch) {
int props = getProperties(ch);
return ((props & $$maskIdentifierInfo) == $$valueJavaWhitespace);
@@ -2258,7 +2258,7 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
// Search for Non-ASCII character (Negative byte value) in a byte array,
// return true if it has any and false otherwise.
// ..\jdk\src\java.base\share\classes\java\lang\StringCoding.java
// @HotSpotIntrinsicCandidate
// @IntrinsicCandidate
// private static boolean hasNegatives(byte[] ba, int off, int len) {
// for (int i = off; i < off + len; i++) {
// if (ba[i] < 0) {
@@ -5133,7 +5133,7 @@ void MacroAssembler::generate_fill(BasicType t, bool aligned,
}

// encode char[] to byte[] in ISO_8859_1
//@HotSpotIntrinsicCandidate
//@IntrinsicCandidate
//private static int implEncodeISOArray(byte[] sa, int sp,
//byte[] da, int dp, int len) {
// int i = 0;
@@ -7510,7 +7510,7 @@ void MacroAssembler::crc32c_ipl_alg2_alt2(Register in_out, Register in1, Registe

// Compress char[] array to byte[].
// ..\jdk\src\java.base\share\classes\java\lang\StringUTF16.java
// @HotSpotIntrinsicCandidate
// @IntrinsicCandidate
// private static int compress(char[] src, int srcOff, byte[] dst, int dstOff, int len) {
// for (int i = 0; i < len; i++) {
// int c = src[srcOff++];
@@ -7726,7 +7726,7 @@ void MacroAssembler::char_array_compress(Register src, Register dst, Register le

// Inflate byte[] array to char[].
// ..\jdk\src\java.base\share\classes\java\lang\StringLatin1.java
// @HotSpotIntrinsicCandidate
// @IntrinsicCandidate
// private static void inflate(byte[] src, int srcOff, char[] dst, int dstOff, int len) {
// for (int i = 0; i < len; i++) {
// dst[dstOff++] = (char)(src[srcOff++] & 0xff);
@@ -1079,7 +1079,7 @@ class AnnotationCollector : public ResourceObj{
_method_InjectedProfile,
_method_LambdaForm_Compiled,
_method_Hidden,
_method_HotSpotIntrinsicCandidate,
_method_IntrinsicCandidate,
_jdk_internal_vm_annotation_Contended,
_field_Stable,
_jdk_internal_vm_annotation_ReservedStackAccess,
@@ -2102,10 +2102,10 @@ AnnotationCollector::annotation_index(const ClassLoaderData* loader_data,
if (!privileged) break; // only allow in privileged code
return _method_Hidden;
}
case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_HotSpotIntrinsicCandidate_signature): {
case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_vm_annotation_IntrinsicCandidate_signature): {
if (_location != _in_method) break; // only allow for methods
if (!privileged) break; // only allow in privileged code
return _method_HotSpotIntrinsicCandidate;
return _method_IntrinsicCandidate;
}
case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_vm_annotation_Stable_signature): {
if (_location != _in_field) break; // only allow for fields
@@ -2159,7 +2159,7 @@ void MethodAnnotationCollector::apply_to(const methodHandle& m) {
m->set_intrinsic_id(vmIntrinsics::_compiledLambdaForm);
if (has_annotation(_method_Hidden))
m->set_hidden(true);
if (has_annotation(_method_HotSpotIntrinsicCandidate) && !m->is_synthetic())
if (has_annotation(_method_IntrinsicCandidate) && !m->is_synthetic())
m->set_intrinsic_candidate(true);
if (has_annotation(_jdk_internal_vm_annotation_ReservedStackAccess))
m->set_has_reserved_stack_access(true);
@@ -5165,22 +5165,22 @@ static void check_methods_for_intrinsics(const InstanceKlass* ik,

if (CheckIntrinsics) {
// Check if an intrinsic is defined for method 'method',
// but the method is not annotated with @HotSpotIntrinsicCandidate.
// but the method is not annotated with @IntrinsicCandidate.
if (method->intrinsic_id() != vmIntrinsics::_none &&
!method->intrinsic_candidate()) {
tty->print("Compiler intrinsic is defined for method [%s], "
"but the method is not annotated with @HotSpotIntrinsicCandidate.%s",
"but the method is not annotated with @IntrinsicCandidate.%s",
method->name_and_sig_as_C_string(),
NOT_DEBUG(" Method will not be inlined.") DEBUG_ONLY(" Exiting.")
);
tty->cr();
DEBUG_ONLY(vm_exit(1));
}
// Check is the method 'method' is annotated with @HotSpotIntrinsicCandidate,
// Check is the method 'method' is annotated with @IntrinsicCandidate,
// but there is no intrinsic available for it.
if (method->intrinsic_candidate() &&
method->intrinsic_id() == vmIntrinsics::_none) {
tty->print("Method [%s] is annotated with @HotSpotIntrinsicCandidate, "
tty->print("Method [%s] is annotated with @IntrinsicCandidate, "
"but no compiler intrinsic is defined for the method.%s",
method->name_and_sig_as_C_string(),
NOT_DEBUG("") DEBUG_ONLY(" Exiting.")
@@ -76,7 +76,7 @@
// in the (Java) source code and the semantics of the method as defined
// by the code in the VM, intrinsic methods must be explicitly marked.
//
// Intrinsic methods are marked by the jdk.internal.HotSpotIntrinsicCandidate
// Intrinsic methods are marked by the jdk.internal.vm.annotation.IntrinsicCandidate
// annotation. If CheckIntrinsics is enabled, the VM performs the following
// checks when a class C is loaded: (1) all intrinsics defined by the VM for
// class C are present in the loaded class file and are marked;
@@ -284,10 +284,10 @@
template(type_annotations_name, "typeAnnotations") \
\
/* Intrinsic Annotation (JDK 9 and above) */ \
template(jdk_internal_HotSpotIntrinsicCandidate_signature, "Ljdk/internal/HotSpotIntrinsicCandidate;") \
template(jdk_internal_vm_annotation_DontInline_signature, "Ljdk/internal/vm/annotation/DontInline;") \
template(jdk_internal_vm_annotation_ForceInline_signature, "Ljdk/internal/vm/annotation/ForceInline;") \
template(jdk_internal_vm_annotation_Hidden_signature, "Ljdk/internal/vm/annotation/Hidden;") \
template(jdk_internal_vm_annotation_IntrinsicCandidate_signature, "Ljdk/internal/vm/annotation/IntrinsicCandidate;") \
template(jdk_internal_vm_annotation_Stable_signature, "Ljdk/internal/vm/annotation/Stable;") \
\
/* Support for JSR 292 & invokedynamic (JDK 1.7 and above) */ \
@@ -2421,10 +2421,10 @@ const intx ObjectAlignmentInBytes = 8;
"When a class C is loaded, check that " \
"(1) all intrinsics defined by the VM for class C are present "\
"in the loaded class file and are marked with the " \
"@HotSpotIntrinsicCandidate annotation, that " \
"@IntrinsicCandidate annotation, that " \
"(2) there is an intrinsic registered for all loaded methods " \
"that are annotated with the @HotSpotIntrinsicCandidate " \
"annotation, and that " \
"that are annotated with the @IntrinsicCandidate annotation, " \
"and that " \
"(3) no orphan methods exist for class C (i.e., methods for " \
"which the VM declares an intrinsic but that are not declared "\
"in the loaded class C. " \
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@
import java.security.MessageDigest;
import java.util.Arrays;

import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;

/**
* Rijndael --pronounced Reindaal-- is a symmetric cipher with a 128-bit
@@ -356,7 +356,7 @@ void encryptBlock(byte[] in, int inOffset,
}

// Encryption operation. Possibly replaced with a compiler intrinsic.
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private void implEncryptBlock(byte[] in, int inOffset,
byte[] out, int outOffset)
{
@@ -435,7 +435,7 @@ void decryptBlock(byte[] in, int inOffset,
}

// Decrypt operation. Possibly replaced with a compiler intrinsic.
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private void implDecryptBlock(byte[] in, int inOffset,
byte[] out, int outOffset)
{
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
import java.security.ProviderException;
import java.util.Objects;

import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import sun.security.util.ArrayUtil;


@@ -153,7 +153,7 @@ int encrypt(byte[] plain, int plainOffset, int plainLen,
cipher, cipherOffset);
}

@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private int implEncrypt(byte[] plain, int plainOffset, int plainLen,
byte[] cipher, int cipherOffset)
{
@@ -203,7 +203,7 @@ int decrypt(byte[] cipher, int cipherOffset, int cipherLen,
return implDecrypt(cipher, cipherOffset, cipherLen, plain, plainOffset);
}

@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private int implDecrypt(byte[] cipher, int cipherOffset, int cipherLen,
byte[] plain, int plainOffset)
{
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@

import java.security.InvalidKeyException;

import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import sun.security.util.ArrayUtil;

/**
@@ -182,7 +182,7 @@ private int crypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
}

// Implementation of crpyt() method. Possibly replaced with a compiler intrinsic.
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private int implCrypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
int result = len;
while (len-- > 0) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
import java.security.ProviderException;
import sun.security.util.ArrayUtil;
import java.util.Objects;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;

/**
* This class represents ciphers in electronic codebook (ECB) mode.
@@ -97,7 +97,7 @@ void init(boolean decrypting, String algorithm, byte[] key, byte[] iv)
embeddedCipher.init(decrypting, algorithm, key);
}

@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private int implECBEncrypt(byte [] in, int inOff, int len, byte[] out, int outOff) {
for (int i = len; i >= blockSize; i -= blockSize) {
embeddedCipher.encryptBlock(in, inOff, out, outOff);
@@ -131,7 +131,7 @@ int encrypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
return implECBEncrypt(in, inOff, len, out, outOff);
}

@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private int implECBDecrypt(byte [] in, int inOff, int len, byte[] out, int outOff) {
for (int i = len; i >= blockSize; i -= blockSize) {
embeddedCipher.decryptBlock(in, inOff, out, outOff);
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -31,7 +31,7 @@

import java.security.ProviderException;

import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;

/**
* This class represents the GHASH function defined in NIST 800-38D
@@ -229,7 +229,7 @@ private static void ghashRangeCheck(byte[] in, int inOfs, int inLen, long[] st,
* the hotspot signature. This method and methods called by it, cannot
* throw exceptions or allocate arrays as it will breaking intrinsics
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static void processBlocks(byte[] data, int inOfs, int blocks, long[] st, long[] subH) {
int offset = inOfs;
while (blocks > 0) {
@@ -25,7 +25,7 @@

package java.lang;

import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;

import java.lang.constant.Constable;
import java.lang.constant.ConstantDesc;
@@ -148,7 +148,7 @@ public static boolean parseBoolean(String s) {
*
* @return the primitive {@code boolean} value of this object.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public boolean booleanValue() {
return value;
}
@@ -167,7 +167,7 @@ public boolean booleanValue() {
* @return a {@code Boolean} instance representing {@code b}.
* @since 1.4
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static Boolean valueOf(boolean b) {
return (b ? TRUE : FALSE);
}
@@ -25,8 +25,8 @@

package java.lang;

import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.misc.CDS;
import jdk.internal.vm.annotation.IntrinsicCandidate;

import java.lang.constant.Constable;
import java.lang.constant.DynamicConstantDesc;
@@ -134,7 +134,7 @@ private ByteCache() {}
* @return a {@code Byte} instance representing {@code b}.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static Byte valueOf(byte b) {
final int offset = 128;
return ByteCache.cache[(int)b + offset];
@@ -369,7 +369,7 @@ public Byte(String s) throws NumberFormatException {
* Returns the value of this {@code Byte} as a
* {@code byte}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public byte byteValue() {
return value;
}

1 comment on commit 2a406f3

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 2a406f3 Sep 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Issues

Please sign in to comment.