public class Blackholeextends Object
Black hole "consumes" the values, conceiving no information to JIT whether the value is actually used afterwards. This can save from the dead-code elimination of the computations resulting in the given values.
Modifier and Type | Field and Description |
---|---|
byte | b1 |
byte | b2 |
boolean | bool1 |
boolean | bool2 |
char | c1 |
char | c2 |
double | d1 |
double | d2 |
float | f1 |
float | f2 |
int | i1 |
int | i2 |
long | l1 |
long | l2 |
org.openjdk.jmh.infra.BlackholeL2 | nullBait |
Object | obj1 |
Object[] | objs1 |
short | s1 |
short | s2 |
int | tlr |
int | tlrMask |
Constructor and Description |
---|
Blackhole() |
Modifier and Type | Method and Description |
---|---|
void | clearSinks() |
void | consume(boolean bool) Consume object. |
void | consume(byte b) Consume object. |
void | consume(char c) Consume object. |
void | consume(double d) Consume object. |
void | consume(float f) Consume object. |
void | consume(int i) Consume object. |
void | consume(long l) Consume object. |
void | consume(Object obj) Consume object. |
void | consume(Object[] objs) Consume object. |
void | consume(short s) Consume object. |
static void | consumeCPU(long tokens) Consume some amount of time tokens. |
public volatile byte b1
public volatile boolean bool1
public volatile char c1
public volatile short s1
public volatile int i1
public volatile long l1
public volatile float f1
public volatile double d1
public byte b2
public boolean bool2
public char c2
public short s2
public int i2
public long l2
public float f2
public double d2
public volatile Object obj1
public volatile Object[] objs1
public volatile org.openjdk.jmh.infra.BlackholeL2 nullBait
public int tlr
public volatile int tlrMask
public void clearSinks()
public final void consume(Object obj)
obj
- object to consume.public final void consume(Object[] objs)
objs
- objects to consume.public final void consume(byte b)
b
- object to consume.public final void consume(boolean bool)
bool
- object to consume.public final void consume(char c)
c
- object to consume.public final void consume(short s)
s
- object to consume.public final void consume(int i)
i
- object to consume.public final void consume(long l)
l
- object to consume.public final void consume(float f)
f
- object to consume.public final void consume(double d)
d
- object to consume.public static void consumeCPU(long tokens)
tokens
- CPU tokens to consumeCopyright © 2012-2015 Oracle. All Rights Reserved.