Skip to content

Commit 522a1d0

Browse files
committed
Document why we don't use IndirectCallContext in ForeignObjectBuiltins and similar
1 parent d575aa6 commit 522a1d0

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/common/ForeignHashingStorage.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@
6868
import com.oracle.truffle.api.nodes.Node;
6969
import com.oracle.truffle.api.profiles.InlinedBranchProfile;
7070

71+
/*
72+
* NOTE: We are not using IndirectCallContext here in this file because it seems unlikely that these interop messages
73+
* would call back to Python and that we would also need precise frame info for that case.
74+
* Adding it shouldn't hurt peak, but might be a non-trivial overhead in interpreter.
75+
*/
7176
public final class ForeignHashingStorage extends HashingStorage {
7277

7378
public final Object foreignDict;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/foreign/ForeignObjectBuiltins.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@
145145
import com.oracle.truffle.api.profiles.InlinedBranchProfile;
146146
import com.oracle.truffle.api.strings.TruffleString;
147147

148+
/*
149+
* NOTE: We are not using IndirectCallContext here in this file (except for CallNode)
150+
* because it seems unlikely that these interop messages would call back to Python
151+
* and that we would also need precise frame info for that case.
152+
* Adding it shouldn't hurt peak, but might be a non-trivial overhead in interpreter.
153+
*/
148154
@CoreFunctions(extendClasses = PythonBuiltinClassType.ForeignObject)
149155
public final class ForeignObjectBuiltins extends PythonBuiltins {
150156
public static TpSlots SLOTS = ForeignObjectBuiltinsSlotsGen.SLOTS;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/ForeignSequenceStorage.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@
6666
import static com.oracle.graal.python.runtime.exception.PythonErrorType.IndexError;
6767
import static com.oracle.graal.python.runtime.exception.PythonErrorType.TypeError;
6868

69+
/*
70+
* NOTE: We are not using IndirectCallContext here in this file because it seems unlikely that these interop messages
71+
* would call back to Python and that we would also need precise frame info for that case.
72+
* Adding it shouldn't hurt peak, but might be a non-trivial overhead in interpreter.
73+
*/
6974
public final class ForeignSequenceStorage extends SequenceStorage {
7075

7176
private final Object foreignArray;

0 commit comments

Comments
 (0)