|
57 | 57 | import java.util.Set; |
58 | 58 | import java.util.concurrent.locks.Lock; |
59 | 59 |
|
| 60 | +import org.graalvm.collections.Pair; |
| 61 | + |
60 | 62 | import com.oracle.graal.python.PythonLanguage; |
61 | 63 | import com.oracle.graal.python.builtins.PythonBuiltinClassType; |
62 | 64 | import com.oracle.graal.python.builtins.modules.BuiltinFunctions.FormatNode; |
|
176 | 178 | import com.oracle.graal.python.nodes.builtins.ListNodesFactory; |
177 | 179 | import com.oracle.graal.python.nodes.builtins.TupleNodes; |
178 | 180 | import com.oracle.graal.python.nodes.builtins.TupleNodesFactory; |
| 181 | +import com.oracle.graal.python.nodes.bytecode.PBytecodeRootNodeFactory.ObjHashMapPutNodeGen; |
179 | 182 | import com.oracle.graal.python.nodes.bytecode.SequenceFromStackNode.ListFromStackNode; |
180 | 183 | import com.oracle.graal.python.nodes.bytecode.SequenceFromStackNode.TupleFromStackNode; |
181 | | -import com.oracle.graal.python.nodes.bytecode.PBytecodeRootNodeFactory.ObjHashMapPutNodeGen; |
182 | 184 | import com.oracle.graal.python.nodes.bytecode.SequenceFromStackNodeFactory.ListFromStackNodeGen; |
183 | 185 | import com.oracle.graal.python.nodes.bytecode.SequenceFromStackNodeFactory.TupleFromStackNodeGen; |
184 | 186 | import com.oracle.graal.python.nodes.bytecode.instrumentation.InstrumentationRoot; |
@@ -1100,16 +1102,22 @@ public Object execute(VirtualFrame virtualFrame) { |
1100 | 1102 | } |
1101 | 1103 | } |
1102 | 1104 |
|
| 1105 | + // Doesn't matter which PArguments slot we use as long as it exists |
| 1106 | + private static final int OSR_FRAME_INDEX = 0; |
| 1107 | + |
1103 | 1108 | @Override |
1104 | 1109 | public Object[] storeParentFrameInArguments(VirtualFrame parentFrame) { |
1105 | 1110 | Object[] arguments = parentFrame.getArguments(); |
1106 | | - PArguments.setOSRFrame(arguments, parentFrame); |
| 1111 | + arguments[0] = Pair.create(arguments[OSR_FRAME_INDEX], parentFrame); |
1107 | 1112 | return arguments; |
1108 | 1113 | } |
1109 | 1114 |
|
1110 | 1115 | @Override |
| 1116 | + @SuppressWarnings("unchecked") |
1111 | 1117 | public Frame restoreParentFrameFromArguments(Object[] arguments) { |
1112 | | - return PArguments.getOSRFrame(arguments); |
| 1118 | + Pair<Object, Frame> pair = (Pair<Object, Frame>) arguments[OSR_FRAME_INDEX]; |
| 1119 | + arguments[0] = pair.getLeft(); |
| 1120 | + return pair.getRight(); |
1113 | 1121 | } |
1114 | 1122 |
|
1115 | 1123 | @Override |
|
0 commit comments