[FIX] OCLReturn slot to use frame slot
@@ -22,7 +22,8 @@ import tornado.drivers.opencl.graal.asm.OCLAssembler;
import tornado.drivers.opencl.graal.asm.OCLAssembler.OCLNullaryOp;
import tornado.drivers.opencl.graal.compiler.OCLCompilationResultBuilder;
-import static tornado.drivers.opencl.graal.asm.OCLAssemblerConstants.HEAP_REF_NAME;
+import static tornado.drivers.opencl.graal.asm.OCLAssemblerConstants.FRAME_REF_NAME;
+import static tornado.runtime.api.TornadoCallStack.RETURN_VALUE_INDEX;
@Opcode("RETURN VALUE")
public class OCLReturnSlot extends AllocatableValue {
@@ -36,7 +37,7 @@ public class OCLReturnSlot extends AllocatableValue {
public void emit(OCLCompilationResultBuilder crb, OCLAssembler asm) {
OCLKind type = ((OCLKind) getPlatformKind());
- asm.emit("*((__global %s *) %s)", type, HEAP_REF_NAME);
+ asm.emit("%s[%d]", FRAME_REF_NAME, RETURN_VALUE_INDEX);
}
@Override
