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

Add constant dynamic unit tests #2870

Merged
merged 2 commits into from
Sep 15, 2018
Merged

Conversation

r30shah
Copy link
Contributor

@r30shah r30shah commented Sep 14, 2018

Add Java 11 tests for Constant Dynamic mainly involves String object, NULL object and Primitive data types objects. Variation covers running this test in interpreted mode as well as specific JIT compilation modes which checks out JIT's handling of resolved and unresolved Constant Dynamic cases.

Signed-off-by: Rahil Shah rahil@ca.ibm.com

@r30shah
Copy link
Contributor Author

r30shah commented Sep 14, 2018

@yanluo7 @fjeremic These are the tests for Constant Dynamic which includes Testing following primitive data types

  1. Int
  2. Float
  3. Double
  4. Long
    It also tests Null and String Objects.
    @smlambert Can I get a review from Testing team as well? Especially for second commit
    ASM generator that we usually got is from release branch which did not have support for Constant Dynamic. So I changed to to get from Snapshots which I am not sure is fine or not.

Copy link
Member

@DanHeidinga DanHeidinga left a comment

Choose a reason for hiding this comment

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

Thanks for writing these tests!

<test>
<testCaseName>CondyPrimitive</testCaseName>
<variations>
<variation>'-Xint'</variation>
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need an -Xint variation as it tends to be slow to run. A no options variant will typically result in the interpreter executing the test methods which should be sufficient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to NoOptions in 2d8f421

<variations>
<variation>'-Xint'</variation>
<variation>'-Xjit:count=1,disableAsyncCompilation'</variation>
<variation>'-Xjit:count=0,disableAsyncCompilation'</variation>
Copy link
Member

Choose a reason for hiding this comment

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

Is this to force runtime resolves? Should it also include the rtResolve options to force the jit to always take the resolve path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to -Xjit:count=1,disableAsyncCompilation,rtResolve in 2d8f421

test/functional/Java11andUp/playlist.xml Outdated Show resolved Hide resolved

public static int bootstrap_constant_int(MethodHandles.Lookup l, String name, Class<?> c, int v) {
return v;
}
Copy link
Member

Choose a reason for hiding this comment

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

Formatting - the methods should be indented like:

public class BootstrapMethods {
	public static Object bootstrap_constant_string(MethodHandles.Lookup l, String name, Class<?> c, String s) {
		return s;
	}
}

@@ -66,9 +66,9 @@
# Define a a hash for each dependent jar
# Contents in the hash should be: url => , fname =>, sha1 =>
my %asm_all = (
url => 'http://central.maven.org/maven2/org/ow2/asm/asm-all/6.0_BETA/asm-all-6.0_BETA.jar',
url => 'https://repository.ow2.org/nexus/content/repositories/snapshots/org/ow2/asm/asm/7.0-beta-SNAPSHOT/asm-7.0-beta-20180911.182645-11.jar',
Copy link
Contributor

Choose a reason for hiding this comment

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

@smlambert @llxia we had to upgrade ASM to a newer level for the condy bytecode support. I'm just verifying this change is ok from the test perspective. Please let us know. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @fjeremic - didn't know you were picking this up, and @tajila and I were just discussing adding this yesterday. It is what is required, and thanks for adding it. I will presume that PR builds should verify that this necessary upgrade does not affect the other tests that rely on asm.

Copy link
Contributor

@llxia llxia Sep 14, 2018

Choose a reason for hiding this comment

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

LGTM.

@fjeremic fjeremic changed the title WIP: Condy test WIP: Add constant dynamic unit tests Sep 14, 2018
@fjeremic fjeremic self-assigned this Sep 14, 2018
@fjeremic
Copy link
Contributor

I'll wait until @DanHeidinga gives an approval before launching builds for this just in case you may have additional comments on the change.

Copy link
Member

@DanHeidinga DanHeidinga left a comment

Choose a reason for hiding this comment

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

lgtm

@r30shah
Copy link
Contributor Author

r30shah commented Sep 14, 2018

Let me squash the commits. I will keep grabbing latest ASM change in separate Commit

@fjeremic
Copy link
Contributor

Jenkins test sanity xlinux,plinux,zlinux JDK8,JDK11

@r30shah r30shah changed the title WIP: Add constant dynamic unit tests Add constant dynamic unit tests Sep 14, 2018
@r30shah
Copy link
Contributor Author

r30shah commented Sep 14, 2018

It seems like we need asm-all (Failures corresponds to misssing components like asm/tree/*
Which are present in released version of asm-all.jar which seems to combine all components of asm in single jar.
Trying to find out similar asm-all.jar for 7.0 snapshots.

Add Java 11 tests for Constant Dynamic mainly involves
String object, NULL object and Primitive data types
objects. Variation covers running this test in interpreted mode
as well as specific JIT compilation modes which checks out
JIT's handling of resolved and unresolved Constant Dynamic cases.

Signed-off-by: Rahil Shah <rahil@ca.ibm.com>
For released asm version we get asm-all.jar which combines all asm
components in single jar. To test ConstantDynamic helper methods
are only available in 7.0 version of asm which is not released yet.
This commit grabs asm-7.0 as well which contains necessary classes
to generate tests for Constant Dynamic

Signed-off-by: Rahil Shah <rahil@ca.ibm.com>
@r30shah
Copy link
Contributor Author

r30shah commented Sep 14, 2018

@fjeremic @llxia I made a change, specifically with getting asm commit. Now we will have two asm jars,
One asm-all.jar required by all tests and another asm-7.0.jar needed for Java 11 tests. This is temporary change , as expecting to have all combined jar available for 7.0 version once released. Made corresponding changes Java11andUp/build.xml as well.

@fjeremic
Copy link
Contributor

@fjeremic @llxia I made a change, specifically with getting asm commit. Now we will have two asm jars,
One asm-all.jar required by all tests and another asm-7.0.jar needed for Java 11 tests. This is temporary change , as expecting to have all combined jar available for 7.0 version once released. Made corresponding changes Java11andUp/build.xml as well.

@llxia I'm not sure how the test team is tracking all the work but can you open up an Issue somewhere to remember to clean this up once 7.0 is released?

@fjeremic
Copy link
Contributor

Jenkins test sanity xlinux,plinux,zlinux JDK8,JDK11

@fjeremic
Copy link
Contributor

JDK11 failures due to #2708. This was way before we merged any of the JIT changes in this area so it cannot be related to this change.

@fjeremic fjeremic merged commit c26bbd5 into eclipse-openj9:master Sep 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants