@@ -259,32 +259,13 @@ private static ListNode handleNamedSub(Parser parser, String subName, String pro
259
259
new RuntimeArray ()
260
260
);
261
261
262
- // Generate bytecode for the subroutine block
263
- byte [] classData = EmitterMethodCreator .getBytecode (newCtx , block , false );
264
- // System.out.println("Creating subroutine " + fullName);
265
- // Load the generated bytecode into a Class object
266
- Class <?> generatedClass = EmitterMethodCreator .loadBytecode (newCtx , classData );
267
-
268
262
// Create a Runnable to execute the subroutine creation
269
263
Runnable subroutineCreationTask = () -> {
270
-
271
- // The following commented-out code is a work in progress for handling concurrency
272
- // Class<?> generatedClass = null;
273
- // try {
274
- // semaphore.acquire();
275
- // byte[] classData = EmitterMethodCreator.getBytecode(newCtx, block, false);
276
- // // System.out.println("Creating subroutine " + fullName);
277
- // generatedClass = EmitterMethodCreator.loadBytecode(newCtx, classData);
278
- //
279
- // } catch (InterruptedException e) {
280
- // throw new RuntimeException(e);
281
- // } finally {
282
- // // Release the semaphore
283
- // semaphore.release();
284
- // }
285
-
264
+ // Generate bytecode and load into a Class object
265
+ Class <?> generatedClass = EmitterMethodCreator .createClassWithMethod (newCtx , block , false );
286
266
// System.out.println("Class " + generatedClass);
287
267
// EmitterMethodCreator.debugInspectClass(generatedClass);
268
+
288
269
try {
289
270
// Prepare constructor with the captured variable types
290
271
Class <?>[] parameterTypes = classList .toArray (new Class <?>[0 ]);
0 commit comments