Skip to content

Commit

Permalink
Merge pull request #18886 from keithc-ca/no_sidecar19
Browse files Browse the repository at this point in the history
Remove JPP flags Sidecar19-SE and Sidecar19-SE-OpenJ9
  • Loading branch information
pshipton authored Feb 5, 2024
2 parents e0d77c6 + 533324f commit c92d583
Show file tree
Hide file tree
Showing 162 changed files with 4,483 additions and 5,611 deletions.
2 changes: 1 addition & 1 deletion jcl/jpp_configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<configuration
label="JAVA11"
outputpath="JAVA11/src"
flags="Sidecar18-SE-OpenJ9,DAA,Sidecar19-SE,Sidecar19-SE-OpenJ9"
flags="Sidecar18-SE-OpenJ9,DAA"
dependencies="SIDECAR18-SE"
jdkcompliance="11">
<classpathentry kind="src" path="src/java.base/share/classes"/>
Expand Down
20 changes: 10 additions & 10 deletions jcl/src/java.base/share/classes/com/ibm/gpu/spi/GPUAssist.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*[INCLUDE-IF Sidecar19-SE]*/
/*[INCLUDE-IF JAVA_SPEC_VERSION >= 9]*/
/*******************************************************************************
* Copyright IBM Corp. and others 2017
*
Expand Down Expand Up @@ -37,7 +37,7 @@ interface Provider {
/**
* Answer a GPUAssist implementation if one is available and enabled
* or null otherwise.
*
*
* @return a GPUAssist implementation or null
*/
GPUAssist getGPUAssist();
Expand Down Expand Up @@ -75,7 +75,7 @@ public boolean trySort(long[] array, int fromIndex, int toIndex) {
* If sort is enabled on the GPU, and the array slice has a reasonable
* size for using a GPU, sort the region of the given array of values
* into ascending order, on the first available device.
*
*
* @param array
* the array that will be sorted
* @param fromIndex
Expand All @@ -85,7 +85,7 @@ public boolean trySort(long[] array, int fromIndex, int toIndex) {
* @return true if the sort was successful, false otherwise
* @throws ArrayIndexOutOfBoundsException
* if fromIndex is negative or toIndex is larger than
* the length of the array
* the length of the array
* @throws IllegalArgumentException if fromIndex &gt; toIndex
*/
boolean trySort(double[] array, int fromIndex, int toIndex);
Expand All @@ -94,7 +94,7 @@ public boolean trySort(long[] array, int fromIndex, int toIndex) {
* If sort is enabled on the GPU, and the array slice has a reasonable
* size for using a GPU, sort the region of the given array of values
* into ascending order, on the first available device.
*
*
* @param array
* the array that will be sorted
* @param fromIndex
Expand All @@ -104,7 +104,7 @@ public boolean trySort(long[] array, int fromIndex, int toIndex) {
* @return true if the sort was successful, false otherwise
* @throws ArrayIndexOutOfBoundsException
* if fromIndex is negative or toIndex is larger than
* the length of the array
* the length of the array
* @throws IllegalArgumentException if fromIndex &gt; toIndex
*/
boolean trySort(float[] array, int fromIndex, int toIndex);
Expand All @@ -113,7 +113,7 @@ public boolean trySort(long[] array, int fromIndex, int toIndex) {
* If sort is enabled on the GPU, and the array slice has a reasonable
* size for using a GPU, sort the region of the given array of values
* into ascending order, on the first available device.
*
*
* @param array
* the array that will be sorted
* @param fromIndex
Expand All @@ -123,7 +123,7 @@ public boolean trySort(long[] array, int fromIndex, int toIndex) {
* @return true if the sort was successful, false otherwise
* @throws ArrayIndexOutOfBoundsException
* if fromIndex is negative or toIndex is larger than
* the length of the array
* the length of the array
* @throws IllegalArgumentException if fromIndex &gt; toIndex
*/
boolean trySort(int[] array, int fromIndex, int toIndex);
Expand All @@ -132,7 +132,7 @@ public boolean trySort(long[] array, int fromIndex, int toIndex) {
* If sort is enabled on the GPU, and the array slice has a reasonable
* size for using a GPU, sort the region of the given array of values
* into ascending order, on the first available device.
*
*
* @param array
* the array that will be sorted
* @param fromIndex
Expand All @@ -142,7 +142,7 @@ public boolean trySort(long[] array, int fromIndex, int toIndex) {
* @return true if the sort was successful, false otherwise
* @throws ArrayIndexOutOfBoundsException
* if fromIndex is negative or toIndex is larger than
* the length of the array
* the length of the array
* @throws IllegalArgumentException if fromIndex &gt; toIndex
*/
boolean trySort(long[] array, int fromIndex, int toIndex);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*[INCLUDE-IF Sidecar19-SE]*/
/*[INCLUDE-IF JAVA_SPEC_VERSION >= 9]*/
/*******************************************************************************
* Copyright IBM Corp. and others 2018
*
Expand Down
81 changes: 40 additions & 41 deletions jcl/src/java.base/share/classes/com/ibm/jit/JITHelpers.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*[INCLUDE-IF Sidecar17]*/

/*[INCLUDE-IF JAVA_SPEC_VERSION >= 8]*/
package com.ibm.jit;

/*******************************************************************************
Expand Down Expand Up @@ -28,15 +27,15 @@
import java.lang.reflect.Field;
import java.lang.reflect.Array;
import com.ibm.oti.vm.VM;
/*[IF Sidecar19-SE]
/*[IF JAVA_SPEC_VERSION >= 9]
import jdk.internal.misc.Unsafe;
import jdk.internal.reflect.Reflection;
import jdk.internal.reflect.CallerSensitive;
/*[ELSE]*/
/*[ELSE] JAVA_SPEC_VERSION >= 9 */
import sun.misc.Unsafe;
import sun.reflect.Reflection;
import sun.reflect.CallerSensitive;
/*[ENDIF]*/
/*[ENDIF] JAVA_SPEC_VERSION >= 9 */

/**
* The <code>JITHelpers</code> class contains methods used by the JIT to optimize certain primitive operations.
Expand Down Expand Up @@ -97,7 +96,7 @@ private static int classIsInterfaceFlag() {

/**
* Java implementation of the native getSuperclass
*
*
* @param clazz
* The class to introspect (must not be null).
* @return The superclass, or null for primitive types, interfaces and java.lang.Object.
Expand Down Expand Up @@ -263,7 +262,7 @@ public boolean toLowerIntrinsicUTF16(char[] value, char[] output, int length) {
* checks for and handles: 1) standard fields in normal objects 2) static fields from classes 3) entries from arrays This sequence is branchy and
* hard for us to optimize. The better solution in cases where we know the type of object is to use case specific accessors which are the methods
* below. Be careful that you know the type of the object you are getting from before using these.
*
*
* NOTE: JIT assumes that obj is non-null and offset is positive - breaking this assumption is just asking for trouble.
*/
public int getIntFromObject(Object obj, long offset) {
Expand Down Expand Up @@ -315,27 +314,27 @@ public void putObjectInObjectVolatile(Object obj, long offset, Object value) {
}

public boolean compareAndSwapIntInObject(Object obj, long offset, int expected, int value) {
/*[IF Sidecar19-SE-OpenJ9]*/
/*[IF JAVA_SPEC_VERSION >= 9]*/
return unsafe.compareAndSetInt(obj, offset, expected, value);
/*[ELSE]
/*[ELSE] JAVA_SPEC_VERSION >= 9 */
return unsafe.compareAndSwapInt(obj, offset, expected, value);
/*[ENDIF]*/
/*[ENDIF] JAVA_SPEC_VERSION >= 9 */
}

public boolean compareAndSwapLongInObject(Object obj, long offset, long expected, long value) {
/*[IF Sidecar19-SE-OpenJ9]*/
/*[IF JAVA_SPEC_VERSION >= 9]*/
return unsafe.compareAndSetLong(obj, offset, expected, value);
/*[ELSE]
/*[ELSE] JAVA_SPEC_VERSION >= 9 */
return unsafe.compareAndSwapLong(obj, offset, expected, value);
/*[ENDIF]*/
/*[ENDIF] JAVA_SPEC_VERSION >= 9 */
}

public boolean compareAndSwapObjectInObject(Object obj, long offset, Object expected, Object value) {
/*[IF Sidecar19-SE-OpenJ9]*/
/*[IF JAVA_SPEC_VERSION >= 9]*/
return unsafe.compareAndSetObject(obj, offset, expected, value);
/*[ELSE]
/*[ELSE] JAVA_SPEC_VERSION >= 9 */
return unsafe.compareAndSwapObject(obj, offset, expected, value);
/*[ENDIF]*/
/*[ENDIF] JAVA_SPEC_VERSION >= 9 */
}

public byte getByteFromArray(Object obj, long offset) {
Expand Down Expand Up @@ -419,27 +418,27 @@ public void putObjectInArrayVolatile(Object obj, long offset, Object value) {
}

public boolean compareAndSwapIntInArray(Object obj, long offset, int expected, int value) {
/*[IF Sidecar19-SE-OpenJ9]*/
/*[IF JAVA_SPEC_VERSION >= 9]*/
return unsafe.compareAndSetInt(obj, offset, expected, value);
/*[ELSE]
/*[ELSE] JAVA_SPEC_VERSION >= 9 */
return unsafe.compareAndSwapInt(obj, offset, expected, value);
/*[ENDIF]*/
/*[ENDIF] JAVA_SPEC_VERSION >= 9 */
}

public boolean compareAndSwapLongInArray(Object obj, long offset, long expected, long value) {
/*[IF Sidecar19-SE-OpenJ9]*/
/*[IF JAVA_SPEC_VERSION >= 9]*/
return unsafe.compareAndSetLong(obj, offset, expected, value);
/*[ELSE]
/*[ELSE] JAVA_SPEC_VERSION >= 9 */
return unsafe.compareAndSwapLong(obj, offset, expected, value);
/*[ENDIF]*/
/*[ENDIF] JAVA_SPEC_VERSION >= 9 */
}

public boolean compareAndSwapObjectInArray(Object obj, long offset, Object expected, Object value) {
/*[IF Sidecar19-SE-OpenJ9]*/
/*[IF JAVA_SPEC_VERSION >= 9]*/
return unsafe.compareAndSetObject(obj, offset, expected, value);
/*[ELSE]
/*[ELSE] JAVA_SPEC_VERSION >= 9 */
return unsafe.compareAndSwapObject(obj, offset, expected, value);
/*[ENDIF]*/
/*[ENDIF] JAVA_SPEC_VERSION >= 9 */
}

public char byteToCharUnsigned(byte b) {
Expand Down Expand Up @@ -504,7 +503,7 @@ public void putByteInArrayByIndex(Object obj, int index, byte value) {

public byte getByteFromArrayByIndex(Object obj, int index) {
Class<?> clazz = obj.getClass();

if (clazz == byte[].class) {
return ((byte[]) obj)[index];
} else if (clazz == char[].class) {
Expand Down Expand Up @@ -579,7 +578,7 @@ public char getCharFromArrayByIndex(Object obj, int index) {
* - 1 <= s2len <= s2Value.length * 2
* - 0 <= start < s1len
* <blockquote><pre>
*
*
* @param s1Value the source character array to search in.
* @param s1len the length (in number of characters) of the source array.
* @param s2Value the target character array to search for.
Expand All @@ -593,7 +592,7 @@ public int intrinsicIndexOfStringLatin1(Object s1Value, int s1len, Object s2Valu

while (true) {
int i = intrinsicIndexOfLatin1(s1Value, (byte)firstChar, start, s1len);

// Handles subCount > count || start >= count
if (i == -1 || s2len + i > s1len) {
return -1;
Expand All @@ -612,7 +611,7 @@ public int intrinsicIndexOfStringLatin1(Object s1Value, int s1len, Object s2Valu
start = i + 1;
}
}

/**
* Returns the first index of the target character array within the source character array starting from the specified
* offset.
Expand All @@ -625,7 +624,7 @@ public int intrinsicIndexOfStringLatin1(Object s1Value, int s1len, Object s2Valu
* - 1 <= s2len <= s2Value.length
* - 0 <= start < s1len
* <blockquote><pre>
*
*
* @param s1Value the source character array to search in.
* @param s1len the length (in number of characters) of the source array.
* @param s2Value the target character array to search for.
Expand All @@ -639,7 +638,7 @@ public int intrinsicIndexOfStringUTF16(Object s1Value, int s1len, Object s2Value

while (true) {
int i = intrinsicIndexOfUTF16(s1Value, firstChar, start, s1len);

// Handles subCount > count || start >= count
if (i == -1 || s2len + i > s1len) {
return -1;
Expand Down Expand Up @@ -668,7 +667,7 @@ public int intrinsicIndexOfStringUTF16(Object s1Value, int s1len, Object s2Value
* - 0 <= offset < length <= array.length * 1 (if array instanceof byte[])
* - 0 <= offset < length <= array.length * 2 (if array instanceof char[])
* <blockquote><pre>
*
*
* @param array the source character array to search in.
* @param ch the character to search for.
* @param offset the starting offset (in number of characters) to search from.
Expand All @@ -694,7 +693,7 @@ public int intrinsicIndexOfLatin1(Object array, byte ch, int offset, int length)
* - 0 <= offset < length <= array.length * 1 (if array instanceof byte[])
* - 0 <= offset < length <= array.length * 2 (if array instanceof char[])
* <blockquote><pre>
*
*
* @param array the source character array to search in.
* @param ch the character to search for.
* @param offset the starting offset (in number of characters) to search from.
Expand Down Expand Up @@ -729,7 +728,7 @@ private static boolean isDescriptorPointerTagged(long descriptorPtr) {

/**
* Called by the JIT on 32bit platforms to copy a source object's contents to a destination object as part of a clone. This is a shallow copy only.
*
*
* @param srcObj
* The object whose fields are to be copied
* @param destObj
Expand Down Expand Up @@ -782,7 +781,7 @@ public final void unsafeObjectShallowCopy32(Object srcObj, Object destObj, int j

/**
* Called by the JIT on 64bit platforms to copy a source object's contents to a destination object as part of a clone. This is a shallow copy only.
*
*
* @param srcObj
* The object whose fields are to be copied
* @param destObj
Expand Down Expand Up @@ -846,7 +845,7 @@ public final void unsafeObjectShallowCopy64(Object srcObj, Object destObj, long

/**
* Java implementation of optimized clone.
*
*
* @param srcObj
* The source object of the clone.
* @return The cloned object.
Expand Down Expand Up @@ -1091,11 +1090,11 @@ public int getInitialLockword(int flags, int reservedCounter, int cancelCounter)
return lwValue;
}

/**
* Determines whether the underlying platform's memory model is big-endian.
*
* @return True if the underlying platform's memory model is big-endian, false otherwise.
*/
/**
* Determines whether the underlying platform's memory model is big-endian.
*
* @return True if the underlying platform's memory model is big-endian, false otherwise.
*/
private native static final boolean isBigEndian();

/* Placeholder for JIT GPU optimizations - this method never actually gets run */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*[INCLUDE-IF Sidecar16]*/
/*[INCLUDE-IF JAVA_SPEC_VERSION >= 8]*/
package com.ibm.oti.reflect;

/*******************************************************************************
Expand Down Expand Up @@ -28,11 +28,11 @@
import java.lang.reflect.Method;
import java.lang.reflect.Field;
import java.lang.reflect.Constructor;
/*[IF Sidecar19-SE]
/*[IF JAVA_SPEC_VERSION >= 9]
import jdk.internal.reflect.ConstantPool;
/*[ELSE]*/
/*[ELSE] JAVA_SPEC_VERSION >= 9 */
import sun.reflect.ConstantPool;
/*[ENDIF]*/
/*[ENDIF] JAVA_SPEC_VERSION >= 9 */
import com.ibm.oti.vm.VM;

public class AnnotationParser {
Expand All @@ -56,26 +56,26 @@ public static Annotation[][] parseParameterAnnotations(Constructor constructor)
public static Annotation[][] parseParameterAnnotations(Method method) {
return parseParameterAnnotations(getParameterAnnotationsData(method), method.getDeclaringClass(), method.getParameterTypes().length);
}

/**
* @param clazz class for which annotations are to be retrieved
* @return annotation attribute bytes, or null if clazz is null.
*/
public static byte[] getAnnotationsData(java.lang.Class clazz) {
byte[] result = null;
byte[] result = null;
if (null != clazz) {
result = getAnnotationsDataImpl(clazz);
}
return result;
};

public static Object parseDefaultValue(Method method) {
byte[] elementValueData = getDefaultValueData(method);
if (elementValueData == null) return null;
ByteBuffer buf = ByteBuffer.wrap(elementValueData);
Class clazz = method.getDeclaringClass();
Object internalConstantPool = VM.getVMLangAccess().getInternalConstantPoolFromClass(clazz);

/* The AnnotationParser boxes primitive return types */
Class returnType = method.getReturnType();
if (returnType.isPrimitive()) {
Expand Down
Loading

0 comments on commit c92d583

Please sign in to comment.