public abstract class FastThreadLocal extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BYTE_OFFSET
Useful value for
FastThreadLocal.setMaxOffset(int): The thread local variable has an offset that can be
expressed as a signed 8-bit value. |
static int |
FIRST_CACHE_LINE
Useful value for
FastThreadLocal.setMaxOffset(int): The thread local variable is in the first cache line
of the memory block. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getAllowFloatingReads()
Returns
true if the floating reads is enabled, else false. |
org.graalvm.word.LocationIdentity |
getLocationIdentity()
Returns the
LocationIdentity used for memory accesses performed by the get
and set methods of the subclasses. |
int |
getMaxOffset() |
String |
getName() |
<T extends FastThreadLocal> |
setAllowFloatingReads(boolean allow)
Sets whether non-volatile fast thread local reads can be read using floating semantics in the
compiler graph.
|
<T extends FastThreadLocal> |
setMaxOffset(int maxOffset)
Sets the maximum offset of this thread local variable in the memory block reserved for each
thread.
|
public static final int FIRST_CACHE_LINE
FastThreadLocal.setMaxOffset(int): The thread local variable is in the first cache line
of the memory block. This allows grouping of the most frequently accessed variables.
We are not using a real cache line size, but instead assume that 64 bytes is the common
minimum size on all platforms.public static final int BYTE_OFFSET
FastThreadLocal.setMaxOffset(int): The thread local variable has an offset that can be
expressed as a signed 8-bit value. Some architectures, e.g. AMD64, need fewer bytes to encode
such offsets.public org.graalvm.word.LocationIdentity getLocationIdentity()
LocationIdentity used for memory accesses performed by the get
and set methods of the subclasses.public <T extends FastThreadLocal> T setMaxOffset(int maxOffset)
public int getMaxOffset()
public <T extends FastThreadLocal> T setAllowFloatingReads(boolean allow)
false (default) then reads will always remain
fixed in the graph and do not move. If this is set to true then reads can float
according to the location identity of the fast thread local.public boolean getAllowFloatingReads()
true if the floating reads is enabled, else false.public String getName()