cpython/Objects
Hood Chatham 6b179adb8c
gh-106213: Make Emscripten trampolines work with JSPI (GH-106219)
There is a WIP proposal to enable webassembly stack switching which have been
implemented in v8:

https://github.com/WebAssembly/js-promise-integration

It is not possible to switch stacks that contain JS frames so the Emscripten JS
trampolines that allow calling functions with the wrong number of arguments
don't work in this case. However, the js-promise-integration proposal requires
the [type reflection for Wasm/JS API](https://github.com/WebAssembly/js-types)
proposal, which allows us to actually count the number of arguments a function
expects.

For better compatibility with stack switching, this PR checks if type reflection
is available, and if so we use a switch block to decide the appropriate
signature. If type reflection is unavailable, we should use the current EMJS
trampoline.

We cache the function argument counts since when I didn't cache them performance
was negatively affected.

Co-authored-by: T. Wouters <thomas@python.org>
Co-authored-by: Brett Cannon <brett@python.org>
2023-09-15 15:04:21 -07:00
..
clinic gh-108915: Removes extra backslashes in str.split docstring (#109044) 2023-09-07 05:33:51 +00:00
stringlib gh-107603: Argument Clinic: Only include pycore_gc.h if needed (#108726) 2023-08-31 23:42:34 +02:00
README
abstract.c gh-106307: Fix PyMapping_GetOptionalItemString() (GH-108797) 2023-09-06 19:47:38 +00:00
boolobject.c GH-84436: Skip refcounting for known immortals (GH-107605) 2023-08-04 16:24:50 -07:00
bytearrayobject.c gh-106320: Remove private _PyEval function (#108433) 2023-08-24 20:25:22 +02:00
bytes_methods.c gh-104922: remove PY_SSIZE_T_CLEAN (#106315) 2023-07-02 15:07:46 +09:00
bytesobject.c gh-108767: Replace ctype.h functions with pyctype.h functions (#108772) 2023-09-01 18:36:53 +02:00
call.c gh-106320: Remove _PyFunction_Vectorcall() API (#107071) 2023-07-22 21:44:33 +00:00
capsule.c gh-108240: Add pycore_capsule.h internal header file (#108596) 2023-08-29 01:20:02 +00:00
cellobject.c gh-99300: Use Py_NewRef() in Objects/ directory (#99332) 2022-11-10 16:27:32 +01:00
classobject.c gh-106320: Remove private _PyEval function (#108433) 2023-08-24 20:25:22 +02:00
codeobject.c gh-109052: Use the base opcode when comparing code objects (gh-109107) 2023-09-09 10:24:49 +09:00
complexobject.c gh-106869: Use new PyMemberDef constant names (#106871) 2023-07-25 15:28:30 +02:00
descrobject.c gh-106213: Make Emscripten trampolines work with JSPI (GH-106219) 2023-09-15 15:04:21 -07:00
dictnotes.txt bpo-46845: Reduce dict size when all keys are Unicode (GH-31564) 2022-03-02 08:09:28 +09:00
dictobject.c Add missing `PyDoc_STR` calls (#109393) 2023-09-15 15:10:48 +02:00
enumobject.c gh-106320: Create pycore_modsupport.h header file (#106355) 2023-07-03 09:39:11 +00:00
exception_handling_notes.txt GH-105848: Simplify the arrangement of CALL's stack (GH-107788) 2023-08-09 18:19:39 +00:00
exceptions.c gh-106869: Use new PyMemberDef constant names (#106871) 2023-07-25 15:28:30 +02:00
fileobject.c gh-108444: Replace _PyLong_AsInt() with PyLong_AsInt() (#108459) 2023-08-25 01:01:30 +02:00
floatobject.c gh-108765: Python.h no longer includes <ctype.h> (#108831) 2023-09-03 18:54:27 +02:00
frame_layout.md GH-96421: Insert shim frame on entry to interpreter (GH-96319) 2022-11-10 12:34:57 +00:00
frameobject.c GH-105848: Replace KW_NAMES + CALL with LOAD_CONST + CALL_KW (GH-109300) 2023-09-13 10:25:45 -07:00
funcobject.c GH-108716: Turn off deep-freezing of code objects. (GH-108722) 2023-09-08 10:34:40 +01:00
genericaliasobject.c Add missing PyDoc_STR to GenericAlias.__parameters__ (#108811) 2023-09-13 20:42:44 -07:00
genobject.c GH-108614: Add `RESUME_CHECK` instruction (GH-108630) 2023-09-07 14:39:03 +01:00
interpreteridobject.c gh-101524: Only Use Public C-API in the _xxsubinterpreters Module (gh-107359) 2023-07-27 15:30:16 -06:00
iterobject.c gh-106320: Remove private _PyEval function (#108433) 2023-08-24 20:25:22 +02:00
listobject.c gh-106320: Remove private _PyEval function (#108433) 2023-08-24 20:25:22 +02:00
listsort.txt Fix typos in the Objects directory (GH-28766) 2021-10-06 16:57:10 -07:00
lnotab_notes.txt Note that lnotab_notes.txt is only valid before 3.11 (#107961) 2023-08-15 20:27:35 +00:00
locations.md GH-88116: Use a compact format to represent end line and column offsets. (GH-91666) 2022-04-21 16:10:37 +01:00
longobject.c gh-108765: Python.h no longer includes <ctype.h> (#108831) 2023-09-03 18:54:27 +02:00
memoryobject.c gh-106320: Remove private _PyManagedBuffer_Type (#108431) 2023-08-24 19:07:54 +02:00
methodobject.c gh-106213: Make Emscripten trampolines work with JSPI (GH-106219) 2023-09-15 15:04:21 -07:00
moduleobject.c gh-108308: Use PyDict_GetItemRef() in moduleobject.c (#108381) 2023-08-23 21:57:40 +00:00
namespaceobject.c gh-109174: Add support of SimpleNamespace in copy.replace() (GH-109175) 2023-09-10 08:09:25 +03:00
object.c gh-108634: PyInterpreterState_New() no longer calls Py_FatalError() (#108748) 2023-09-01 12:43:30 +02:00
object_layout.md fix typos (#106247) 2023-06-30 13:00:22 +09:00
object_layout_312.gv GH-96068: Document object layout (GH-96069) 2022-08-23 13:55:43 +01:00
object_layout_312.png GH-96068: Document object layout (GH-96069) 2022-08-23 13:55:43 +01:00
object_layout_full_312.gv GH-96068: Document object layout (GH-96069) 2022-08-23 13:55:43 +01:00
object_layout_full_312.png GH-96068: Document object layout (GH-96069) 2022-08-23 13:55:43 +01:00
obmalloc.c gh-106320: Remove private _PyObject C API (#107147) 2023-07-23 20:09:08 +00:00
odictobject.c gh-106320: Remove private _PyErr_ChainExceptions() (#108713) 2023-08-31 13:53:19 +02:00
picklebufobject.c gh-104922: remove PY_SSIZE_T_CLEAN (#106315) 2023-07-02 15:07:46 +09:00
rangeobject.c gh-106320: Remove private _PyEval function (#108433) 2023-08-24 20:25:22 +02:00
setobject.c gh-108634: Py_TRACE_REFS uses a hash table (#108663) 2023-08-31 18:33:34 +02:00
sliceobject.c gh-108634: Py_TRACE_REFS uses a hash table (#108663) 2023-08-31 18:33:34 +02:00
structseq.c gh-108634: Py_TRACE_REFS uses a hash table (#108663) 2023-08-31 18:33:34 +02:00
tupleobject.c gh-106320: Remove private _PyEval function (#108433) 2023-08-24 20:25:22 +02:00
typeobject.c gh-108765: Python.h no longer includes <ctype.h> (#108831) 2023-09-03 18:54:27 +02:00
typeslots.inc bpo-41073: PyType_GetSlot() can now accept static types. (GH-21931) 2020-11-10 12:53:46 -08:00
typeslots.py bpo-41073: PyType_GetSlot() can now accept static types. (GH-21931) 2020-11-10 12:53:46 -08:00
typevarobject.c Add missing `PyDoc_STR` calls (#109393) 2023-09-15 15:10:48 +02:00
unicodectype.c bpo-46670: Remove unused macros in the Objects directory (GH-31193) 2022-02-07 16:21:41 +01:00
unicodeobject.c gh-108915: Removes extra backslashes in str.split docstring (#109044) 2023-09-07 05:33:51 +00:00
unicodetype_db.h bpo-47243: Duplicate entry in 'Objects/unicodetype_db.h' (GH-32376) 2022-09-28 06:57:14 -07:00
unionobject.c Add missing `PyDoc_STR` calls (#109393) 2023-09-15 15:10:48 +02:00
weakrefobject.c gh-106320: Remove private _PyErr_ChainExceptions() (#108713) 2023-08-31 13:53:19 +02:00

README

Source files for various builtin objects