1 /* |
1 /* |
2 * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
81 xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, |
81 xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, |
82 xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 |
82 xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 |
83 }; |
83 }; |
84 // @formatter:on |
84 // @formatter:on |
85 |
85 |
86 AMD64HotSpotRegisterAllocationConfig(RegisterConfig registerConfig, String[] allocationRestrictedTo) { |
86 private final boolean useStandardFrameProlog; |
|
87 |
|
88 AMD64HotSpotRegisterAllocationConfig(RegisterConfig registerConfig, String[] allocationRestrictedTo, boolean useStandardFrameProlog) { |
87 super(registerConfig, allocationRestrictedTo); |
89 super(registerConfig, allocationRestrictedTo); |
|
90 this.useStandardFrameProlog = useStandardFrameProlog; |
88 } |
91 } |
89 |
92 |
90 @Override |
93 @Override |
91 protected RegisterArray initAllocatable(RegisterArray registers) { |
94 protected RegisterArray initAllocatable(RegisterArray registers) { |
92 BitSet regMap = new BitSet(registerConfig.getAllocatableRegisters().size()); |
95 BitSet regMap = new BitSet(registerConfig.getAllocatableRegisters().size()); |
93 for (Register reg : registers) { |
96 for (Register reg : registers) { |
94 regMap.set(reg.number); |
97 regMap.set(reg.number); |
|
98 } |
|
99 if (useStandardFrameProlog) { |
|
100 regMap.clear(rbp.number); |
95 } |
101 } |
96 |
102 |
97 ArrayList<Register> allocatableRegisters = new ArrayList<>(registers.size()); |
103 ArrayList<Register> allocatableRegisters = new ArrayList<>(registers.size()); |
98 for (Register reg : registerAllocationOrder) { |
104 for (Register reg : registerAllocationOrder) { |
99 if (regMap.get(reg.number)) { |
105 if (regMap.get(reg.number)) { |