Mercurial > hg > graal-compiler
changeset 20919:c6545476bc77
RegisterAllocationConfig: add 'catch-all' constant for RegisterPressure.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Mon, 13 Apr 2015 17:00:21 +0200 |
parents | 6daa0fd4af52 |
children | badbe99cfaa4 |
files | graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/alloc/RegisterAllocationConfig.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanPhase.java |
diffstat | 2 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/alloc/RegisterAllocationConfig.java Mon Apr 13 16:53:47 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/alloc/RegisterAllocationConfig.java Mon Apr 13 17:00:21 2015 +0200 @@ -36,6 +36,8 @@ */ public class RegisterAllocationConfig { + public static final String ALL_REGISTERS = "<all>"; + private static Register findRegister(String name, Register[] all) { for (Register reg : all) { if (reg.name.equals(name)) { @@ -46,7 +48,7 @@ } private static Register[] initAllocatable(Register[] registers) { - if (RegisterPressure.getValue() != null) { + if (RegisterPressure.getValue() != null && !RegisterPressure.getValue().equals(ALL_REGISTERS)) { String[] names = RegisterPressure.getValue().split(","); Register[] regs = new Register[names.length]; for (int i = 0; i < names.length; i++) {
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanPhase.java Mon Apr 13 16:53:47 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanPhase.java Mon Apr 13 17:00:21 2015 +0200 @@ -43,7 +43,7 @@ new LinearScan(target, lirGenRes, spillMoveFactory, new RegisterAllocationConfig(lirGenRes.getFrameMapBuilder().getRegisterConfig())).allocate(); } catch (OutOfRegistersException e) { if (RegisterPressure.getValue() != null) { - try (OverrideScope s = OptionValue.override(RegisterPressure, null)) { + try (OverrideScope s = OptionValue.override(RegisterPressure, RegisterAllocationConfig.ALL_REGISTERS)) { // retry with default register set new LinearScan(target, lirGenRes, spillMoveFactory, new RegisterAllocationConfig(lirGenRes.getFrameMapBuilder().getRegisterConfig())).allocate(); }