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

jdknext build problems String.getBytes() #11312

Closed
pshipton opened this issue Dec 1, 2020 · 10 comments · Fixed by #11322
Closed

jdknext build problems String.getBytes() #11312

pshipton opened this issue Dec 1, 2020 · 10 comments · Fixed by #11322

Comments

@pshipton
Copy link
Member

pshipton commented Dec 1, 2020

https://ci.eclipse.org/openj9/job/Pipeline-OpenJDK-Acceptance/390/

ang/AbstractStringBuilder.java:1720: error: no suitable method found for getBytes(byte[],int,int,byte,int)
[2020-12-01T05:27:31.916Z]         str.getBytes(value, off, index, coder, end);
[2020-12-01T05:27:31.916Z]            ^
[2020-12-01T05:27:31.916Z]     method String.getBytes(byte[],int,byte) is not applicable
[2020-12-01T05:27:31.916Z]       (actual and formal argument lists differ in length)
[2020-12-01T05:27:31.916Z]     method String.getBytes() is not applicable
[2020-12-01T05:27:31.916Z]       (actual and formal argument lists differ in length)
[2020-12-01T05:27:31.916Z]     method String.getBytes(int,int,byte[],int) is not applicable
[2020-12-01T05:27:31.916Z]       (actual and formal argument lists differ in length)
[2020-12-01T05:27:31.916Z]     method String.getBytes(String) is not applicable
[2020-12-01T05:27:31.916Z]       (actual and formal argument lists differ in length)
[2020-12-01T05:27:31.916Z]     method String.getBytes(Charset) is not applicable
[2020-12-01T05:27:31.916Z]       (actual and formal argument lists differ in length)
[2020-12-01T05:27:31.916Z] /home/jenkins/workspace/Build_JDKnext_ppc64_aix_OpenJDK/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java:406: error: method defineHiddenClassWithClassData in class Lookup cannot be applied to given types;
[2020-12-01T05:27:31.916Z]                 lookup = caller.defineHiddenClassWithClassData(classBytes, implMethod, !disableEagerInitialization,
[2020-12-01T05:27:31.916Z]                                ^
[2020-12-01T05:27:31.916Z]   required: byte[],Object,ClassOption[]
[2020-12-01T05:27:31.916Z]   found:    byte[],MethodHandle,boolean,ClassOption,ClassOption
[2020-12-01T05:27:31.916Z]   reason: varargs mismatch; boolean cannot be converted to ClassOption
[2020-12-01T05:27:31.916Z] /home/jenkins/workspace/Build_JDKnext_ppc64_aix_OpenJDK/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java:42: error: cannot find symbol
[2020-12-01T05:27:31.916Z]     private static final int ORIGINAL_ALLOWED = java.lang.invoke.MethodHandles.Lookup.ORIGINAL;
[2020-12-01T05:27:31.916Z]                                                                                      ^
[2020-12-01T05:27:31.916Z]   symbol:   variable ORIGINAL
[2020-12-01T05:27:31.916Z]   location: class Lookup
@pshipton
Copy link
Member Author

pshipton commented Dec 1, 2020

@JasonFengJ9 @tajila @babsingh fyi

I'll disable the jdknext acceptance until resolved.

@tajila
Copy link
Contributor

tajila commented Dec 1, 2020

@hangshao0 Can you take a look at this. It looks like the signature for public Lookup defineHiddenClassWithClassData(byte[] bytes, Object classData, boolean initialize, ClassOption... options) has changed.

@babsingh
Copy link
Contributor

babsingh commented Dec 1, 2020

New defineHiddenClassWithClassData for JDK16: it is changed to a public method; and the initOption is supplied by the caller instead of it being always true.

public Lookup defineHiddenClassWithClassData(byte[] bytes, Object classData, boolean initOption, ClassOption... classOptions) throws IllegalAccessException {
	ClassDefiner definer = classDefiner(bytes, classOptions);
	return new Lookup(definer.defineClass(initOption, classData));
}

@babsingh
Copy link
Contributor

babsingh commented Dec 1, 2020

New String.getBytes for JDK16:

void getBytes(byte[] bytes, int srcIndex, int destIndex, byte coder, int length) {
	// Check if the String is compressed
	if (enableCompression && (null == compressionFlag || this.coder == LATIN1)) {
		if (String.LATIN1 == coder) {
			compressedArrayCopy(value, srcIndex, bytes, destIndex, length);
		} else {
			decompress(value, srcIndex, bytes, destIndex, length);
		}
	} else {
		decompressedArrayCopy(value, srcIndex, bytes, destIndex, length);
	}
}

@tajila
Copy link
Contributor

tajila commented Dec 1, 2020

There are some other changes to Lookup regarding hidden classes, I've opened an issue to track it, #11321.

@babsingh
Copy link
Contributor

babsingh commented Dec 1, 2020

New Lookup.ORIGINAL field for JDK16: it has the same value as INTERNAL_PRIVILEGED. Since INTERNAL_PRIVILEGED is J9 specific, we will have to give it a different value.

public static final int ORIGINAL = 0x40;

static final int INTERNAL_PRIVILEGED = 0x80;

@tajila tajila changed the title jdknext build problems String.getBytes(), Lookup.defineHiddenClassWithClassData(), Lookup.ORIGINAL jdknext build problems String.getBytes() Dec 1, 2020
@tajila
Copy link
Contributor

tajila commented Dec 1, 2020

This PR can track the string changes

@babsingh
Copy link
Contributor

babsingh commented Dec 1, 2020

@tajila
Copy link
Contributor

tajila commented Dec 1, 2020

@babsingh Can you open a PR for the String changes

@babsingh
Copy link
Contributor

babsingh commented Dec 1, 2020

Can you open a PR for the String changes

I will open a PR for all three changes since all are standalone changes, and they will need to be in one PR to test successful JDK16 compilation.

babsingh added a commit to babsingh/openj9 that referenced this issue Dec 2, 2020
Related: eclipse-openj9#11312

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
babsingh added a commit to babsingh/openj9 that referenced this issue Dec 2, 2020
The new Lookup.ORIGINAL field (= 0x40) conflicts with
Lookup.INTERNAL_PRIVILEGED. Since INTERNAL_PRIVILEGED is J9 specific, it
is given a different value (= 0x80).

In JDK16, defineHiddenClassWithClassData has changed to a public method;
and the initOption is supplied by the caller instead of it always being
true.

Related:
eclipse-openj9#11312
eclipse-openj9#11321

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants