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

Enable JITInlineFieldwatch when option specified #4253

Merged
merged 1 commit into from
Jan 14, 2019

Conversation

cathyzhyi
Copy link
Contributor

This change enables JIT inlined field watch on X86 when
-XX:+JITInlineWatches is specified in the Java command line.

Signed-off-by: Yi Zhang yizhang@ca.ibm.com

This change enables JIT inlined field watch on X86 when
-XX:+JITInlineWatches is specified in the Java command line.

Signed-off-by: Yi Zhang <yizhang@ca.ibm.com>
#if !defined(TR_HOST_X86)
//The bit is set when -XX:+JITInlineWatches is specified
if (J9_ARE_ANY_BITS_SET(javaVM->extendedRuntimeFlags, J9_EXTENDED_RUNTIME_JIT_INLINE_WATCHES))
TR_ASSERT_FATAL(false, "this platform doesn't support JIT inline field watch");
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure a fatal assert and crash is the right thing to do - isn't there a more graceful way to fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a new option for users to experiment with and will not be publicized so It's probably better to keep the assertion here and let it fail fast in our testing environment.

@cathyzhyi
Copy link
Contributor Author

@gacholio Currently we assert on platforms not supporting field watch and it's better if we can fall back to old field watch without crashing. Is there a place in VM we can do that?

@gacholio
Copy link
Contributor

If we had a build flag in the spec, we could do it. I'm not sure it's worth the effort, as I don't plan to publicize the option to enable field watch (once it's working on all platforms, we'll remove the old code).

@DanHeidinga Any thoughts? I'm fine with the assertion in the short term.

@DanHeidinga
Copy link
Member

I'm on board with failing to start the JVM if an invalid option is specified. An assert feels like a strange way to do that. Isn't there an existing way in the JIT to fail to start due to invalid options?

Also, -XX:+ options always have a -XX:- version as well to allow disabling the option.

Thinking about this further, we should only check for the -XX:[+-]JITInlineWatches option on platforms that support it. Unrecognized -XX options are ignored.

@gacholio
Copy link
Contributor

We can do that (though the options are soon not going to be ignored, iirc). Better that we fail early with a vaguely useful message than assert.

@DanHeidinga
Copy link
Member

I misread this PR. It's not adding the option, only testing the result.

In that case, asserting is fine as we should never enable the bit on a platform that doesn't support the option.

@gacholio
Copy link
Contributor

@cathyzhyi If you remove your check and assert, you can add #if defined(J9VM_ARCH_X86) here:

https://github.com/eclipse/openj9/blob/ffbffce5ca61db3c775b19f37ee3e11a55c6d5eb/runtime/vm/jvminit.c#L2977-L2980

@gacholio
Copy link
Contributor

For performance testing, asserting is better than silently ignoring the option.

@gacholio
Copy link
Contributor

Looks like the final decision is to leave the assert the way it is.

@andrewcraik
Copy link
Contributor

ok so I'm fine with leaving the assert in the IT given the comments above

@andrewcraik
Copy link
Contributor

Jenkins test sanity xlinux,win,plinux jdk8

@gacholio gacholio merged commit 184f00e into eclipse-openj9:master Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants