Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for JEP 383 (Java 15): Part 1 #9697

Merged
merged 1 commit into from May 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,7 +1,7 @@
/*[INCLUDE-IF Sidecar18-SE-OpenJ9]*/

/*******************************************************************************
* Copyright (c) 2017, 2017 IBM Corp. and others
* Copyright (c) 2017, 2020 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -62,6 +62,16 @@ LambdaForm.NamedFunction getterFunction(int num) {
throw OpenJDKCompileStub.OpenJDKCompileStubThrowError();
}

/*[IF Java15]*/
final int fieldCount() {
throw OpenJDKCompileStub.OpenJDKCompileStubThrowError();
}

final Object arg(int i) {
throw OpenJDKCompileStub.OpenJDKCompileStubThrowError();
}
/*[ENDIF] Java15 */

class SpeciesData {
MethodHandle constructor() {
throw OpenJDKCompileStub.OpenJDKCompileStubThrowError();
Expand Down
@@ -1,7 +1,7 @@
/*[INCLUDE-IF Sidecar18-SE-OpenJ9]*/

/*******************************************************************************
* Copyright (c) 2017, 2018 IBM Corp. and others
* Copyright (c) 2017, 2020 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand All @@ -21,3 +21,17 @@
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/
/*[IF Java15]*/
package java.lang.invoke;

/*
* Stub class to compile RI j.l.i.MethodHandleImpl
*/

class DirectMethodHandle extends MethodHandle {
DirectMethodHandle(MethodType mt, LambdaForm lf) {
super(mt, lf);
OpenJDKCompileStub.OpenJDKCompileStubThrowError();
}
}
/*[ENDIF] Java15 */
Expand Up @@ -2305,6 +2305,10 @@ public Lookup defineHiddenClass(byte[] bytes, boolean initOption, ClassOption...
return new Lookup(definer.defineClass(initOption), false);
}

Lookup defineHiddenClassWithClassData(byte[] bytes, Object data, ClassOption... classOptions) {
throw OpenJDKCompileStub.OpenJDKCompileStubThrowError();
}

ClassDefiner makeHiddenClassDefiner(String name, byte[] template) {
ClassDefiner definer = new ClassDefiner(name, template, this);
return definer;
Expand Down Expand Up @@ -5389,6 +5393,12 @@ public Object helper(Object[] arguments) throws Throwable {
}
}

/*[IF Java15]*/
static boolean permuteArgumentChecks(int[] arr, MethodType mt1, MethodType mt2) {
throw OpenJDKCompileStub.OpenJDKCompileStubThrowError();
}
/*[ENDIF] Java15 */

/*[IF Sidecar18-SE-OpenJ9]*/
static MethodHandle basicInvoker(MethodType mt) {
throw OpenJDKCompileStub.OpenJDKCompileStubThrowError();
Expand Down
30 changes: 30 additions & 0 deletions jcl/src/java.base/share/classes/java/lang/invoke/VarHandle.java
Expand Up @@ -523,7 +523,11 @@ int getModifiers() {
*
* @return The field type
*/
/*[IF Java15]*/
public Class<?> varType() {
/*[ELSE]*/
public final Class<?> varType() {
/*[ENDIF] Java15 */
return this.fieldType;
}

Expand All @@ -535,7 +539,11 @@ public final Class<?> varType() {
*
* @return The parameters required to access the field.
*/
/*[IF Java15]*/
public List<Class<?>> coordinateTypes() {
/*[ELSE]*/
public final List<Class<?>> coordinateTypes() {
/*[ENDIF] Java15 */
return Collections.unmodifiableList(Arrays.<Class<?>>asList(coordinateTypes));
}

Expand Down Expand Up @@ -730,7 +738,11 @@ public final boolean isAccessModeSupported(AccessMode accessMode) {
* @return A {@link MethodHandle} for the specified {@link AccessMode}, bound to
* this {@link VarHandle} instance.
*/
/*[IF Java15]*/
public MethodHandle toMethodHandle(AccessMode accessMode) {
/*[ELSE]*/
public final MethodHandle toMethodHandle(AccessMode accessMode) {
/*[ENDIF] Java15 */
MethodHandle mh = handleTable[accessMode.ordinal()];

if (mh != null) {
Expand Down Expand Up @@ -1507,5 +1519,23 @@ private ClassDesc getArrayTypeClassDesc() {
}
/*[ENDIF] Java12 */

/*[IF Java15]*/
VarHandle target() {
throw OpenJDKCompileStub.OpenJDKCompileStubThrowError();
}

VarHandle asDirect() {
throw OpenJDKCompileStub.OpenJDKCompileStubThrowError();
}

MethodHandle getMethodHandle(int i) {
throw OpenJDKCompileStub.OpenJDKCompileStubThrowError();
}

boolean isDirect() {
throw OpenJDKCompileStub.OpenJDKCompileStubThrowError();
}
/*[ENDIF] Java15 */

abstract MethodType accessModeTypeUncached(AccessMode accessMode);
}