Proposal: #FixClassFileFormat

mark.reinhold at oracle.com mark.reinhold at oracle.com
Wed Jul 6 14:49:17 UTC 2016


2016/7/1 13:20:25 -0700, Remi Forax <forax at univ-mlv.fr>:
> ...
> 
> and i've forgotten a third issue, ACC_MODULE is specified as 0x8000,
> 0x8000 is very special value because it's the only one that left which
> is available on class, method and field.  Historically, in the first
> specs, "module" was a modifier like public or private thus using the
> same value for all the elements was making sense, but now ACC_MODULE
> can only applied on class so using a value available on all the
> elements make less sense, the value 0x8000 should be free in order to
> be used later.  The possible value for ACC_MODULE are: 0x0008
> (ACC_STATIC), 0x0040 (ACC_VOLATILE or ACC_BRIDGE), 0x0080 (ACC_VARARGS
> or ACC_TRANSIENT), 0x0100 (ACC_NATIVE), 0x0800 (ACC_STRICT).  So
> either, 0x0040 or 0x0080 are the best candidate because the other
> values are only valid either on field or on method but not on
> both. And now, because 0x0080 is a permutation of 0x8000 in term of
> characters , i think 0x0040 is the best value for ACC_MODULE.
> 
> Changing the value of ACC_MODULE is interesting if it's done at the
> same time as the other changes because the compiler and the VM can
> easily detect and reject the classfile encoded with what will become
> an old format.

I'll enter this in the issue list as:

  #ClassFileAccModule_ --- The `ACC_MODULE` constant is currently
  specified to have the value `0x8000`.  This is the last available bit
  remaining across all of the various `access_flags` fields of a class
  file, and thus should be reserved for some unspecified future purpose
  where it may be useful to use the same value in all such fields.
  Alternative candidates for `ACC_MODULE` include `0x0040` (overlaps
  with `ACC_VOLATILE` and `ACC_BRIDGE`) and `0x0080` (`ACC_TRANSIENT`
  and `ACC_VARARGS`).

- Mark


More information about the jpms-spec-experts mailing list