1 /* |
1 /* |
2 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2013, 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. |
76 * call-free methods also have this space reserved. Then the VM can use the memory at offset 0 |
76 * call-free methods also have this space reserved. Then the VM can use the memory at offset 0 |
77 * relative to the stack pointer. |
77 * relative to the stack pointer. |
78 */ |
78 */ |
79 public class AMD64FrameMap extends FrameMap { |
79 public class AMD64FrameMap extends FrameMap { |
80 |
80 |
|
81 private final boolean useStandardFrameProlog; |
81 private StackSlot rbpSpillSlot; |
82 private StackSlot rbpSpillSlot; |
82 |
83 |
83 public AMD64FrameMap(CodeCacheProvider codeCache, RegisterConfig registerConfig, ReferenceMapBuilderFactory referenceMapFactory) { |
84 public AMD64FrameMap(CodeCacheProvider codeCache, RegisterConfig registerConfig, ReferenceMapBuilderFactory referenceMapFactory, boolean useStandardFrameProlog) { |
84 this(codeCache, registerConfig, referenceMapFactory, false); |
|
85 } |
|
86 |
|
87 public AMD64FrameMap(CodeCacheProvider codeCache, RegisterConfig registerConfig, ReferenceMapBuilderFactory referenceMapFactory, boolean useBasePointer) { |
|
88 super(codeCache, registerConfig, referenceMapFactory); |
85 super(codeCache, registerConfig, referenceMapFactory); |
89 // (negative) offset relative to sp + total frame size |
86 // (negative) offset relative to sp + total frame size |
90 initialSpillSize = returnAddressSize() + (useBasePointer ? getTarget().arch.getWordSize() : 0); |
87 this.useStandardFrameProlog = useStandardFrameProlog; |
91 spillSize = initialSpillSize; |
88 this.initialSpillSize = returnAddressSize() + (useStandardFrameProlog ? getTarget().arch.getWordSize() : 0); |
|
89 this.spillSize = initialSpillSize; |
92 } |
90 } |
93 |
91 |
94 @Override |
92 @Override |
95 public int totalFrameSize() { |
93 public int totalFrameSize() { |
96 int result = frameSize() + initialSpillSize; |
94 int result = frameSize() + initialSpillSize; |
139 public StackSlot allocateDeoptimizationRescueSlot() { |
137 public StackSlot allocateDeoptimizationRescueSlot() { |
140 assert spillSize == initialSpillSize || spillSize == initialSpillSize + |
138 assert spillSize == initialSpillSize || spillSize == initialSpillSize + |
141 spillSlotSize(LIRKind.value(AMD64Kind.QWORD)) : "Deoptimization rescue slot must be the first or second (if there is an RBP spill slot) stack slot"; |
139 spillSlotSize(LIRKind.value(AMD64Kind.QWORD)) : "Deoptimization rescue slot must be the first or second (if there is an RBP spill slot) stack slot"; |
142 return allocateSpillSlot(LIRKind.value(AMD64Kind.QWORD)); |
140 return allocateSpillSlot(LIRKind.value(AMD64Kind.QWORD)); |
143 } |
141 } |
|
142 |
|
143 public boolean useStandardFrameProlog() { |
|
144 return useStandardFrameProlog; |
|
145 } |
144 } |
146 } |