In order to widen the types of lambda expressions that could be offloaded to the GPU, we wanted to be able to handle lambdas that used object allocation. The following describes some experiments with allocation using the HSAIL Backend to graal which are available on the graal trunk.
Note: As is true of many modern compilers, graal can avoid the actual allocation when, by using escape analysis, it canto prove that the allocated objects do not escape. Here's an example junit test where graal can successfully use escape analysis.
...