restriction

fun restriction(type: A_Type, constantOrNull: A_BasicObject?, givenExcludedTypes: Set<A_Type> = emptySet(), givenExcludedValues: Set<A_BasicObject> = emptySet(), possibleVariants: Set<ObjectLayoutVariant>? = null, excludedVariants: Set<ObjectLayoutVariant>? = null, possibleTypeVariants: Set<ObjectLayoutVariant>? = null, excludedTypeVariants: Set<ObjectLayoutVariant>? = null, isImmutable: Boolean = false, isBoxed: Boolean = true, isUnboxedInt: Boolean = false, isUnboxedFloat: Boolean = false): TypeRestriction

Create or reuse an immutable TypeRestriction, canonicalizing the arguments.

Return

The new or existing canonical TypeRestriction.

Parameters

type

The Avail type that constrains some value somewhere.

constantOrNull

Either null or the exact value that some value somewhere must equal.

givenExcludedTypes

A set of A_Types to consider excluded.

givenExcludedValues

A set of values to consider excluded.

possibleVariants

Either the set of all ObjectLayoutVariants that objects with this restriction may have, or nil if unknown. This must not be populated if excludedVariants is also populated.

excludedVariants

Either the set of all ObjectLayoutVariants that objects with this restriction definitely do not have, or nil if unknown. This must not be populated if possibleVariants is also populated.

possibleTypeVariants

Either the set of all ObjectLayoutVariants that object types with this restriction may have, or nil if unknown. This must not be populated if excludedTypeVariants is also populated.

excludedTypeVariants

Either the set of all ObjectLayoutVariants that object types with this restriction definitely do not have, or nil if unknown. This must not be populated if possibleTypeVariants is also populated.

isImmutable

Whether the value is known to be immutable.

isBoxed

Whether this value is known to already reside in an L2BoxedRegister.

isUnboxedInt

Whether this value is known to already reside in an L2IntRegister.

isUnboxedFloat

Whether this value is known to already reside in an L2FloatRegister.


fun restriction(type: A_Type, constantOrNull: A_BasicObject?, givenExcludedTypes: Set<A_Type>, givenExcludedValues: Set<A_BasicObject>, possibleVariants: Set<ObjectLayoutVariant>?, excludedVariants: Set<ObjectLayoutVariant>?, possibleTypeVariants: Set<ObjectLayoutVariant>?, excludedTypeVariants: Set<ObjectLayoutVariant>?, flags: Int): TypeRestriction

Create or reuse an immutable TypeRestriction, canonicalizing the arguments.

Return

The new or existing canonical TypeRestriction.

Parameters

type

The Avail type that constrains some value somewhere.

constantOrNull

Either null or the exact value that some value somewhere must equal.

givenExcludedTypes

A set of A_Types to consider excluded.

givenExcludedValues

A set of values to consider excluded.

possibleVariants

Either the set of all ObjectLayoutVariants that objects with this restriction may have, or nil if unknown. This must not be populated if excludedVariants is also populated.

excludedVariants

Either the set of all ObjectLayoutVariants that objects with this restriction definitely do not have, or nil if unknown. This must not be populated if possibleVariants is also populated.

possibleTypeVariants

Either the set of all ObjectLayoutVariants that object types with this restriction may have, or nil if unknown. This must not be populated if excludedTypeVariants is also populated.

excludedTypeVariants

Either the set of all ObjectLayoutVariants that object types with this restriction definitely do not have, or nil if unknown. This must not be populated if possibleTypeVariants is also populated.

flags

The encoded flags.