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 jvm_static_field_is command for specifying static fields in JVM. #981

Merged
merged 5 commits into from
Jan 12, 2021

Conversation

brianhuffman
Copy link
Contributor

@brianhuffman brianhuffman commented Dec 16, 2020

Fixes #908.

This PR also includes a crucible submodule update that fixes #925.

The crucible submodule update was included with #992.

@brianhuffman brianhuffman requested a review from atomb December 16, 2020 10:09
@brianhuffman
Copy link
Contributor Author

As currently implemented, the jvm_static_field_is statement takes a JavaClass value (obtained from java_load_class) and a String field name as its arguments. But perhaps it would be more convenient (and also more consistent with other JVMSetup commands) to just take a single String that can optionally include a class name qualifier. @atomb, what do you think?

@atomb
Copy link
Contributor

atomb commented Dec 16, 2020

I'd be inclined to implement the version that allows an arbitrary class name + field name string, partly because we may not otherwise have any other reason to load the class containing the static field. I think it might also be worth fixing the bug in crucible-jvm that causes one of the tests to fail. And so this can probably wait until after we release 0.7.

@brianhuffman
Copy link
Contributor Author

Ok, then I think I'll mark this PR as a draft until I implement the qualified-name syntax for jvm_static_field_is.

@brianhuffman brianhuffman marked this pull request as draft December 16, 2020 19:54
@brianhuffman brianhuffman marked this pull request as ready for review January 12, 2021 04:25
Copy link
Contributor

@atomb atomb left a comment

Choose a reason for hiding this comment

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

This looks good. Thanks!

@brianhuffman
Copy link
Contributor Author

The ubuntu tests are failing in the install_system_deps phase.

Brian Huffman added 5 commits January 12, 2021 13:21
This makes it possible to verify JVM specs that specify initial
values of static fields; previously the static initializers would
always run upon the first field access and overwrite the assumed
initial values.

Eventually the addition of explicit JVMSetup commands for class
initialization status preconditions will make this unnecessary (#916).
By default, the command refers to static fields in the same class
as the method that the spec is for. Static fields in other classes
can be specified using a qualified name like "C.x".
This fixes a previously-broken example in test_jvm_static_fields.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants