firstVariableNumber initialization for LinearScan

D.Sturm D.Sturm42 at gmail.com
Sun Mar 23 22:08:49 UTC 2014


The constructor for LinearScan uses "this.firstVariableNumber =
registers.length;" to assign the first non-register id it can use.

That's a problem if the register numbering does have jumps in it, which
happens to be true for the Aarch64 HotSpot runtime.

Could we replace it with something like
        int maxRegNumber = -1;
        for (Register reg : this.registers) {
            maxRegNumber = Math.max(maxRegNumber, reg.number);
        }
        this.firstVariableNumber = maxRegNumber + 1;

Otherwise I'd have to introduce a sequential numbering system for Graal and
translate register numbers when transitioning from Graal to HotSpot.

--Daniel


More information about the graal-dev mailing list