You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

This page describes the command line for the java compiler the java launcher and HotSpot for the support of value types in the valhalla project.

javac

  • -XDenableValueTypes
    Boolean value, default value is `false`
    Enable direct declaration and compilation of value type classes via the "__ByValue" and other qualifiers.
  • -XDmangleClassInfo
    Boolean value, default value is `false`
    Ensure value type names are distinguishable a reference class names by prepending ";Q" to the value type name.
    Should be used in conjunction with java flag "valhalla.mangleClassInfo".
  • -Xlint:values
    Lint category for warnings associated to bad usage of value capable classes - examples:
    • VCC not final
    • VCC cannot 'extend' another class
    • overrides of 'bad' Object methods (such as wait/notify)
    • illegal modifiers on VCC such as 'synchronized'
    • non-final instance fields in VCC
    • cannot assign 'null' to variable of VCC type

java

  • -Djava.lang.invoke.MethodHandle.DUMP_CLASS_FILES
    Boolean value, default value is `false`
    If true dump class files generated for lambda forms and derived value types into a directory named DUMP_CLASS_FILES under the current directory
  • -Djdk.lang.reflect.DVT
    Boolean value, default value is `false`
    If true, allow reflection on derived value types.  This is a temporary workaround until existing hotspot tests convert to VCC/DVT and use reflection on VCC only.
  • -Dvalhalla.enableValueLambdaForms
    Boolean value, default value is `true`
    If true then lambda forms with value types in their signature will use the Q type __Value and value-type specific byte code will be generated.
  • -Dvalhalla.enablePoolPatches
    Boolean value, default value is `false`
    If true and if "valhalla.enableValueLambdaForms" is true then lambda forms with value types in their signature will generate byte code with constant pool patching where appropriate
  • -Dvalhalla.mangleClassInfo
    Boolean value, default value is `false`
    Ensure value type names are distinguishable a reference class names by prepending ";Q" to the value type name.
    Should be used in conjunction with javac flag "mangleClassInfo".

HotSpot

  • -XX:EnableMVT
    Boolean value, default value is `false`
    If true enable support for minimal value types with a value capable class and an associated derived value type.
  • -XX:EnableValhalla
    Boolean value, default value is `false`
    If true enable support for "valhalla" value types, which in contrast to MVT supports direct value types in conjunction with byte code generation or with the javac flag "enableValueTypes".
  • -XX:ValueTypePassFieldsAsArgs
    Boolean value, default value is `true`
    Pass each value type field as an argument to a method call instead of a value type reference
  • -XX:ValueTypeReturnedAsFields
    Boolean value, default value is `true`
    Return value type fields instead of a value type reference
  • -XX:ValueArrayFlatten
    Boolean value, default value is `true`
    Flatten arrays of values, if possible
  • -XX:ValueArrayElemMaxFlatSize
    Integer value, default is -1
    Max size for flattening an array of values, < 0 means no limit
  • -XX:ValueArrayElemMaxFlatOops
    Integer value, default is 4
    Max number of embedded object references in value type to flatten in an array, < 0 means no limit 
  • -XX:ValueArrayAtomicAccess
    Boolean value, default value is `false`
    Enable atomic access to values in an array

 

To determine if there unwanted allocations (boxing) see the flags:

  -XX:-UseTLAB
  -XX:+PrintEliminateAllocations
  -XX:+PrintEscapeAnalysis

 

  • No labels