@@ -261,6 +261,28 @@ symbolt implemented_method_symbol(
261
261
return implemented_method_symbol;
262
262
}
263
263
264
+ // invokedynamic will be called with operands that should be stored in a
265
+ // synthetic object implementing the interface type that it returns. For
266
+ // example, "invokedynamic f(a, b, c) -> MyInterface" should result in the
267
+ // creation of the synthetic class:
268
+ // public class SyntheticCapture implements MyInterface {
269
+ // private int a;
270
+ // private float b;
271
+ // private Other c;
272
+ // public SyntheticCapture(int a, float b, Other c) {
273
+ // this.a = a; this.b = b; this.c = c;
274
+ // }
275
+ // public void myInterfaceMethod(int d) {
276
+ // f(a, b, c, d);
277
+ // }
278
+ // }
279
+ // This method just creates the outline; the methods will be populated on
280
+ // demand via java_bytecode_languaget::convert_lazy_method.
281
+
282
+ // Check that we understand the lambda method handle; if we don't then
283
+ // we will not create a synthetic class at all, and the corresponding
284
+ // invoke instruction will return null when eventually converted by
285
+ // java_bytecode_convert_method.
264
286
void create_invokedynamic_synthetic_classes (
265
287
const irep_idt &method_identifier,
266
288
const java_bytecode_parse_treet::methodt::instructionst &instructions,
@@ -274,28 +296,6 @@ void create_invokedynamic_synthetic_classes(
274
296
{
275
297
if (strcmp (bytecode_info[instruction.bytecode ].mnemonic , " invokedynamic" ))
276
298
continue ;
277
- // invokedynamic will be called with operands that should be stored in a
278
- // synthetic object implementing the interface type that it returns. For
279
- // example, "invokedynamic f(a, b, c) -> MyInterface" should result in the
280
- // creation of the synthetic class:
281
- // public class SyntheticCapture implements MyInterface {
282
- // private int a;
283
- // private float b;
284
- // private Other c;
285
- // public SyntheticCapture(int a, float b, Other c) {
286
- // this.a = a; this.b = b; this.c = c;
287
- // }
288
- // public void myInterfaceMethod(int d) {
289
- // f(a, b, c, d);
290
- // }
291
- // }
292
- // This method just creates the outline; the methods will be populated on
293
- // demand via java_bytecode_languaget::convert_lazy_method.
294
-
295
- // Check that we understand the lambda method handle; if we don't then
296
- // we will not create a synthetic class at all, and the corresponding
297
- // invoke instruction will return null when eventually converted by
298
- // java_bytecode_convert_method.
299
299
const auto &dynamic_method_type =
300
300
to_java_method_type (instruction.args .at (0 ).type ());
301
301
const auto lambda_method_name = ::lambda_method_name (
0 commit comments