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

Changes to crucible-jvm field operations #589

Merged
merged 5 commits into from
Dec 16, 2020
Merged

Changes to crucible-jvm field operations #589

merged 5 commits into from
Dec 16, 2020

Conversation

brianhuffman
Copy link
Contributor

This PR includes a few changes to the APIs for loading and storing of instance fields and static fields:

  • Simplify key type on staticFields map of JVMContext.
  • doFieldLoad and doFieldStore now take a FieldId instead of a string
  • Add functions doStaticFieldStore and doStaticFieldLoad
  • Add field name to error messages for getfield and getstatic

Brian Huffman added 4 commits December 3, 2020 15:30
The `FieldId` type already contains a `ClassName`; we don't
need to have a separate `ClassName` as part of the map key.
Previously the field name was specified with only a string, which
was used directly as a key to the internal map. This required users
to know the correct string format, which must agree with the one
specified in `fieldIdText`. Now those internal details are no longer
user-visible.
These are variants of the `putstatic` and `getstatic` instructions
that can be run in the `IO` monad; they are intended to be used
to set up memory states and implement overrides in saw-script, for
example.
Copy link
Contributor

@robdockins robdockins left a comment

Choose a reason for hiding this comment

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

Looks OK to me.

crucible-jvm/src/Lang/Crucible/JVM/Simulate.hs Outdated Show resolved Hide resolved
@brianhuffman brianhuffman merged commit 54bb819 into master Dec 16, 2020
brianhuffman pushed a commit to GaloisInc/saw-script that referenced this pull request Dec 16, 2020
This patch includes PR GaloisInc/crucible#589.

Functions `doFieldStore` and `doFieldLoad` now take a `FieldId`
instead of just a `String`.
brianhuffman pushed a commit to GaloisInc/saw-script that referenced this pull request Jan 7, 2021
This patch includes PR GaloisInc/crucible#589.

Functions `doFieldStore` and `doFieldLoad` now take a `FieldId`
instead of just a `String`.
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.

None yet

2 participants