< prev index next >

test/micro/org/openjdk/bench/vm/lambda/invoke/Function0.java

Print this page

108     @Benchmark
109     public Integer innerL() {
110         return anonymL.foo();
111     }
112 
113     public final FunctionI lambdaI = () -> valueI;
114 
115     public final FunctionL lambdaL = () -> valueL;
116 
117     @Benchmark
118     public int lambdaI() {
119         return lambdaI.foo();
120     }
121 
122     @Benchmark
123     public Integer lambdaL() {
124         return lambdaL.foo();
125     }
126 
127     public final FunctionI mref_I2I  = Function0::fooStaticI;

128     public final FunctionI mref_I2I_bound = this::fooInstanceI;
129 
130     public final FunctionL mref_I2L  = Function0::fooStaticI;

131     public final FunctionL mref_I2L_bound = this::fooInstanceI;
132 
133     public final FunctionI mref_L2I  = Function0::fooStaticL;

134     public final FunctionI mref_L2I_bound = this::fooInstanceL;
135 
136     public final FunctionL mref_L2L  = Function0::fooStaticL;

137     public final FunctionL mref_L2L_bound = this::fooInstanceL;
138 
139     // mref naming
140     // sig1_sig2 where:
141     // sig1 - signature of the method referenced by method ref
142     // sig2 - FuntionalInterface signature
143 
144     @Benchmark
145     public int mrefI_I() {
146         return mref_I2I.foo();
147     }
148 
149     @Benchmark
150     public int mref_bndI_I() {
151         return mref_I2I_bound.foo();
152     }
153 
154     @Benchmark
155     public Integer mrefI_L() {
156         return mref_I2L.foo();

108     @Benchmark
109     public Integer innerL() {
110         return anonymL.foo();
111     }
112 
113     public final FunctionI lambdaI = () -> valueI;
114 
115     public final FunctionL lambdaL = () -> valueL;
116 
117     @Benchmark
118     public int lambdaI() {
119         return lambdaI.foo();
120     }
121 
122     @Benchmark
123     public Integer lambdaL() {
124         return lambdaL.foo();
125     }
126 
127     public final FunctionI mref_I2I  = Function0::fooStaticI;
128     @SuppressWarnings("initialization")
129     public final FunctionI mref_I2I_bound = this::fooInstanceI;
130 
131     public final FunctionL mref_I2L  = Function0::fooStaticI;
132     @SuppressWarnings("initialization")
133     public final FunctionL mref_I2L_bound = this::fooInstanceI;
134 
135     public final FunctionI mref_L2I  = Function0::fooStaticL;
136     @SuppressWarnings("initialization")
137     public final FunctionI mref_L2I_bound = this::fooInstanceL;
138 
139     public final FunctionL mref_L2L  = Function0::fooStaticL;
140     @SuppressWarnings("initialization")
141     public final FunctionL mref_L2L_bound = this::fooInstanceL;
142 
143     // mref naming
144     // sig1_sig2 where:
145     // sig1 - signature of the method referenced by method ref
146     // sig2 - FuntionalInterface signature
147 
148     @Benchmark
149     public int mrefI_I() {
150         return mref_I2I.foo();
151     }
152 
153     @Benchmark
154     public int mref_bndI_I() {
155         return mref_I2I_bound.foo();
156     }
157 
158     @Benchmark
159     public Integer mrefI_L() {
160         return mref_I2L.foo();
< prev index next >