Nuitka-winsvc 2.7.7__cp313-cp313-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/Builtins.py +259 -0
- nuitka/BytecodeCaching.py +184 -0
- nuitka/Bytecodes.py +109 -0
- nuitka/CacheCleanup.py +54 -0
- nuitka/Constants.py +425 -0
- nuitka/Errors.py +93 -0
- nuitka/HardImportRegistry.py +408 -0
- nuitka/MainControl.py +1201 -0
- nuitka/ModuleRegistry.py +364 -0
- nuitka/OptionParsing.py +2473 -0
- nuitka/Options.py +2948 -0
- nuitka/OutputDirectories.py +201 -0
- nuitka/PostProcessing.py +551 -0
- nuitka/Progress.py +252 -0
- nuitka/PythonFlavors.py +426 -0
- nuitka/PythonOperators.py +146 -0
- nuitka/PythonVersions.py +513 -0
- nuitka/Serialization.py +291 -0
- nuitka/SourceCodeReferences.py +176 -0
- nuitka/Tracing.py +579 -0
- nuitka/TreeXML.py +141 -0
- nuitka/Variables.py +515 -0
- nuitka/Version.py +88 -0
- nuitka/__init__.py +19 -0
- nuitka/__main__.py +224 -0
- nuitka/__past__.py +217 -0
- nuitka/build/Backend.scons +1111 -0
- nuitka/build/CCompilerVersion.scons +281 -0
- nuitka/build/DataComposerInterface.py +116 -0
- nuitka/build/Offsets.scons +626 -0
- nuitka/build/Onefile.scons +564 -0
- nuitka/build/SconsCaching.py +451 -0
- nuitka/build/SconsCompilerSettings.py +1133 -0
- nuitka/build/SconsHacks.py +215 -0
- nuitka/build/SconsInterface.py +664 -0
- nuitka/build/SconsProgress.py +100 -0
- nuitka/build/SconsSpawn.py +436 -0
- nuitka/build/SconsUtils.py +939 -0
- nuitka/build/__init__.py +19 -0
- nuitka/build/include/nuitka/allocator.h +450 -0
- nuitka/build/include/nuitka/builtins.h +97 -0
- nuitka/build/include/nuitka/calling.h +123 -0
- nuitka/build/include/nuitka/checkers.h +39 -0
- nuitka/build/include/nuitka/checksum_tools.h +28 -0
- nuitka/build/include/nuitka/compiled_asyncgen.h +281 -0
- nuitka/build/include/nuitka/compiled_cell.h +64 -0
- nuitka/build/include/nuitka/compiled_coroutine.h +271 -0
- nuitka/build/include/nuitka/compiled_frame.h +502 -0
- nuitka/build/include/nuitka/compiled_function.h +170 -0
- nuitka/build/include/nuitka/compiled_generator.h +287 -0
- nuitka/build/include/nuitka/compiled_method.h +54 -0
- nuitka/build/include/nuitka/constants.h +251 -0
- nuitka/build/include/nuitka/constants_blob.h +34 -0
- nuitka/build/include/nuitka/debug_settings.h +60 -0
- nuitka/build/include/nuitka/environment_variables.h +30 -0
- nuitka/build/include/nuitka/environment_variables_system.h +51 -0
- nuitka/build/include/nuitka/exception_groups.h +167 -0
- nuitka/build/include/nuitka/exceptions.h +1458 -0
- nuitka/build/include/nuitka/filesystem_paths.h +117 -0
- nuitka/build/include/nuitka/freelists.h +92 -0
- nuitka/build/include/nuitka/hedley.h +1774 -0
- nuitka/build/include/nuitka/helper/attributes.h +90 -0
- nuitka/build/include/nuitka/helper/boolean.h +86 -0
- nuitka/build/include/nuitka/helper/bytearrays.h +34 -0
- nuitka/build/include/nuitka/helper/bytes.h +28 -0
- nuitka/build/include/nuitka/helper/calling_generated.h +132 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_eq.h +247 -0
- nuitka/build/include/nuitka/helper/comparisons_ge.h +197 -0
- nuitka/build/include/nuitka/helper/comparisons_gt.h +197 -0
- nuitka/build/include/nuitka/helper/comparisons_le.h +247 -0
- nuitka/build/include/nuitka/helper/comparisons_lt.h +247 -0
- nuitka/build/include/nuitka/helper/comparisons_ne.h +197 -0
- nuitka/build/include/nuitka/helper/complex.h +46 -0
- nuitka/build/include/nuitka/helper/dictionaries.h +481 -0
- nuitka/build/include/nuitka/helper/floats.h +32 -0
- nuitka/build/include/nuitka/helper/import_hard.h +121 -0
- nuitka/build/include/nuitka/helper/indexes.h +47 -0
- nuitka/build/include/nuitka/helper/ints.h +165 -0
- nuitka/build/include/nuitka/helper/iterators.h +376 -0
- nuitka/build/include/nuitka/helper/lists.h +94 -0
- nuitka/build/include/nuitka/helper/lists_generated.h +36 -0
- nuitka/build/include/nuitka/helper/mappings.h +39 -0
- nuitka/build/include/nuitka/helper/operations.h +114 -0
- nuitka/build/include/nuitka/helper/operations_binary_add.h +240 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitand.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitor.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitxor.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_divmod.h +103 -0
- nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
- nuitka/build/include/nuitka/helper/operations_binary_floordiv.h +103 -0
- nuitka/build/include/nuitka/helper/operations_binary_lshift.h +99 -0
- nuitka/build/include/nuitka/helper/operations_binary_matmult.h +60 -0
- nuitka/build/include/nuitka/helper/operations_binary_mod.h +304 -0
- nuitka/build/include/nuitka/helper/operations_binary_mult.h +247 -0
- nuitka/build/include/nuitka/helper/operations_binary_olddiv.h +125 -0
- nuitka/build/include/nuitka/helper/operations_binary_pow.h +90 -0
- nuitka/build/include/nuitka/helper/operations_binary_rshift.h +99 -0
- nuitka/build/include/nuitka/helper/operations_binary_sub.h +117 -0
- nuitka/build/include/nuitka/helper/operations_binary_truediv.h +103 -0
- nuitka/build/include/nuitka/helper/operations_builtin_types.h +247 -0
- nuitka/build/include/nuitka/helper/operations_inplace_add.h +173 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitand.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitor.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitxor.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_floordiv.h +95 -0
- nuitka/build/include/nuitka/helper/operations_inplace_lshift.h +62 -0
- nuitka/build/include/nuitka/helper/operations_inplace_matmult.h +60 -0
- nuitka/build/include/nuitka/helper/operations_inplace_mod.h +218 -0
- nuitka/build/include/nuitka/helper/operations_inplace_mult.h +184 -0
- nuitka/build/include/nuitka/helper/operations_inplace_olddiv.h +115 -0
- nuitka/build/include/nuitka/helper/operations_inplace_pow.h +87 -0
- nuitka/build/include/nuitka/helper/operations_inplace_rshift.h +62 -0
- nuitka/build/include/nuitka/helper/operations_inplace_sub.h +102 -0
- nuitka/build/include/nuitka/helper/operations_inplace_truediv.h +95 -0
- nuitka/build/include/nuitka/helper/raising.h +114 -0
- nuitka/build/include/nuitka/helper/rangeobjects.h +66 -0
- nuitka/build/include/nuitka/helper/richcomparisons.h +35 -0
- nuitka/build/include/nuitka/helper/sequences.h +33 -0
- nuitka/build/include/nuitka/helper/sets.h +25 -0
- nuitka/build/include/nuitka/helper/slices.h +314 -0
- nuitka/build/include/nuitka/helper/strings.h +30 -0
- nuitka/build/include/nuitka/helper/subscripts.h +390 -0
- nuitka/build/include/nuitka/helper/tuples.h +187 -0
- nuitka/build/include/nuitka/helpers.h +417 -0
- nuitka/build/include/nuitka/importing.h +149 -0
- nuitka/build/include/nuitka/incbin.h +402 -0
- nuitka/build/include/nuitka/jit_sources.h +25 -0
- nuitka/build/include/nuitka/prelude.h +626 -0
- nuitka/build/include/nuitka/printing.h +84 -0
- nuitka/build/include/nuitka/python_pgo.h +57 -0
- nuitka/build/include/nuitka/safe_string_ops.h +57 -0
- nuitka/build/include/nuitka/threading.h +142 -0
- nuitka/build/include/nuitka/tracing.h +82 -0
- nuitka/build/include/nuitka/type_aliases.h +30 -0
- nuitka/build/include/nuitka/unfreezing.h +91 -0
- nuitka/build/inline_copy/appdirs/LICENSE.txt +23 -0
- nuitka/build/inline_copy/appdirs/appdirs.py +611 -0
- nuitka/build/inline_copy/atomicwrites/LICENSE +19 -0
- nuitka/build/inline_copy/atomicwrites/atomicwrites.py +226 -0
- nuitka/build/inline_copy/bin/scons.py +58 -0
- nuitka/build/inline_copy/clcache/clcache/LICENSE +30 -0
- nuitka/build/inline_copy/clcache/clcache/__init__.py +4 -0
- nuitka/build/inline_copy/clcache/clcache/caching.py +2008 -0
- nuitka/build/inline_copy/colorama/LICENSE.txt +27 -0
- nuitka/build/inline_copy/colorama/colorama/__init__.py +6 -0
- nuitka/build/inline_copy/colorama/colorama/ansi.py +102 -0
- nuitka/build/inline_copy/colorama/colorama/ansitowin32.py +258 -0
- nuitka/build/inline_copy/colorama/colorama/initialise.py +80 -0
- nuitka/build/inline_copy/colorama/colorama/win32.py +152 -0
- nuitka/build/inline_copy/colorama/colorama/winterm.py +169 -0
- nuitka/build/inline_copy/glob2/LICENSE +27 -0
- nuitka/build/inline_copy/glob2/glob2/__init__.py +5 -0
- nuitka/build/inline_copy/glob2/glob2/compat.py +167 -0
- nuitka/build/inline_copy/glob2/glob2/fnmatch.py +141 -0
- nuitka/build/inline_copy/glob2/glob2/impl.py +216 -0
- nuitka/build/inline_copy/jinja2/LICENSE.rst +28 -0
- nuitka/build/inline_copy/jinja2/README.rst +2 -0
- nuitka/build/inline_copy/jinja2/jinja2/__init__.py +72 -0
- nuitka/build/inline_copy/jinja2/jinja2/_compat.py +105 -0
- nuitka/build/inline_copy/jinja2/jinja2/_identifier.py +2 -0
- nuitka/build/inline_copy/jinja2/jinja2/bccache.py +361 -0
- nuitka/build/inline_copy/jinja2/jinja2/compiler.py +1721 -0
- nuitka/build/inline_copy/jinja2/jinja2/constants.py +32 -0
- nuitka/build/inline_copy/jinja2/jinja2/debug.py +378 -0
- nuitka/build/inline_copy/jinja2/jinja2/defaults.py +56 -0
- nuitka/build/inline_copy/jinja2/jinja2/environment.py +1276 -0
- nuitka/build/inline_copy/jinja2/jinja2/exceptions.py +146 -0
- nuitka/build/inline_copy/jinja2/jinja2/ext.py +627 -0
- nuitka/build/inline_copy/jinja2/jinja2/filters.py +1190 -0
- nuitka/build/inline_copy/jinja2/jinja2/idtracking.py +286 -0
- nuitka/build/inline_copy/jinja2/jinja2/lexer.py +739 -0
- nuitka/build/inline_copy/jinja2/jinja2/loaders.py +483 -0
- nuitka/build/inline_copy/jinja2/jinja2/meta.py +106 -0
- nuitka/build/inline_copy/jinja2/jinja2/nativetypes.py +220 -0
- nuitka/build/inline_copy/jinja2/jinja2/nodes.py +999 -0
- nuitka/build/inline_copy/jinja2/jinja2/optimizer.py +49 -0
- nuitka/build/inline_copy/jinja2/jinja2/parser.py +903 -0
- nuitka/build/inline_copy/jinja2/jinja2/runtime.py +808 -0
- nuitka/build/inline_copy/jinja2/jinja2/sandbox.py +488 -0
- nuitka/build/inline_copy/jinja2/jinja2/tests.py +174 -0
- nuitka/build/inline_copy/jinja2/jinja2/utils.py +642 -0
- nuitka/build/inline_copy/jinja2/jinja2/visitor.py +87 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Action.py +1475 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Builder.py +905 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/CacheDir.py +314 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Conftest.py +805 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Debug.py +251 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Defaults.py +646 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Environment.py +2561 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/EnvironmentValues.py +119 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Errors.py +222 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Executor.py +660 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Job.py +439 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Memoize.py +242 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Alias.py +176 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/FS.py +3861 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Python.py +195 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/__init__.py +1784 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/PathList.py +224 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/__init__.py +341 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/aix.py +81 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/cygwin.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/darwin.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/hpux.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/irix.py +41 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/mingw.py +33 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/os2.py +55 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/posix.py +124 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/sunos.py +47 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/virtualenv.py +115 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/win32.py +429 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConf.py +1119 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConsign.py +453 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/C.py +226 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Dir.py +131 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Prog.py +114 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/RC.py +57 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/__init__.py +436 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Interactive.py +372 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Main.py +1469 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConsOptions.py +1071 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConscript.py +686 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/__init__.py +425 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Subst.py +979 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Taskmaster.py +1062 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/386asm.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/GettextCommon.py +429 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/__init__.py +52 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/arch.py +66 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/common.py +371 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/netframework.py +83 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/sdk.py +411 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vc.py +994 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vs.py +608 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/PharLapCommon.py +116 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/__init__.py +882 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixc++.py +43 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcc.py +74 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcxx.py +77 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixlink.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/applelink.py +209 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ar.py +63 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/as.py +49 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/asm.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/bcc32.py +81 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/c++.py +44 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cc.py +105 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clang.py +91 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangCommon/__init__.py +18 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangxx.py +99 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cxx.py +95 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cyglink.py +212 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/default.py +50 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/filesystem.py +98 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/g++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gas.py +56 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gcc.py +110 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gettext_tool.py +69 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gnulink.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gxx.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpc++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcc.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcxx.py +88 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hplink.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icc.py +59 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icl.py +52 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink.py +55 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink32.py +60 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/install.py +510 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/intelc.py +617 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/link.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/LoadableModule.py +131 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/SharedLibrary.py +218 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/__init__.py +171 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkloc.py +112 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/m4.py +63 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/masm.py +77 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mingw.py +232 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgfmt.py +132 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msginit.py +137 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgmerge.py +125 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslib.py +73 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslink.py +339 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mssdk.py +50 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvc.py +325 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvs.py +2116 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwcc.py +207 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwld.py +108 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/nasm.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rmic.py +139 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rpcgen.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgiar.py +68 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgic++.py +43 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicc.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicxx.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgilink.py +59 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunar.py +64 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunc++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncc.py +58 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncxx.py +153 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunlink.py +79 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tar.py +73 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/textfile.py +198 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tlib.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/wix.py +104 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/xgettext.py +337 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/zip.py +120 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Util.py +2134 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/ConfigureCache.py +171 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/__init__.py +0 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/sconsign.py +494 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/BoolVariable.py +96 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/EnumVariable.py +110 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/ListVariable.py +152 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PackageVariable.py +107 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PathVariable.py +158 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/__init__.py +334 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Warnings.py +238 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/__init__.py +9 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/__init__.py +104 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/_scons_dbm.py +42 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/win32.py +101 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/cpp.py +640 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/dblite.py +295 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/exitfuncs.py +59 -0
- nuitka/build/inline_copy/markupsafe/LICENSE.rst +28 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/__init__.py +327 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_compat.py +33 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_constants.py +264 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_native.py +69 -0
- nuitka/build/inline_copy/pefile/LICENSE.txt +21 -0
- nuitka/build/inline_copy/pefile/ordlookup/__init__.py +41 -0
- nuitka/build/inline_copy/pefile/ordlookup/oleaut32.py +400 -0
- nuitka/build/inline_copy/pefile/ordlookup/ws2_32.py +120 -0
- nuitka/build/inline_copy/pefile/pefile.py +8034 -0
- nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +3272 -0
- nuitka/build/inline_copy/pkg_resources/pkg_resources/py31compat.py +21 -0
- nuitka/build/inline_copy/python_hacl/LICENSE.txt +201 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.c +1430 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.h +66 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.c +463 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.h +66 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.c +1273 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.h +204 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.c +734 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.h +131 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Streaming_Types.h +83 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt128_Verified.h +346 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt_8_16_32_64.h +107 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/fstar_uint128_struct_endianness.h +68 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/internal/target.h +293 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/lowstar_endianness.h +231 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/types.h +14 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_MD5.h +56 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA1.h +56 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA2.h +164 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA3.h +65 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/python_hacl_namespaces.h +89 -0
- nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
- nuitka/build/inline_copy/stubgen/six.py +998 -0
- nuitka/build/inline_copy/stubgen/stubgen.py +484 -0
- nuitka/build/inline_copy/tqdm/tqdm/__init__.py +40 -0
- nuitka/build/inline_copy/tqdm/tqdm/_main.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +97 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm_notebook.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm_pandas.py +24 -0
- nuitka/build/inline_copy/tqdm/tqdm/_utils.py +12 -0
- nuitka/build/inline_copy/tqdm/tqdm/auto.py +44 -0
- nuitka/build/inline_copy/tqdm/tqdm/autonotebook.py +28 -0
- nuitka/build/inline_copy/tqdm/tqdm/dask.py +46 -0
- nuitka/build/inline_copy/tqdm/tqdm/notebook.py +316 -0
- nuitka/build/inline_copy/tqdm/tqdm/std.py +1524 -0
- nuitka/build/inline_copy/tqdm/tqdm/tk.py +207 -0
- nuitka/build/inline_copy/tqdm/tqdm/utils.py +351 -0
- nuitka/build/inline_copy/tqdm/tqdm/version.py +2 -0
- nuitka/build/inline_copy/yaml/LICENSE +20 -0
- nuitka/build/inline_copy/yaml/yaml/__init__.py +427 -0
- nuitka/build/inline_copy/yaml/yaml/composer.py +139 -0
- nuitka/build/inline_copy/yaml/yaml/constructor.py +748 -0
- nuitka/build/inline_copy/yaml/yaml/cyaml.py +101 -0
- nuitka/build/inline_copy/yaml/yaml/dumper.py +62 -0
- nuitka/build/inline_copy/yaml/yaml/emitter.py +1137 -0
- nuitka/build/inline_copy/yaml/yaml/error.py +75 -0
- nuitka/build/inline_copy/yaml/yaml/events.py +86 -0
- nuitka/build/inline_copy/yaml/yaml/loader.py +63 -0
- nuitka/build/inline_copy/yaml/yaml/nodes.py +49 -0
- nuitka/build/inline_copy/yaml/yaml/parser.py +589 -0
- nuitka/build/inline_copy/yaml/yaml/reader.py +185 -0
- nuitka/build/inline_copy/yaml/yaml/representer.py +389 -0
- nuitka/build/inline_copy/yaml/yaml/resolver.py +227 -0
- nuitka/build/inline_copy/yaml/yaml/scanner.py +1435 -0
- nuitka/build/inline_copy/yaml/yaml/serializer.py +111 -0
- nuitka/build/inline_copy/yaml/yaml/tokens.py +104 -0
- nuitka/build/inline_copy/zlib/LICENSE +22 -0
- nuitka/build/inline_copy/zlib/crc32.c +1049 -0
- nuitka/build/inline_copy/zlib/crc32.h +9446 -0
- nuitka/build/inline_copy/zlib/zconf.h +551 -0
- nuitka/build/inline_copy/zlib/zlib.h +1938 -0
- nuitka/build/inline_copy/zlib/zutil.h +275 -0
- nuitka/build/inline_copy/zstd/LICENSE.txt +30 -0
- nuitka/build/inline_copy/zstd/common/bitstream.h +463 -0
- nuitka/build/inline_copy/zstd/common/compiler.h +288 -0
- nuitka/build/inline_copy/zstd/common/cpu.h +213 -0
- nuitka/build/inline_copy/zstd/common/debug.h +107 -0
- nuitka/build/inline_copy/zstd/common/entropy_common.c +360 -0
- nuitka/build/inline_copy/zstd/common/error_private.c +56 -0
- nuitka/build/inline_copy/zstd/common/error_private.h +80 -0
- nuitka/build/inline_copy/zstd/common/fse.h +715 -0
- nuitka/build/inline_copy/zstd/common/fse_decompress.c +393 -0
- nuitka/build/inline_copy/zstd/common/huf.h +361 -0
- nuitka/build/inline_copy/zstd/common/mem.h +426 -0
- nuitka/build/inline_copy/zstd/common/xxhash.c +826 -0
- nuitka/build/inline_copy/zstd/common/xxhash.h +285 -0
- nuitka/build/inline_copy/zstd/common/zstd_common.c +83 -0
- nuitka/build/inline_copy/zstd/common/zstd_deps.h +111 -0
- nuitka/build/inline_copy/zstd/common/zstd_errors.h +95 -0
- nuitka/build/inline_copy/zstd/common/zstd_internal.h +478 -0
- nuitka/build/inline_copy/zstd/decompress/huf_decompress.c +1350 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_ddict.c +244 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_ddict.h +44 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress.c +1930 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.c +1540 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.h +62 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_internal.h +190 -0
- nuitka/build/inline_copy/zstd/zstd.h +2391 -0
- nuitka/build/static_src/CompiledAsyncgenType.c +2211 -0
- nuitka/build/static_src/CompiledCellType.c +300 -0
- nuitka/build/static_src/CompiledCodeHelpers.c +2160 -0
- nuitka/build/static_src/CompiledCoroutineType.c +1946 -0
- nuitka/build/static_src/CompiledFrameType.c +1337 -0
- nuitka/build/static_src/CompiledFunctionType.c +3320 -0
- nuitka/build/static_src/CompiledGeneratorType.c +1997 -0
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2117 -0
- nuitka/build/static_src/CompiledMethodType.c +614 -0
- nuitka/build/static_src/GenerateHeadersMain.c +30 -0
- nuitka/build/static_src/HelpersAllocator.c +939 -0
- nuitka/build/static_src/HelpersAttributes.c +1241 -0
- nuitka/build/static_src/HelpersBuiltin.c +901 -0
- nuitka/build/static_src/HelpersBuiltinTypeMethods.c +3594 -0
- nuitka/build/static_src/HelpersBytes.c +107 -0
- nuitka/build/static_src/HelpersCalling.c +397 -0
- nuitka/build/static_src/HelpersCallingGenerated.c +14361 -0
- nuitka/build/static_src/HelpersChecksumTools.c +59 -0
- nuitka/build/static_src/HelpersClasses.c +91 -0
- nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
- nuitka/build/static_src/HelpersComparisonEq.c +12070 -0
- nuitka/build/static_src/HelpersComparisonEqUtils.c +169 -0
- nuitka/build/static_src/HelpersComparisonGe.c +11871 -0
- nuitka/build/static_src/HelpersComparisonGt.c +11855 -0
- nuitka/build/static_src/HelpersComparisonLe.c +11957 -0
- nuitka/build/static_src/HelpersComparisonLt.c +11941 -0
- nuitka/build/static_src/HelpersComparisonNe.c +11979 -0
- nuitka/build/static_src/HelpersConsole.c +124 -0
- nuitka/build/static_src/HelpersConstantsBlob.c +1487 -0
- nuitka/build/static_src/HelpersDeepcopy.c +636 -0
- nuitka/build/static_src/HelpersDictionaries.c +1739 -0
- nuitka/build/static_src/HelpersDictionariesGenerated.c +738 -0
- nuitka/build/static_src/HelpersDumpBacktraces.c +63 -0
- nuitka/build/static_src/HelpersEnvironmentVariables.c +65 -0
- nuitka/build/static_src/HelpersEnvironmentVariablesSystem.c +97 -0
- nuitka/build/static_src/HelpersExceptions.c +298 -0
- nuitka/build/static_src/HelpersFiles.c +353 -0
- nuitka/build/static_src/HelpersFilesystemPaths.c +1322 -0
- nuitka/build/static_src/HelpersFloats.c +92 -0
- nuitka/build/static_src/HelpersHeapStorage.c +68 -0
- nuitka/build/static_src/HelpersImport.c +506 -0
- nuitka/build/static_src/HelpersImportHard.c +526 -0
- nuitka/build/static_src/HelpersJitSources.c +48 -0
- nuitka/build/static_src/HelpersLists.c +899 -0
- nuitka/build/static_src/HelpersListsGenerated.c +564 -0
- nuitka/build/static_src/HelpersMappings.c +46 -0
- nuitka/build/static_src/HelpersMatching.c +192 -0
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +6477 -0
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +703 -0
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +2406 -0
- nuitka/build/static_src/HelpersOperationBinaryDivmodUtils.c +33 -0
- nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +2422 -0
- nuitka/build/static_src/HelpersOperationBinaryInplaceAdd.c +220 -0
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +2846 -0
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +453 -0
- nuitka/build/static_src/HelpersOperationBinaryMod.c +6549 -0
- nuitka/build/static_src/HelpersOperationBinaryMult.c +6438 -0
- nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +125 -0
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +2355 -0
- nuitka/build/static_src/HelpersOperationBinaryPow.c +2743 -0
- nuitka/build/static_src/HelpersOperationBinaryPowUtils.c +26 -0
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +2706 -0
- nuitka/build/static_src/HelpersOperationBinarySub.c +2649 -0
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +2415 -0
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +5211 -0
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +144 -0
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +2605 -0
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +1594 -0
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +603 -0
- nuitka/build/static_src/HelpersOperationInplaceMod.c +4762 -0
- nuitka/build/static_src/HelpersOperationInplaceMult.c +4689 -0
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +2553 -0
- nuitka/build/static_src/HelpersOperationInplacePow.c +2807 -0
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +1534 -0
- nuitka/build/static_src/HelpersOperationInplaceSub.c +2894 -0
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +2612 -0
- nuitka/build/static_src/HelpersProfiling.c +104 -0
- nuitka/build/static_src/HelpersPythonPgo.c +113 -0
- nuitka/build/static_src/HelpersRaising.c +447 -0
- nuitka/build/static_src/HelpersSafeStrings.c +185 -0
- nuitka/build/static_src/HelpersSequences.c +134 -0
- nuitka/build/static_src/HelpersSlices.c +73 -0
- nuitka/build/static_src/HelpersStrings.c +998 -0
- nuitka/build/static_src/HelpersTuples.c +148 -0
- nuitka/build/static_src/HelpersTypes.c +329 -0
- nuitka/build/static_src/InspectPatcher.c +439 -0
- nuitka/build/static_src/MainProgram.c +2060 -0
- nuitka/build/static_src/MetaPathBasedLoader.c +2290 -0
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +125 -0
- nuitka/build/static_src/MetaPathBasedLoaderResourceReader.c +158 -0
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +785 -0
- nuitka/build/static_src/OnefileBootstrap.c +1580 -0
- nuitka/build/static_src/OnefileSplashScreen.cpp +275 -0
- nuitka/code_generation/AsyncgenCodes.py +186 -0
- nuitka/code_generation/AttributeCodes.py +357 -0
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +720 -0
- nuitka/code_generation/BranchCodes.py +67 -0
- nuitka/code_generation/BuiltinCodes.py +529 -0
- nuitka/code_generation/CallCodes.py +1186 -0
- nuitka/code_generation/ClassCodes.py +156 -0
- nuitka/code_generation/CodeGeneration.py +1078 -0
- nuitka/code_generation/CodeHelperSelection.py +81 -0
- nuitka/code_generation/CodeHelpers.py +455 -0
- nuitka/code_generation/CodeObjectCodes.py +165 -0
- nuitka/code_generation/ComparisonCodes.py +569 -0
- nuitka/code_generation/ComparisonHelperDefinitions.py +146 -0
- nuitka/code_generation/ConditionalCodes.py +236 -0
- nuitka/code_generation/ConstantCodes.py +243 -0
- nuitka/code_generation/Contexts.py +1248 -0
- nuitka/code_generation/CoroutineCodes.py +253 -0
- nuitka/code_generation/CtypesCodes.py +46 -0
- nuitka/code_generation/DictCodes.py +918 -0
- nuitka/code_generation/Emission.py +75 -0
- nuitka/code_generation/ErrorCodes.py +281 -0
- nuitka/code_generation/EvalCodes.py +444 -0
- nuitka/code_generation/ExceptionCodes.py +337 -0
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +227 -0
- nuitka/code_generation/ExpressionCodes.py +61 -0
- nuitka/code_generation/FrameCodes.py +518 -0
- nuitka/code_generation/FunctionCodes.py +858 -0
- nuitka/code_generation/GeneratorCodes.py +218 -0
- nuitka/code_generation/GlobalConstants.py +249 -0
- nuitka/code_generation/GlobalsLocalsCodes.py +211 -0
- nuitka/code_generation/IdCodes.py +53 -0
- nuitka/code_generation/ImportCodes.py +468 -0
- nuitka/code_generation/Indentation.py +45 -0
- nuitka/code_generation/IndexCodes.py +50 -0
- nuitka/code_generation/InjectCCodes.py +28 -0
- nuitka/code_generation/IntegerCodes.py +110 -0
- nuitka/code_generation/IteratorCodes.py +378 -0
- nuitka/code_generation/JitCodes.py +44 -0
- nuitka/code_generation/LabelCodes.py +68 -0
- nuitka/code_generation/LineNumberCodes.py +91 -0
- nuitka/code_generation/ListCodes.py +502 -0
- nuitka/code_generation/LoaderCodes.py +193 -0
- nuitka/code_generation/LocalsDictCodes.py +359 -0
- nuitka/code_generation/LoopCodes.py +88 -0
- nuitka/code_generation/MatchCodes.py +67 -0
- nuitka/code_generation/ModuleCodes.py +247 -0
- nuitka/code_generation/Namify.py +260 -0
- nuitka/code_generation/NetworkxCodes.py +51 -0
- nuitka/code_generation/OperationCodes.py +398 -0
- nuitka/code_generation/PackageResourceCodes.py +986 -0
- nuitka/code_generation/PrintCodes.py +93 -0
- nuitka/code_generation/PythonAPICodes.py +215 -0
- nuitka/code_generation/RaisingCodes.py +481 -0
- nuitka/code_generation/Reports.py +115 -0
- nuitka/code_generation/ReturnCodes.py +143 -0
- nuitka/code_generation/SetCodes.py +196 -0
- nuitka/code_generation/SliceCodes.py +465 -0
- nuitka/code_generation/StringCodes.py +303 -0
- nuitka/code_generation/SubscriptCodes.py +263 -0
- nuitka/code_generation/TensorflowCodes.py +54 -0
- nuitka/code_generation/TryCodes.py +326 -0
- nuitka/code_generation/TupleCodes.py +115 -0
- nuitka/code_generation/TypeAliasCodes.py +120 -0
- nuitka/code_generation/VariableCodes.py +519 -0
- nuitka/code_generation/VariableDeclarations.py +279 -0
- nuitka/code_generation/YieldCodes.py +253 -0
- nuitka/code_generation/__init__.py +19 -0
- nuitka/code_generation/c_types/CTypeBases.py +177 -0
- nuitka/code_generation/c_types/CTypeBooleans.py +104 -0
- nuitka/code_generation/c_types/CTypeCFloats.py +57 -0
- nuitka/code_generation/c_types/CTypeCLongs.py +45 -0
- nuitka/code_generation/c_types/CTypeModuleDictVariables.py +109 -0
- nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +150 -0
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +200 -0
- nuitka/code_generation/c_types/CTypeNuitkaVoids.py +107 -0
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +572 -0
- nuitka/code_generation/c_types/CTypeVoids.py +92 -0
- nuitka/code_generation/c_types/__init__.py +19 -0
- nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +106 -0
- nuitka/code_generation/templates/CodeTemplatesConstants.py +296 -0
- nuitka/code_generation/templates/CodeTemplatesCoroutines.py +109 -0
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +84 -0
- nuitka/code_generation/templates/CodeTemplatesFrames.py +235 -0
- nuitka/code_generation/templates/CodeTemplatesFunction.py +117 -0
- nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +130 -0
- nuitka/code_generation/templates/CodeTemplatesIterators.py +40 -0
- nuitka/code_generation/templates/CodeTemplatesLoader.py +180 -0
- nuitka/code_generation/templates/CodeTemplatesModules.py +710 -0
- nuitka/code_generation/templates/CodeTemplatesVariables.py +388 -0
- nuitka/code_generation/templates/TemplateDebugWrapper.py +80 -0
- nuitka/code_generation/templates/__init__.py +19 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +321 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +143 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +677 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +165 -0
- nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +38 -0
- nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +41 -0
- nuitka/code_generation/templates_c/HelperBuiltinMethodOperation.c.j2 +53 -0
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +364 -0
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +37 -0
- nuitka/code_generation/templates_c/HelperLongTools.c.j2 +53 -0
- nuitka/code_generation/templates_c/HelperObjectTools.c.j2 +20 -0
- nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +148 -0
- nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +352 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +31 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +32 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +112 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +157 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +99 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +281 -0
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +420 -0
- nuitka/code_generation/templates_c/HelperSlotsBytes.c.j2 +51 -0
- nuitka/code_generation/templates_c/HelperSlotsCommon.c.j2 +71 -0
- nuitka/code_generation/templates_c/HelperSlotsFloat.c.j2 +327 -0
- nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +411 -0
- nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +59 -0
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +229 -0
- nuitka/code_generation/templates_c/HelperSlotsSet.c.j2 +47 -0
- nuitka/code_generation/templates_c/HelperSlotsStr.c.j2 +55 -0
- nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +58 -0
- nuitka/code_generation/templates_c/HelperSlotsUnicode.c.j2 +62 -0
- nuitka/containers/Namedtuples.py +51 -0
- nuitka/containers/OrderedDicts.py +191 -0
- nuitka/containers/OrderedSets.py +123 -0
- nuitka/containers/OrderedSetsFallback.py +139 -0
- nuitka/containers/__init__.py +19 -0
- nuitka/distutils/Build.py +76 -0
- nuitka/distutils/DistutilCommands.py +438 -0
- nuitka/distutils/__init__.py +19 -0
- nuitka/finalizations/Finalization.py +35 -0
- nuitka/finalizations/FinalizeMarkups.py +136 -0
- nuitka/finalizations/__init__.py +19 -0
- nuitka/freezer/DependsExe.py +257 -0
- nuitka/freezer/DllDependenciesCommon.py +97 -0
- nuitka/freezer/DllDependenciesMacOS.py +444 -0
- nuitka/freezer/DllDependenciesPosix.py +242 -0
- nuitka/freezer/DllDependenciesWin32.py +315 -0
- nuitka/freezer/ImportDetection.py +359 -0
- nuitka/freezer/IncludedDataFiles.py +689 -0
- nuitka/freezer/IncludedEntryPoints.py +376 -0
- nuitka/freezer/Onefile.py +296 -0
- nuitka/freezer/Standalone.py +520 -0
- nuitka/freezer/__init__.py +19 -0
- nuitka/importing/IgnoreListing.py +449 -0
- nuitka/importing/ImportCache.py +95 -0
- nuitka/importing/ImportResolving.py +186 -0
- nuitka/importing/Importing.py +1200 -0
- nuitka/importing/PreloadedPackages.py +164 -0
- nuitka/importing/Recursion.py +611 -0
- nuitka/importing/StandardLibrary.py +429 -0
- nuitka/importing/__init__.py +19 -0
- nuitka/nodes/AsyncgenNodes.py +107 -0
- nuitka/nodes/AttributeLookupNodes.py +124 -0
- nuitka/nodes/AttributeNodes.py +386 -0
- nuitka/nodes/AttributeNodesGenerated.py +10734 -0
- nuitka/nodes/BuiltinAllNodes.py +115 -0
- nuitka/nodes/BuiltinAnyNodes.py +124 -0
- nuitka/nodes/BuiltinComplexNodes.py +83 -0
- nuitka/nodes/BuiltinDecodingNodes.py +52 -0
- nuitka/nodes/BuiltinDecoratorNodes.py +85 -0
- nuitka/nodes/BuiltinDictNodes.py +140 -0
- nuitka/nodes/BuiltinFormatNodes.py +159 -0
- nuitka/nodes/BuiltinHashNodes.py +63 -0
- nuitka/nodes/BuiltinInputNodes.py +39 -0
- nuitka/nodes/BuiltinIntegerNodes.py +170 -0
- nuitka/nodes/BuiltinIteratorNodes.py +391 -0
- nuitka/nodes/BuiltinLenNodes.py +61 -0
- nuitka/nodes/BuiltinNextNodes.py +111 -0
- nuitka/nodes/BuiltinOpenNodes.py +148 -0
- nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +7367 -0
- nuitka/nodes/BuiltinRangeNodes.py +690 -0
- nuitka/nodes/BuiltinRefNodes.py +314 -0
- nuitka/nodes/BuiltinSumNodes.py +104 -0
- nuitka/nodes/BuiltinTypeNodes.py +454 -0
- nuitka/nodes/BuiltinVarsNodes.py +44 -0
- nuitka/nodes/BytesNodes.py +829 -0
- nuitka/nodes/CallNodes.py +217 -0
- nuitka/nodes/Checkers.py +55 -0
- nuitka/nodes/ChildrenHavingMixins.py +21576 -0
- nuitka/nodes/ClassNodes.py +286 -0
- nuitka/nodes/CodeObjectSpecs.py +230 -0
- nuitka/nodes/ComparisonNodes.py +687 -0
- nuitka/nodes/ConditionalNodes.py +884 -0
- nuitka/nodes/ConstantRefNodes.py +1717 -0
- nuitka/nodes/ContainerMakingNodes.py +408 -0
- nuitka/nodes/ContainerOperationNodes.py +87 -0
- nuitka/nodes/CoroutineNodes.py +144 -0
- nuitka/nodes/CtypesNodes.py +51 -0
- nuitka/nodes/DictionaryNodes.py +1513 -0
- nuitka/nodes/ExceptionNodes.py +393 -0
- nuitka/nodes/ExecEvalNodes.py +229 -0
- nuitka/nodes/ExpressionBases.py +1301 -0
- nuitka/nodes/ExpressionBasesGenerated.py +2103 -0
- nuitka/nodes/ExpressionShapeMixins.py +886 -0
- nuitka/nodes/FrameNodes.py +413 -0
- nuitka/nodes/FunctionAttributeNodes.py +102 -0
- nuitka/nodes/FunctionNodes.py +1303 -0
- nuitka/nodes/FutureSpecs.py +224 -0
- nuitka/nodes/GeneratorNodes.py +201 -0
- nuitka/nodes/GlobalsLocalsNodes.py +209 -0
- nuitka/nodes/HardImportNodesGenerated.py +3599 -0
- nuitka/nodes/ImportHardNodes.py +185 -0
- nuitka/nodes/ImportNodes.py +1366 -0
- nuitka/nodes/IndicatorMixins.py +79 -0
- nuitka/nodes/InjectCNodes.py +51 -0
- nuitka/nodes/IterationHandles.py +407 -0
- nuitka/nodes/KeyValuePairNodes.py +378 -0
- nuitka/nodes/ListOperationNodes.py +525 -0
- nuitka/nodes/LocalsDictNodes.py +717 -0
- nuitka/nodes/LocalsScopes.py +505 -0
- nuitka/nodes/LoopNodes.py +445 -0
- nuitka/nodes/MatchNodes.py +60 -0
- nuitka/nodes/ModuleAttributeNodes.py +180 -0
- nuitka/nodes/ModuleNodes.py +1137 -0
- nuitka/nodes/NetworkxNodes.py +45 -0
- nuitka/nodes/NodeBases.py +890 -0
- nuitka/nodes/NodeMakingHelpers.py +481 -0
- nuitka/nodes/NodeMetaClasses.py +172 -0
- nuitka/nodes/OperatorNodes.py +944 -0
- nuitka/nodes/OperatorNodesUnary.py +403 -0
- nuitka/nodes/OsSysNodes.py +215 -0
- nuitka/nodes/OutlineNodes.py +372 -0
- nuitka/nodes/PackageMetadataNodes.py +982 -0
- nuitka/nodes/PackageResourceNodes.py +424 -0
- nuitka/nodes/PrintNodes.py +105 -0
- nuitka/nodes/ReturnNodes.py +255 -0
- nuitka/nodes/SideEffectNodes.py +139 -0
- nuitka/nodes/SliceNodes.py +386 -0
- nuitka/nodes/StatementBasesGenerated.py +3419 -0
- nuitka/nodes/StatementNodes.py +316 -0
- nuitka/nodes/StrNodes.py +919 -0
- nuitka/nodes/StringConcatenationNodes.py +103 -0
- nuitka/nodes/SubscriptNodes.py +245 -0
- nuitka/nodes/TensorflowNodes.py +38 -0
- nuitka/nodes/TryNodes.py +519 -0
- nuitka/nodes/TypeMatchNodes.py +65 -0
- nuitka/nodes/TypeNodes.py +390 -0
- nuitka/nodes/VariableAssignNodes.py +1177 -0
- nuitka/nodes/VariableDelNodes.py +320 -0
- nuitka/nodes/VariableNameNodes.py +153 -0
- nuitka/nodes/VariableRefNodes.py +895 -0
- nuitka/nodes/VariableReleaseNodes.py +153 -0
- nuitka/nodes/YieldNodes.py +121 -0
- nuitka/nodes/__init__.py +19 -0
- nuitka/nodes/shapes/BuiltinTypeShapes.py +4290 -0
- nuitka/nodes/shapes/ControlFlowDescriptions.py +199 -0
- nuitka/nodes/shapes/IteratorShapes.py +71 -0
- nuitka/nodes/shapes/ShapeMixins.py +255 -0
- nuitka/nodes/shapes/StandardShapes.py +1384 -0
- nuitka/nodes/shapes/__init__.py +19 -0
- nuitka/optimizations/BytecodeDemotion.py +105 -0
- nuitka/optimizations/FunctionInlining.py +110 -0
- nuitka/optimizations/Graphs.py +70 -0
- nuitka/optimizations/Optimization.py +363 -0
- nuitka/optimizations/OptimizeBuiltinCalls.py +1582 -0
- nuitka/optimizations/Tags.py +76 -0
- nuitka/optimizations/TraceCollections.py +1257 -0
- nuitka/optimizations/ValueTraces.py +980 -0
- nuitka/optimizations/__init__.py +19 -0
- nuitka/pgo/PGO.py +160 -0
- nuitka/pgo/__init__.py +19 -0
- nuitka/plugins/PluginBase.py +1924 -0
- nuitka/plugins/Plugins.py +2007 -0
- nuitka/plugins/YamlPluginBase.py +121 -0
- nuitka/plugins/__init__.py +19 -0
- nuitka/plugins/standard/AntiBloatPlugin.py +1024 -0
- nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +95 -0
- nuitka/plugins/standard/DataFilesPlugin.py +311 -0
- nuitka/plugins/standard/DelvewheelPlugin.py +150 -0
- nuitka/plugins/standard/DillPlugin/DillPlugin.c +37 -0
- nuitka/plugins/standard/DillPlugin/cloudpickle-postLoad.py +67 -0
- nuitka/plugins/standard/DillPlugin/dill-postLoad.py +223 -0
- nuitka/plugins/standard/DillPlugin.py +137 -0
- nuitka/plugins/standard/DllFilesPlugin.py +527 -0
- nuitka/plugins/standard/EnumPlugin.py +64 -0
- nuitka/plugins/standard/EventletPlugin.py +57 -0
- nuitka/plugins/standard/GeventPlugin.py +64 -0
- nuitka/plugins/standard/GiPlugin.py +118 -0
- nuitka/plugins/standard/GlfwPlugin.py +138 -0
- nuitka/plugins/standard/ImplicitImports.py +845 -0
- nuitka/plugins/standard/KivyPlugin.py +141 -0
- nuitka/plugins/standard/MatplotlibPlugin.py +256 -0
- nuitka/plugins/standard/MultiprocessingPlugin.py +199 -0
- nuitka/plugins/standard/NumpyPlugin.py +35 -0
- nuitka/plugins/standard/OptionsNannyPlugin.py +158 -0
- nuitka/plugins/standard/PbrPlugin.py +62 -0
- nuitka/plugins/standard/PkgResourcesPlugin.py +162 -0
- nuitka/plugins/standard/PlaywrightPlugin.py +179 -0
- nuitka/plugins/standard/PmwPlugin.py +248 -0
- nuitka/plugins/standard/PySidePyQtPlugin.py +1666 -0
- nuitka/plugins/standard/PywebViewPlugin.py +81 -0
- nuitka/plugins/standard/SpacyPlugin.py +137 -0
- nuitka/plugins/standard/TensorflowPlugin.py +35 -0
- nuitka/plugins/standard/TkinterPlugin.py +416 -0
- nuitka/plugins/standard/TorchPlugin.py +35 -0
- nuitka/plugins/standard/TransformersPlugin.py +121 -0
- nuitka/plugins/standard/TrioPlugin.py +33 -0
- nuitka/plugins/standard/UpxPlugin.py +174 -0
- nuitka/plugins/standard/__init__.py +19 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +9313 -0
- nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +78 -0
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +468 -0
- nuitka/reports/CompilationReportReader.py +83 -0
- nuitka/reports/LicenseReport.rst.j2 +41 -0
- nuitka/reports/Reports.py +961 -0
- nuitka/reports/__init__.py +19 -0
- nuitka/specs/BuiltinBytesOperationSpecs.py +180 -0
- nuitka/specs/BuiltinDictOperationSpecs.py +82 -0
- nuitka/specs/BuiltinListOperationSpecs.py +80 -0
- nuitka/specs/BuiltinParameterSpecs.py +831 -0
- nuitka/specs/BuiltinStrOperationSpecs.py +181 -0
- nuitka/specs/BuiltinTypeOperationSpecs.py +34 -0
- nuitka/specs/BuiltinUnicodeOperationSpecs.py +123 -0
- nuitka/specs/HardImportSpecs.py +236 -0
- nuitka/specs/ParameterSpecs.py +630 -0
- nuitka/specs/__init__.py +19 -0
- nuitka/tools/Basics.py +55 -0
- nuitka/tools/__init__.py +19 -0
- nuitka/tools/commercial/__init__.py +21 -0
- nuitka/tools/data_composer/DataComposer.py +593 -0
- nuitka/tools/data_composer/__init__.py +19 -0
- nuitka/tools/data_composer/__main__.py +41 -0
- nuitka/tools/environments/CreateEnvironment.py +69 -0
- nuitka/tools/environments/Virtualenv.py +158 -0
- nuitka/tools/environments/__init__.py +19 -0
- nuitka/tools/general/__init__.py +19 -0
- nuitka/tools/general/dll_report/__init__.py +19 -0
- nuitka/tools/general/dll_report/__main__.py +83 -0
- nuitka/tools/general/find_module/FindModuleCode.py +127 -0
- nuitka/tools/general/find_module/__init__.py +19 -0
- nuitka/tools/general/generate_header/GenerateHeader.py +73 -0
- nuitka/tools/general/generate_header/__init__.py +19 -0
- nuitka/tools/onefile_compressor/OnefileCompressor.py +390 -0
- nuitka/tools/onefile_compressor/__init__.py +19 -0
- nuitka/tools/onefile_compressor/__main__.py +41 -0
- nuitka/tools/podman/Podman.py +55 -0
- nuitka/tools/podman/__init__.py +19 -0
- nuitka/tools/podman/__main__.py +425 -0
- nuitka/tools/profiler/__init__.py +19 -0
- nuitka/tools/profiler/__main__.py +93 -0
- nuitka/tools/scanning/DisplayDistributions.py +39 -0
- nuitka/tools/scanning/DisplayPackageDLLs.py +151 -0
- nuitka/tools/scanning/DisplayPackageData.py +73 -0
- nuitka/tools/scanning/__init__.py +19 -0
- nuitka/tools/specialize/CTypeDescriptions.py +1928 -0
- nuitka/tools/specialize/Common.py +380 -0
- nuitka/tools/specialize/SpecializeC.py +1483 -0
- nuitka/tools/specialize/SpecializePython.py +1151 -0
- nuitka/tools/specialize/__init__.py +19 -0
- nuitka/tools/testing/Common.py +2007 -0
- nuitka/tools/testing/Constructs.py +53 -0
- nuitka/tools/testing/DocTests.py +156 -0
- nuitka/tools/testing/OutputComparison.py +313 -0
- nuitka/tools/testing/Pythons.py +34 -0
- nuitka/tools/testing/RuntimeTracing.py +260 -0
- nuitka/tools/testing/SearchModes.py +208 -0
- nuitka/tools/testing/Valgrind.py +103 -0
- nuitka/tools/testing/__init__.py +19 -0
- nuitka/tools/testing/check_reference_counts/__init__.py +19 -0
- nuitka/tools/testing/check_reference_counts/__main__.py +107 -0
- nuitka/tools/testing/compare_with_cpython/__init__.py +19 -0
- nuitka/tools/testing/compare_with_cpython/__main__.py +942 -0
- nuitka/tools/testing/find_sxs_modules/__init__.py +19 -0
- nuitka/tools/testing/find_sxs_modules/__main__.py +73 -0
- nuitka/tools/testing/measure_construct_performance/__init__.py +19 -0
- nuitka/tools/testing/measure_construct_performance/__main__.py +288 -0
- nuitka/tools/testing/run_nuitka_tests/__init__.py +19 -0
- nuitka/tools/testing/run_nuitka_tests/__main__.py +1091 -0
- nuitka/tools/watch/AutoStage.py +145 -0
- nuitka/tools/watch/Common.py +55 -0
- nuitka/tools/watch/Conda.py +125 -0
- nuitka/tools/watch/GitHub.py +113 -0
- nuitka/tools/watch/Pacman.py +73 -0
- nuitka/tools/watch/Pipenv.py +145 -0
- nuitka/tools/watch/__init__.py +19 -0
- nuitka/tools/watch/__main__.py +615 -0
- nuitka/tree/Building.py +1459 -0
- nuitka/tree/ComplexCallHelperFunctions.py +2150 -0
- nuitka/tree/Extractions.py +48 -0
- nuitka/tree/FutureSpecState.py +71 -0
- nuitka/tree/InternalModule.py +96 -0
- nuitka/tree/Operations.py +45 -0
- nuitka/tree/ReformulationAssertStatements.py +97 -0
- nuitka/tree/ReformulationAssignmentStatements.py +1260 -0
- nuitka/tree/ReformulationBooleanExpressions.py +97 -0
- nuitka/tree/ReformulationCallExpressions.py +314 -0
- nuitka/tree/ReformulationClasses.py +407 -0
- nuitka/tree/ReformulationClasses3.py +1149 -0
- nuitka/tree/ReformulationComparisonExpressions.py +174 -0
- nuitka/tree/ReformulationContractionExpressions.py +676 -0
- nuitka/tree/ReformulationDictionaryCreation.py +304 -0
- nuitka/tree/ReformulationExecStatements.py +386 -0
- nuitka/tree/ReformulationForLoopStatements.py +215 -0
- nuitka/tree/ReformulationFunctionStatements.py +931 -0
- nuitka/tree/ReformulationImportStatements.py +333 -0
- nuitka/tree/ReformulationLambdaExpressions.py +185 -0
- nuitka/tree/ReformulationMatchStatements.py +797 -0
- nuitka/tree/ReformulationMultidist.py +80 -0
- nuitka/tree/ReformulationNamespacePackages.py +239 -0
- nuitka/tree/ReformulationPrintStatements.py +127 -0
- nuitka/tree/ReformulationSequenceCreation.py +438 -0
- nuitka/tree/ReformulationSubscriptExpressions.py +123 -0
- nuitka/tree/ReformulationTryExceptStatements.py +418 -0
- nuitka/tree/ReformulationTryFinallyStatements.py +239 -0
- nuitka/tree/ReformulationWhileLoopStatements.py +160 -0
- nuitka/tree/ReformulationWithStatements.py +382 -0
- nuitka/tree/ReformulationYieldExpressions.py +133 -0
- nuitka/tree/SourceHandling.py +476 -0
- nuitka/tree/SyntaxErrors.py +143 -0
- nuitka/tree/TreeHelpers.py +720 -0
- nuitka/tree/VariableClosure.py +483 -0
- nuitka/tree/__init__.py +19 -0
- nuitka/utils/AppDirs.py +104 -0
- nuitka/utils/CStrings.py +208 -0
- nuitka/utils/CommandLineOptions.py +207 -0
- nuitka/utils/Distributions.py +728 -0
- nuitka/utils/Download.py +217 -0
- nuitka/utils/Execution.py +517 -0
- nuitka/utils/FileOperations.py +1587 -0
- nuitka/utils/Hashing.py +137 -0
- nuitka/utils/Images.py +79 -0
- nuitka/utils/Importing.py +335 -0
- nuitka/utils/InlineCopies.py +52 -0
- nuitka/utils/InstalledPythons.py +254 -0
- nuitka/utils/InstanceCounters.py +86 -0
- nuitka/utils/Jinja2.py +158 -0
- nuitka/utils/Json.py +40 -0
- nuitka/utils/MacOSApp.py +134 -0
- nuitka/utils/MemoryUsage.py +165 -0
- nuitka/utils/ModuleNames.py +317 -0
- nuitka/utils/PackageResources.py +44 -0
- nuitka/utils/ReExecute.py +152 -0
- nuitka/utils/Rest.py +60 -0
- nuitka/utils/SharedLibraries.py +1014 -0
- nuitka/utils/Shebang.py +113 -0
- nuitka/utils/Signing.py +144 -0
- nuitka/utils/SlotMetaClasses.py +57 -0
- nuitka/utils/StaticLibraries.py +260 -0
- nuitka/utils/ThreadedExecutor.py +87 -0
- nuitka/utils/Timing.py +102 -0
- nuitka/utils/Utils.py +483 -0
- nuitka/utils/WindowsFileUsage.py +337 -0
- nuitka/utils/WindowsResources.py +652 -0
- nuitka/utils/Yaml.py +247 -0
- nuitka/utils/__init__.py +19 -0
- nuitka_winsvc-2.7.7.data/scripts/nuitka-run.cmd +24 -0
- nuitka_winsvc-2.7.7.data/scripts/nuitka.cmd +30 -0
- nuitka_winsvc-2.7.7.dist-info/METADATA +115 -0
- nuitka_winsvc-2.7.7.dist-info/RECORD +995 -0
- nuitka_winsvc-2.7.7.dist-info/WHEEL +5 -0
- nuitka_winsvc-2.7.7.dist-info/entry_points.txt +7 -0
- nuitka_winsvc-2.7.7.dist-info/licenses/LICENSE.txt +202 -0
- nuitka_winsvc-2.7.7.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,2415 @@
|
|
|
1
|
+
// Copyright 2025, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
|
|
2
|
+
|
|
3
|
+
/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */
|
|
4
|
+
|
|
5
|
+
/* This file is included from another C file, help IDEs to still parse it on its own. */
|
|
6
|
+
#ifdef __IDE_ONLY__
|
|
7
|
+
#include "nuitka/prelude.h"
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
/* C helpers for type specialized "/" (TRUEDIV) operations */
|
|
11
|
+
|
|
12
|
+
#if PYTHON_VERSION < 0x300
|
|
13
|
+
/* Code referring to "INT" corresponds to Python2 'int' and "INT" to Python2 'int'. */
|
|
14
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {
|
|
15
|
+
CHECK_OBJECT(operand1);
|
|
16
|
+
assert(PyInt_CheckExact(operand1));
|
|
17
|
+
CHECK_OBJECT(operand2);
|
|
18
|
+
assert(PyInt_CheckExact(operand2));
|
|
19
|
+
|
|
20
|
+
PyObject *result;
|
|
21
|
+
|
|
22
|
+
// Not every code path will make use of all possible results.
|
|
23
|
+
#ifdef _MSC_VER
|
|
24
|
+
#pragma warning(push)
|
|
25
|
+
#pragma warning(disable : 4101)
|
|
26
|
+
#endif
|
|
27
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
28
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
29
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
30
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
31
|
+
#ifdef _MSC_VER
|
|
32
|
+
#pragma warning(pop)
|
|
33
|
+
#endif
|
|
34
|
+
|
|
35
|
+
CHECK_OBJECT(operand1);
|
|
36
|
+
assert(PyInt_CheckExact(operand1));
|
|
37
|
+
CHECK_OBJECT(operand2);
|
|
38
|
+
assert(PyInt_CheckExact(operand2));
|
|
39
|
+
|
|
40
|
+
const long a = PyInt_AS_LONG(operand1);
|
|
41
|
+
const long b = PyInt_AS_LONG(operand2);
|
|
42
|
+
|
|
43
|
+
if (unlikely(b == 0)) {
|
|
44
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
45
|
+
|
|
46
|
+
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, "division by zero");
|
|
47
|
+
goto exit_result_exception;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (a == 0) {
|
|
51
|
+
if (b < 0) {
|
|
52
|
+
goto exit_result_ok_const_float_minus_0_0;
|
|
53
|
+
} else {
|
|
54
|
+
goto exit_result_ok_const_float_0_0;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* May need to resort to LONG code, which we currently do not
|
|
59
|
+
* specialize yet. TODO: Once we do that, call it here instead.
|
|
60
|
+
*/
|
|
61
|
+
#if DBL_MANT_DIG < WIDTH_OF_ULONG
|
|
62
|
+
if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {
|
|
63
|
+
} else
|
|
64
|
+
#endif
|
|
65
|
+
{
|
|
66
|
+
double r = (double)a / (double)b;
|
|
67
|
+
|
|
68
|
+
cfloat_result = r;
|
|
69
|
+
goto exit_result_ok_cfloat;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
{
|
|
73
|
+
PyObject *operand1_object = operand1;
|
|
74
|
+
PyObject *operand2_object = operand2;
|
|
75
|
+
|
|
76
|
+
PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);
|
|
77
|
+
assert(r != Py_NotImplemented);
|
|
78
|
+
|
|
79
|
+
obj_result = r;
|
|
80
|
+
goto exit_result_object;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
exit_result_ok_cfloat:
|
|
84
|
+
result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
|
|
85
|
+
goto exit_result_ok;
|
|
86
|
+
|
|
87
|
+
exit_result_object:
|
|
88
|
+
if (unlikely(obj_result == NULL)) {
|
|
89
|
+
goto exit_result_exception;
|
|
90
|
+
}
|
|
91
|
+
result = obj_result;
|
|
92
|
+
goto exit_result_ok;
|
|
93
|
+
|
|
94
|
+
exit_result_ok_const_float_0_0:
|
|
95
|
+
Py_INCREF(const_float_0_0);
|
|
96
|
+
result = const_float_0_0;
|
|
97
|
+
goto exit_result_ok;
|
|
98
|
+
|
|
99
|
+
exit_result_ok_const_float_minus_0_0:
|
|
100
|
+
Py_INCREF(const_float_minus_0_0);
|
|
101
|
+
result = const_float_minus_0_0;
|
|
102
|
+
goto exit_result_ok;
|
|
103
|
+
|
|
104
|
+
exit_result_ok:
|
|
105
|
+
return result;
|
|
106
|
+
|
|
107
|
+
exit_result_exception:
|
|
108
|
+
return NULL;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {
|
|
112
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_INT(operand1, operand2);
|
|
113
|
+
}
|
|
114
|
+
#endif
|
|
115
|
+
|
|
116
|
+
#if PYTHON_VERSION < 0x300
|
|
117
|
+
/* Code referring to "OBJECT" corresponds to any Python object and "INT" to Python2 'int'. */
|
|
118
|
+
static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_INT(PyObject *operand1,
|
|
119
|
+
PyObject *operand2) {
|
|
120
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
121
|
+
|
|
122
|
+
#ifdef _MSC_VER
|
|
123
|
+
#pragma warning(push)
|
|
124
|
+
#pragma warning(disable : 4101)
|
|
125
|
+
#endif
|
|
126
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
127
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
128
|
+
#ifdef _MSC_VER
|
|
129
|
+
#pragma warning(pop)
|
|
130
|
+
#endif
|
|
131
|
+
|
|
132
|
+
binaryfunc slot1 =
|
|
133
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_true_divide : NULL;
|
|
134
|
+
binaryfunc slot2 = NULL;
|
|
135
|
+
|
|
136
|
+
if (!(type1 == &PyInt_Type)) {
|
|
137
|
+
// Different types, need to consider second value slot.
|
|
138
|
+
|
|
139
|
+
slot2 = PyInt_Type.tp_as_number->nb_true_divide;
|
|
140
|
+
|
|
141
|
+
if (slot1 == slot2) {
|
|
142
|
+
slot2 = NULL;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (slot1 != NULL) {
|
|
147
|
+
PyObject *x = slot1(operand1, operand2);
|
|
148
|
+
|
|
149
|
+
if (x != Py_NotImplemented) {
|
|
150
|
+
obj_result = x;
|
|
151
|
+
goto exit_binary_result_object;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
Py_DECREF_IMMORTAL(x);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (slot2 != NULL) {
|
|
158
|
+
PyObject *x = slot2(operand1, operand2);
|
|
159
|
+
|
|
160
|
+
if (x != Py_NotImplemented) {
|
|
161
|
+
obj_result = x;
|
|
162
|
+
goto exit_binary_result_object;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
Py_DECREF_IMMORTAL(x);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
#if PYTHON_VERSION < 0x300
|
|
169
|
+
if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
|
|
170
|
+
coercion c1 =
|
|
171
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
|
|
172
|
+
|
|
173
|
+
if (c1 != NULL) {
|
|
174
|
+
PyObject *coerced1 = operand1;
|
|
175
|
+
PyObject *coerced2 = operand2;
|
|
176
|
+
|
|
177
|
+
int err = c1(&coerced1, &coerced2);
|
|
178
|
+
|
|
179
|
+
if (unlikely(err < 0)) {
|
|
180
|
+
goto exit_binary_exception;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (err == 0) {
|
|
184
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
185
|
+
|
|
186
|
+
if (likely(mv == NULL)) {
|
|
187
|
+
binaryfunc slot = mv->nb_true_divide;
|
|
188
|
+
|
|
189
|
+
if (likely(slot != NULL)) {
|
|
190
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
191
|
+
|
|
192
|
+
Py_DECREF(coerced1);
|
|
193
|
+
Py_DECREF(coerced2);
|
|
194
|
+
|
|
195
|
+
obj_result = x;
|
|
196
|
+
goto exit_binary_result_object;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// nb_coerce took a reference.
|
|
201
|
+
Py_DECREF(coerced1);
|
|
202
|
+
Py_DECREF(coerced2);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
coercion c2 = PyInt_Type.tp_as_number->nb_coerce;
|
|
206
|
+
|
|
207
|
+
if (c2 != NULL) {
|
|
208
|
+
PyObject *coerced1 = operand1;
|
|
209
|
+
PyObject *coerced2 = operand2;
|
|
210
|
+
|
|
211
|
+
int err = c2(&coerced2, &coerced1);
|
|
212
|
+
|
|
213
|
+
if (unlikely(err < 0)) {
|
|
214
|
+
goto exit_binary_exception;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (err == 0) {
|
|
218
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
219
|
+
|
|
220
|
+
if (likely(mv == NULL)) {
|
|
221
|
+
binaryfunc slot = mv->nb_true_divide;
|
|
222
|
+
|
|
223
|
+
if (likely(slot != NULL)) {
|
|
224
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
225
|
+
|
|
226
|
+
Py_DECREF(coerced1);
|
|
227
|
+
Py_DECREF(coerced2);
|
|
228
|
+
|
|
229
|
+
obj_result = x;
|
|
230
|
+
goto exit_binary_result_object;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// nb_coerce took a reference.
|
|
235
|
+
Py_DECREF(coerced1);
|
|
236
|
+
Py_DECREF(coerced2);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
#endif
|
|
241
|
+
|
|
242
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for /: '%s' and 'int'", type1->tp_name);
|
|
243
|
+
goto exit_binary_exception;
|
|
244
|
+
|
|
245
|
+
exit_binary_result_object:
|
|
246
|
+
return obj_result;
|
|
247
|
+
|
|
248
|
+
exit_binary_exception:
|
|
249
|
+
return NULL;
|
|
250
|
+
}
|
|
251
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
|
|
252
|
+
CHECK_OBJECT(operand1);
|
|
253
|
+
CHECK_OBJECT(operand2);
|
|
254
|
+
assert(PyInt_CheckExact(operand2));
|
|
255
|
+
|
|
256
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
257
|
+
|
|
258
|
+
if (type1 == &PyInt_Type) {
|
|
259
|
+
PyObject *result;
|
|
260
|
+
|
|
261
|
+
// return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_INT(operand1, operand2);
|
|
262
|
+
|
|
263
|
+
// Not every code path will make use of all possible results.
|
|
264
|
+
#ifdef _MSC_VER
|
|
265
|
+
#pragma warning(push)
|
|
266
|
+
#pragma warning(disable : 4101)
|
|
267
|
+
#endif
|
|
268
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
269
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
270
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
271
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
272
|
+
#ifdef _MSC_VER
|
|
273
|
+
#pragma warning(pop)
|
|
274
|
+
#endif
|
|
275
|
+
|
|
276
|
+
CHECK_OBJECT(operand1);
|
|
277
|
+
assert(PyInt_CheckExact(operand1));
|
|
278
|
+
CHECK_OBJECT(operand2);
|
|
279
|
+
assert(PyInt_CheckExact(operand2));
|
|
280
|
+
|
|
281
|
+
const long a = PyInt_AS_LONG(operand1);
|
|
282
|
+
const long b = PyInt_AS_LONG(operand2);
|
|
283
|
+
|
|
284
|
+
if (unlikely(b == 0)) {
|
|
285
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
286
|
+
|
|
287
|
+
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, "division by zero");
|
|
288
|
+
goto exit_result_exception;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
if (a == 0) {
|
|
292
|
+
if (b < 0) {
|
|
293
|
+
goto exit_result_ok_const_float_minus_0_0;
|
|
294
|
+
} else {
|
|
295
|
+
goto exit_result_ok_const_float_0_0;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/* May need to resort to LONG code, which we currently do not
|
|
300
|
+
* specialize yet. TODO: Once we do that, call it here instead.
|
|
301
|
+
*/
|
|
302
|
+
#if DBL_MANT_DIG < WIDTH_OF_ULONG
|
|
303
|
+
if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {
|
|
304
|
+
} else
|
|
305
|
+
#endif
|
|
306
|
+
{
|
|
307
|
+
double r = (double)a / (double)b;
|
|
308
|
+
|
|
309
|
+
cfloat_result = r;
|
|
310
|
+
goto exit_result_ok_cfloat;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
{
|
|
314
|
+
PyObject *operand1_object = operand1;
|
|
315
|
+
PyObject *operand2_object = operand2;
|
|
316
|
+
|
|
317
|
+
PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);
|
|
318
|
+
assert(r != Py_NotImplemented);
|
|
319
|
+
|
|
320
|
+
obj_result = r;
|
|
321
|
+
goto exit_result_object;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
exit_result_ok_cfloat:
|
|
325
|
+
result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
|
|
326
|
+
goto exit_result_ok;
|
|
327
|
+
|
|
328
|
+
exit_result_object:
|
|
329
|
+
if (unlikely(obj_result == NULL)) {
|
|
330
|
+
goto exit_result_exception;
|
|
331
|
+
}
|
|
332
|
+
result = obj_result;
|
|
333
|
+
goto exit_result_ok;
|
|
334
|
+
|
|
335
|
+
exit_result_ok_const_float_0_0:
|
|
336
|
+
Py_INCREF(const_float_0_0);
|
|
337
|
+
result = const_float_0_0;
|
|
338
|
+
goto exit_result_ok;
|
|
339
|
+
|
|
340
|
+
exit_result_ok_const_float_minus_0_0:
|
|
341
|
+
Py_INCREF(const_float_minus_0_0);
|
|
342
|
+
result = const_float_minus_0_0;
|
|
343
|
+
goto exit_result_ok;
|
|
344
|
+
|
|
345
|
+
exit_result_ok:
|
|
346
|
+
return result;
|
|
347
|
+
|
|
348
|
+
exit_result_exception:
|
|
349
|
+
return NULL;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
return __BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_INT(operand1, operand2);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
|
|
356
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_INT(operand1, operand2);
|
|
357
|
+
}
|
|
358
|
+
#endif
|
|
359
|
+
|
|
360
|
+
#if PYTHON_VERSION < 0x300
|
|
361
|
+
/* Code referring to "INT" corresponds to Python2 'int' and "OBJECT" to any Python object. */
|
|
362
|
+
static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_INT_OBJECT(PyObject *operand1,
|
|
363
|
+
PyObject *operand2) {
|
|
364
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
365
|
+
|
|
366
|
+
#ifdef _MSC_VER
|
|
367
|
+
#pragma warning(push)
|
|
368
|
+
#pragma warning(disable : 4101)
|
|
369
|
+
#endif
|
|
370
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
371
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
372
|
+
#ifdef _MSC_VER
|
|
373
|
+
#pragma warning(pop)
|
|
374
|
+
#endif
|
|
375
|
+
|
|
376
|
+
binaryfunc slot1 = PyInt_Type.tp_as_number->nb_true_divide;
|
|
377
|
+
binaryfunc slot2 = NULL;
|
|
378
|
+
|
|
379
|
+
if (!(&PyInt_Type == type2)) {
|
|
380
|
+
// Different types, need to consider second value slot.
|
|
381
|
+
|
|
382
|
+
slot2 =
|
|
383
|
+
(type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_true_divide : NULL;
|
|
384
|
+
|
|
385
|
+
if (slot1 == slot2) {
|
|
386
|
+
slot2 = NULL;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
if (slot1 != NULL) {
|
|
391
|
+
if (slot2 != NULL) {
|
|
392
|
+
if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
|
|
393
|
+
PyObject *x = slot2(operand1, operand2);
|
|
394
|
+
|
|
395
|
+
if (x != Py_NotImplemented) {
|
|
396
|
+
obj_result = x;
|
|
397
|
+
goto exit_binary_result_object;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
Py_DECREF_IMMORTAL(x);
|
|
401
|
+
slot2 = NULL;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
PyObject *x = slot1(operand1, operand2);
|
|
406
|
+
|
|
407
|
+
if (x != Py_NotImplemented) {
|
|
408
|
+
obj_result = x;
|
|
409
|
+
goto exit_binary_result_object;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
Py_DECREF_IMMORTAL(x);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
if (slot2 != NULL) {
|
|
416
|
+
PyObject *x = slot2(operand1, operand2);
|
|
417
|
+
|
|
418
|
+
if (x != Py_NotImplemented) {
|
|
419
|
+
obj_result = x;
|
|
420
|
+
goto exit_binary_result_object;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
Py_DECREF_IMMORTAL(x);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
#if PYTHON_VERSION < 0x300
|
|
427
|
+
if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
|
|
428
|
+
coercion c1 = PyInt_Type.tp_as_number->nb_coerce;
|
|
429
|
+
|
|
430
|
+
if (c1 != NULL) {
|
|
431
|
+
PyObject *coerced1 = operand1;
|
|
432
|
+
PyObject *coerced2 = operand2;
|
|
433
|
+
|
|
434
|
+
int err = c1(&coerced1, &coerced2);
|
|
435
|
+
|
|
436
|
+
if (unlikely(err < 0)) {
|
|
437
|
+
goto exit_binary_exception;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
if (err == 0) {
|
|
441
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
442
|
+
|
|
443
|
+
if (likely(mv == NULL)) {
|
|
444
|
+
binaryfunc slot = mv->nb_true_divide;
|
|
445
|
+
|
|
446
|
+
if (likely(slot != NULL)) {
|
|
447
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
448
|
+
|
|
449
|
+
Py_DECREF(coerced1);
|
|
450
|
+
Py_DECREF(coerced2);
|
|
451
|
+
|
|
452
|
+
obj_result = x;
|
|
453
|
+
goto exit_binary_result_object;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// nb_coerce took a reference.
|
|
458
|
+
Py_DECREF(coerced1);
|
|
459
|
+
Py_DECREF(coerced2);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
coercion c2 =
|
|
463
|
+
(type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
|
|
464
|
+
|
|
465
|
+
if (c2 != NULL) {
|
|
466
|
+
PyObject *coerced1 = operand1;
|
|
467
|
+
PyObject *coerced2 = operand2;
|
|
468
|
+
|
|
469
|
+
int err = c2(&coerced2, &coerced1);
|
|
470
|
+
|
|
471
|
+
if (unlikely(err < 0)) {
|
|
472
|
+
goto exit_binary_exception;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
if (err == 0) {
|
|
476
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
477
|
+
|
|
478
|
+
if (likely(mv == NULL)) {
|
|
479
|
+
binaryfunc slot = mv->nb_true_divide;
|
|
480
|
+
|
|
481
|
+
if (likely(slot != NULL)) {
|
|
482
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
483
|
+
|
|
484
|
+
Py_DECREF(coerced1);
|
|
485
|
+
Py_DECREF(coerced2);
|
|
486
|
+
|
|
487
|
+
obj_result = x;
|
|
488
|
+
goto exit_binary_result_object;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
// nb_coerce took a reference.
|
|
493
|
+
Py_DECREF(coerced1);
|
|
494
|
+
Py_DECREF(coerced2);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
#endif
|
|
499
|
+
|
|
500
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for /: 'int' and '%s'", type2->tp_name);
|
|
501
|
+
goto exit_binary_exception;
|
|
502
|
+
|
|
503
|
+
exit_binary_result_object:
|
|
504
|
+
return obj_result;
|
|
505
|
+
|
|
506
|
+
exit_binary_exception:
|
|
507
|
+
return NULL;
|
|
508
|
+
}
|
|
509
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
510
|
+
CHECK_OBJECT(operand1);
|
|
511
|
+
assert(PyInt_CheckExact(operand1));
|
|
512
|
+
CHECK_OBJECT(operand2);
|
|
513
|
+
|
|
514
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
515
|
+
|
|
516
|
+
if (&PyInt_Type == type2) {
|
|
517
|
+
PyObject *result;
|
|
518
|
+
|
|
519
|
+
// return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_INT(operand1, operand2);
|
|
520
|
+
|
|
521
|
+
// Not every code path will make use of all possible results.
|
|
522
|
+
#ifdef _MSC_VER
|
|
523
|
+
#pragma warning(push)
|
|
524
|
+
#pragma warning(disable : 4101)
|
|
525
|
+
#endif
|
|
526
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
527
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
528
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
529
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
530
|
+
#ifdef _MSC_VER
|
|
531
|
+
#pragma warning(pop)
|
|
532
|
+
#endif
|
|
533
|
+
|
|
534
|
+
CHECK_OBJECT(operand1);
|
|
535
|
+
assert(PyInt_CheckExact(operand1));
|
|
536
|
+
CHECK_OBJECT(operand2);
|
|
537
|
+
assert(PyInt_CheckExact(operand2));
|
|
538
|
+
|
|
539
|
+
const long a = PyInt_AS_LONG(operand1);
|
|
540
|
+
const long b = PyInt_AS_LONG(operand2);
|
|
541
|
+
|
|
542
|
+
if (unlikely(b == 0)) {
|
|
543
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
544
|
+
|
|
545
|
+
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, "division by zero");
|
|
546
|
+
goto exit_result_exception;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
if (a == 0) {
|
|
550
|
+
if (b < 0) {
|
|
551
|
+
goto exit_result_ok_const_float_minus_0_0;
|
|
552
|
+
} else {
|
|
553
|
+
goto exit_result_ok_const_float_0_0;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/* May need to resort to LONG code, which we currently do not
|
|
558
|
+
* specialize yet. TODO: Once we do that, call it here instead.
|
|
559
|
+
*/
|
|
560
|
+
#if DBL_MANT_DIG < WIDTH_OF_ULONG
|
|
561
|
+
if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {
|
|
562
|
+
} else
|
|
563
|
+
#endif
|
|
564
|
+
{
|
|
565
|
+
double r = (double)a / (double)b;
|
|
566
|
+
|
|
567
|
+
cfloat_result = r;
|
|
568
|
+
goto exit_result_ok_cfloat;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
{
|
|
572
|
+
PyObject *operand1_object = operand1;
|
|
573
|
+
PyObject *operand2_object = operand2;
|
|
574
|
+
|
|
575
|
+
PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);
|
|
576
|
+
assert(r != Py_NotImplemented);
|
|
577
|
+
|
|
578
|
+
obj_result = r;
|
|
579
|
+
goto exit_result_object;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
exit_result_ok_cfloat:
|
|
583
|
+
result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
|
|
584
|
+
goto exit_result_ok;
|
|
585
|
+
|
|
586
|
+
exit_result_object:
|
|
587
|
+
if (unlikely(obj_result == NULL)) {
|
|
588
|
+
goto exit_result_exception;
|
|
589
|
+
}
|
|
590
|
+
result = obj_result;
|
|
591
|
+
goto exit_result_ok;
|
|
592
|
+
|
|
593
|
+
exit_result_ok_const_float_0_0:
|
|
594
|
+
Py_INCREF(const_float_0_0);
|
|
595
|
+
result = const_float_0_0;
|
|
596
|
+
goto exit_result_ok;
|
|
597
|
+
|
|
598
|
+
exit_result_ok_const_float_minus_0_0:
|
|
599
|
+
Py_INCREF(const_float_minus_0_0);
|
|
600
|
+
result = const_float_minus_0_0;
|
|
601
|
+
goto exit_result_ok;
|
|
602
|
+
|
|
603
|
+
exit_result_ok:
|
|
604
|
+
return result;
|
|
605
|
+
|
|
606
|
+
exit_result_exception:
|
|
607
|
+
return NULL;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
return __BINARY_OPERATION_TRUEDIV_OBJECT_INT_OBJECT(operand1, operand2);
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
614
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_OBJECT(operand1, operand2);
|
|
615
|
+
}
|
|
616
|
+
#endif
|
|
617
|
+
|
|
618
|
+
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "LONG" to Python2 'long', Python3 'int'. */
|
|
619
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {
|
|
620
|
+
CHECK_OBJECT(operand1);
|
|
621
|
+
assert(PyLong_CheckExact(operand1));
|
|
622
|
+
CHECK_OBJECT(operand2);
|
|
623
|
+
assert(PyLong_CheckExact(operand2));
|
|
624
|
+
|
|
625
|
+
PyObject *result;
|
|
626
|
+
|
|
627
|
+
// Not every code path will make use of all possible results.
|
|
628
|
+
#ifdef _MSC_VER
|
|
629
|
+
#pragma warning(push)
|
|
630
|
+
#pragma warning(disable : 4101)
|
|
631
|
+
#endif
|
|
632
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
633
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
634
|
+
#ifdef _MSC_VER
|
|
635
|
+
#pragma warning(pop)
|
|
636
|
+
#endif
|
|
637
|
+
|
|
638
|
+
PyObject *x = PyLong_Type.tp_as_number->nb_true_divide(operand1, operand2);
|
|
639
|
+
assert(x != Py_NotImplemented);
|
|
640
|
+
|
|
641
|
+
obj_result = x;
|
|
642
|
+
goto exit_result_object;
|
|
643
|
+
|
|
644
|
+
exit_result_object:
|
|
645
|
+
if (unlikely(obj_result == NULL)) {
|
|
646
|
+
goto exit_result_exception;
|
|
647
|
+
}
|
|
648
|
+
result = obj_result;
|
|
649
|
+
goto exit_result_ok;
|
|
650
|
+
|
|
651
|
+
exit_result_ok:
|
|
652
|
+
return result;
|
|
653
|
+
|
|
654
|
+
exit_result_exception:
|
|
655
|
+
return NULL;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {
|
|
659
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_LONG_LONG(operand1, operand2);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
/* Code referring to "OBJECT" corresponds to any Python object and "LONG" to Python2 'long', Python3 'int'. */
|
|
663
|
+
static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_LONG(PyObject *operand1,
|
|
664
|
+
PyObject *operand2) {
|
|
665
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
666
|
+
|
|
667
|
+
#ifdef _MSC_VER
|
|
668
|
+
#pragma warning(push)
|
|
669
|
+
#pragma warning(disable : 4101)
|
|
670
|
+
#endif
|
|
671
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
672
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
673
|
+
#ifdef _MSC_VER
|
|
674
|
+
#pragma warning(pop)
|
|
675
|
+
#endif
|
|
676
|
+
|
|
677
|
+
binaryfunc slot1 =
|
|
678
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_true_divide : NULL;
|
|
679
|
+
binaryfunc slot2 = NULL;
|
|
680
|
+
|
|
681
|
+
if (!(type1 == &PyLong_Type)) {
|
|
682
|
+
// Different types, need to consider second value slot.
|
|
683
|
+
|
|
684
|
+
slot2 = PyLong_Type.tp_as_number->nb_true_divide;
|
|
685
|
+
|
|
686
|
+
if (slot1 == slot2) {
|
|
687
|
+
slot2 = NULL;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
if (slot1 != NULL) {
|
|
692
|
+
PyObject *x = slot1(operand1, operand2);
|
|
693
|
+
|
|
694
|
+
if (x != Py_NotImplemented) {
|
|
695
|
+
obj_result = x;
|
|
696
|
+
goto exit_binary_result_object;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
Py_DECREF_IMMORTAL(x);
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
if (slot2 != NULL) {
|
|
703
|
+
PyObject *x = slot2(operand1, operand2);
|
|
704
|
+
|
|
705
|
+
if (x != Py_NotImplemented) {
|
|
706
|
+
obj_result = x;
|
|
707
|
+
goto exit_binary_result_object;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
Py_DECREF_IMMORTAL(x);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
#if PYTHON_VERSION < 0x300
|
|
714
|
+
if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
|
|
715
|
+
coercion c1 =
|
|
716
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
|
|
717
|
+
|
|
718
|
+
if (c1 != NULL) {
|
|
719
|
+
PyObject *coerced1 = operand1;
|
|
720
|
+
PyObject *coerced2 = operand2;
|
|
721
|
+
|
|
722
|
+
int err = c1(&coerced1, &coerced2);
|
|
723
|
+
|
|
724
|
+
if (unlikely(err < 0)) {
|
|
725
|
+
goto exit_binary_exception;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
if (err == 0) {
|
|
729
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
730
|
+
|
|
731
|
+
if (likely(mv == NULL)) {
|
|
732
|
+
binaryfunc slot = mv->nb_true_divide;
|
|
733
|
+
|
|
734
|
+
if (likely(slot != NULL)) {
|
|
735
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
736
|
+
|
|
737
|
+
Py_DECREF(coerced1);
|
|
738
|
+
Py_DECREF(coerced2);
|
|
739
|
+
|
|
740
|
+
obj_result = x;
|
|
741
|
+
goto exit_binary_result_object;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
// nb_coerce took a reference.
|
|
746
|
+
Py_DECREF(coerced1);
|
|
747
|
+
Py_DECREF(coerced2);
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
coercion c2 = PyLong_Type.tp_as_number->nb_coerce;
|
|
751
|
+
|
|
752
|
+
if (c2 != NULL) {
|
|
753
|
+
PyObject *coerced1 = operand1;
|
|
754
|
+
PyObject *coerced2 = operand2;
|
|
755
|
+
|
|
756
|
+
int err = c2(&coerced2, &coerced1);
|
|
757
|
+
|
|
758
|
+
if (unlikely(err < 0)) {
|
|
759
|
+
goto exit_binary_exception;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
if (err == 0) {
|
|
763
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
764
|
+
|
|
765
|
+
if (likely(mv == NULL)) {
|
|
766
|
+
binaryfunc slot = mv->nb_true_divide;
|
|
767
|
+
|
|
768
|
+
if (likely(slot != NULL)) {
|
|
769
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
770
|
+
|
|
771
|
+
Py_DECREF(coerced1);
|
|
772
|
+
Py_DECREF(coerced2);
|
|
773
|
+
|
|
774
|
+
obj_result = x;
|
|
775
|
+
goto exit_binary_result_object;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
// nb_coerce took a reference.
|
|
780
|
+
Py_DECREF(coerced1);
|
|
781
|
+
Py_DECREF(coerced2);
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
#endif
|
|
786
|
+
|
|
787
|
+
#if PYTHON_VERSION < 0x300
|
|
788
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for /: '%s' and 'long'", type1->tp_name);
|
|
789
|
+
#else
|
|
790
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for /: '%s' and 'int'", type1->tp_name);
|
|
791
|
+
#endif
|
|
792
|
+
goto exit_binary_exception;
|
|
793
|
+
|
|
794
|
+
exit_binary_result_object:
|
|
795
|
+
return obj_result;
|
|
796
|
+
|
|
797
|
+
exit_binary_exception:
|
|
798
|
+
return NULL;
|
|
799
|
+
}
|
|
800
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
|
|
801
|
+
CHECK_OBJECT(operand1);
|
|
802
|
+
CHECK_OBJECT(operand2);
|
|
803
|
+
assert(PyLong_CheckExact(operand2));
|
|
804
|
+
|
|
805
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
806
|
+
|
|
807
|
+
if (type1 == &PyLong_Type) {
|
|
808
|
+
PyObject *result;
|
|
809
|
+
|
|
810
|
+
// return _BINARY_OPERATION_TRUEDIV_OBJECT_LONG_LONG(operand1, operand2);
|
|
811
|
+
|
|
812
|
+
// Not every code path will make use of all possible results.
|
|
813
|
+
#ifdef _MSC_VER
|
|
814
|
+
#pragma warning(push)
|
|
815
|
+
#pragma warning(disable : 4101)
|
|
816
|
+
#endif
|
|
817
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
818
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
819
|
+
#ifdef _MSC_VER
|
|
820
|
+
#pragma warning(pop)
|
|
821
|
+
#endif
|
|
822
|
+
|
|
823
|
+
PyObject *x = PyLong_Type.tp_as_number->nb_true_divide(operand1, operand2);
|
|
824
|
+
assert(x != Py_NotImplemented);
|
|
825
|
+
|
|
826
|
+
obj_result = x;
|
|
827
|
+
goto exit_result_object;
|
|
828
|
+
|
|
829
|
+
exit_result_object:
|
|
830
|
+
if (unlikely(obj_result == NULL)) {
|
|
831
|
+
goto exit_result_exception;
|
|
832
|
+
}
|
|
833
|
+
result = obj_result;
|
|
834
|
+
goto exit_result_ok;
|
|
835
|
+
|
|
836
|
+
exit_result_ok:
|
|
837
|
+
return result;
|
|
838
|
+
|
|
839
|
+
exit_result_exception:
|
|
840
|
+
return NULL;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
return __BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_LONG(operand1, operand2);
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
|
|
847
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_LONG(operand1, operand2);
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "OBJECT" to any Python object. */
|
|
851
|
+
static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_LONG_OBJECT(PyObject *operand1,
|
|
852
|
+
PyObject *operand2) {
|
|
853
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
854
|
+
|
|
855
|
+
#ifdef _MSC_VER
|
|
856
|
+
#pragma warning(push)
|
|
857
|
+
#pragma warning(disable : 4101)
|
|
858
|
+
#endif
|
|
859
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
860
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
861
|
+
#ifdef _MSC_VER
|
|
862
|
+
#pragma warning(pop)
|
|
863
|
+
#endif
|
|
864
|
+
|
|
865
|
+
binaryfunc slot1 = PyLong_Type.tp_as_number->nb_true_divide;
|
|
866
|
+
binaryfunc slot2 = NULL;
|
|
867
|
+
|
|
868
|
+
if (!(&PyLong_Type == type2)) {
|
|
869
|
+
// Different types, need to consider second value slot.
|
|
870
|
+
|
|
871
|
+
slot2 =
|
|
872
|
+
(type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_true_divide : NULL;
|
|
873
|
+
|
|
874
|
+
if (slot1 == slot2) {
|
|
875
|
+
slot2 = NULL;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
if (slot1 != NULL) {
|
|
880
|
+
if (slot2 != NULL) {
|
|
881
|
+
if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
|
|
882
|
+
PyObject *x = slot2(operand1, operand2);
|
|
883
|
+
|
|
884
|
+
if (x != Py_NotImplemented) {
|
|
885
|
+
obj_result = x;
|
|
886
|
+
goto exit_binary_result_object;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
Py_DECREF_IMMORTAL(x);
|
|
890
|
+
slot2 = NULL;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
PyObject *x = slot1(operand1, operand2);
|
|
895
|
+
|
|
896
|
+
if (x != Py_NotImplemented) {
|
|
897
|
+
obj_result = x;
|
|
898
|
+
goto exit_binary_result_object;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
Py_DECREF_IMMORTAL(x);
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
if (slot2 != NULL) {
|
|
905
|
+
PyObject *x = slot2(operand1, operand2);
|
|
906
|
+
|
|
907
|
+
if (x != Py_NotImplemented) {
|
|
908
|
+
obj_result = x;
|
|
909
|
+
goto exit_binary_result_object;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
Py_DECREF_IMMORTAL(x);
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
#if PYTHON_VERSION < 0x300
|
|
916
|
+
if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
|
|
917
|
+
coercion c1 = PyLong_Type.tp_as_number->nb_coerce;
|
|
918
|
+
|
|
919
|
+
if (c1 != NULL) {
|
|
920
|
+
PyObject *coerced1 = operand1;
|
|
921
|
+
PyObject *coerced2 = operand2;
|
|
922
|
+
|
|
923
|
+
int err = c1(&coerced1, &coerced2);
|
|
924
|
+
|
|
925
|
+
if (unlikely(err < 0)) {
|
|
926
|
+
goto exit_binary_exception;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
if (err == 0) {
|
|
930
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
931
|
+
|
|
932
|
+
if (likely(mv == NULL)) {
|
|
933
|
+
binaryfunc slot = mv->nb_true_divide;
|
|
934
|
+
|
|
935
|
+
if (likely(slot != NULL)) {
|
|
936
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
937
|
+
|
|
938
|
+
Py_DECREF(coerced1);
|
|
939
|
+
Py_DECREF(coerced2);
|
|
940
|
+
|
|
941
|
+
obj_result = x;
|
|
942
|
+
goto exit_binary_result_object;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
// nb_coerce took a reference.
|
|
947
|
+
Py_DECREF(coerced1);
|
|
948
|
+
Py_DECREF(coerced2);
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
coercion c2 =
|
|
952
|
+
(type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
|
|
953
|
+
|
|
954
|
+
if (c2 != NULL) {
|
|
955
|
+
PyObject *coerced1 = operand1;
|
|
956
|
+
PyObject *coerced2 = operand2;
|
|
957
|
+
|
|
958
|
+
int err = c2(&coerced2, &coerced1);
|
|
959
|
+
|
|
960
|
+
if (unlikely(err < 0)) {
|
|
961
|
+
goto exit_binary_exception;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
if (err == 0) {
|
|
965
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
966
|
+
|
|
967
|
+
if (likely(mv == NULL)) {
|
|
968
|
+
binaryfunc slot = mv->nb_true_divide;
|
|
969
|
+
|
|
970
|
+
if (likely(slot != NULL)) {
|
|
971
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
972
|
+
|
|
973
|
+
Py_DECREF(coerced1);
|
|
974
|
+
Py_DECREF(coerced2);
|
|
975
|
+
|
|
976
|
+
obj_result = x;
|
|
977
|
+
goto exit_binary_result_object;
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
// nb_coerce took a reference.
|
|
982
|
+
Py_DECREF(coerced1);
|
|
983
|
+
Py_DECREF(coerced2);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
#endif
|
|
988
|
+
|
|
989
|
+
#if PYTHON_VERSION < 0x300
|
|
990
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for /: 'long' and '%s'", type2->tp_name);
|
|
991
|
+
#else
|
|
992
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for /: 'int' and '%s'", type2->tp_name);
|
|
993
|
+
#endif
|
|
994
|
+
goto exit_binary_exception;
|
|
995
|
+
|
|
996
|
+
exit_binary_result_object:
|
|
997
|
+
return obj_result;
|
|
998
|
+
|
|
999
|
+
exit_binary_exception:
|
|
1000
|
+
return NULL;
|
|
1001
|
+
}
|
|
1002
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
1003
|
+
CHECK_OBJECT(operand1);
|
|
1004
|
+
assert(PyLong_CheckExact(operand1));
|
|
1005
|
+
CHECK_OBJECT(operand2);
|
|
1006
|
+
|
|
1007
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
1008
|
+
|
|
1009
|
+
if (&PyLong_Type == type2) {
|
|
1010
|
+
PyObject *result;
|
|
1011
|
+
|
|
1012
|
+
// return _BINARY_OPERATION_TRUEDIV_OBJECT_LONG_LONG(operand1, operand2);
|
|
1013
|
+
|
|
1014
|
+
// Not every code path will make use of all possible results.
|
|
1015
|
+
#ifdef _MSC_VER
|
|
1016
|
+
#pragma warning(push)
|
|
1017
|
+
#pragma warning(disable : 4101)
|
|
1018
|
+
#endif
|
|
1019
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1020
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
1021
|
+
#ifdef _MSC_VER
|
|
1022
|
+
#pragma warning(pop)
|
|
1023
|
+
#endif
|
|
1024
|
+
|
|
1025
|
+
PyObject *x = PyLong_Type.tp_as_number->nb_true_divide(operand1, operand2);
|
|
1026
|
+
assert(x != Py_NotImplemented);
|
|
1027
|
+
|
|
1028
|
+
obj_result = x;
|
|
1029
|
+
goto exit_result_object;
|
|
1030
|
+
|
|
1031
|
+
exit_result_object:
|
|
1032
|
+
if (unlikely(obj_result == NULL)) {
|
|
1033
|
+
goto exit_result_exception;
|
|
1034
|
+
}
|
|
1035
|
+
result = obj_result;
|
|
1036
|
+
goto exit_result_ok;
|
|
1037
|
+
|
|
1038
|
+
exit_result_ok:
|
|
1039
|
+
return result;
|
|
1040
|
+
|
|
1041
|
+
exit_result_exception:
|
|
1042
|
+
return NULL;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
return __BINARY_OPERATION_TRUEDIV_OBJECT_LONG_OBJECT(operand1, operand2);
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
1049
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_LONG_OBJECT(operand1, operand2);
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
/* Code referring to "FLOAT" corresponds to Python 'float' and "FLOAT" to Python 'float'. */
|
|
1053
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {
|
|
1054
|
+
CHECK_OBJECT(operand1);
|
|
1055
|
+
assert(PyFloat_CheckExact(operand1));
|
|
1056
|
+
CHECK_OBJECT(operand2);
|
|
1057
|
+
assert(PyFloat_CheckExact(operand2));
|
|
1058
|
+
|
|
1059
|
+
PyObject *result;
|
|
1060
|
+
|
|
1061
|
+
#ifdef _MSC_VER
|
|
1062
|
+
#pragma warning(push)
|
|
1063
|
+
#pragma warning(disable : 4101)
|
|
1064
|
+
#endif
|
|
1065
|
+
// Not every code path will make use of all possible results.
|
|
1066
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1067
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
1068
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
1069
|
+
#ifdef _MSC_VER
|
|
1070
|
+
#pragma warning(pop)
|
|
1071
|
+
#endif
|
|
1072
|
+
|
|
1073
|
+
CHECK_OBJECT(operand1);
|
|
1074
|
+
assert(PyFloat_CheckExact(operand1));
|
|
1075
|
+
CHECK_OBJECT(operand2);
|
|
1076
|
+
assert(PyFloat_CheckExact(operand2));
|
|
1077
|
+
|
|
1078
|
+
const double a = PyFloat_AS_DOUBLE(operand1);
|
|
1079
|
+
const double b = PyFloat_AS_DOUBLE(operand2);
|
|
1080
|
+
|
|
1081
|
+
if (unlikely(b == 0.0)) {
|
|
1082
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
1083
|
+
|
|
1084
|
+
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, "float division by zero");
|
|
1085
|
+
goto exit_result_exception;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
{
|
|
1089
|
+
double r = a / b;
|
|
1090
|
+
|
|
1091
|
+
cfloat_result = r;
|
|
1092
|
+
goto exit_result_ok_cfloat;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
exit_result_ok_cfloat:
|
|
1096
|
+
result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
|
|
1097
|
+
goto exit_result_ok;
|
|
1098
|
+
|
|
1099
|
+
exit_result_ok:
|
|
1100
|
+
return result;
|
|
1101
|
+
|
|
1102
|
+
exit_result_exception:
|
|
1103
|
+
return NULL;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {
|
|
1107
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_FLOAT(operand1, operand2);
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
/* Code referring to "OBJECT" corresponds to any Python object and "FLOAT" to Python 'float'. */
|
|
1111
|
+
static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1,
|
|
1112
|
+
PyObject *operand2) {
|
|
1113
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
1114
|
+
|
|
1115
|
+
#ifdef _MSC_VER
|
|
1116
|
+
#pragma warning(push)
|
|
1117
|
+
#pragma warning(disable : 4101)
|
|
1118
|
+
#endif
|
|
1119
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1120
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1121
|
+
#ifdef _MSC_VER
|
|
1122
|
+
#pragma warning(pop)
|
|
1123
|
+
#endif
|
|
1124
|
+
|
|
1125
|
+
binaryfunc slot1 =
|
|
1126
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_true_divide : NULL;
|
|
1127
|
+
binaryfunc slot2 = NULL;
|
|
1128
|
+
|
|
1129
|
+
if (!(type1 == &PyFloat_Type)) {
|
|
1130
|
+
// Different types, need to consider second value slot.
|
|
1131
|
+
|
|
1132
|
+
slot2 = PyFloat_Type.tp_as_number->nb_true_divide;
|
|
1133
|
+
|
|
1134
|
+
if (slot1 == slot2) {
|
|
1135
|
+
slot2 = NULL;
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
if (slot1 != NULL) {
|
|
1140
|
+
PyObject *x = slot1(operand1, operand2);
|
|
1141
|
+
|
|
1142
|
+
if (x != Py_NotImplemented) {
|
|
1143
|
+
obj_result = x;
|
|
1144
|
+
goto exit_binary_result_object;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
Py_DECREF_IMMORTAL(x);
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
if (slot2 != NULL) {
|
|
1151
|
+
PyObject *x = slot2(operand1, operand2);
|
|
1152
|
+
|
|
1153
|
+
if (x != Py_NotImplemented) {
|
|
1154
|
+
obj_result = x;
|
|
1155
|
+
goto exit_binary_result_object;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
Py_DECREF_IMMORTAL(x);
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
#if PYTHON_VERSION < 0x300
|
|
1162
|
+
if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
|
|
1163
|
+
coercion c1 =
|
|
1164
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
|
|
1165
|
+
|
|
1166
|
+
if (c1 != NULL) {
|
|
1167
|
+
PyObject *coerced1 = operand1;
|
|
1168
|
+
PyObject *coerced2 = operand2;
|
|
1169
|
+
|
|
1170
|
+
int err = c1(&coerced1, &coerced2);
|
|
1171
|
+
|
|
1172
|
+
if (unlikely(err < 0)) {
|
|
1173
|
+
goto exit_binary_exception;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
if (err == 0) {
|
|
1177
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
1178
|
+
|
|
1179
|
+
if (likely(mv == NULL)) {
|
|
1180
|
+
binaryfunc slot = mv->nb_true_divide;
|
|
1181
|
+
|
|
1182
|
+
if (likely(slot != NULL)) {
|
|
1183
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
1184
|
+
|
|
1185
|
+
Py_DECREF(coerced1);
|
|
1186
|
+
Py_DECREF(coerced2);
|
|
1187
|
+
|
|
1188
|
+
obj_result = x;
|
|
1189
|
+
goto exit_binary_result_object;
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
// nb_coerce took a reference.
|
|
1194
|
+
Py_DECREF(coerced1);
|
|
1195
|
+
Py_DECREF(coerced2);
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;
|
|
1199
|
+
|
|
1200
|
+
if (c2 != NULL) {
|
|
1201
|
+
PyObject *coerced1 = operand1;
|
|
1202
|
+
PyObject *coerced2 = operand2;
|
|
1203
|
+
|
|
1204
|
+
int err = c2(&coerced2, &coerced1);
|
|
1205
|
+
|
|
1206
|
+
if (unlikely(err < 0)) {
|
|
1207
|
+
goto exit_binary_exception;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
if (err == 0) {
|
|
1211
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
1212
|
+
|
|
1213
|
+
if (likely(mv == NULL)) {
|
|
1214
|
+
binaryfunc slot = mv->nb_true_divide;
|
|
1215
|
+
|
|
1216
|
+
if (likely(slot != NULL)) {
|
|
1217
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
1218
|
+
|
|
1219
|
+
Py_DECREF(coerced1);
|
|
1220
|
+
Py_DECREF(coerced2);
|
|
1221
|
+
|
|
1222
|
+
obj_result = x;
|
|
1223
|
+
goto exit_binary_result_object;
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
// nb_coerce took a reference.
|
|
1228
|
+
Py_DECREF(coerced1);
|
|
1229
|
+
Py_DECREF(coerced2);
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
#endif
|
|
1234
|
+
|
|
1235
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for /: '%s' and 'float'", type1->tp_name);
|
|
1236
|
+
goto exit_binary_exception;
|
|
1237
|
+
|
|
1238
|
+
exit_binary_result_object:
|
|
1239
|
+
return obj_result;
|
|
1240
|
+
|
|
1241
|
+
exit_binary_exception:
|
|
1242
|
+
return NULL;
|
|
1243
|
+
}
|
|
1244
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {
|
|
1245
|
+
CHECK_OBJECT(operand1);
|
|
1246
|
+
CHECK_OBJECT(operand2);
|
|
1247
|
+
assert(PyFloat_CheckExact(operand2));
|
|
1248
|
+
|
|
1249
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
1250
|
+
|
|
1251
|
+
if (type1 == &PyFloat_Type) {
|
|
1252
|
+
PyObject *result;
|
|
1253
|
+
|
|
1254
|
+
// return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_FLOAT(operand1, operand2);
|
|
1255
|
+
|
|
1256
|
+
#ifdef _MSC_VER
|
|
1257
|
+
#pragma warning(push)
|
|
1258
|
+
#pragma warning(disable : 4101)
|
|
1259
|
+
#endif
|
|
1260
|
+
// Not every code path will make use of all possible results.
|
|
1261
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1262
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
1263
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
1264
|
+
#ifdef _MSC_VER
|
|
1265
|
+
#pragma warning(pop)
|
|
1266
|
+
#endif
|
|
1267
|
+
|
|
1268
|
+
CHECK_OBJECT(operand1);
|
|
1269
|
+
assert(PyFloat_CheckExact(operand1));
|
|
1270
|
+
CHECK_OBJECT(operand2);
|
|
1271
|
+
assert(PyFloat_CheckExact(operand2));
|
|
1272
|
+
|
|
1273
|
+
const double a = PyFloat_AS_DOUBLE(operand1);
|
|
1274
|
+
const double b = PyFloat_AS_DOUBLE(operand2);
|
|
1275
|
+
|
|
1276
|
+
if (unlikely(b == 0.0)) {
|
|
1277
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
1278
|
+
|
|
1279
|
+
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, "float division by zero");
|
|
1280
|
+
goto exit_result_exception;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
{
|
|
1284
|
+
double r = a / b;
|
|
1285
|
+
|
|
1286
|
+
cfloat_result = r;
|
|
1287
|
+
goto exit_result_ok_cfloat;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
exit_result_ok_cfloat:
|
|
1291
|
+
result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
|
|
1292
|
+
goto exit_result_ok;
|
|
1293
|
+
|
|
1294
|
+
exit_result_ok:
|
|
1295
|
+
return result;
|
|
1296
|
+
|
|
1297
|
+
exit_result_exception:
|
|
1298
|
+
return NULL;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
return __BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_FLOAT(operand1, operand2);
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {
|
|
1305
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_FLOAT(operand1, operand2);
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
/* Code referring to "FLOAT" corresponds to Python 'float' and "OBJECT" to any Python object. */
|
|
1309
|
+
static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1,
|
|
1310
|
+
PyObject *operand2) {
|
|
1311
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
1312
|
+
|
|
1313
|
+
#ifdef _MSC_VER
|
|
1314
|
+
#pragma warning(push)
|
|
1315
|
+
#pragma warning(disable : 4101)
|
|
1316
|
+
#endif
|
|
1317
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1318
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1319
|
+
#ifdef _MSC_VER
|
|
1320
|
+
#pragma warning(pop)
|
|
1321
|
+
#endif
|
|
1322
|
+
|
|
1323
|
+
binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_true_divide;
|
|
1324
|
+
binaryfunc slot2 = NULL;
|
|
1325
|
+
|
|
1326
|
+
if (!(&PyFloat_Type == type2)) {
|
|
1327
|
+
// Different types, need to consider second value slot.
|
|
1328
|
+
|
|
1329
|
+
slot2 =
|
|
1330
|
+
(type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_true_divide : NULL;
|
|
1331
|
+
|
|
1332
|
+
if (slot1 == slot2) {
|
|
1333
|
+
slot2 = NULL;
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
if (slot1 != NULL) {
|
|
1338
|
+
if (slot2 != NULL) {
|
|
1339
|
+
if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
|
|
1340
|
+
PyObject *x = slot2(operand1, operand2);
|
|
1341
|
+
|
|
1342
|
+
if (x != Py_NotImplemented) {
|
|
1343
|
+
obj_result = x;
|
|
1344
|
+
goto exit_binary_result_object;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
Py_DECREF_IMMORTAL(x);
|
|
1348
|
+
slot2 = NULL;
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
PyObject *x = slot1(operand1, operand2);
|
|
1353
|
+
|
|
1354
|
+
if (x != Py_NotImplemented) {
|
|
1355
|
+
obj_result = x;
|
|
1356
|
+
goto exit_binary_result_object;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
Py_DECREF_IMMORTAL(x);
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
if (slot2 != NULL) {
|
|
1363
|
+
PyObject *x = slot2(operand1, operand2);
|
|
1364
|
+
|
|
1365
|
+
if (x != Py_NotImplemented) {
|
|
1366
|
+
obj_result = x;
|
|
1367
|
+
goto exit_binary_result_object;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
Py_DECREF_IMMORTAL(x);
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
#if PYTHON_VERSION < 0x300
|
|
1374
|
+
if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
|
|
1375
|
+
coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;
|
|
1376
|
+
|
|
1377
|
+
if (c1 != NULL) {
|
|
1378
|
+
PyObject *coerced1 = operand1;
|
|
1379
|
+
PyObject *coerced2 = operand2;
|
|
1380
|
+
|
|
1381
|
+
int err = c1(&coerced1, &coerced2);
|
|
1382
|
+
|
|
1383
|
+
if (unlikely(err < 0)) {
|
|
1384
|
+
goto exit_binary_exception;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
if (err == 0) {
|
|
1388
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
1389
|
+
|
|
1390
|
+
if (likely(mv == NULL)) {
|
|
1391
|
+
binaryfunc slot = mv->nb_true_divide;
|
|
1392
|
+
|
|
1393
|
+
if (likely(slot != NULL)) {
|
|
1394
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
1395
|
+
|
|
1396
|
+
Py_DECREF(coerced1);
|
|
1397
|
+
Py_DECREF(coerced2);
|
|
1398
|
+
|
|
1399
|
+
obj_result = x;
|
|
1400
|
+
goto exit_binary_result_object;
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
// nb_coerce took a reference.
|
|
1405
|
+
Py_DECREF(coerced1);
|
|
1406
|
+
Py_DECREF(coerced2);
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
coercion c2 =
|
|
1410
|
+
(type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
|
|
1411
|
+
|
|
1412
|
+
if (c2 != NULL) {
|
|
1413
|
+
PyObject *coerced1 = operand1;
|
|
1414
|
+
PyObject *coerced2 = operand2;
|
|
1415
|
+
|
|
1416
|
+
int err = c2(&coerced2, &coerced1);
|
|
1417
|
+
|
|
1418
|
+
if (unlikely(err < 0)) {
|
|
1419
|
+
goto exit_binary_exception;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
if (err == 0) {
|
|
1423
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
1424
|
+
|
|
1425
|
+
if (likely(mv == NULL)) {
|
|
1426
|
+
binaryfunc slot = mv->nb_true_divide;
|
|
1427
|
+
|
|
1428
|
+
if (likely(slot != NULL)) {
|
|
1429
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
1430
|
+
|
|
1431
|
+
Py_DECREF(coerced1);
|
|
1432
|
+
Py_DECREF(coerced2);
|
|
1433
|
+
|
|
1434
|
+
obj_result = x;
|
|
1435
|
+
goto exit_binary_result_object;
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
// nb_coerce took a reference.
|
|
1440
|
+
Py_DECREF(coerced1);
|
|
1441
|
+
Py_DECREF(coerced2);
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
#endif
|
|
1446
|
+
|
|
1447
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for /: 'float' and '%s'", type2->tp_name);
|
|
1448
|
+
goto exit_binary_exception;
|
|
1449
|
+
|
|
1450
|
+
exit_binary_result_object:
|
|
1451
|
+
return obj_result;
|
|
1452
|
+
|
|
1453
|
+
exit_binary_exception:
|
|
1454
|
+
return NULL;
|
|
1455
|
+
}
|
|
1456
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
1457
|
+
CHECK_OBJECT(operand1);
|
|
1458
|
+
assert(PyFloat_CheckExact(operand1));
|
|
1459
|
+
CHECK_OBJECT(operand2);
|
|
1460
|
+
|
|
1461
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
1462
|
+
|
|
1463
|
+
if (&PyFloat_Type == type2) {
|
|
1464
|
+
PyObject *result;
|
|
1465
|
+
|
|
1466
|
+
// return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_FLOAT(operand1, operand2);
|
|
1467
|
+
|
|
1468
|
+
#ifdef _MSC_VER
|
|
1469
|
+
#pragma warning(push)
|
|
1470
|
+
#pragma warning(disable : 4101)
|
|
1471
|
+
#endif
|
|
1472
|
+
// Not every code path will make use of all possible results.
|
|
1473
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1474
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
1475
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
1476
|
+
#ifdef _MSC_VER
|
|
1477
|
+
#pragma warning(pop)
|
|
1478
|
+
#endif
|
|
1479
|
+
|
|
1480
|
+
CHECK_OBJECT(operand1);
|
|
1481
|
+
assert(PyFloat_CheckExact(operand1));
|
|
1482
|
+
CHECK_OBJECT(operand2);
|
|
1483
|
+
assert(PyFloat_CheckExact(operand2));
|
|
1484
|
+
|
|
1485
|
+
const double a = PyFloat_AS_DOUBLE(operand1);
|
|
1486
|
+
const double b = PyFloat_AS_DOUBLE(operand2);
|
|
1487
|
+
|
|
1488
|
+
if (unlikely(b == 0.0)) {
|
|
1489
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
1490
|
+
|
|
1491
|
+
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, "float division by zero");
|
|
1492
|
+
goto exit_result_exception;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
{
|
|
1496
|
+
double r = a / b;
|
|
1497
|
+
|
|
1498
|
+
cfloat_result = r;
|
|
1499
|
+
goto exit_result_ok_cfloat;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
exit_result_ok_cfloat:
|
|
1503
|
+
result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
|
|
1504
|
+
goto exit_result_ok;
|
|
1505
|
+
|
|
1506
|
+
exit_result_ok:
|
|
1507
|
+
return result;
|
|
1508
|
+
|
|
1509
|
+
exit_result_exception:
|
|
1510
|
+
return NULL;
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
return __BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_OBJECT(operand1, operand2);
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
1517
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_OBJECT(operand1, operand2);
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
/* Code referring to "FLOAT" corresponds to Python 'float' and "LONG" to Python2 'long', Python3 'int'. */
|
|
1521
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {
|
|
1522
|
+
CHECK_OBJECT(operand1);
|
|
1523
|
+
assert(PyFloat_CheckExact(operand1));
|
|
1524
|
+
CHECK_OBJECT(operand2);
|
|
1525
|
+
assert(PyLong_CheckExact(operand2));
|
|
1526
|
+
|
|
1527
|
+
#ifdef _MSC_VER
|
|
1528
|
+
#pragma warning(push)
|
|
1529
|
+
#pragma warning(disable : 4101)
|
|
1530
|
+
#endif
|
|
1531
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1532
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1533
|
+
#ifdef _MSC_VER
|
|
1534
|
+
#pragma warning(pop)
|
|
1535
|
+
#endif
|
|
1536
|
+
|
|
1537
|
+
binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_true_divide;
|
|
1538
|
+
// Slot2 ignored on purpose, type1 takes precedence.
|
|
1539
|
+
|
|
1540
|
+
if (slot1 != NULL) {
|
|
1541
|
+
PyObject *x = slot1(operand1, operand2);
|
|
1542
|
+
|
|
1543
|
+
if (x != Py_NotImplemented) {
|
|
1544
|
+
obj_result = x;
|
|
1545
|
+
goto exit_binary_result_object;
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
Py_DECREF_IMMORTAL(x);
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
// Statically recognized that coercion is not possible with these types
|
|
1552
|
+
|
|
1553
|
+
#if PYTHON_VERSION < 0x300
|
|
1554
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for /: 'float' and 'long'");
|
|
1555
|
+
#else
|
|
1556
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for /: 'float' and 'int'");
|
|
1557
|
+
#endif
|
|
1558
|
+
goto exit_binary_exception;
|
|
1559
|
+
|
|
1560
|
+
exit_binary_result_object:
|
|
1561
|
+
return obj_result;
|
|
1562
|
+
|
|
1563
|
+
exit_binary_exception:
|
|
1564
|
+
return NULL;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {
|
|
1568
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_LONG(operand1, operand2);
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "FLOAT" to Python 'float'. */
|
|
1572
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {
|
|
1573
|
+
CHECK_OBJECT(operand1);
|
|
1574
|
+
assert(PyLong_CheckExact(operand1));
|
|
1575
|
+
CHECK_OBJECT(operand2);
|
|
1576
|
+
assert(PyFloat_CheckExact(operand2));
|
|
1577
|
+
|
|
1578
|
+
#ifdef _MSC_VER
|
|
1579
|
+
#pragma warning(push)
|
|
1580
|
+
#pragma warning(disable : 4101)
|
|
1581
|
+
#endif
|
|
1582
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1583
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1584
|
+
#ifdef _MSC_VER
|
|
1585
|
+
#pragma warning(pop)
|
|
1586
|
+
#endif
|
|
1587
|
+
|
|
1588
|
+
// Slot1 ignored on purpose, type2 takes precedence.
|
|
1589
|
+
binaryfunc slot2 = NULL;
|
|
1590
|
+
|
|
1591
|
+
if (!(0)) {
|
|
1592
|
+
// Different types, need to consider second value slot.
|
|
1593
|
+
|
|
1594
|
+
slot2 = PyFloat_Type.tp_as_number->nb_true_divide;
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
if (slot2 != NULL) {
|
|
1598
|
+
PyObject *x = slot2(operand1, operand2);
|
|
1599
|
+
|
|
1600
|
+
if (x != Py_NotImplemented) {
|
|
1601
|
+
obj_result = x;
|
|
1602
|
+
goto exit_binary_result_object;
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
Py_DECREF_IMMORTAL(x);
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
// Statically recognized that coercion is not possible with these types
|
|
1609
|
+
|
|
1610
|
+
#if PYTHON_VERSION < 0x300
|
|
1611
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for /: 'long' and 'float'");
|
|
1612
|
+
#else
|
|
1613
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for /: 'int' and 'float'");
|
|
1614
|
+
#endif
|
|
1615
|
+
goto exit_binary_exception;
|
|
1616
|
+
|
|
1617
|
+
exit_binary_result_object:
|
|
1618
|
+
return obj_result;
|
|
1619
|
+
|
|
1620
|
+
exit_binary_exception:
|
|
1621
|
+
return NULL;
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {
|
|
1625
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_LONG_FLOAT(operand1, operand2);
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
#if PYTHON_VERSION < 0x300
|
|
1629
|
+
/* Code referring to "FLOAT" corresponds to Python 'float' and "INT" to Python2 'int'. */
|
|
1630
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {
|
|
1631
|
+
CHECK_OBJECT(operand1);
|
|
1632
|
+
assert(PyFloat_CheckExact(operand1));
|
|
1633
|
+
CHECK_OBJECT(operand2);
|
|
1634
|
+
assert(PyInt_CheckExact(operand2));
|
|
1635
|
+
|
|
1636
|
+
#ifdef _MSC_VER
|
|
1637
|
+
#pragma warning(push)
|
|
1638
|
+
#pragma warning(disable : 4101)
|
|
1639
|
+
#endif
|
|
1640
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1641
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1642
|
+
#ifdef _MSC_VER
|
|
1643
|
+
#pragma warning(pop)
|
|
1644
|
+
#endif
|
|
1645
|
+
|
|
1646
|
+
binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_true_divide;
|
|
1647
|
+
// Slot2 ignored on purpose, type1 takes precedence.
|
|
1648
|
+
|
|
1649
|
+
if (slot1 != NULL) {
|
|
1650
|
+
PyObject *x = slot1(operand1, operand2);
|
|
1651
|
+
|
|
1652
|
+
if (x != Py_NotImplemented) {
|
|
1653
|
+
obj_result = x;
|
|
1654
|
+
goto exit_binary_result_object;
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
Py_DECREF_IMMORTAL(x);
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
// Statically recognized that coercion is not possible with these types
|
|
1661
|
+
|
|
1662
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for /: 'float' and 'int'");
|
|
1663
|
+
goto exit_binary_exception;
|
|
1664
|
+
|
|
1665
|
+
exit_binary_result_object:
|
|
1666
|
+
return obj_result;
|
|
1667
|
+
|
|
1668
|
+
exit_binary_exception:
|
|
1669
|
+
return NULL;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {
|
|
1673
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_INT(operand1, operand2);
|
|
1674
|
+
}
|
|
1675
|
+
#endif
|
|
1676
|
+
|
|
1677
|
+
#if PYTHON_VERSION < 0x300
|
|
1678
|
+
/* Code referring to "INT" corresponds to Python2 'int' and "FLOAT" to Python 'float'. */
|
|
1679
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {
|
|
1680
|
+
CHECK_OBJECT(operand1);
|
|
1681
|
+
assert(PyInt_CheckExact(operand1));
|
|
1682
|
+
CHECK_OBJECT(operand2);
|
|
1683
|
+
assert(PyFloat_CheckExact(operand2));
|
|
1684
|
+
|
|
1685
|
+
#ifdef _MSC_VER
|
|
1686
|
+
#pragma warning(push)
|
|
1687
|
+
#pragma warning(disable : 4101)
|
|
1688
|
+
#endif
|
|
1689
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1690
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1691
|
+
#ifdef _MSC_VER
|
|
1692
|
+
#pragma warning(pop)
|
|
1693
|
+
#endif
|
|
1694
|
+
|
|
1695
|
+
// Slot1 ignored on purpose, type2 takes precedence.
|
|
1696
|
+
binaryfunc slot2 = NULL;
|
|
1697
|
+
|
|
1698
|
+
if (!(0)) {
|
|
1699
|
+
// Different types, need to consider second value slot.
|
|
1700
|
+
|
|
1701
|
+
slot2 = PyFloat_Type.tp_as_number->nb_true_divide;
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
if (slot2 != NULL) {
|
|
1705
|
+
PyObject *x = slot2(operand1, operand2);
|
|
1706
|
+
|
|
1707
|
+
if (x != Py_NotImplemented) {
|
|
1708
|
+
obj_result = x;
|
|
1709
|
+
goto exit_binary_result_object;
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
Py_DECREF_IMMORTAL(x);
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
// Statically recognized that coercion is not possible with these types
|
|
1716
|
+
|
|
1717
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for /: 'int' and 'float'");
|
|
1718
|
+
goto exit_binary_exception;
|
|
1719
|
+
|
|
1720
|
+
exit_binary_result_object:
|
|
1721
|
+
return obj_result;
|
|
1722
|
+
|
|
1723
|
+
exit_binary_exception:
|
|
1724
|
+
return NULL;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {
|
|
1728
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_FLOAT(operand1, operand2);
|
|
1729
|
+
}
|
|
1730
|
+
#endif
|
|
1731
|
+
|
|
1732
|
+
#if PYTHON_VERSION < 0x300
|
|
1733
|
+
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "INT" to Python2 'int'. */
|
|
1734
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {
|
|
1735
|
+
CHECK_OBJECT(operand1);
|
|
1736
|
+
assert(PyLong_CheckExact(operand1));
|
|
1737
|
+
CHECK_OBJECT(operand2);
|
|
1738
|
+
assert(PyInt_CheckExact(operand2));
|
|
1739
|
+
|
|
1740
|
+
#ifdef _MSC_VER
|
|
1741
|
+
#pragma warning(push)
|
|
1742
|
+
#pragma warning(disable : 4101)
|
|
1743
|
+
#endif
|
|
1744
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1745
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1746
|
+
#ifdef _MSC_VER
|
|
1747
|
+
#pragma warning(pop)
|
|
1748
|
+
#endif
|
|
1749
|
+
|
|
1750
|
+
binaryfunc slot1 = PyLong_Type.tp_as_number->nb_true_divide;
|
|
1751
|
+
// Slot2 ignored on purpose, type1 takes precedence.
|
|
1752
|
+
|
|
1753
|
+
if (slot1 != NULL) {
|
|
1754
|
+
PyObject *x = slot1(operand1, operand2);
|
|
1755
|
+
|
|
1756
|
+
if (x != Py_NotImplemented) {
|
|
1757
|
+
obj_result = x;
|
|
1758
|
+
goto exit_binary_result_object;
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
Py_DECREF_IMMORTAL(x);
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
// Statically recognized that coercion is not possible with these types
|
|
1765
|
+
|
|
1766
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for /: 'long' and 'int'");
|
|
1767
|
+
goto exit_binary_exception;
|
|
1768
|
+
|
|
1769
|
+
exit_binary_result_object:
|
|
1770
|
+
return obj_result;
|
|
1771
|
+
|
|
1772
|
+
exit_binary_exception:
|
|
1773
|
+
return NULL;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {
|
|
1777
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_LONG_INT(operand1, operand2);
|
|
1778
|
+
}
|
|
1779
|
+
#endif
|
|
1780
|
+
|
|
1781
|
+
#if PYTHON_VERSION < 0x300
|
|
1782
|
+
/* Code referring to "INT" corresponds to Python2 'int' and "LONG" to Python2 'long', Python3 'int'. */
|
|
1783
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {
|
|
1784
|
+
CHECK_OBJECT(operand1);
|
|
1785
|
+
assert(PyInt_CheckExact(operand1));
|
|
1786
|
+
CHECK_OBJECT(operand2);
|
|
1787
|
+
assert(PyLong_CheckExact(operand2));
|
|
1788
|
+
|
|
1789
|
+
#ifdef _MSC_VER
|
|
1790
|
+
#pragma warning(push)
|
|
1791
|
+
#pragma warning(disable : 4101)
|
|
1792
|
+
#endif
|
|
1793
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1794
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1795
|
+
#ifdef _MSC_VER
|
|
1796
|
+
#pragma warning(pop)
|
|
1797
|
+
#endif
|
|
1798
|
+
|
|
1799
|
+
// Slot1 ignored on purpose, type2 takes precedence.
|
|
1800
|
+
binaryfunc slot2 = NULL;
|
|
1801
|
+
|
|
1802
|
+
if (!(0)) {
|
|
1803
|
+
// Different types, need to consider second value slot.
|
|
1804
|
+
|
|
1805
|
+
slot2 = PyLong_Type.tp_as_number->nb_true_divide;
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
if (slot2 != NULL) {
|
|
1809
|
+
PyObject *x = slot2(operand1, operand2);
|
|
1810
|
+
|
|
1811
|
+
if (x != Py_NotImplemented) {
|
|
1812
|
+
obj_result = x;
|
|
1813
|
+
goto exit_binary_result_object;
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
Py_DECREF_IMMORTAL(x);
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
// Statically recognized that coercion is not possible with these types
|
|
1820
|
+
|
|
1821
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for /: 'int' and 'long'");
|
|
1822
|
+
goto exit_binary_exception;
|
|
1823
|
+
|
|
1824
|
+
exit_binary_result_object:
|
|
1825
|
+
return obj_result;
|
|
1826
|
+
|
|
1827
|
+
exit_binary_exception:
|
|
1828
|
+
return NULL;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {
|
|
1832
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_LONG(operand1, operand2);
|
|
1833
|
+
}
|
|
1834
|
+
#endif
|
|
1835
|
+
|
|
1836
|
+
#if PYTHON_VERSION < 0x300
|
|
1837
|
+
/* Code referring to "INT" corresponds to Python2 'int' and "CLONG" to C platform long value. */
|
|
1838
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {
|
|
1839
|
+
CHECK_OBJECT(operand1);
|
|
1840
|
+
assert(PyInt_CheckExact(operand1));
|
|
1841
|
+
|
|
1842
|
+
PyObject *result;
|
|
1843
|
+
|
|
1844
|
+
// Not every code path will make use of all possible results.
|
|
1845
|
+
#ifdef _MSC_VER
|
|
1846
|
+
#pragma warning(push)
|
|
1847
|
+
#pragma warning(disable : 4101)
|
|
1848
|
+
#endif
|
|
1849
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1850
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1851
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
1852
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
1853
|
+
#ifdef _MSC_VER
|
|
1854
|
+
#pragma warning(pop)
|
|
1855
|
+
#endif
|
|
1856
|
+
|
|
1857
|
+
CHECK_OBJECT(operand1);
|
|
1858
|
+
assert(PyInt_CheckExact(operand1));
|
|
1859
|
+
|
|
1860
|
+
const long a = PyInt_AS_LONG(operand1);
|
|
1861
|
+
const long b = operand2;
|
|
1862
|
+
|
|
1863
|
+
if (unlikely(b == 0)) {
|
|
1864
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
1865
|
+
|
|
1866
|
+
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, "division by zero");
|
|
1867
|
+
goto exit_result_exception;
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
if (a == 0) {
|
|
1871
|
+
if (b < 0) {
|
|
1872
|
+
goto exit_result_ok_const_float_minus_0_0;
|
|
1873
|
+
} else {
|
|
1874
|
+
goto exit_result_ok_const_float_0_0;
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
/* May need to resort to LONG code, which we currently do not
|
|
1879
|
+
* specialize yet. TODO: Once we do that, call it here instead.
|
|
1880
|
+
*/
|
|
1881
|
+
#if DBL_MANT_DIG < WIDTH_OF_ULONG
|
|
1882
|
+
if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {
|
|
1883
|
+
} else
|
|
1884
|
+
#endif
|
|
1885
|
+
{
|
|
1886
|
+
double r = (double)a / (double)b;
|
|
1887
|
+
|
|
1888
|
+
cfloat_result = r;
|
|
1889
|
+
goto exit_result_ok_cfloat;
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
{
|
|
1893
|
+
PyObject *operand1_object = operand1;
|
|
1894
|
+
PyObject *operand2_object = Nuitka_PyLong_FromLong(operand2);
|
|
1895
|
+
|
|
1896
|
+
PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);
|
|
1897
|
+
assert(r != Py_NotImplemented);
|
|
1898
|
+
|
|
1899
|
+
Py_DECREF(operand2_object);
|
|
1900
|
+
|
|
1901
|
+
obj_result = r;
|
|
1902
|
+
goto exit_result_object;
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
exit_result_ok_cfloat:
|
|
1906
|
+
result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
|
|
1907
|
+
goto exit_result_ok;
|
|
1908
|
+
|
|
1909
|
+
exit_result_object:
|
|
1910
|
+
if (unlikely(obj_result == NULL)) {
|
|
1911
|
+
goto exit_result_exception;
|
|
1912
|
+
}
|
|
1913
|
+
result = obj_result;
|
|
1914
|
+
goto exit_result_ok;
|
|
1915
|
+
|
|
1916
|
+
exit_result_ok_const_float_0_0:
|
|
1917
|
+
Py_INCREF(const_float_0_0);
|
|
1918
|
+
result = const_float_0_0;
|
|
1919
|
+
goto exit_result_ok;
|
|
1920
|
+
|
|
1921
|
+
exit_result_ok_const_float_minus_0_0:
|
|
1922
|
+
Py_INCREF(const_float_minus_0_0);
|
|
1923
|
+
result = const_float_minus_0_0;
|
|
1924
|
+
goto exit_result_ok;
|
|
1925
|
+
|
|
1926
|
+
exit_result_ok:
|
|
1927
|
+
return result;
|
|
1928
|
+
|
|
1929
|
+
exit_result_exception:
|
|
1930
|
+
return NULL;
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {
|
|
1934
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_CLONG(operand1, operand2);
|
|
1935
|
+
}
|
|
1936
|
+
#endif
|
|
1937
|
+
|
|
1938
|
+
#if PYTHON_VERSION < 0x300
|
|
1939
|
+
/* Code referring to "CLONG" corresponds to C platform long value and "INT" to Python2 'int'. */
|
|
1940
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_CLONG_INT(long operand1, PyObject *operand2) {
|
|
1941
|
+
|
|
1942
|
+
CHECK_OBJECT(operand2);
|
|
1943
|
+
assert(PyInt_CheckExact(operand2));
|
|
1944
|
+
|
|
1945
|
+
PyObject *result;
|
|
1946
|
+
|
|
1947
|
+
// Not every code path will make use of all possible results.
|
|
1948
|
+
#ifdef _MSC_VER
|
|
1949
|
+
#pragma warning(push)
|
|
1950
|
+
#pragma warning(disable : 4101)
|
|
1951
|
+
#endif
|
|
1952
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1953
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1954
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
1955
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
1956
|
+
#ifdef _MSC_VER
|
|
1957
|
+
#pragma warning(pop)
|
|
1958
|
+
#endif
|
|
1959
|
+
|
|
1960
|
+
CHECK_OBJECT(operand2);
|
|
1961
|
+
assert(PyInt_CheckExact(operand2));
|
|
1962
|
+
|
|
1963
|
+
const long a = operand1;
|
|
1964
|
+
const long b = PyInt_AS_LONG(operand2);
|
|
1965
|
+
|
|
1966
|
+
if (unlikely(b == 0)) {
|
|
1967
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
1968
|
+
|
|
1969
|
+
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, "division by zero");
|
|
1970
|
+
goto exit_result_exception;
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
if (a == 0) {
|
|
1974
|
+
if (b < 0) {
|
|
1975
|
+
goto exit_result_ok_const_float_minus_0_0;
|
|
1976
|
+
} else {
|
|
1977
|
+
goto exit_result_ok_const_float_0_0;
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
/* May need to resort to LONG code, which we currently do not
|
|
1982
|
+
* specialize yet. TODO: Once we do that, call it here instead.
|
|
1983
|
+
*/
|
|
1984
|
+
#if DBL_MANT_DIG < WIDTH_OF_ULONG
|
|
1985
|
+
if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {
|
|
1986
|
+
} else
|
|
1987
|
+
#endif
|
|
1988
|
+
{
|
|
1989
|
+
double r = (double)a / (double)b;
|
|
1990
|
+
|
|
1991
|
+
cfloat_result = r;
|
|
1992
|
+
goto exit_result_ok_cfloat;
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
{
|
|
1996
|
+
PyObject *operand1_object = Nuitka_PyLong_FromLong(operand1);
|
|
1997
|
+
PyObject *operand2_object = operand2;
|
|
1998
|
+
|
|
1999
|
+
PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);
|
|
2000
|
+
assert(r != Py_NotImplemented);
|
|
2001
|
+
|
|
2002
|
+
Py_DECREF(operand1_object);
|
|
2003
|
+
|
|
2004
|
+
obj_result = r;
|
|
2005
|
+
goto exit_result_object;
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
exit_result_ok_cfloat:
|
|
2009
|
+
result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
|
|
2010
|
+
goto exit_result_ok;
|
|
2011
|
+
|
|
2012
|
+
exit_result_object:
|
|
2013
|
+
if (unlikely(obj_result == NULL)) {
|
|
2014
|
+
goto exit_result_exception;
|
|
2015
|
+
}
|
|
2016
|
+
result = obj_result;
|
|
2017
|
+
goto exit_result_ok;
|
|
2018
|
+
|
|
2019
|
+
exit_result_ok_const_float_0_0:
|
|
2020
|
+
Py_INCREF(const_float_0_0);
|
|
2021
|
+
result = const_float_0_0;
|
|
2022
|
+
goto exit_result_ok;
|
|
2023
|
+
|
|
2024
|
+
exit_result_ok_const_float_minus_0_0:
|
|
2025
|
+
Py_INCREF(const_float_minus_0_0);
|
|
2026
|
+
result = const_float_minus_0_0;
|
|
2027
|
+
goto exit_result_ok;
|
|
2028
|
+
|
|
2029
|
+
exit_result_ok:
|
|
2030
|
+
return result;
|
|
2031
|
+
|
|
2032
|
+
exit_result_exception:
|
|
2033
|
+
return NULL;
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_CLONG_INT(long operand1, PyObject *operand2) {
|
|
2037
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_CLONG_INT(operand1, operand2);
|
|
2038
|
+
}
|
|
2039
|
+
#endif
|
|
2040
|
+
|
|
2041
|
+
/* Code referring to "FLOAT" corresponds to Python 'float' and "CFLOAT" to C platform float value. */
|
|
2042
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {
|
|
2043
|
+
CHECK_OBJECT(operand1);
|
|
2044
|
+
assert(PyFloat_CheckExact(operand1));
|
|
2045
|
+
|
|
2046
|
+
PyObject *result;
|
|
2047
|
+
|
|
2048
|
+
#ifdef _MSC_VER
|
|
2049
|
+
#pragma warning(push)
|
|
2050
|
+
#pragma warning(disable : 4101)
|
|
2051
|
+
#endif
|
|
2052
|
+
// Not every code path will make use of all possible results.
|
|
2053
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
2054
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
2055
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
2056
|
+
#ifdef _MSC_VER
|
|
2057
|
+
#pragma warning(pop)
|
|
2058
|
+
#endif
|
|
2059
|
+
|
|
2060
|
+
CHECK_OBJECT(operand1);
|
|
2061
|
+
assert(PyFloat_CheckExact(operand1));
|
|
2062
|
+
|
|
2063
|
+
const double a = PyFloat_AS_DOUBLE(operand1);
|
|
2064
|
+
const double b = operand2;
|
|
2065
|
+
|
|
2066
|
+
if (unlikely(b == 0.0)) {
|
|
2067
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
2068
|
+
|
|
2069
|
+
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, "float division by zero");
|
|
2070
|
+
goto exit_result_exception;
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
{
|
|
2074
|
+
double r = a / b;
|
|
2075
|
+
|
|
2076
|
+
cfloat_result = r;
|
|
2077
|
+
goto exit_result_ok_cfloat;
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
exit_result_ok_cfloat:
|
|
2081
|
+
result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
|
|
2082
|
+
goto exit_result_ok;
|
|
2083
|
+
|
|
2084
|
+
exit_result_ok:
|
|
2085
|
+
return result;
|
|
2086
|
+
|
|
2087
|
+
exit_result_exception:
|
|
2088
|
+
return NULL;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {
|
|
2092
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_CFLOAT(operand1, operand2);
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
/* Code referring to "CFLOAT" corresponds to C platform float value and "FLOAT" to Python 'float'. */
|
|
2096
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2) {
|
|
2097
|
+
|
|
2098
|
+
CHECK_OBJECT(operand2);
|
|
2099
|
+
assert(PyFloat_CheckExact(operand2));
|
|
2100
|
+
|
|
2101
|
+
PyObject *result;
|
|
2102
|
+
|
|
2103
|
+
#ifdef _MSC_VER
|
|
2104
|
+
#pragma warning(push)
|
|
2105
|
+
#pragma warning(disable : 4101)
|
|
2106
|
+
#endif
|
|
2107
|
+
// Not every code path will make use of all possible results.
|
|
2108
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
2109
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
2110
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
2111
|
+
#ifdef _MSC_VER
|
|
2112
|
+
#pragma warning(pop)
|
|
2113
|
+
#endif
|
|
2114
|
+
|
|
2115
|
+
CHECK_OBJECT(operand2);
|
|
2116
|
+
assert(PyFloat_CheckExact(operand2));
|
|
2117
|
+
|
|
2118
|
+
const double a = operand1;
|
|
2119
|
+
const double b = PyFloat_AS_DOUBLE(operand2);
|
|
2120
|
+
|
|
2121
|
+
if (unlikely(b == 0.0)) {
|
|
2122
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
2123
|
+
|
|
2124
|
+
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, "float division by zero");
|
|
2125
|
+
goto exit_result_exception;
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
{
|
|
2129
|
+
double r = a / b;
|
|
2130
|
+
|
|
2131
|
+
cfloat_result = r;
|
|
2132
|
+
goto exit_result_ok_cfloat;
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
exit_result_ok_cfloat:
|
|
2136
|
+
result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
|
|
2137
|
+
goto exit_result_ok;
|
|
2138
|
+
|
|
2139
|
+
exit_result_ok:
|
|
2140
|
+
return result;
|
|
2141
|
+
|
|
2142
|
+
exit_result_exception:
|
|
2143
|
+
return NULL;
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2) {
|
|
2147
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_CFLOAT_FLOAT(operand1, operand2);
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
/* Code referring to "OBJECT" corresponds to any Python object and "OBJECT" to any Python object. */
|
|
2151
|
+
static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
2152
|
+
CHECK_OBJECT(operand1);
|
|
2153
|
+
CHECK_OBJECT(operand2);
|
|
2154
|
+
|
|
2155
|
+
#if PYTHON_VERSION < 0x300
|
|
2156
|
+
if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {
|
|
2157
|
+
PyObject *result;
|
|
2158
|
+
|
|
2159
|
+
// Not every code path will make use of all possible results.
|
|
2160
|
+
#ifdef _MSC_VER
|
|
2161
|
+
#pragma warning(push)
|
|
2162
|
+
#pragma warning(disable : 4101)
|
|
2163
|
+
#endif
|
|
2164
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
2165
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
2166
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
2167
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
2168
|
+
#ifdef _MSC_VER
|
|
2169
|
+
#pragma warning(pop)
|
|
2170
|
+
#endif
|
|
2171
|
+
|
|
2172
|
+
CHECK_OBJECT(operand1);
|
|
2173
|
+
assert(PyInt_CheckExact(operand1));
|
|
2174
|
+
CHECK_OBJECT(operand2);
|
|
2175
|
+
assert(PyInt_CheckExact(operand2));
|
|
2176
|
+
|
|
2177
|
+
const long a = PyInt_AS_LONG(operand1);
|
|
2178
|
+
const long b = PyInt_AS_LONG(operand2);
|
|
2179
|
+
|
|
2180
|
+
if (unlikely(b == 0)) {
|
|
2181
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
2182
|
+
|
|
2183
|
+
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, "division by zero");
|
|
2184
|
+
goto exit_result_exception;
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
if (a == 0) {
|
|
2188
|
+
if (b < 0) {
|
|
2189
|
+
goto exit_result_ok_const_float_minus_0_0;
|
|
2190
|
+
} else {
|
|
2191
|
+
goto exit_result_ok_const_float_0_0;
|
|
2192
|
+
}
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
/* May need to resort to LONG code, which we currently do not
|
|
2196
|
+
* specialize yet. TODO: Once we do that, call it here instead.
|
|
2197
|
+
*/
|
|
2198
|
+
#if DBL_MANT_DIG < WIDTH_OF_ULONG
|
|
2199
|
+
if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {
|
|
2200
|
+
} else
|
|
2201
|
+
#endif
|
|
2202
|
+
{
|
|
2203
|
+
double r = (double)a / (double)b;
|
|
2204
|
+
|
|
2205
|
+
cfloat_result = r;
|
|
2206
|
+
goto exit_result_ok_cfloat;
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2209
|
+
{
|
|
2210
|
+
PyObject *operand1_object = operand1;
|
|
2211
|
+
PyObject *operand2_object = operand2;
|
|
2212
|
+
|
|
2213
|
+
PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);
|
|
2214
|
+
assert(r != Py_NotImplemented);
|
|
2215
|
+
|
|
2216
|
+
obj_result = r;
|
|
2217
|
+
goto exit_result_object;
|
|
2218
|
+
}
|
|
2219
|
+
|
|
2220
|
+
exit_result_ok_cfloat:
|
|
2221
|
+
result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
|
|
2222
|
+
goto exit_result_ok;
|
|
2223
|
+
|
|
2224
|
+
exit_result_object:
|
|
2225
|
+
if (unlikely(obj_result == NULL)) {
|
|
2226
|
+
goto exit_result_exception;
|
|
2227
|
+
}
|
|
2228
|
+
result = obj_result;
|
|
2229
|
+
goto exit_result_ok;
|
|
2230
|
+
|
|
2231
|
+
exit_result_ok_const_float_0_0:
|
|
2232
|
+
Py_INCREF(const_float_0_0);
|
|
2233
|
+
result = const_float_0_0;
|
|
2234
|
+
goto exit_result_ok;
|
|
2235
|
+
|
|
2236
|
+
exit_result_ok_const_float_minus_0_0:
|
|
2237
|
+
Py_INCREF(const_float_minus_0_0);
|
|
2238
|
+
result = const_float_minus_0_0;
|
|
2239
|
+
goto exit_result_ok;
|
|
2240
|
+
|
|
2241
|
+
exit_result_ok:
|
|
2242
|
+
return result;
|
|
2243
|
+
|
|
2244
|
+
exit_result_exception:
|
|
2245
|
+
return NULL;
|
|
2246
|
+
}
|
|
2247
|
+
#endif
|
|
2248
|
+
|
|
2249
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
2250
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
2251
|
+
|
|
2252
|
+
#ifdef _MSC_VER
|
|
2253
|
+
#pragma warning(push)
|
|
2254
|
+
#pragma warning(disable : 4101)
|
|
2255
|
+
#endif
|
|
2256
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
2257
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
2258
|
+
#ifdef _MSC_VER
|
|
2259
|
+
#pragma warning(pop)
|
|
2260
|
+
#endif
|
|
2261
|
+
|
|
2262
|
+
binaryfunc slot1 =
|
|
2263
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_true_divide : NULL;
|
|
2264
|
+
binaryfunc slot2 = NULL;
|
|
2265
|
+
|
|
2266
|
+
if (!(type1 == type2)) {
|
|
2267
|
+
// Different types, need to consider second value slot.
|
|
2268
|
+
|
|
2269
|
+
slot2 =
|
|
2270
|
+
(type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_true_divide : NULL;
|
|
2271
|
+
|
|
2272
|
+
if (slot1 == slot2) {
|
|
2273
|
+
slot2 = NULL;
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
if (slot1 != NULL) {
|
|
2278
|
+
if (slot2 != NULL) {
|
|
2279
|
+
if (Nuitka_Type_IsSubtype(type2, type1)) {
|
|
2280
|
+
PyObject *x = slot2(operand1, operand2);
|
|
2281
|
+
|
|
2282
|
+
if (x != Py_NotImplemented) {
|
|
2283
|
+
obj_result = x;
|
|
2284
|
+
goto exit_binary_result_object;
|
|
2285
|
+
}
|
|
2286
|
+
|
|
2287
|
+
Py_DECREF_IMMORTAL(x);
|
|
2288
|
+
slot2 = NULL;
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
|
|
2292
|
+
PyObject *x = slot1(operand1, operand2);
|
|
2293
|
+
|
|
2294
|
+
if (x != Py_NotImplemented) {
|
|
2295
|
+
obj_result = x;
|
|
2296
|
+
goto exit_binary_result_object;
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
Py_DECREF_IMMORTAL(x);
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
if (slot2 != NULL) {
|
|
2303
|
+
PyObject *x = slot2(operand1, operand2);
|
|
2304
|
+
|
|
2305
|
+
if (x != Py_NotImplemented) {
|
|
2306
|
+
obj_result = x;
|
|
2307
|
+
goto exit_binary_result_object;
|
|
2308
|
+
}
|
|
2309
|
+
|
|
2310
|
+
Py_DECREF_IMMORTAL(x);
|
|
2311
|
+
}
|
|
2312
|
+
|
|
2313
|
+
#if PYTHON_VERSION < 0x300
|
|
2314
|
+
if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {
|
|
2315
|
+
coercion c1 =
|
|
2316
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
|
|
2317
|
+
|
|
2318
|
+
if (c1 != NULL) {
|
|
2319
|
+
PyObject *coerced1 = operand1;
|
|
2320
|
+
PyObject *coerced2 = operand2;
|
|
2321
|
+
|
|
2322
|
+
int err = c1(&coerced1, &coerced2);
|
|
2323
|
+
|
|
2324
|
+
if (unlikely(err < 0)) {
|
|
2325
|
+
goto exit_binary_exception;
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2328
|
+
if (err == 0) {
|
|
2329
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
2330
|
+
|
|
2331
|
+
if (likely(mv == NULL)) {
|
|
2332
|
+
binaryfunc slot = mv->nb_true_divide;
|
|
2333
|
+
|
|
2334
|
+
if (likely(slot != NULL)) {
|
|
2335
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
2336
|
+
|
|
2337
|
+
Py_DECREF(coerced1);
|
|
2338
|
+
Py_DECREF(coerced2);
|
|
2339
|
+
|
|
2340
|
+
obj_result = x;
|
|
2341
|
+
goto exit_binary_result_object;
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2345
|
+
// nb_coerce took a reference.
|
|
2346
|
+
Py_DECREF(coerced1);
|
|
2347
|
+
Py_DECREF(coerced2);
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
coercion c2 =
|
|
2351
|
+
(type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
|
|
2352
|
+
|
|
2353
|
+
if (c2 != NULL) {
|
|
2354
|
+
PyObject *coerced1 = operand1;
|
|
2355
|
+
PyObject *coerced2 = operand2;
|
|
2356
|
+
|
|
2357
|
+
int err = c2(&coerced2, &coerced1);
|
|
2358
|
+
|
|
2359
|
+
if (unlikely(err < 0)) {
|
|
2360
|
+
goto exit_binary_exception;
|
|
2361
|
+
}
|
|
2362
|
+
|
|
2363
|
+
if (err == 0) {
|
|
2364
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
2365
|
+
|
|
2366
|
+
if (likely(mv == NULL)) {
|
|
2367
|
+
binaryfunc slot = mv->nb_true_divide;
|
|
2368
|
+
|
|
2369
|
+
if (likely(slot != NULL)) {
|
|
2370
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
2371
|
+
|
|
2372
|
+
Py_DECREF(coerced1);
|
|
2373
|
+
Py_DECREF(coerced2);
|
|
2374
|
+
|
|
2375
|
+
obj_result = x;
|
|
2376
|
+
goto exit_binary_result_object;
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
// nb_coerce took a reference.
|
|
2381
|
+
Py_DECREF(coerced1);
|
|
2382
|
+
Py_DECREF(coerced2);
|
|
2383
|
+
}
|
|
2384
|
+
}
|
|
2385
|
+
}
|
|
2386
|
+
#endif
|
|
2387
|
+
|
|
2388
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for /: '%s' and '%s'", type1->tp_name, type2->tp_name);
|
|
2389
|
+
goto exit_binary_exception;
|
|
2390
|
+
|
|
2391
|
+
exit_binary_result_object:
|
|
2392
|
+
return obj_result;
|
|
2393
|
+
|
|
2394
|
+
exit_binary_exception:
|
|
2395
|
+
return NULL;
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2398
|
+
PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
2399
|
+
return _BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_OBJECT(operand1, operand2);
|
|
2400
|
+
}
|
|
2401
|
+
|
|
2402
|
+
// Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
2403
|
+
// integrates with CPython, but also works on its own.
|
|
2404
|
+
//
|
|
2405
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
2406
|
+
// you may not use this file except in compliance with the License.
|
|
2407
|
+
// You may obtain a copy of the License at
|
|
2408
|
+
//
|
|
2409
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
2410
|
+
//
|
|
2411
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
2412
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
2413
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2414
|
+
// See the License for the specific language governing permissions and
|
|
2415
|
+
// limitations under the License.
|