mirror of
https://github.com/apple/pkl.git
synced 2026-04-25 09:48:41 +02:00
Ensure findOrAddAuxiliarySlot is not called during compilation (#969)
Fixes an issue that is preventing the native executable from building
This commit is contained in:
@@ -2538,9 +2538,17 @@ public abstract class TypeNode extends PklNode {
|
|||||||
|
|
||||||
@ExplodeLoop
|
@ExplodeLoop
|
||||||
protected Object executeLazily(VirtualFrame frame, Object value) {
|
protected Object executeLazily(VirtualFrame frame, Object value) {
|
||||||
var customThisSlot =
|
int customThisSlot;
|
||||||
frame.getFrameDescriptor().findOrAddAuxiliarySlot(CustomThisScope.FRAME_SLOT_ID);
|
var numberOfAuxiliarySlots = frame.getFrameDescriptor().getNumberOfAuxiliarySlots();
|
||||||
|
if (numberOfAuxiliarySlots == 0) {
|
||||||
|
CompilerDirectives.transferToInterpreterAndInvalidate();
|
||||||
|
customThisSlot =
|
||||||
|
frame.getFrameDescriptor().findOrAddAuxiliarySlot(CustomThisScope.FRAME_SLOT_ID);
|
||||||
|
} else {
|
||||||
|
// assertion: we only use auxiliary slots for custom `this`.
|
||||||
|
assert numberOfAuxiliarySlots == 1;
|
||||||
|
customThisSlot = 0;
|
||||||
|
}
|
||||||
var ret = childNode.executeLazily(frame, value);
|
var ret = childNode.executeLazily(frame, value);
|
||||||
|
|
||||||
var localContext = language.localContext.get();
|
var localContext = language.localContext.get();
|
||||||
|
|||||||
Reference in New Issue
Block a user