Skip to content

Conversation

ehsankianifar
Copy link
Contributor

@r30shah
This PR add support for offheap 2D array allocation. It is calling helper if the second dim is zero length and allocating offheap. I have a few possible solutions for that.

Enhances the multianewarray evaluator to support offheap allocation on IMB Z platform. Offheap allocation for arrays with a zero-length second dimension is not supported; in such cases, a helper call is triggered to handle the allocation. signed-off-by: Ehsan Kiani Far <ehsan.kianifar@gmail.com>
@ehsankianifar ehsankianifar changed the title Z: Add support for offheap allocation in multianewarray evaluator Add support for offheap allocation in multianewarray evaluator on IBM Z platform Oct 17, 2025

TR::Register *dim2SizeReg = cg->allocateRegister();
dependencies->addPostCondition(dim2SizeReg, TR::RealRegister::AssignAny);
cursor = generateRXInstruction(cg, TR::InstOpCode::LTGF, node, dim2SizeReg, generateS390MemoryReference(dimsPtrReg, 0, cg), cursor);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This instruction is redundant!

@ehsankianifar ehsankianifar marked this pull request as draft October 17, 2025 15:39
@ehsankianifar
Copy link
Contributor Author

Remove WIP when I finish testing

@ehsankianifar
Copy link
Contributor Author

Local tests pass. I remove the WIP and launching jenkin tests.
The compilation logs:
offHeap.log

@ehsankianifar ehsankianifar self-assigned this Oct 17, 2025
@ehsankianifar ehsankianifar requested a review from r30shah October 17, 2025 16:53
@ehsankianifar ehsankianifar marked this pull request as ready for review October 17, 2025 16:53
Copy link
Contributor

@r30shah r30shah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VermaSh - Can I request your review on this first for off heap?

Copy link
Contributor

@r30shah r30shah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enhances the multianewarray evaluator to support offheap allocation on
IMB Z platform. Offheap allocation for arrays with a zero-length second
dimension is not supported; in such cases, a helper call is triggered
to handle the allocation.

Please fix typo (IBM Z not IMB Z).

I have not looked into your code - but can you confirm this statement is true or not.

  • We did inline zero-length first / second dimension array when off-heap is enabled. But changes in this PR will divert those case to helper (Or only zero length second dimension) and only inlines if both dimension is not zero?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants