1 /* |
1 /* |
2 * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2014, 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. |
25 package org.graalvm.compiler.lir.framemap; |
25 package org.graalvm.compiler.lir.framemap; |
26 |
26 |
27 import static org.graalvm.compiler.lir.LIRValueUtil.isVirtualStackSlot; |
27 import static org.graalvm.compiler.lir.LIRValueUtil.isVirtualStackSlot; |
28 |
28 |
29 import java.util.ArrayList; |
29 import java.util.ArrayList; |
30 import java.util.BitSet; |
|
31 import java.util.EnumSet; |
30 import java.util.EnumSet; |
32 import java.util.List; |
31 import java.util.List; |
33 |
32 |
34 import org.graalvm.compiler.core.common.LIRKind; |
33 import org.graalvm.compiler.core.common.LIRKind; |
35 import org.graalvm.compiler.core.common.cfg.AbstractBlockBase; |
34 import org.graalvm.compiler.core.common.cfg.AbstractBlockBase; |
36 import org.graalvm.compiler.debug.DebugContext; |
35 import org.graalvm.compiler.debug.DebugContext; |
37 import org.graalvm.compiler.debug.GraalError; |
|
38 import org.graalvm.compiler.lir.InstructionValueConsumer; |
36 import org.graalvm.compiler.lir.InstructionValueConsumer; |
39 import org.graalvm.compiler.lir.LIR; |
37 import org.graalvm.compiler.lir.LIR; |
40 import org.graalvm.compiler.lir.LIRInstruction; |
38 import org.graalvm.compiler.lir.LIRInstruction; |
41 import org.graalvm.compiler.lir.LIRInstruction.OperandFlag; |
39 import org.graalvm.compiler.lir.LIRInstruction.OperandFlag; |
42 import org.graalvm.compiler.lir.LIRInstruction.OperandMode; |
40 import org.graalvm.compiler.lir.LIRInstruction.OperandMode; |
44 import org.graalvm.compiler.lir.gen.LIRGenerationResult; |
42 import org.graalvm.compiler.lir.gen.LIRGenerationResult; |
45 |
43 |
46 import jdk.vm.ci.code.CallingConvention; |
44 import jdk.vm.ci.code.CallingConvention; |
47 import jdk.vm.ci.code.CodeCacheProvider; |
45 import jdk.vm.ci.code.CodeCacheProvider; |
48 import jdk.vm.ci.code.RegisterConfig; |
46 import jdk.vm.ci.code.RegisterConfig; |
49 import jdk.vm.ci.meta.JavaKind; |
|
50 import jdk.vm.ci.meta.Value; |
47 import jdk.vm.ci.meta.Value; |
51 import jdk.vm.ci.meta.ValueKind; |
48 import jdk.vm.ci.meta.ValueKind; |
52 |
49 |
53 /** |
50 /** |
54 * A FrameMapBuilder that records allocation. |
51 * A FrameMapBuilder that records allocation. |
78 stackSlots.add(slot); |
75 stackSlots.add(slot); |
79 return slot; |
76 return slot; |
80 } |
77 } |
81 |
78 |
82 @Override |
79 @Override |
83 public VirtualStackSlot allocateStackSlots(int slots, BitSet objects, List<VirtualStackSlot> outObjectStackSlots) { |
80 public VirtualStackSlot allocateStackSlots(int slots) { |
84 if (slots == 0) { |
81 if (slots == 0) { |
85 return null; |
82 return null; |
86 } |
83 } |
87 if (outObjectStackSlots != null) { |
84 VirtualStackSlotRange slot = new VirtualStackSlotRange(numStackSlots++, slots, LIRKind.value(frameMap.getTarget().arch.getWordKind())); |
88 throw GraalError.unimplemented(); |
|
89 } |
|
90 VirtualStackSlotRange slot = new VirtualStackSlotRange(numStackSlots++, slots, objects, LIRKind.fromJavaKind(frameMap.getTarget().arch, JavaKind.Object)); |
|
91 stackSlots.add(slot); |
85 stackSlots.add(slot); |
92 return slot; |
86 return slot; |
93 } |
87 } |
94 |
88 |
95 @Override |
89 @Override |