Skip to content

Commit fd20053

Browse files
committed
Clean up
1 parent c48298d commit fd20053

File tree

4 files changed

+10
-35
lines changed

4 files changed

+10
-35
lines changed

Include/internal/pycore_runtime_structs.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -276,15 +276,6 @@ struct pyruntimestate {
276276
struct _types_runtime_state types;
277277
struct _Py_time_runtime_state time;
278278

279-
#if defined(__EMSCRIPTEN__) && defined(PY_CALL_TRAMPOLINE)
280-
// Used in "Python/emscripten_trampoline.c" to choose between type
281-
// reflection trampoline and EM_JS trampoline.
282-
PyObject *(*emscripten_trampoline)(int *success,
283-
PyCFunctionWithKeywords func,
284-
PyObject *arg1, PyObject *arg2,
285-
PyObject *arg3);
286-
#endif
287-
288279
/* All the objects that are shared by the runtime's interpreters. */
289280
struct _Py_cached_objects cached_objects;
290281
struct _Py_static_objects static_objects;

Python/emscripten_trampoline.c

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,6 @@
22

33
#include <emscripten.h> // EM_JS, EM_JS_DEPS
44
#include <Python.h>
5-
#include "pycore_runtime.h" // _PyRuntime
6-
7-
typedef PyObject *(*TrampolineFunc)(int *success, PyCFunctionWithKeywords func,
8-
PyObject *arg1, PyObject *arg2,
9-
PyObject *arg3);
10-
11-
12-
void
13-
_Py_EmscriptenTrampoline_Init(_PyRuntimeState *runtime)
14-
{
15-
}
165

176
// We have to be careful to work correctly with memory snapshots. Even if we are
187
// loading a memory snapshot, we need to perform the JS initialization work.
@@ -22,7 +11,13 @@ _Py_EmscriptenTrampoline_Init(_PyRuntimeState *runtime)
2211
/**
2312
* Backwards compatible trampoline works with all JS runtimes
2413
*/
25-
EM_JS(PyObject*, _PyEM_TrampolineCall_inner, (int* success, PyCFunctionWithKeywords func, PyObject *arg1, PyObject *arg2, PyObject *arg3), {
14+
EM_JS(
15+
PyObject*,
16+
_PyEM_TrampolineCall_inner, (int* success,
17+
PyCFunctionWithKeywords func,
18+
PyObject *arg1,
19+
PyObject *arg2,
20+
PyObject *arg3), {
2621
return wasmTable.get(func)(arg1, arg2, arg3);
2722
}
2823
try {
@@ -34,11 +29,6 @@ try {
3429
} catch (e) {}
3530
);
3631

37-
typedef PyObject* (*zero_arg)(void);
38-
typedef PyObject* (*one_arg)(PyObject*);
39-
typedef PyObject* (*two_arg)(PyObject*, PyObject*);
40-
typedef PyObject* (*three_arg)(PyObject*, PyObject*, PyObject*);
41-
4232
PyObject*
4333
_PyEM_TrampolineCall(PyCFunctionWithKeywords func,
4434
PyObject* self,

Python/emscripten_trampoline_inner.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
typedef void PyObject;
22

3-
typedef PyObject* (*zero_arg)(void);
4-
typedef PyObject* (*one_arg)(PyObject*);
5-
typedef PyObject* (*two_arg)(PyObject*, PyObject*);
63
typedef PyObject* (*three_arg)(PyObject*, PyObject*, PyObject*);
4+
typedef PyObject* (*two_arg)(PyObject*, PyObject*);
5+
typedef PyObject* (*one_arg)(PyObject*);
6+
typedef PyObject* (*zero_arg)(void);
77

88
#define TRY_RETURN_CALL(ty, args...) \
99
if (__builtin_wasm_test_function_pointer_signature((ty)func)) { \

Python/pystate.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "pycore_codecs.h" // _PyCodec_Fini()
99
#include "pycore_critical_section.h" // _PyCriticalSection_Resume()
1010
#include "pycore_dtoa.h" // _dtoa_state_INIT()
11-
#include "pycore_emscripten_trampoline.h" // _Py_EmscriptenTrampoline_Init()
1211
#include "pycore_freelist.h" // _PyObject_ClearFreeLists()
1312
#include "pycore_initconfig.h" // _PyStatus_OK()
1413
#include "pycore_interpframe.h" // _PyThreadState_HasStackSpace()
@@ -353,11 +352,6 @@ init_runtime(_PyRuntimeState *runtime,
353352
runtime->main_thread = PyThread_get_thread_ident();
354353

355354
runtime->unicode_state.ids.next_index = unicode_next_index;
356-
357-
#if defined(__EMSCRIPTEN__) && defined(PY_CALL_TRAMPOLINE)
358-
_Py_EmscriptenTrampoline_Init(runtime);
359-
#endif
360-
361355
runtime->_initialized = 1;
362356
}
363357

0 commit comments

Comments
 (0)