Nuitka-winsvc 2.2.3__cp311-cp311-win_amd64.whl → 2.3.2__cp311-cp311-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Nuitka-winsvc might be problematic. Click here for more details.
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/METADATA +2 -1
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/RECORD +201 -200
- nuitka/Bytecodes.py +4 -2
- nuitka/HardImportRegistry.py +1 -0
- nuitka/MainControl.py +16 -10
- nuitka/ModuleRegistry.py +15 -0
- nuitka/OptionParsing.py +30 -8
- nuitka/Options.py +106 -45
- nuitka/PostProcessing.py +9 -8
- nuitka/PythonVersions.py +2 -1
- nuitka/Serialization.py +47 -30
- nuitka/Version.py +1 -1
- nuitka/build/Backend.scons +46 -19
- nuitka/build/CCompilerVersion.scons +3 -3
- nuitka/build/Onefile.scons +4 -4
- nuitka/build/SconsCaching.py +3 -2
- nuitka/build/SconsCompilerSettings.py +18 -6
- nuitka/build/SconsInterface.py +28 -8
- nuitka/build/SconsUtils.py +9 -1
- nuitka/build/include/nuitka/allocator.h +58 -2
- nuitka/build/include/nuitka/compiled_frame.h +48 -13
- nuitka/build/include/nuitka/compiled_function.h +4 -0
- nuitka/build/include/nuitka/constants.h +6 -0
- nuitka/build/include/nuitka/exception_groups.h +6 -6
- nuitka/build/include/nuitka/exceptions.h +3 -3
- nuitka/build/include/nuitka/freelists.h +11 -0
- nuitka/build/include/nuitka/helper/dictionaries.h +5 -4
- nuitka/build/include/nuitka/helper/lists.h +5 -5
- nuitka/build/include/nuitka/helper/lists_generated.h +12 -12
- nuitka/build/include/nuitka/helper/sequences.h +6 -0
- nuitka/build/include/nuitka/helper/slices.h +14 -8
- nuitka/build/include/nuitka/helper/subscripts.h +1 -184
- nuitka/build/include/nuitka/helper/tuples.h +42 -33
- nuitka/build/include/nuitka/importing.h +5 -0
- nuitka/build/include/nuitka/prelude.h +49 -5
- nuitka/build/include/nuitka/safe_string_ops.h +1 -0
- nuitka/build/include/nuitka/threading.h +13 -10
- nuitka/build/static_src/CompiledAsyncgenType.c +19 -8
- nuitka/build/static_src/CompiledCellType.c +1 -1
- nuitka/build/static_src/CompiledCodeHelpers.c +18 -16
- nuitka/build/static_src/CompiledCoroutineType.c +23 -19
- nuitka/build/static_src/CompiledFrameType.c +46 -34
- nuitka/build/static_src/CompiledFunctionType.c +55 -34
- nuitka/build/static_src/CompiledGeneratorType.c +21 -19
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +127 -130
- nuitka/build/static_src/CompiledMethodType.c +15 -17
- nuitka/build/static_src/HelpersAllocator.c +71 -0
- nuitka/build/static_src/HelpersAttributes.c +1 -1
- nuitka/build/static_src/HelpersBuiltin.c +5 -5
- nuitka/build/static_src/HelpersBytes.c +2 -2
- nuitka/build/static_src/HelpersCalling.c +3 -0
- nuitka/build/static_src/HelpersCallingGenerated.c +952 -133
- nuitka/build/static_src/HelpersComparisonEq.c +329 -329
- nuitka/build/static_src/HelpersComparisonEqUtils.c +3 -1
- nuitka/build/static_src/HelpersComparisonGe.c +322 -322
- nuitka/build/static_src/HelpersComparisonGt.c +321 -321
- nuitka/build/static_src/HelpersComparisonLe.c +322 -322
- nuitka/build/static_src/HelpersComparisonLt.c +321 -321
- nuitka/build/static_src/HelpersComparisonNe.c +329 -329
- nuitka/build/static_src/HelpersConsole.c +96 -0
- nuitka/build/static_src/HelpersConstantsBlob.c +10 -6
- nuitka/build/static_src/HelpersDeepcopy.c +10 -8
- nuitka/build/static_src/HelpersDictionaries.c +17 -11
- nuitka/build/static_src/HelpersDictionariesGenerated.c +65 -29
- nuitka/build/static_src/HelpersExceptions.c +107 -9
- nuitka/build/static_src/HelpersFilesystemPaths.c +64 -4
- nuitka/build/static_src/HelpersFloats.c +20 -14
- nuitka/build/static_src/HelpersImport.c +1 -1
- nuitka/build/static_src/HelpersJitSources.c +1 -1
- nuitka/build/static_src/HelpersLists.c +29 -19
- nuitka/build/static_src/HelpersListsGenerated.c +24 -24
- nuitka/build/static_src/HelpersMatching.c +32 -5
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +90 -63
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +4 -4
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +33 -33
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +33 -33
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +33 -33
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +30 -30
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +7 -7
- nuitka/build/static_src/HelpersOperationBinaryMod.c +90 -90
- nuitka/build/static_src/HelpersOperationBinaryMult.c +64 -58
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryPow.c +27 -27
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +30 -30
- nuitka/build/static_src/HelpersOperationBinarySub.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +24 -24
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +67 -49
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +25 -25
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +25 -25
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +25 -25
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +28 -28
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +18 -18
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +10 -10
- nuitka/build/static_src/HelpersOperationInplaceMod.c +70 -70
- nuitka/build/static_src/HelpersOperationInplaceMult.c +33 -33
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +28 -28
- nuitka/build/static_src/HelpersOperationInplacePow.c +28 -28
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +18 -18
- nuitka/build/static_src/HelpersOperationInplaceSub.c +28 -28
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +28 -28
- nuitka/build/static_src/HelpersRaising.c +10 -3
- nuitka/build/static_src/HelpersSafeStrings.c +14 -4
- nuitka/build/static_src/HelpersSlices.c +12 -5
- nuitka/build/static_src/HelpersStrings.c +1 -1
- nuitka/build/static_src/HelpersTuples.c +20 -15
- nuitka/build/static_src/InspectPatcher.c +74 -6
- nuitka/build/static_src/MainProgram.c +90 -25
- nuitka/build/static_src/MetaPathBasedLoader.c +81 -45
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +2 -2
- nuitka/build/static_src/OnefileBootstrap.c +16 -17
- nuitka/code_generation/CodeGeneration.py +5 -2
- nuitka/code_generation/ConstantCodes.py +2 -2
- nuitka/code_generation/DictCodes.py +2 -2
- nuitka/code_generation/GlobalConstants.py +5 -0
- nuitka/code_generation/GlobalsLocalsCodes.py +2 -2
- nuitka/code_generation/ListCodes.py +2 -2
- nuitka/code_generation/LocalsDictCodes.py +1 -1
- nuitka/code_generation/ModuleCodes.py +19 -0
- nuitka/code_generation/PackageResourceCodes.py +14 -0
- nuitka/code_generation/SliceCodes.py +3 -3
- nuitka/code_generation/SubscriptCodes.py +5 -13
- nuitka/code_generation/TupleCodes.py +1 -1
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +7 -7
- nuitka/code_generation/templates/CodeTemplatesConstants.py +7 -5
- nuitka/code_generation/templates/CodeTemplatesLoader.py +2 -0
- nuitka/code_generation/templates/CodeTemplatesModules.py +80 -54
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +1 -1
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +59 -8
- nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +5 -5
- nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +2 -2
- nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +2 -2
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +57 -21
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +5 -5
- nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +18 -18
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +11 -11
- nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +11 -11
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +10 -10
- nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +4 -1
- nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +4 -1
- nuitka/finalizations/FinalizeMarkups.py +0 -18
- nuitka/freezer/DependsExe.py +9 -4
- nuitka/freezer/DllDependenciesMacOS.py +1 -1
- nuitka/freezer/DllDependenciesWin32.py +1 -1
- nuitka/freezer/ImportDetection.py +1 -0
- nuitka/freezer/IncludedDataFiles.py +13 -4
- nuitka/freezer/IncludedEntryPoints.py +16 -0
- nuitka/freezer/Onefile.py +0 -1
- nuitka/freezer/Standalone.py +38 -21
- nuitka/importing/ImportCache.py +3 -2
- nuitka/importing/Importing.py +16 -3
- nuitka/importing/StandardLibrary.py +4 -0
- nuitka/nodes/ChildrenHavingMixins.py +2 -0
- nuitka/nodes/ExpressionBasesGenerated.py +4 -0
- nuitka/nodes/HardImportNodesGenerated.py +83 -0
- nuitka/nodes/ModuleNodes.py +10 -2
- nuitka/nodes/OsSysNodes.py +16 -0
- nuitka/nodes/SubscriptNodes.py +3 -3
- nuitka/plugins/PluginBase.py +2 -0
- nuitka/plugins/standard/DataFilesPlugin.py +22 -1
- nuitka/plugins/standard/DillPlugin/DillPlugin.c +3 -3
- nuitka/plugins/standard/ImplicitImports.py +3 -0
- nuitka/plugins/standard/OptionsNannyPlugin.py +9 -41
- nuitka/plugins/standard/PkgResourcesPlugin.py +8 -2
- nuitka/plugins/standard/PySidePyQtPlugin.py +3 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +28 -13
- nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +2 -2
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +7 -2
- nuitka/specs/HardImportSpecs.py +3 -0
- nuitka/specs/ParameterSpecs.py +26 -15
- nuitka/tools/general/find_module/FindModuleCode.py +3 -2
- nuitka/tools/specialize/CTypeDescriptions.py +11 -9
- nuitka/tools/testing/Common.py +12 -5
- nuitka/tools/testing/SearchModes.py +5 -1
- nuitka/tools/testing/run_nuitka_tests/__main__.py +37 -0
- nuitka/tools/watch/GitHub.py +1 -7
- nuitka/tree/Building.py +9 -6
- nuitka/tree/ReformulationMatchStatements.py +51 -14
- nuitka/tree/TreeHelpers.py +8 -0
- nuitka/utils/CStrings.py +7 -0
- nuitka/utils/Execution.py +10 -1
- nuitka/utils/FileOperations.py +21 -13
- nuitka/utils/Importing.py +24 -0
- nuitka/utils/ReExecute.py +12 -3
- nuitka/utils/SharedLibraries.py +26 -1
- nuitka/utils/Yaml.py +9 -1
- {Nuitka_winsvc-2.2.3.data → Nuitka_winsvc-2.3.2.data}/scripts/nuitka-run.bat +0 -0
- {Nuitka_winsvc-2.2.3.data → Nuitka_winsvc-2.3.2.data}/scripts/nuitka.bat +0 -0
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/WHEEL +0 -0
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/top_level.txt +0 -0
|
@@ -69,7 +69,7 @@ PyObject *CALL_METHODDESCR_WITH_ARGS{{args_count}}(PyThreadState *tstate, PyObje
|
|
|
69
69
|
PyObject *result;
|
|
70
70
|
|
|
71
71
|
#if PYTHON_VERSION < 0x360
|
|
72
|
-
PyObject *pos_args = MAKE_TUPLE(args+1, {{args_count-1}});
|
|
72
|
+
PyObject *pos_args = MAKE_TUPLE(tstate, args+1, {{args_count-1}});
|
|
73
73
|
|
|
74
74
|
if (flags & METH_KEYWORDS) {
|
|
75
75
|
result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);
|
|
@@ -80,19 +80,19 @@ PyObject *CALL_METHODDESCR_WITH_ARGS{{args_count}}(PyThreadState *tstate, PyObje
|
|
|
80
80
|
Py_DECREF(pos_args);
|
|
81
81
|
#else
|
|
82
82
|
if (flags == (METH_VARARGS|METH_KEYWORDS)) {
|
|
83
|
-
PyObject *pos_args = MAKE_TUPLE(args+1, {{args_count-1}});
|
|
83
|
+
PyObject *pos_args = MAKE_TUPLE(tstate, args+1, {{args_count-1}});
|
|
84
84
|
result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);
|
|
85
85
|
Py_DECREF(pos_args);
|
|
86
86
|
} else if (flags == METH_FASTCALL) {
|
|
87
87
|
#if PYTHON_VERSION < 0x370
|
|
88
88
|
result = (*(_PyCFunctionFast)method)(self, (PyObject **)args+1, {{args_count-1}}, NULL);
|
|
89
89
|
#else
|
|
90
|
-
PyObject *pos_args = MAKE_TUPLE(args+1, {{args_count-1}});
|
|
90
|
+
PyObject *pos_args = MAKE_TUPLE(tstate, args+1, {{args_count-1}});
|
|
91
91
|
result = (*(_PyCFunctionFast)method)(self, &pos_args, {{args_count}});
|
|
92
92
|
Py_DECREF(pos_args);
|
|
93
93
|
#endif
|
|
94
94
|
} else {
|
|
95
|
-
PyObject *pos_args = MAKE_TUPLE(args+1, {{args_count-1}});
|
|
95
|
+
PyObject *pos_args = MAKE_TUPLE(tstate, args+1, {{args_count-1}});
|
|
96
96
|
result = (*method)(self, pos_args);
|
|
97
97
|
Py_DECREF(pos_args);
|
|
98
98
|
}
|
|
@@ -118,7 +118,7 @@ PyObject *CALL_METHODDESCR_WITH_ARGS{{args_count}}(PyThreadState *tstate, PyObje
|
|
|
118
118
|
{% if args_count == 0 %}
|
|
119
119
|
PyObject *result = CALL_FUNCTION(tstate, called, const_tuple_empty, NULL);
|
|
120
120
|
{% else %}
|
|
121
|
-
PyObject *pos_args = MAKE_TUPLE(args, {{args_count}});
|
|
121
|
+
PyObject *pos_args = MAKE_TUPLE(tstate, args, {{args_count}});
|
|
122
122
|
|
|
123
123
|
PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);
|
|
124
124
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{# Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}
|
|
2
2
|
|
|
3
|
-
PyObject *MAKE_LIST{{args_count}}(PyObject *list) {
|
|
3
|
+
PyObject *MAKE_LIST{{args_count}}(PyThreadState *tstate, PyObject *list) {
|
|
4
4
|
CHECK_OBJECT(list);
|
|
5
5
|
assert(PyList_CheckExact(list));
|
|
6
6
|
assert(PyList_GET_SIZE(list) == {{args_count}});
|
|
7
7
|
|
|
8
|
-
PyObject *result = MAKE_LIST_EMPTY({{args_count}});
|
|
8
|
+
PyObject *result = MAKE_LIST_EMPTY(tstate, {{args_count}});
|
|
9
9
|
|
|
10
10
|
if (unlikely(result == NULL)) {
|
|
11
11
|
return NULL;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{# Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}
|
|
2
2
|
|
|
3
|
-
PyObject *MAKE_LIST{{args_count}}(
|
|
3
|
+
PyObject *MAKE_LIST{{args_count}}(PyThreadState *tstate,
|
|
4
4
|
{% for i in range(args_count) %}
|
|
5
5
|
{% if i != 0 %}
|
|
6
6
|
,
|
|
@@ -9,7 +9,7 @@ PyObject *MAKE_LIST{{args_count}}(
|
|
|
9
9
|
{% endfor %}
|
|
10
10
|
) {
|
|
11
11
|
|
|
12
|
-
PyObject *result = MAKE_LIST_EMPTY({{args_count}});
|
|
12
|
+
PyObject *result = MAKE_LIST_EMPTY(tstate, {{args_count}});
|
|
13
13
|
|
|
14
14
|
if (unlikely(result == NULL)) {
|
|
15
15
|
return NULL;
|
|
@@ -5,7 +5,7 @@ CHECK_OBJECT({{dict_value}});
|
|
|
5
5
|
assert(PyDict_CheckExact({{dict_value}}));
|
|
6
6
|
|
|
7
7
|
if (((PyDictObject *){{dict_value}})->ma_used == 0) {
|
|
8
|
-
{{ result }} = MAKE_DICT_EMPTY();
|
|
8
|
+
{{ result }} = MAKE_DICT_EMPTY(tstate);
|
|
9
9
|
}
|
|
10
10
|
else
|
|
11
11
|
{
|
|
@@ -38,7 +38,7 @@ else
|
|
|
38
38
|
/* Python 3 */
|
|
39
39
|
#ifndef PY_NOGIL
|
|
40
40
|
if (_PyDict_HasSplitTable(dict_mp)) {
|
|
41
|
-
PyDictObject *result_mp = _Nuitka_AllocatePyDictObject();
|
|
41
|
+
PyDictObject *result_mp = _Nuitka_AllocatePyDictObject(tstate);
|
|
42
42
|
assert(result_mp != NULL);
|
|
43
43
|
{{ result }} = (PyObject *)result_mp;
|
|
44
44
|
|
|
@@ -115,14 +115,14 @@ else
|
|
|
115
115
|
assert(dict_mp->ma_values == NULL);
|
|
116
116
|
assert(dict_mp->ma_keys->dk_refcnt == 1);
|
|
117
117
|
|
|
118
|
-
PyDictObject *result_mp = _Nuitka_AllocatePyDictObject();
|
|
118
|
+
PyDictObject *result_mp = _Nuitka_AllocatePyDictObject(tstate);
|
|
119
119
|
{{ result }} = (PyObject *)result_mp;
|
|
120
120
|
|
|
121
121
|
result_mp->ma_values = NULL;
|
|
122
122
|
result_mp->ma_used = dict_mp->ma_used;
|
|
123
123
|
|
|
124
124
|
Py_ssize_t keys_size = _Nuitka_Py_PyDict_KeysSize(dict_mp->ma_keys);
|
|
125
|
-
result_mp->ma_keys = (
|
|
125
|
+
result_mp->ma_keys = _Nuitka_AllocatePyDictKeysObject(tstate, keys_size);
|
|
126
126
|
assert(result_mp->ma_keys);
|
|
127
127
|
|
|
128
128
|
memcpy(result_mp->ma_keys, dict_mp->ma_keys, keys_size);
|
|
@@ -288,12 +288,12 @@ static inline PyDictValues *_Nuitka_PyDict_new_values(Py_ssize_t size) {
|
|
|
288
288
|
Py_ssize_t values_size = sizeof(PyObject *) * size;
|
|
289
289
|
|
|
290
290
|
#if PYTHON_VERSION < 0x3b0
|
|
291
|
-
return (PyDictValues *)
|
|
291
|
+
return (PyDictValues *)NuitkaMem_Malloc(values_size);
|
|
292
292
|
#else
|
|
293
293
|
// With Python3.11 or higher a prefix is allocated too.
|
|
294
294
|
size_t prefix_size = _Py_SIZE_ROUND_UP(size + 2, sizeof(PyObject *));
|
|
295
295
|
size_t n = prefix_size + values_size;
|
|
296
|
-
uint8_t *mem = (uint8_t *)
|
|
296
|
+
uint8_t *mem = (uint8_t *)NuitkaMem_Malloc(n);
|
|
297
297
|
|
|
298
298
|
assert(mem != NULL);
|
|
299
299
|
|
|
@@ -304,22 +304,26 @@ static inline PyDictValues *_Nuitka_PyDict_new_values(Py_ssize_t size) {
|
|
|
304
304
|
#endif
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
#if NUITKA_DICT_HAS_FREELIST
|
|
308
|
-
static struct _Py_dict_state *_Nuitka_Py_get_dict_state(void) {
|
|
309
|
-
PyInterpreterState *interp = _PyInterpreterState_GET();
|
|
310
|
-
return &interp->dict_state;
|
|
311
|
-
}
|
|
312
|
-
#endif
|
|
313
|
-
|
|
314
307
|
#if PYTHON_VERSION >= 0x300
|
|
315
|
-
static PyDictObject *_Nuitka_AllocatePyDictObject(
|
|
308
|
+
static PyDictObject *_Nuitka_AllocatePyDictObject(PyThreadState *tstate) {
|
|
316
309
|
PyDictObject *result_mp;
|
|
317
310
|
|
|
318
311
|
#if NUITKA_DICT_HAS_FREELIST
|
|
319
|
-
|
|
312
|
+
// This is the CPython name, spell-checker: ignore numfree
|
|
313
|
+
|
|
314
|
+
#if PYTHON_VERSION < 0x3d0
|
|
315
|
+
PyDictObject **items = tstate->interp->dict_state.free_list;
|
|
316
|
+
int *numfree = &tstate->interp->dict_state.numfree;
|
|
317
|
+
#else
|
|
318
|
+
struct _Py_object_freelists *freelists = _Nuitka_object_freelists_GET(tstate);
|
|
319
|
+
struct _Py_dict_freelist *state = &freelists->dicts;
|
|
320
|
+
PyDictObject **items = state->items;
|
|
321
|
+
int *numfree = &state->numfree;
|
|
322
|
+
#endif
|
|
320
323
|
|
|
321
|
-
if (
|
|
322
|
-
|
|
324
|
+
if (*numfree) {
|
|
325
|
+
(*numfree) -= 1;
|
|
326
|
+
result_mp = items[*numfree];
|
|
323
327
|
|
|
324
328
|
Nuitka_Py_NewReference((PyObject *)result_mp);
|
|
325
329
|
|
|
@@ -335,6 +339,38 @@ static PyDictObject *_Nuitka_AllocatePyDictObject(void) {
|
|
|
335
339
|
}
|
|
336
340
|
#endif
|
|
337
341
|
|
|
342
|
+
#if PYTHON_VERSION >= 0x360
|
|
343
|
+
static PyDictKeysObject *_Nuitka_AllocatePyDictKeysObject(PyThreadState *tstate, Py_ssize_t keys_size) {
|
|
344
|
+
// CPython names, spell-checker: ignore numfree,dictkeys
|
|
345
|
+
PyDictKeysObject *dk;
|
|
346
|
+
|
|
347
|
+
// TODO: Cannot always use cached objects. Need to also consider
|
|
348
|
+
// "log2_size == PyDict_LOG_MINSIZE && unicode" as a criterion,
|
|
349
|
+
// seems it can only be used for the smallest keys type.
|
|
350
|
+
#if NUITKA_DICT_HAS_FREELIST && 0
|
|
351
|
+
#if PYTHON_VERSION < 0x3d0
|
|
352
|
+
PyDictKeysObject **items = tstate->interp->dict_state.keys_free_list;
|
|
353
|
+
int *numfree = &tstate->interp->dict_state.keys_numfree;
|
|
354
|
+
#else
|
|
355
|
+
struct _Py_object_freelists *freelists = _Nuitka_object_freelists_GET(tstate);
|
|
356
|
+
struct _Py_dictkeys_freelist *state = &freelists->dictkeys;
|
|
357
|
+
PyDictKeysObject **items = state->items;
|
|
358
|
+
int *numfree = &state->numfree;
|
|
359
|
+
#endif
|
|
360
|
+
|
|
361
|
+
if (*numfree) {
|
|
362
|
+
(*numfree) -= 1;
|
|
363
|
+
dk = items[*numfree];
|
|
364
|
+
} else
|
|
365
|
+
#endif
|
|
366
|
+
{
|
|
367
|
+
dk = (PyDictKeysObject *)NuitkaObject_Malloc(keys_size);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
return dk;
|
|
371
|
+
}
|
|
372
|
+
#endif
|
|
373
|
+
|
|
338
374
|
#if PYTHON_VERSION >= 0x360 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_DICT_OPT)
|
|
339
375
|
static Py_ssize_t _Nuitka_Py_PyDict_KeysSize(PyDictKeysObject *keys) {
|
|
340
376
|
#if PYTHON_VERSION < 0x360
|
|
@@ -357,7 +393,7 @@ static Py_ssize_t _Nuitka_Py_PyDict_KeysSize(PyDictKeysObject *keys) {
|
|
|
357
393
|
}
|
|
358
394
|
#endif
|
|
359
395
|
|
|
360
|
-
PyObject *DICT_COPY(PyObject *dict_value) {
|
|
396
|
+
PyObject *DICT_COPY(PyThreadState *tstate, PyObject *dict_value) {
|
|
361
397
|
#if _NUITKA_EXPERIMENTAL_DISABLE_DICT_OPT
|
|
362
398
|
CHECK_OBJECT(dict_value);
|
|
363
399
|
assert(PyDict_CheckExact(dict_value));
|
|
@@ -379,7 +415,7 @@ PyObject *DEEP_COPY_DICT(PyThreadState *tstate, PyObject *dict_value) {
|
|
|
379
415
|
CHECK_OBJECT(dict_value);
|
|
380
416
|
assert(PyDict_CheckExact(dict_value));
|
|
381
417
|
|
|
382
|
-
result = DICT_COPY(dict_value);
|
|
418
|
+
result = DICT_COPY(tstate, dict_value);
|
|
383
419
|
|
|
384
420
|
Py_ssize_t pos = 0;
|
|
385
421
|
PyObject *key, *value;
|
|
@@ -399,7 +435,7 @@ PyObject *DEEP_COPY_DICT(PyThreadState *tstate, PyObject *dict_value) {
|
|
|
399
435
|
}
|
|
400
436
|
|
|
401
437
|
// Helper for function calls with star dict arguments. */
|
|
402
|
-
static PyObject *COPY_DICT_KW(PyObject *dict_value) {
|
|
438
|
+
static PyObject *COPY_DICT_KW(PyThreadState *tstate, PyObject *dict_value) {
|
|
403
439
|
PyObject *result;
|
|
404
440
|
bool had_kw_error = false;
|
|
405
441
|
|
|
@@ -407,7 +443,7 @@ static PyObject *COPY_DICT_KW(PyObject *dict_value) {
|
|
|
407
443
|
CHECK_OBJECT(dict_value);
|
|
408
444
|
assert(PyDict_CheckExact(dict_value));
|
|
409
445
|
|
|
410
|
-
result = DICT_COPY(dict_value);
|
|
446
|
+
result = DICT_COPY(tstate, dict_value);
|
|
411
447
|
|
|
412
448
|
Py_ssize_t pos = 0;
|
|
413
449
|
PyObject *key, *value;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{# Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}
|
|
2
2
|
|
|
3
|
-
{{target.getTypeDecl()}} {{module_code_name}}(void) {
|
|
3
|
+
{{ target.getTypeDecl() }} {{module_code_name}}(void) {
|
|
4
4
|
static PyObject *module_{{module_code_name.lower()}} = NULL;
|
|
5
5
|
|
|
6
6
|
if (module_{{module_code_name.lower()}} == NULL) {
|
|
@@ -39,7 +39,7 @@ exit_binary_exception:
|
|
|
39
39
|
{% endif %}
|
|
40
40
|
{% endmacro %}
|
|
41
41
|
{% if not left.hasTypeSpecializationCode(right, nb_slot, sq_slot) and left.getSameTypeType(right).hasSameTypeOperationSpecializationCode(right.getSameTypeType(left), nb_slot, sq_slot) %}
|
|
42
|
-
static HEDLEY_NEVER_INLINE {{target.getTypeDecl()}} __BINARY_OPERATION_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
42
|
+
static HEDLEY_NEVER_INLINE {{ target.getTypeDecl() }} __BINARY_OPERATION_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
43
43
|
{% set props = {"exits": {}} %}
|
|
44
44
|
{% if left == object_desc %}
|
|
45
45
|
PyTypeObject *type1 = {{ left.getTypeValueExpression("operand1") }};
|
|
@@ -51,7 +51,7 @@ static HEDLEY_NEVER_INLINE {{target.getTypeDecl()}} __BINARY_OPERATION_{{op_code
|
|
|
51
51
|
{{ binary_fallback_operation(props, target, left, right, "type1", "type2") }}
|
|
52
52
|
}
|
|
53
53
|
{% endif %}
|
|
54
|
-
static {{target.getTypeDecl()}} _BINARY_OPERATION_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
54
|
+
static {{ target.getTypeDecl() }} _BINARY_OPERATION_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
55
55
|
{{ left.getCheckValueCode("operand1") }}
|
|
56
56
|
{{ right.getCheckValueCode("operand2") }}
|
|
57
57
|
|
|
@@ -59,7 +59,7 @@ static {{target.getTypeDecl()}} _BINARY_OPERATION_{{op_code}}_{{target.getHelper
|
|
|
59
59
|
{# CPython2 treats integer values with fast path. #}
|
|
60
60
|
#if PYTHON_VERSION < 0x300
|
|
61
61
|
if ({{ left.getIntCheckExpression("operand1") }} && {{ right.getIntCheckExpression("operand2") }}) {
|
|
62
|
-
{{target.getTypeDecl()}} result;
|
|
62
|
+
{{ target.getTypeDecl() }} result;
|
|
63
63
|
|
|
64
64
|
{% set props = {"exits": {}} %}
|
|
65
65
|
{{ int_slot(props, operator, nb_slot, target, int_desc, int_desc, "result", "operand1", "operand2", "exit_result_ok", "exit_result_exception") }}
|
|
@@ -98,7 +98,7 @@ static {{target.getTypeDecl()}} _BINARY_OPERATION_{{op_code}}_{{target.getHelper
|
|
|
98
98
|
{% endif %}
|
|
99
99
|
|
|
100
100
|
if ({{ left.getTypeIdenticalCheckExpression(right, "type1", "type2") }}) {
|
|
101
|
-
{{target.getTypeDecl()}} result;
|
|
101
|
+
{{ target.getTypeDecl() }} result;
|
|
102
102
|
|
|
103
103
|
{# There is special code for same types. #}
|
|
104
104
|
// return _BINARY_OPERATION_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getSameTypeType(right).getHelperCodeName()}}_{{right.getSameTypeType(left).getHelperCodeName()}}(operand1, operand2);
|
|
@@ -128,7 +128,7 @@ static {{target.getTypeDecl()}} _BINARY_OPERATION_{{op_code}}_{{target.getHelper
|
|
|
128
128
|
{% endif %}
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
{{target.getTypeDecl()}} BINARY_OPERATION_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
131
|
+
{{ target.getTypeDecl() }} BINARY_OPERATION_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
132
132
|
return _BINARY_OPERATION_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}(operand1, operand2);
|
|
133
133
|
}
|
|
134
134
|
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
// Quick path for avoidable checks, compatible with CPython.
|
|
17
17
|
if (operand1 == operand2 && {{left.getMostSpecificType(right).getSaneTypeCheckCode("operand1")}}) {
|
|
18
18
|
bool r = {% if op_code == "NE" %} false {% else %} true {%endif %};
|
|
19
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
20
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
19
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
20
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
21
21
|
return result;
|
|
22
22
|
}
|
|
23
23
|
{% endif %}
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
{{ target.getReturnFromObjectExpressionCode("result") }}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
Py_DECREF_IMMORTAL(result);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
// No rich comparison worked, but maybe compare works.
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
bool r = c != 0;
|
|
108
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
109
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
108
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
109
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
110
110
|
return result;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
{{ target.getReturnFromObjectExpressionCode("result") }}
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
Py_DECREF_IMMORTAL(result);
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
{{ target.getReturnFromObjectExpressionCode("result") }}
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
Py_DECREF_IMMORTAL(result);
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
f = {{right.getSlotValueExpression("type2", "tp_richcompare")}};
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
{{ target.getReturnFromObjectExpressionCode("result") }}
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
Py_DECREF_IMMORTAL(result);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
int c;
|
|
@@ -240,8 +240,8 @@
|
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
bool r = c != 0;
|
|
243
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
244
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
243
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
244
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
245
245
|
return result;
|
|
246
246
|
#else
|
|
247
247
|
bool checked_reverse_op = false;
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
{{ target.getReturnFromObjectExpressionCode("result") }}
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
|
|
264
|
+
Py_DECREF_IMMORTAL(result);
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
|
|
@@ -276,7 +276,7 @@
|
|
|
276
276
|
{{ target.getReturnFromObjectExpressionCode("result") }}
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
-
|
|
279
|
+
Py_DECREF_IMMORTAL(result);
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
if (checked_reverse_op == false) {
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
{{ target.getReturnFromObjectExpressionCode("result") }}
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
-
|
|
294
|
+
Py_DECREF_IMMORTAL(result);
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
|
|
@@ -302,14 +302,14 @@
|
|
|
302
302
|
switch(Py_{{op_code}}) {
|
|
303
303
|
case Py_EQ: {
|
|
304
304
|
bool r = operand1 == operand2;
|
|
305
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
306
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
305
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
306
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
307
307
|
return result;
|
|
308
308
|
}
|
|
309
309
|
case Py_NE: {
|
|
310
310
|
bool r = operand1 != operand2;
|
|
311
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
312
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
311
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
312
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
313
313
|
return result;
|
|
314
314
|
}
|
|
315
315
|
default:
|
|
@@ -318,7 +318,7 @@
|
|
|
318
318
|
#endif
|
|
319
319
|
{% endif %}
|
|
320
320
|
{% endmacro %}
|
|
321
|
-
{{target.getTypeDecl()}} RICH_COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
321
|
+
{{ target.getTypeDecl() }} RICH_COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
322
322
|
|
|
323
323
|
{# Divert to more special implementation immediately if possible. #}
|
|
324
324
|
{% if left.getTypeComparisonSpecializationCode(right, op_code, target, "operand1", "operand2") %}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{# Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}
|
|
2
2
|
|
|
3
|
-
static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
3
|
+
static {{ target.getTypeDecl() }} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
4
4
|
{{left.getCheckValueCode("operand1")}}
|
|
5
5
|
{{right.getCheckValueCode("operand2")}}
|
|
6
6
|
|
|
@@ -16,8 +16,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
|
|
|
16
16
|
{% endif %}
|
|
17
17
|
|
|
18
18
|
// Convert to target type.
|
|
19
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
20
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
19
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
20
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
21
21
|
return result;
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -34,8 +34,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
|
|
|
34
34
|
{% endif %}
|
|
35
35
|
|
|
36
36
|
// Convert to target type.
|
|
37
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
38
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
37
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
38
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
39
39
|
return result;
|
|
40
40
|
} else {
|
|
41
41
|
if ((a->ob_sval[0] == b->ob_sval[0]) && (memcmp(a->ob_sval, b->ob_sval, len_a) == 0)) {
|
|
@@ -46,8 +46,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
|
|
|
46
46
|
{% endif %}
|
|
47
47
|
|
|
48
48
|
// Convert to target type.
|
|
49
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
50
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
49
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
50
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
51
51
|
return result;
|
|
52
52
|
} else {
|
|
53
53
|
{% if operand == "==" %}
|
|
@@ -57,8 +57,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
|
|
|
57
57
|
{% endif %}
|
|
58
58
|
|
|
59
59
|
// Convert to target type.
|
|
60
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
61
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
60
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
61
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
62
62
|
return result;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -92,8 +92,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
|
|
|
92
92
|
{% endif %}
|
|
93
93
|
|
|
94
94
|
// Convert to target type.
|
|
95
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("c != 0")}};
|
|
96
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
95
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("c != 0")}};
|
|
96
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
97
97
|
return result;
|
|
98
98
|
|
|
99
99
|
{% endif %}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{# Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}
|
|
2
2
|
|
|
3
|
-
static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
3
|
+
static {{ target.getTypeDecl() }} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
4
4
|
{{ left.getCheckValueCode("operand1") }}
|
|
5
5
|
{{ right.getCheckValueCode("operand2") }}
|
|
6
6
|
|
|
@@ -10,8 +10,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
|
|
|
10
10
|
bool r = a {{operand}} b;
|
|
11
11
|
|
|
12
12
|
// Convert to target type.
|
|
13
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
14
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
13
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
14
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
15
15
|
return result;
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{# Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}
|
|
2
2
|
|
|
3
|
-
static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
3
|
+
static {{ target.getTypeDecl() }} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
4
4
|
{{left.getCheckValueCode("operand1")}}
|
|
5
5
|
{{right.getCheckValueCode("operand2")}}
|
|
6
6
|
|
|
@@ -11,8 +11,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
|
|
|
11
11
|
bool r = a {{operand}} b;
|
|
12
12
|
|
|
13
13
|
// Convert to target type.
|
|
14
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
15
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
14
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
15
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
16
16
|
return result;
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{# Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}
|
|
2
2
|
|
|
3
|
-
static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
3
|
+
static {{ target.getTypeDecl() }} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
4
4
|
{{left.getCheckValueCode("operand1")}}
|
|
5
5
|
{{right.getCheckValueCode("operand2")}}
|
|
6
6
|
|
|
@@ -18,8 +18,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
|
|
|
18
18
|
{% endif %}
|
|
19
19
|
|
|
20
20
|
// Convert to target type.
|
|
21
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
22
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
21
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
22
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
23
23
|
return result;
|
|
24
24
|
}
|
|
25
25
|
{% endif %}
|
|
@@ -63,8 +63,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
|
|
|
63
63
|
bool r = Py_SIZE(a) {{operand}} Py_SIZE(b);
|
|
64
64
|
|
|
65
65
|
// Convert to target type.
|
|
66
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
67
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
66
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
67
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
68
68
|
return result;
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -88,8 +88,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
|
|
|
88
88
|
{% endif %}
|
|
89
89
|
|
|
90
90
|
// Convert to target type.
|
|
91
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
92
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
91
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
92
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
93
93
|
return result;
|
|
94
94
|
|
|
95
95
|
{% endif %}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{# Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}
|
|
2
2
|
|
|
3
3
|
{% from 'HelperLongTools.c.j2' import declare_long_access with context %}
|
|
4
|
-
static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
4
|
+
static {{ target.getTypeDecl() }} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
5
5
|
{{ left.getCheckValueCode("operand1") }}
|
|
6
6
|
{{ right.getCheckValueCode("operand2") }}
|
|
7
7
|
|
|
@@ -136,8 +136,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
|
|
|
136
136
|
{% endif %}
|
|
137
137
|
|
|
138
138
|
// Convert to target type.
|
|
139
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
140
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
139
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
140
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
141
141
|
return result;
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{# Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}
|
|
2
2
|
|
|
3
|
-
static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
3
|
+
static {{ target.getTypeDecl() }} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
|
|
4
4
|
{{left.getCheckValueCode("operand1")}}
|
|
5
5
|
{{right.getCheckValueCode("operand2")}}
|
|
6
6
|
|
|
@@ -16,8 +16,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
|
|
|
16
16
|
{% endif %}
|
|
17
17
|
|
|
18
18
|
// Convert to target type.
|
|
19
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
20
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
19
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
20
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
21
21
|
return result;
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -34,8 +34,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
|
|
|
34
34
|
{% endif %}
|
|
35
35
|
|
|
36
36
|
// Convert to target type.
|
|
37
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
38
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
37
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
38
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
39
39
|
return result;
|
|
40
40
|
} else {
|
|
41
41
|
if ((a->ob_sval[0] == b->ob_sval[0]) && (memcmp(a->ob_sval, b->ob_sval, len_a) == 0)) {
|
|
@@ -46,8 +46,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
|
|
|
46
46
|
{% endif %}
|
|
47
47
|
|
|
48
48
|
// Convert to target type.
|
|
49
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
50
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
49
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
50
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
51
51
|
return result;
|
|
52
52
|
} else {
|
|
53
53
|
{% if operand == "==" %}
|
|
@@ -57,8 +57,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
|
|
|
57
57
|
{% endif %}
|
|
58
58
|
|
|
59
59
|
// Convert to target type.
|
|
60
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
|
|
61
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
60
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
|
|
61
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
62
62
|
return result;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -92,8 +92,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
|
|
|
92
92
|
{% endif %}
|
|
93
93
|
|
|
94
94
|
// Convert to target type.
|
|
95
|
-
{{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("c != 0")}};
|
|
96
|
-
{{target.getTakeReferenceStatement("result")}}
|
|
95
|
+
{{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("c != 0")}};
|
|
96
|
+
{{ target.getTakeReferenceStatement("result", immortal=True) }}
|
|
97
97
|
return result;
|
|
98
98
|
|
|
99
99
|
{% endif %}
|