[Rev 01] RFR: 8238549: Add explicit cast to correct implementation type in VarHandle implementation methods

Maurizio Cimadamore mcimadamore at openjdk.java.net
Thu Feb 6 12:18:45 UTC 2020


> Hi,
> as promised, I took a look into adding a bit more structure under our var handle implementations - more specifically, I've tweaked the signatures of the various implementation methods to take a plain VarHandle instead of a var handle implementation class.
> 
> This was tedious, but ultimately easy to do. Since, to do this in a complete way I also had to touch regular var handles (e.g. non-memory access ones), it seemed like a good idea to take an existing var handle test (VarHandleTestMethodTypeXYZ) and tweak it so that it tests all combinations of (adpated=yes/no, guards=yes/no). This revealed several issues in the adapter logic:
> 
> * first, varType() and coordinates() triggered a resolution of some of the underlying MH attached to the indirect handle - since this can fail with UOE, these methods could also fail spuriously with UOE which is wrong
> 
> * second, accessModeTypeUncached, in addition to the aforementioned problem, also had an issue in that it didn't make correct use of the direct handle target
> 
> * third, I realized that I did not update the lambda forms for var handle invokers to also call VarHandle::asDirect - this was causing issues when calling an adapted handle through the invoker
> 
> With these changes, all tests pass despite the extra layers of adaptation. So, in the end it turned out to be a fruitful bug hunt (thanks for the hint Paul!).
> 
> Cheers
> Maurizio

The pull request has been updated with 1 additional commit.

-------------

Added commits:
 - cf326fa3: Remove redundant cast

Changes:
  - all: https://git.openjdk.java.net/panama-foreign/pull/6/files
  - new: https://git.openjdk.java.net/panama-foreign/pull/6/files/066559b2..cf326fa3

Webrevs:
 - full: https://webrevs.openjdk.java.net/panama-foreign/6/webrev.01
 - incr: https://webrevs.openjdk.java.net/panama-foreign/6/webrev.00-01

  Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/6.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/6/head:pull/6

PR: https://git.openjdk.java.net/panama-foreign/pull/6


More information about the panama-dev mailing list