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,2738 @@
|
|
|
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 "|" (BITOR) operations */
|
|
11
|
+
|
|
12
|
+
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "LONG" to Python2 'long', Python3 'int'. */
|
|
13
|
+
static PyObject *_BINARY_OPERATION_BITOR_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {
|
|
14
|
+
CHECK_OBJECT(operand1);
|
|
15
|
+
assert(PyLong_CheckExact(operand1));
|
|
16
|
+
CHECK_OBJECT(operand2);
|
|
17
|
+
assert(PyLong_CheckExact(operand2));
|
|
18
|
+
|
|
19
|
+
PyObject *result;
|
|
20
|
+
|
|
21
|
+
// Not every code path will make use of all possible results.
|
|
22
|
+
#ifdef _MSC_VER
|
|
23
|
+
#pragma warning(push)
|
|
24
|
+
#pragma warning(disable : 4101)
|
|
25
|
+
#endif
|
|
26
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
27
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
28
|
+
#ifdef _MSC_VER
|
|
29
|
+
#pragma warning(pop)
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
PyObject *x = PyLong_Type.tp_as_number->nb_or(operand1, operand2);
|
|
33
|
+
assert(x != Py_NotImplemented);
|
|
34
|
+
|
|
35
|
+
obj_result = x;
|
|
36
|
+
goto exit_result_object;
|
|
37
|
+
|
|
38
|
+
exit_result_object:
|
|
39
|
+
if (unlikely(obj_result == NULL)) {
|
|
40
|
+
goto exit_result_exception;
|
|
41
|
+
}
|
|
42
|
+
result = obj_result;
|
|
43
|
+
goto exit_result_ok;
|
|
44
|
+
|
|
45
|
+
exit_result_ok:
|
|
46
|
+
return result;
|
|
47
|
+
|
|
48
|
+
exit_result_exception:
|
|
49
|
+
return NULL;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
PyObject *BINARY_OPERATION_BITOR_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {
|
|
53
|
+
return _BINARY_OPERATION_BITOR_OBJECT_LONG_LONG(operand1, operand2);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Code referring to "OBJECT" corresponds to any Python object and "LONG" to Python2 'long', Python3 'int'. */
|
|
57
|
+
static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITOR_OBJECT_OBJECT_LONG(PyObject *operand1,
|
|
58
|
+
PyObject *operand2) {
|
|
59
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
60
|
+
|
|
61
|
+
#ifdef _MSC_VER
|
|
62
|
+
#pragma warning(push)
|
|
63
|
+
#pragma warning(disable : 4101)
|
|
64
|
+
#endif
|
|
65
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
66
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
67
|
+
#ifdef _MSC_VER
|
|
68
|
+
#pragma warning(pop)
|
|
69
|
+
#endif
|
|
70
|
+
|
|
71
|
+
binaryfunc slot1 =
|
|
72
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;
|
|
73
|
+
binaryfunc slot2 = NULL;
|
|
74
|
+
|
|
75
|
+
if (!(type1 == &PyLong_Type)) {
|
|
76
|
+
// Different types, need to consider second value slot.
|
|
77
|
+
|
|
78
|
+
slot2 = PyLong_Type.tp_as_number->nb_or;
|
|
79
|
+
|
|
80
|
+
if (slot1 == slot2) {
|
|
81
|
+
slot2 = NULL;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (slot1 != NULL) {
|
|
86
|
+
PyObject *x = slot1(operand1, operand2);
|
|
87
|
+
|
|
88
|
+
if (x != Py_NotImplemented) {
|
|
89
|
+
obj_result = x;
|
|
90
|
+
goto exit_binary_result_object;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
Py_DECREF_IMMORTAL(x);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (slot2 != NULL) {
|
|
97
|
+
PyObject *x = slot2(operand1, operand2);
|
|
98
|
+
|
|
99
|
+
if (x != Py_NotImplemented) {
|
|
100
|
+
obj_result = x;
|
|
101
|
+
goto exit_binary_result_object;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
Py_DECREF_IMMORTAL(x);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
#if PYTHON_VERSION < 0x300
|
|
108
|
+
if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
|
|
109
|
+
coercion c1 =
|
|
110
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
|
|
111
|
+
|
|
112
|
+
if (c1 != NULL) {
|
|
113
|
+
PyObject *coerced1 = operand1;
|
|
114
|
+
PyObject *coerced2 = operand2;
|
|
115
|
+
|
|
116
|
+
int err = c1(&coerced1, &coerced2);
|
|
117
|
+
|
|
118
|
+
if (unlikely(err < 0)) {
|
|
119
|
+
goto exit_binary_exception;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (err == 0) {
|
|
123
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
124
|
+
|
|
125
|
+
if (likely(mv == NULL)) {
|
|
126
|
+
binaryfunc slot = mv->nb_or;
|
|
127
|
+
|
|
128
|
+
if (likely(slot != NULL)) {
|
|
129
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
130
|
+
|
|
131
|
+
Py_DECREF(coerced1);
|
|
132
|
+
Py_DECREF(coerced2);
|
|
133
|
+
|
|
134
|
+
obj_result = x;
|
|
135
|
+
goto exit_binary_result_object;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// nb_coerce took a reference.
|
|
140
|
+
Py_DECREF(coerced1);
|
|
141
|
+
Py_DECREF(coerced2);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
coercion c2 = PyLong_Type.tp_as_number->nb_coerce;
|
|
145
|
+
|
|
146
|
+
if (c2 != NULL) {
|
|
147
|
+
PyObject *coerced1 = operand1;
|
|
148
|
+
PyObject *coerced2 = operand2;
|
|
149
|
+
|
|
150
|
+
int err = c2(&coerced2, &coerced1);
|
|
151
|
+
|
|
152
|
+
if (unlikely(err < 0)) {
|
|
153
|
+
goto exit_binary_exception;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (err == 0) {
|
|
157
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
158
|
+
|
|
159
|
+
if (likely(mv == NULL)) {
|
|
160
|
+
binaryfunc slot = mv->nb_or;
|
|
161
|
+
|
|
162
|
+
if (likely(slot != NULL)) {
|
|
163
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
164
|
+
|
|
165
|
+
Py_DECREF(coerced1);
|
|
166
|
+
Py_DECREF(coerced2);
|
|
167
|
+
|
|
168
|
+
obj_result = x;
|
|
169
|
+
goto exit_binary_result_object;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// nb_coerce took a reference.
|
|
174
|
+
Py_DECREF(coerced1);
|
|
175
|
+
Py_DECREF(coerced2);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
#endif
|
|
180
|
+
|
|
181
|
+
#if PYTHON_VERSION < 0x300
|
|
182
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: '%s' and 'long'", type1->tp_name);
|
|
183
|
+
#else
|
|
184
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: '%s' and 'int'", type1->tp_name);
|
|
185
|
+
#endif
|
|
186
|
+
goto exit_binary_exception;
|
|
187
|
+
|
|
188
|
+
exit_binary_result_object:
|
|
189
|
+
return obj_result;
|
|
190
|
+
|
|
191
|
+
exit_binary_exception:
|
|
192
|
+
return NULL;
|
|
193
|
+
}
|
|
194
|
+
static PyObject *_BINARY_OPERATION_BITOR_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
|
|
195
|
+
CHECK_OBJECT(operand1);
|
|
196
|
+
CHECK_OBJECT(operand2);
|
|
197
|
+
assert(PyLong_CheckExact(operand2));
|
|
198
|
+
|
|
199
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
200
|
+
|
|
201
|
+
if (type1 == &PyLong_Type) {
|
|
202
|
+
PyObject *result;
|
|
203
|
+
|
|
204
|
+
// return _BINARY_OPERATION_BITOR_OBJECT_LONG_LONG(operand1, operand2);
|
|
205
|
+
|
|
206
|
+
// Not every code path will make use of all possible results.
|
|
207
|
+
#ifdef _MSC_VER
|
|
208
|
+
#pragma warning(push)
|
|
209
|
+
#pragma warning(disable : 4101)
|
|
210
|
+
#endif
|
|
211
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
212
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
213
|
+
#ifdef _MSC_VER
|
|
214
|
+
#pragma warning(pop)
|
|
215
|
+
#endif
|
|
216
|
+
|
|
217
|
+
PyObject *x = PyLong_Type.tp_as_number->nb_or(operand1, operand2);
|
|
218
|
+
assert(x != Py_NotImplemented);
|
|
219
|
+
|
|
220
|
+
obj_result = x;
|
|
221
|
+
goto exit_result_object;
|
|
222
|
+
|
|
223
|
+
exit_result_object:
|
|
224
|
+
if (unlikely(obj_result == NULL)) {
|
|
225
|
+
goto exit_result_exception;
|
|
226
|
+
}
|
|
227
|
+
result = obj_result;
|
|
228
|
+
goto exit_result_ok;
|
|
229
|
+
|
|
230
|
+
exit_result_ok:
|
|
231
|
+
return result;
|
|
232
|
+
|
|
233
|
+
exit_result_exception:
|
|
234
|
+
return NULL;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return __BINARY_OPERATION_BITOR_OBJECT_OBJECT_LONG(operand1, operand2);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
PyObject *BINARY_OPERATION_BITOR_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
|
|
241
|
+
return _BINARY_OPERATION_BITOR_OBJECT_OBJECT_LONG(operand1, operand2);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "OBJECT" to any Python object. */
|
|
245
|
+
static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITOR_OBJECT_LONG_OBJECT(PyObject *operand1,
|
|
246
|
+
PyObject *operand2) {
|
|
247
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
248
|
+
|
|
249
|
+
#ifdef _MSC_VER
|
|
250
|
+
#pragma warning(push)
|
|
251
|
+
#pragma warning(disable : 4101)
|
|
252
|
+
#endif
|
|
253
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
254
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
255
|
+
#ifdef _MSC_VER
|
|
256
|
+
#pragma warning(pop)
|
|
257
|
+
#endif
|
|
258
|
+
|
|
259
|
+
binaryfunc slot1 = PyLong_Type.tp_as_number->nb_or;
|
|
260
|
+
binaryfunc slot2 = NULL;
|
|
261
|
+
|
|
262
|
+
if (!(&PyLong_Type == type2)) {
|
|
263
|
+
// Different types, need to consider second value slot.
|
|
264
|
+
|
|
265
|
+
slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;
|
|
266
|
+
|
|
267
|
+
if (slot1 == slot2) {
|
|
268
|
+
slot2 = NULL;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
if (slot1 != NULL) {
|
|
273
|
+
if (slot2 != NULL) {
|
|
274
|
+
if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
|
|
275
|
+
PyObject *x = slot2(operand1, operand2);
|
|
276
|
+
|
|
277
|
+
if (x != Py_NotImplemented) {
|
|
278
|
+
obj_result = x;
|
|
279
|
+
goto exit_binary_result_object;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
Py_DECREF_IMMORTAL(x);
|
|
283
|
+
slot2 = NULL;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
PyObject *x = slot1(operand1, operand2);
|
|
288
|
+
|
|
289
|
+
if (x != Py_NotImplemented) {
|
|
290
|
+
obj_result = x;
|
|
291
|
+
goto exit_binary_result_object;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
Py_DECREF_IMMORTAL(x);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (slot2 != NULL) {
|
|
298
|
+
PyObject *x = slot2(operand1, operand2);
|
|
299
|
+
|
|
300
|
+
if (x != Py_NotImplemented) {
|
|
301
|
+
obj_result = x;
|
|
302
|
+
goto exit_binary_result_object;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
Py_DECREF_IMMORTAL(x);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
#if PYTHON_VERSION < 0x300
|
|
309
|
+
if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
|
|
310
|
+
coercion c1 = PyLong_Type.tp_as_number->nb_coerce;
|
|
311
|
+
|
|
312
|
+
if (c1 != NULL) {
|
|
313
|
+
PyObject *coerced1 = operand1;
|
|
314
|
+
PyObject *coerced2 = operand2;
|
|
315
|
+
|
|
316
|
+
int err = c1(&coerced1, &coerced2);
|
|
317
|
+
|
|
318
|
+
if (unlikely(err < 0)) {
|
|
319
|
+
goto exit_binary_exception;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
if (err == 0) {
|
|
323
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
324
|
+
|
|
325
|
+
if (likely(mv == NULL)) {
|
|
326
|
+
binaryfunc slot = mv->nb_or;
|
|
327
|
+
|
|
328
|
+
if (likely(slot != NULL)) {
|
|
329
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
330
|
+
|
|
331
|
+
Py_DECREF(coerced1);
|
|
332
|
+
Py_DECREF(coerced2);
|
|
333
|
+
|
|
334
|
+
obj_result = x;
|
|
335
|
+
goto exit_binary_result_object;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// nb_coerce took a reference.
|
|
340
|
+
Py_DECREF(coerced1);
|
|
341
|
+
Py_DECREF(coerced2);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
coercion c2 =
|
|
345
|
+
(type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
|
|
346
|
+
|
|
347
|
+
if (c2 != NULL) {
|
|
348
|
+
PyObject *coerced1 = operand1;
|
|
349
|
+
PyObject *coerced2 = operand2;
|
|
350
|
+
|
|
351
|
+
int err = c2(&coerced2, &coerced1);
|
|
352
|
+
|
|
353
|
+
if (unlikely(err < 0)) {
|
|
354
|
+
goto exit_binary_exception;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (err == 0) {
|
|
358
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
359
|
+
|
|
360
|
+
if (likely(mv == NULL)) {
|
|
361
|
+
binaryfunc slot = mv->nb_or;
|
|
362
|
+
|
|
363
|
+
if (likely(slot != NULL)) {
|
|
364
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
365
|
+
|
|
366
|
+
Py_DECREF(coerced1);
|
|
367
|
+
Py_DECREF(coerced2);
|
|
368
|
+
|
|
369
|
+
obj_result = x;
|
|
370
|
+
goto exit_binary_result_object;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// nb_coerce took a reference.
|
|
375
|
+
Py_DECREF(coerced1);
|
|
376
|
+
Py_DECREF(coerced2);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
#endif
|
|
381
|
+
|
|
382
|
+
#if PYTHON_VERSION < 0x300
|
|
383
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: 'long' and '%s'", type2->tp_name);
|
|
384
|
+
#else
|
|
385
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: 'int' and '%s'", type2->tp_name);
|
|
386
|
+
#endif
|
|
387
|
+
goto exit_binary_exception;
|
|
388
|
+
|
|
389
|
+
exit_binary_result_object:
|
|
390
|
+
return obj_result;
|
|
391
|
+
|
|
392
|
+
exit_binary_exception:
|
|
393
|
+
return NULL;
|
|
394
|
+
}
|
|
395
|
+
static PyObject *_BINARY_OPERATION_BITOR_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
396
|
+
CHECK_OBJECT(operand1);
|
|
397
|
+
assert(PyLong_CheckExact(operand1));
|
|
398
|
+
CHECK_OBJECT(operand2);
|
|
399
|
+
|
|
400
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
401
|
+
|
|
402
|
+
if (&PyLong_Type == type2) {
|
|
403
|
+
PyObject *result;
|
|
404
|
+
|
|
405
|
+
// return _BINARY_OPERATION_BITOR_OBJECT_LONG_LONG(operand1, operand2);
|
|
406
|
+
|
|
407
|
+
// Not every code path will make use of all possible results.
|
|
408
|
+
#ifdef _MSC_VER
|
|
409
|
+
#pragma warning(push)
|
|
410
|
+
#pragma warning(disable : 4101)
|
|
411
|
+
#endif
|
|
412
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
413
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
414
|
+
#ifdef _MSC_VER
|
|
415
|
+
#pragma warning(pop)
|
|
416
|
+
#endif
|
|
417
|
+
|
|
418
|
+
PyObject *x = PyLong_Type.tp_as_number->nb_or(operand1, operand2);
|
|
419
|
+
assert(x != Py_NotImplemented);
|
|
420
|
+
|
|
421
|
+
obj_result = x;
|
|
422
|
+
goto exit_result_object;
|
|
423
|
+
|
|
424
|
+
exit_result_object:
|
|
425
|
+
if (unlikely(obj_result == NULL)) {
|
|
426
|
+
goto exit_result_exception;
|
|
427
|
+
}
|
|
428
|
+
result = obj_result;
|
|
429
|
+
goto exit_result_ok;
|
|
430
|
+
|
|
431
|
+
exit_result_ok:
|
|
432
|
+
return result;
|
|
433
|
+
|
|
434
|
+
exit_result_exception:
|
|
435
|
+
return NULL;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
return __BINARY_OPERATION_BITOR_OBJECT_LONG_OBJECT(operand1, operand2);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
PyObject *BINARY_OPERATION_BITOR_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
442
|
+
return _BINARY_OPERATION_BITOR_OBJECT_LONG_OBJECT(operand1, operand2);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "LONG" to Python2 'long', Python3 'int'. */
|
|
446
|
+
static nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {
|
|
447
|
+
CHECK_OBJECT(operand1);
|
|
448
|
+
assert(PyLong_CheckExact(operand1));
|
|
449
|
+
CHECK_OBJECT(operand2);
|
|
450
|
+
assert(PyLong_CheckExact(operand2));
|
|
451
|
+
|
|
452
|
+
nuitka_bool result;
|
|
453
|
+
|
|
454
|
+
// Not every code path will make use of all possible results.
|
|
455
|
+
#ifdef _MSC_VER
|
|
456
|
+
#pragma warning(push)
|
|
457
|
+
#pragma warning(disable : 4101)
|
|
458
|
+
#endif
|
|
459
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
460
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
461
|
+
#ifdef _MSC_VER
|
|
462
|
+
#pragma warning(pop)
|
|
463
|
+
#endif
|
|
464
|
+
|
|
465
|
+
PyObject *x = PyLong_Type.tp_as_number->nb_or(operand1, operand2);
|
|
466
|
+
assert(x != Py_NotImplemented);
|
|
467
|
+
|
|
468
|
+
obj_result = x;
|
|
469
|
+
goto exit_result_object;
|
|
470
|
+
|
|
471
|
+
exit_result_object:
|
|
472
|
+
if (unlikely(obj_result == NULL)) {
|
|
473
|
+
goto exit_result_exception;
|
|
474
|
+
}
|
|
475
|
+
result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
|
|
476
|
+
Py_DECREF(obj_result);
|
|
477
|
+
goto exit_result_ok;
|
|
478
|
+
|
|
479
|
+
exit_result_ok:
|
|
480
|
+
return result;
|
|
481
|
+
|
|
482
|
+
exit_result_exception:
|
|
483
|
+
return NUITKA_BOOL_EXCEPTION;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
nuitka_bool BINARY_OPERATION_BITOR_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {
|
|
487
|
+
return _BINARY_OPERATION_BITOR_NBOOL_LONG_LONG(operand1, operand2);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/* Code referring to "OBJECT" corresponds to any Python object and "LONG" to Python2 'long', Python3 'int'. */
|
|
491
|
+
static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITOR_NBOOL_OBJECT_LONG(PyObject *operand1,
|
|
492
|
+
PyObject *operand2) {
|
|
493
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
494
|
+
|
|
495
|
+
#ifdef _MSC_VER
|
|
496
|
+
#pragma warning(push)
|
|
497
|
+
#pragma warning(disable : 4101)
|
|
498
|
+
#endif
|
|
499
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
500
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
501
|
+
#ifdef _MSC_VER
|
|
502
|
+
#pragma warning(pop)
|
|
503
|
+
#endif
|
|
504
|
+
|
|
505
|
+
binaryfunc slot1 =
|
|
506
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;
|
|
507
|
+
binaryfunc slot2 = NULL;
|
|
508
|
+
|
|
509
|
+
if (!(type1 == &PyLong_Type)) {
|
|
510
|
+
// Different types, need to consider second value slot.
|
|
511
|
+
|
|
512
|
+
slot2 = PyLong_Type.tp_as_number->nb_or;
|
|
513
|
+
|
|
514
|
+
if (slot1 == slot2) {
|
|
515
|
+
slot2 = NULL;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
if (slot1 != NULL) {
|
|
520
|
+
PyObject *x = slot1(operand1, operand2);
|
|
521
|
+
|
|
522
|
+
if (x != Py_NotImplemented) {
|
|
523
|
+
obj_result = x;
|
|
524
|
+
goto exit_binary_result_object;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
Py_DECREF_IMMORTAL(x);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
if (slot2 != NULL) {
|
|
531
|
+
PyObject *x = slot2(operand1, operand2);
|
|
532
|
+
|
|
533
|
+
if (x != Py_NotImplemented) {
|
|
534
|
+
obj_result = x;
|
|
535
|
+
goto exit_binary_result_object;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
Py_DECREF_IMMORTAL(x);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
#if PYTHON_VERSION < 0x300
|
|
542
|
+
if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
|
|
543
|
+
coercion c1 =
|
|
544
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
|
|
545
|
+
|
|
546
|
+
if (c1 != NULL) {
|
|
547
|
+
PyObject *coerced1 = operand1;
|
|
548
|
+
PyObject *coerced2 = operand2;
|
|
549
|
+
|
|
550
|
+
int err = c1(&coerced1, &coerced2);
|
|
551
|
+
|
|
552
|
+
if (unlikely(err < 0)) {
|
|
553
|
+
goto exit_binary_exception;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
if (err == 0) {
|
|
557
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
558
|
+
|
|
559
|
+
if (likely(mv == NULL)) {
|
|
560
|
+
binaryfunc slot = mv->nb_or;
|
|
561
|
+
|
|
562
|
+
if (likely(slot != NULL)) {
|
|
563
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
564
|
+
|
|
565
|
+
Py_DECREF(coerced1);
|
|
566
|
+
Py_DECREF(coerced2);
|
|
567
|
+
|
|
568
|
+
obj_result = x;
|
|
569
|
+
goto exit_binary_result_object;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
// nb_coerce took a reference.
|
|
574
|
+
Py_DECREF(coerced1);
|
|
575
|
+
Py_DECREF(coerced2);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
coercion c2 = PyLong_Type.tp_as_number->nb_coerce;
|
|
579
|
+
|
|
580
|
+
if (c2 != NULL) {
|
|
581
|
+
PyObject *coerced1 = operand1;
|
|
582
|
+
PyObject *coerced2 = operand2;
|
|
583
|
+
|
|
584
|
+
int err = c2(&coerced2, &coerced1);
|
|
585
|
+
|
|
586
|
+
if (unlikely(err < 0)) {
|
|
587
|
+
goto exit_binary_exception;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
if (err == 0) {
|
|
591
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
592
|
+
|
|
593
|
+
if (likely(mv == NULL)) {
|
|
594
|
+
binaryfunc slot = mv->nb_or;
|
|
595
|
+
|
|
596
|
+
if (likely(slot != NULL)) {
|
|
597
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
598
|
+
|
|
599
|
+
Py_DECREF(coerced1);
|
|
600
|
+
Py_DECREF(coerced2);
|
|
601
|
+
|
|
602
|
+
obj_result = x;
|
|
603
|
+
goto exit_binary_result_object;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
// nb_coerce took a reference.
|
|
608
|
+
Py_DECREF(coerced1);
|
|
609
|
+
Py_DECREF(coerced2);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
#endif
|
|
614
|
+
|
|
615
|
+
#if PYTHON_VERSION < 0x300
|
|
616
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: '%s' and 'long'", type1->tp_name);
|
|
617
|
+
#else
|
|
618
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: '%s' and 'int'", type1->tp_name);
|
|
619
|
+
#endif
|
|
620
|
+
goto exit_binary_exception;
|
|
621
|
+
|
|
622
|
+
exit_binary_result_object:
|
|
623
|
+
if (unlikely(obj_result == NULL)) {
|
|
624
|
+
return NUITKA_BOOL_EXCEPTION;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
{
|
|
628
|
+
nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
|
|
629
|
+
Py_DECREF(obj_result);
|
|
630
|
+
return r;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
exit_binary_exception:
|
|
634
|
+
return NUITKA_BOOL_EXCEPTION;
|
|
635
|
+
}
|
|
636
|
+
static nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
|
|
637
|
+
CHECK_OBJECT(operand1);
|
|
638
|
+
CHECK_OBJECT(operand2);
|
|
639
|
+
assert(PyLong_CheckExact(operand2));
|
|
640
|
+
|
|
641
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
642
|
+
|
|
643
|
+
if (type1 == &PyLong_Type) {
|
|
644
|
+
nuitka_bool result;
|
|
645
|
+
|
|
646
|
+
// return _BINARY_OPERATION_BITOR_NBOOL_LONG_LONG(operand1, operand2);
|
|
647
|
+
|
|
648
|
+
// Not every code path will make use of all possible results.
|
|
649
|
+
#ifdef _MSC_VER
|
|
650
|
+
#pragma warning(push)
|
|
651
|
+
#pragma warning(disable : 4101)
|
|
652
|
+
#endif
|
|
653
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
654
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
655
|
+
#ifdef _MSC_VER
|
|
656
|
+
#pragma warning(pop)
|
|
657
|
+
#endif
|
|
658
|
+
|
|
659
|
+
PyObject *x = PyLong_Type.tp_as_number->nb_or(operand1, operand2);
|
|
660
|
+
assert(x != Py_NotImplemented);
|
|
661
|
+
|
|
662
|
+
obj_result = x;
|
|
663
|
+
goto exit_result_object;
|
|
664
|
+
|
|
665
|
+
exit_result_object:
|
|
666
|
+
if (unlikely(obj_result == NULL)) {
|
|
667
|
+
goto exit_result_exception;
|
|
668
|
+
}
|
|
669
|
+
result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
|
|
670
|
+
Py_DECREF(obj_result);
|
|
671
|
+
goto exit_result_ok;
|
|
672
|
+
|
|
673
|
+
exit_result_ok:
|
|
674
|
+
return result;
|
|
675
|
+
|
|
676
|
+
exit_result_exception:
|
|
677
|
+
return NUITKA_BOOL_EXCEPTION;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
return __BINARY_OPERATION_BITOR_NBOOL_OBJECT_LONG(operand1, operand2);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
nuitka_bool BINARY_OPERATION_BITOR_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
|
|
684
|
+
return _BINARY_OPERATION_BITOR_NBOOL_OBJECT_LONG(operand1, operand2);
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "OBJECT" to any Python object. */
|
|
688
|
+
static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITOR_NBOOL_LONG_OBJECT(PyObject *operand1,
|
|
689
|
+
PyObject *operand2) {
|
|
690
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
691
|
+
|
|
692
|
+
#ifdef _MSC_VER
|
|
693
|
+
#pragma warning(push)
|
|
694
|
+
#pragma warning(disable : 4101)
|
|
695
|
+
#endif
|
|
696
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
697
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
698
|
+
#ifdef _MSC_VER
|
|
699
|
+
#pragma warning(pop)
|
|
700
|
+
#endif
|
|
701
|
+
|
|
702
|
+
binaryfunc slot1 = PyLong_Type.tp_as_number->nb_or;
|
|
703
|
+
binaryfunc slot2 = NULL;
|
|
704
|
+
|
|
705
|
+
if (!(&PyLong_Type == type2)) {
|
|
706
|
+
// Different types, need to consider second value slot.
|
|
707
|
+
|
|
708
|
+
slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;
|
|
709
|
+
|
|
710
|
+
if (slot1 == slot2) {
|
|
711
|
+
slot2 = NULL;
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
if (slot1 != NULL) {
|
|
716
|
+
if (slot2 != NULL) {
|
|
717
|
+
if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
|
|
718
|
+
PyObject *x = slot2(operand1, operand2);
|
|
719
|
+
|
|
720
|
+
if (x != Py_NotImplemented) {
|
|
721
|
+
obj_result = x;
|
|
722
|
+
goto exit_binary_result_object;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
Py_DECREF_IMMORTAL(x);
|
|
726
|
+
slot2 = NULL;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
PyObject *x = slot1(operand1, operand2);
|
|
731
|
+
|
|
732
|
+
if (x != Py_NotImplemented) {
|
|
733
|
+
obj_result = x;
|
|
734
|
+
goto exit_binary_result_object;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
Py_DECREF_IMMORTAL(x);
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
if (slot2 != NULL) {
|
|
741
|
+
PyObject *x = slot2(operand1, operand2);
|
|
742
|
+
|
|
743
|
+
if (x != Py_NotImplemented) {
|
|
744
|
+
obj_result = x;
|
|
745
|
+
goto exit_binary_result_object;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
Py_DECREF_IMMORTAL(x);
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
#if PYTHON_VERSION < 0x300
|
|
752
|
+
if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
|
|
753
|
+
coercion c1 = PyLong_Type.tp_as_number->nb_coerce;
|
|
754
|
+
|
|
755
|
+
if (c1 != NULL) {
|
|
756
|
+
PyObject *coerced1 = operand1;
|
|
757
|
+
PyObject *coerced2 = operand2;
|
|
758
|
+
|
|
759
|
+
int err = c1(&coerced1, &coerced2);
|
|
760
|
+
|
|
761
|
+
if (unlikely(err < 0)) {
|
|
762
|
+
goto exit_binary_exception;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
if (err == 0) {
|
|
766
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
767
|
+
|
|
768
|
+
if (likely(mv == NULL)) {
|
|
769
|
+
binaryfunc slot = mv->nb_or;
|
|
770
|
+
|
|
771
|
+
if (likely(slot != NULL)) {
|
|
772
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
773
|
+
|
|
774
|
+
Py_DECREF(coerced1);
|
|
775
|
+
Py_DECREF(coerced2);
|
|
776
|
+
|
|
777
|
+
obj_result = x;
|
|
778
|
+
goto exit_binary_result_object;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
// nb_coerce took a reference.
|
|
783
|
+
Py_DECREF(coerced1);
|
|
784
|
+
Py_DECREF(coerced2);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
coercion c2 =
|
|
788
|
+
(type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
|
|
789
|
+
|
|
790
|
+
if (c2 != NULL) {
|
|
791
|
+
PyObject *coerced1 = operand1;
|
|
792
|
+
PyObject *coerced2 = operand2;
|
|
793
|
+
|
|
794
|
+
int err = c2(&coerced2, &coerced1);
|
|
795
|
+
|
|
796
|
+
if (unlikely(err < 0)) {
|
|
797
|
+
goto exit_binary_exception;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
if (err == 0) {
|
|
801
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
802
|
+
|
|
803
|
+
if (likely(mv == NULL)) {
|
|
804
|
+
binaryfunc slot = mv->nb_or;
|
|
805
|
+
|
|
806
|
+
if (likely(slot != NULL)) {
|
|
807
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
808
|
+
|
|
809
|
+
Py_DECREF(coerced1);
|
|
810
|
+
Py_DECREF(coerced2);
|
|
811
|
+
|
|
812
|
+
obj_result = x;
|
|
813
|
+
goto exit_binary_result_object;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
// nb_coerce took a reference.
|
|
818
|
+
Py_DECREF(coerced1);
|
|
819
|
+
Py_DECREF(coerced2);
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
#endif
|
|
824
|
+
|
|
825
|
+
#if PYTHON_VERSION < 0x300
|
|
826
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: 'long' and '%s'", type2->tp_name);
|
|
827
|
+
#else
|
|
828
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: 'int' and '%s'", type2->tp_name);
|
|
829
|
+
#endif
|
|
830
|
+
goto exit_binary_exception;
|
|
831
|
+
|
|
832
|
+
exit_binary_result_object:
|
|
833
|
+
if (unlikely(obj_result == NULL)) {
|
|
834
|
+
return NUITKA_BOOL_EXCEPTION;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
{
|
|
838
|
+
nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
|
|
839
|
+
Py_DECREF(obj_result);
|
|
840
|
+
return r;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
exit_binary_exception:
|
|
844
|
+
return NUITKA_BOOL_EXCEPTION;
|
|
845
|
+
}
|
|
846
|
+
static nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
847
|
+
CHECK_OBJECT(operand1);
|
|
848
|
+
assert(PyLong_CheckExact(operand1));
|
|
849
|
+
CHECK_OBJECT(operand2);
|
|
850
|
+
|
|
851
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
852
|
+
|
|
853
|
+
if (&PyLong_Type == type2) {
|
|
854
|
+
nuitka_bool result;
|
|
855
|
+
|
|
856
|
+
// return _BINARY_OPERATION_BITOR_NBOOL_LONG_LONG(operand1, operand2);
|
|
857
|
+
|
|
858
|
+
// Not every code path will make use of all possible results.
|
|
859
|
+
#ifdef _MSC_VER
|
|
860
|
+
#pragma warning(push)
|
|
861
|
+
#pragma warning(disable : 4101)
|
|
862
|
+
#endif
|
|
863
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
864
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
865
|
+
#ifdef _MSC_VER
|
|
866
|
+
#pragma warning(pop)
|
|
867
|
+
#endif
|
|
868
|
+
|
|
869
|
+
PyObject *x = PyLong_Type.tp_as_number->nb_or(operand1, operand2);
|
|
870
|
+
assert(x != Py_NotImplemented);
|
|
871
|
+
|
|
872
|
+
obj_result = x;
|
|
873
|
+
goto exit_result_object;
|
|
874
|
+
|
|
875
|
+
exit_result_object:
|
|
876
|
+
if (unlikely(obj_result == NULL)) {
|
|
877
|
+
goto exit_result_exception;
|
|
878
|
+
}
|
|
879
|
+
result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
|
|
880
|
+
Py_DECREF(obj_result);
|
|
881
|
+
goto exit_result_ok;
|
|
882
|
+
|
|
883
|
+
exit_result_ok:
|
|
884
|
+
return result;
|
|
885
|
+
|
|
886
|
+
exit_result_exception:
|
|
887
|
+
return NUITKA_BOOL_EXCEPTION;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
return __BINARY_OPERATION_BITOR_NBOOL_LONG_OBJECT(operand1, operand2);
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
nuitka_bool BINARY_OPERATION_BITOR_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
894
|
+
return _BINARY_OPERATION_BITOR_NBOOL_LONG_OBJECT(operand1, operand2);
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
#if PYTHON_VERSION < 0x300
|
|
898
|
+
/* Code referring to "INT" corresponds to Python2 'int' and "INT" to Python2 'int'. */
|
|
899
|
+
static PyObject *_BINARY_OPERATION_BITOR_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {
|
|
900
|
+
CHECK_OBJECT(operand1);
|
|
901
|
+
assert(PyInt_CheckExact(operand1));
|
|
902
|
+
CHECK_OBJECT(operand2);
|
|
903
|
+
assert(PyInt_CheckExact(operand2));
|
|
904
|
+
|
|
905
|
+
PyObject *result;
|
|
906
|
+
|
|
907
|
+
// Not every code path will make use of all possible results.
|
|
908
|
+
#ifdef _MSC_VER
|
|
909
|
+
#pragma warning(push)
|
|
910
|
+
#pragma warning(disable : 4101)
|
|
911
|
+
#endif
|
|
912
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
913
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
914
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
915
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
916
|
+
#ifdef _MSC_VER
|
|
917
|
+
#pragma warning(pop)
|
|
918
|
+
#endif
|
|
919
|
+
|
|
920
|
+
CHECK_OBJECT(operand1);
|
|
921
|
+
assert(PyInt_CheckExact(operand1));
|
|
922
|
+
CHECK_OBJECT(operand2);
|
|
923
|
+
assert(PyInt_CheckExact(operand2));
|
|
924
|
+
|
|
925
|
+
const long a = PyInt_AS_LONG(operand1);
|
|
926
|
+
const long b = PyInt_AS_LONG(operand2);
|
|
927
|
+
|
|
928
|
+
const long r = a | b;
|
|
929
|
+
|
|
930
|
+
clong_result = r;
|
|
931
|
+
goto exit_result_ok_clong;
|
|
932
|
+
|
|
933
|
+
exit_result_ok_clong:
|
|
934
|
+
result = Nuitka_PyInt_FromLong(clong_result);
|
|
935
|
+
goto exit_result_ok;
|
|
936
|
+
|
|
937
|
+
exit_result_ok:
|
|
938
|
+
return result;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
PyObject *BINARY_OPERATION_BITOR_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {
|
|
942
|
+
return _BINARY_OPERATION_BITOR_OBJECT_INT_INT(operand1, operand2);
|
|
943
|
+
}
|
|
944
|
+
#endif
|
|
945
|
+
|
|
946
|
+
#if PYTHON_VERSION < 0x300
|
|
947
|
+
/* Code referring to "OBJECT" corresponds to any Python object and "INT" to Python2 'int'. */
|
|
948
|
+
static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITOR_OBJECT_OBJECT_INT(PyObject *operand1,
|
|
949
|
+
PyObject *operand2) {
|
|
950
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
951
|
+
|
|
952
|
+
#ifdef _MSC_VER
|
|
953
|
+
#pragma warning(push)
|
|
954
|
+
#pragma warning(disable : 4101)
|
|
955
|
+
#endif
|
|
956
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
957
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
958
|
+
#ifdef _MSC_VER
|
|
959
|
+
#pragma warning(pop)
|
|
960
|
+
#endif
|
|
961
|
+
|
|
962
|
+
binaryfunc slot1 =
|
|
963
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;
|
|
964
|
+
binaryfunc slot2 = NULL;
|
|
965
|
+
|
|
966
|
+
if (!(type1 == &PyInt_Type)) {
|
|
967
|
+
// Different types, need to consider second value slot.
|
|
968
|
+
|
|
969
|
+
slot2 = PyInt_Type.tp_as_number->nb_or;
|
|
970
|
+
|
|
971
|
+
if (slot1 == slot2) {
|
|
972
|
+
slot2 = NULL;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
if (slot1 != NULL) {
|
|
977
|
+
PyObject *x = slot1(operand1, operand2);
|
|
978
|
+
|
|
979
|
+
if (x != Py_NotImplemented) {
|
|
980
|
+
obj_result = x;
|
|
981
|
+
goto exit_binary_result_object;
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
Py_DECREF_IMMORTAL(x);
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
if (slot2 != NULL) {
|
|
988
|
+
PyObject *x = slot2(operand1, operand2);
|
|
989
|
+
|
|
990
|
+
if (x != Py_NotImplemented) {
|
|
991
|
+
obj_result = x;
|
|
992
|
+
goto exit_binary_result_object;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
Py_DECREF_IMMORTAL(x);
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
#if PYTHON_VERSION < 0x300
|
|
999
|
+
if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
|
|
1000
|
+
coercion c1 =
|
|
1001
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
|
|
1002
|
+
|
|
1003
|
+
if (c1 != NULL) {
|
|
1004
|
+
PyObject *coerced1 = operand1;
|
|
1005
|
+
PyObject *coerced2 = operand2;
|
|
1006
|
+
|
|
1007
|
+
int err = c1(&coerced1, &coerced2);
|
|
1008
|
+
|
|
1009
|
+
if (unlikely(err < 0)) {
|
|
1010
|
+
goto exit_binary_exception;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
if (err == 0) {
|
|
1014
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
1015
|
+
|
|
1016
|
+
if (likely(mv == NULL)) {
|
|
1017
|
+
binaryfunc slot = mv->nb_or;
|
|
1018
|
+
|
|
1019
|
+
if (likely(slot != NULL)) {
|
|
1020
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
1021
|
+
|
|
1022
|
+
Py_DECREF(coerced1);
|
|
1023
|
+
Py_DECREF(coerced2);
|
|
1024
|
+
|
|
1025
|
+
obj_result = x;
|
|
1026
|
+
goto exit_binary_result_object;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
// nb_coerce took a reference.
|
|
1031
|
+
Py_DECREF(coerced1);
|
|
1032
|
+
Py_DECREF(coerced2);
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
coercion c2 = PyInt_Type.tp_as_number->nb_coerce;
|
|
1036
|
+
|
|
1037
|
+
if (c2 != NULL) {
|
|
1038
|
+
PyObject *coerced1 = operand1;
|
|
1039
|
+
PyObject *coerced2 = operand2;
|
|
1040
|
+
|
|
1041
|
+
int err = c2(&coerced2, &coerced1);
|
|
1042
|
+
|
|
1043
|
+
if (unlikely(err < 0)) {
|
|
1044
|
+
goto exit_binary_exception;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
if (err == 0) {
|
|
1048
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
1049
|
+
|
|
1050
|
+
if (likely(mv == NULL)) {
|
|
1051
|
+
binaryfunc slot = mv->nb_or;
|
|
1052
|
+
|
|
1053
|
+
if (likely(slot != NULL)) {
|
|
1054
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
1055
|
+
|
|
1056
|
+
Py_DECREF(coerced1);
|
|
1057
|
+
Py_DECREF(coerced2);
|
|
1058
|
+
|
|
1059
|
+
obj_result = x;
|
|
1060
|
+
goto exit_binary_result_object;
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
// nb_coerce took a reference.
|
|
1065
|
+
Py_DECREF(coerced1);
|
|
1066
|
+
Py_DECREF(coerced2);
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
#endif
|
|
1071
|
+
|
|
1072
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: '%s' and 'int'", type1->tp_name);
|
|
1073
|
+
goto exit_binary_exception;
|
|
1074
|
+
|
|
1075
|
+
exit_binary_result_object:
|
|
1076
|
+
return obj_result;
|
|
1077
|
+
|
|
1078
|
+
exit_binary_exception:
|
|
1079
|
+
return NULL;
|
|
1080
|
+
}
|
|
1081
|
+
static PyObject *_BINARY_OPERATION_BITOR_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
|
|
1082
|
+
CHECK_OBJECT(operand1);
|
|
1083
|
+
CHECK_OBJECT(operand2);
|
|
1084
|
+
assert(PyInt_CheckExact(operand2));
|
|
1085
|
+
|
|
1086
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
1087
|
+
|
|
1088
|
+
if (type1 == &PyInt_Type) {
|
|
1089
|
+
PyObject *result;
|
|
1090
|
+
|
|
1091
|
+
// return _BINARY_OPERATION_BITOR_OBJECT_INT_INT(operand1, operand2);
|
|
1092
|
+
|
|
1093
|
+
// Not every code path will make use of all possible results.
|
|
1094
|
+
#ifdef _MSC_VER
|
|
1095
|
+
#pragma warning(push)
|
|
1096
|
+
#pragma warning(disable : 4101)
|
|
1097
|
+
#endif
|
|
1098
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1099
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1100
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
1101
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
1102
|
+
#ifdef _MSC_VER
|
|
1103
|
+
#pragma warning(pop)
|
|
1104
|
+
#endif
|
|
1105
|
+
|
|
1106
|
+
CHECK_OBJECT(operand1);
|
|
1107
|
+
assert(PyInt_CheckExact(operand1));
|
|
1108
|
+
CHECK_OBJECT(operand2);
|
|
1109
|
+
assert(PyInt_CheckExact(operand2));
|
|
1110
|
+
|
|
1111
|
+
const long a = PyInt_AS_LONG(operand1);
|
|
1112
|
+
const long b = PyInt_AS_LONG(operand2);
|
|
1113
|
+
|
|
1114
|
+
const long r = a | b;
|
|
1115
|
+
|
|
1116
|
+
clong_result = r;
|
|
1117
|
+
goto exit_result_ok_clong;
|
|
1118
|
+
|
|
1119
|
+
exit_result_ok_clong:
|
|
1120
|
+
result = Nuitka_PyInt_FromLong(clong_result);
|
|
1121
|
+
goto exit_result_ok;
|
|
1122
|
+
|
|
1123
|
+
exit_result_ok:
|
|
1124
|
+
return result;
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
return __BINARY_OPERATION_BITOR_OBJECT_OBJECT_INT(operand1, operand2);
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
PyObject *BINARY_OPERATION_BITOR_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
|
|
1131
|
+
return _BINARY_OPERATION_BITOR_OBJECT_OBJECT_INT(operand1, operand2);
|
|
1132
|
+
}
|
|
1133
|
+
#endif
|
|
1134
|
+
|
|
1135
|
+
#if PYTHON_VERSION < 0x300
|
|
1136
|
+
/* Code referring to "INT" corresponds to Python2 'int' and "OBJECT" to any Python object. */
|
|
1137
|
+
static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITOR_OBJECT_INT_OBJECT(PyObject *operand1,
|
|
1138
|
+
PyObject *operand2) {
|
|
1139
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
1140
|
+
|
|
1141
|
+
#ifdef _MSC_VER
|
|
1142
|
+
#pragma warning(push)
|
|
1143
|
+
#pragma warning(disable : 4101)
|
|
1144
|
+
#endif
|
|
1145
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1146
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1147
|
+
#ifdef _MSC_VER
|
|
1148
|
+
#pragma warning(pop)
|
|
1149
|
+
#endif
|
|
1150
|
+
|
|
1151
|
+
binaryfunc slot1 = PyInt_Type.tp_as_number->nb_or;
|
|
1152
|
+
binaryfunc slot2 = NULL;
|
|
1153
|
+
|
|
1154
|
+
if (!(&PyInt_Type == type2)) {
|
|
1155
|
+
// Different types, need to consider second value slot.
|
|
1156
|
+
|
|
1157
|
+
slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;
|
|
1158
|
+
|
|
1159
|
+
if (slot1 == slot2) {
|
|
1160
|
+
slot2 = NULL;
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
if (slot1 != NULL) {
|
|
1165
|
+
if (slot2 != NULL) {
|
|
1166
|
+
if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
|
|
1167
|
+
PyObject *x = slot2(operand1, operand2);
|
|
1168
|
+
|
|
1169
|
+
if (x != Py_NotImplemented) {
|
|
1170
|
+
obj_result = x;
|
|
1171
|
+
goto exit_binary_result_object;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
Py_DECREF_IMMORTAL(x);
|
|
1175
|
+
slot2 = NULL;
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
PyObject *x = slot1(operand1, operand2);
|
|
1180
|
+
|
|
1181
|
+
if (x != Py_NotImplemented) {
|
|
1182
|
+
obj_result = x;
|
|
1183
|
+
goto exit_binary_result_object;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
Py_DECREF_IMMORTAL(x);
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
if (slot2 != NULL) {
|
|
1190
|
+
PyObject *x = slot2(operand1, operand2);
|
|
1191
|
+
|
|
1192
|
+
if (x != Py_NotImplemented) {
|
|
1193
|
+
obj_result = x;
|
|
1194
|
+
goto exit_binary_result_object;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
Py_DECREF_IMMORTAL(x);
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
#if PYTHON_VERSION < 0x300
|
|
1201
|
+
if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
|
|
1202
|
+
coercion c1 = PyInt_Type.tp_as_number->nb_coerce;
|
|
1203
|
+
|
|
1204
|
+
if (c1 != NULL) {
|
|
1205
|
+
PyObject *coerced1 = operand1;
|
|
1206
|
+
PyObject *coerced2 = operand2;
|
|
1207
|
+
|
|
1208
|
+
int err = c1(&coerced1, &coerced2);
|
|
1209
|
+
|
|
1210
|
+
if (unlikely(err < 0)) {
|
|
1211
|
+
goto exit_binary_exception;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
if (err == 0) {
|
|
1215
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
1216
|
+
|
|
1217
|
+
if (likely(mv == NULL)) {
|
|
1218
|
+
binaryfunc slot = mv->nb_or;
|
|
1219
|
+
|
|
1220
|
+
if (likely(slot != NULL)) {
|
|
1221
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
1222
|
+
|
|
1223
|
+
Py_DECREF(coerced1);
|
|
1224
|
+
Py_DECREF(coerced2);
|
|
1225
|
+
|
|
1226
|
+
obj_result = x;
|
|
1227
|
+
goto exit_binary_result_object;
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
// nb_coerce took a reference.
|
|
1232
|
+
Py_DECREF(coerced1);
|
|
1233
|
+
Py_DECREF(coerced2);
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
coercion c2 =
|
|
1237
|
+
(type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
|
|
1238
|
+
|
|
1239
|
+
if (c2 != NULL) {
|
|
1240
|
+
PyObject *coerced1 = operand1;
|
|
1241
|
+
PyObject *coerced2 = operand2;
|
|
1242
|
+
|
|
1243
|
+
int err = c2(&coerced2, &coerced1);
|
|
1244
|
+
|
|
1245
|
+
if (unlikely(err < 0)) {
|
|
1246
|
+
goto exit_binary_exception;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
if (err == 0) {
|
|
1250
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
1251
|
+
|
|
1252
|
+
if (likely(mv == NULL)) {
|
|
1253
|
+
binaryfunc slot = mv->nb_or;
|
|
1254
|
+
|
|
1255
|
+
if (likely(slot != NULL)) {
|
|
1256
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
1257
|
+
|
|
1258
|
+
Py_DECREF(coerced1);
|
|
1259
|
+
Py_DECREF(coerced2);
|
|
1260
|
+
|
|
1261
|
+
obj_result = x;
|
|
1262
|
+
goto exit_binary_result_object;
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
// nb_coerce took a reference.
|
|
1267
|
+
Py_DECREF(coerced1);
|
|
1268
|
+
Py_DECREF(coerced2);
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
#endif
|
|
1273
|
+
|
|
1274
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: 'int' and '%s'", type2->tp_name);
|
|
1275
|
+
goto exit_binary_exception;
|
|
1276
|
+
|
|
1277
|
+
exit_binary_result_object:
|
|
1278
|
+
return obj_result;
|
|
1279
|
+
|
|
1280
|
+
exit_binary_exception:
|
|
1281
|
+
return NULL;
|
|
1282
|
+
}
|
|
1283
|
+
static PyObject *_BINARY_OPERATION_BITOR_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
1284
|
+
CHECK_OBJECT(operand1);
|
|
1285
|
+
assert(PyInt_CheckExact(operand1));
|
|
1286
|
+
CHECK_OBJECT(operand2);
|
|
1287
|
+
|
|
1288
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
1289
|
+
|
|
1290
|
+
if (&PyInt_Type == type2) {
|
|
1291
|
+
PyObject *result;
|
|
1292
|
+
|
|
1293
|
+
// return _BINARY_OPERATION_BITOR_OBJECT_INT_INT(operand1, operand2);
|
|
1294
|
+
|
|
1295
|
+
// Not every code path will make use of all possible results.
|
|
1296
|
+
#ifdef _MSC_VER
|
|
1297
|
+
#pragma warning(push)
|
|
1298
|
+
#pragma warning(disable : 4101)
|
|
1299
|
+
#endif
|
|
1300
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1301
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1302
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
1303
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
1304
|
+
#ifdef _MSC_VER
|
|
1305
|
+
#pragma warning(pop)
|
|
1306
|
+
#endif
|
|
1307
|
+
|
|
1308
|
+
CHECK_OBJECT(operand1);
|
|
1309
|
+
assert(PyInt_CheckExact(operand1));
|
|
1310
|
+
CHECK_OBJECT(operand2);
|
|
1311
|
+
assert(PyInt_CheckExact(operand2));
|
|
1312
|
+
|
|
1313
|
+
const long a = PyInt_AS_LONG(operand1);
|
|
1314
|
+
const long b = PyInt_AS_LONG(operand2);
|
|
1315
|
+
|
|
1316
|
+
const long r = a | b;
|
|
1317
|
+
|
|
1318
|
+
clong_result = r;
|
|
1319
|
+
goto exit_result_ok_clong;
|
|
1320
|
+
|
|
1321
|
+
exit_result_ok_clong:
|
|
1322
|
+
result = Nuitka_PyInt_FromLong(clong_result);
|
|
1323
|
+
goto exit_result_ok;
|
|
1324
|
+
|
|
1325
|
+
exit_result_ok:
|
|
1326
|
+
return result;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
return __BINARY_OPERATION_BITOR_OBJECT_INT_OBJECT(operand1, operand2);
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
PyObject *BINARY_OPERATION_BITOR_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
1333
|
+
return _BINARY_OPERATION_BITOR_OBJECT_INT_OBJECT(operand1, operand2);
|
|
1334
|
+
}
|
|
1335
|
+
#endif
|
|
1336
|
+
|
|
1337
|
+
#if PYTHON_VERSION < 0x300
|
|
1338
|
+
/* Code referring to "INT" corresponds to Python2 'int' and "INT" to Python2 'int'. */
|
|
1339
|
+
static nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {
|
|
1340
|
+
CHECK_OBJECT(operand1);
|
|
1341
|
+
assert(PyInt_CheckExact(operand1));
|
|
1342
|
+
CHECK_OBJECT(operand2);
|
|
1343
|
+
assert(PyInt_CheckExact(operand2));
|
|
1344
|
+
|
|
1345
|
+
nuitka_bool result;
|
|
1346
|
+
|
|
1347
|
+
// Not every code path will make use of all possible results.
|
|
1348
|
+
#ifdef _MSC_VER
|
|
1349
|
+
#pragma warning(push)
|
|
1350
|
+
#pragma warning(disable : 4101)
|
|
1351
|
+
#endif
|
|
1352
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1353
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1354
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
1355
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
1356
|
+
#ifdef _MSC_VER
|
|
1357
|
+
#pragma warning(pop)
|
|
1358
|
+
#endif
|
|
1359
|
+
|
|
1360
|
+
CHECK_OBJECT(operand1);
|
|
1361
|
+
assert(PyInt_CheckExact(operand1));
|
|
1362
|
+
CHECK_OBJECT(operand2);
|
|
1363
|
+
assert(PyInt_CheckExact(operand2));
|
|
1364
|
+
|
|
1365
|
+
const long a = PyInt_AS_LONG(operand1);
|
|
1366
|
+
const long b = PyInt_AS_LONG(operand2);
|
|
1367
|
+
|
|
1368
|
+
const long r = a | b;
|
|
1369
|
+
|
|
1370
|
+
clong_result = r;
|
|
1371
|
+
goto exit_result_ok_clong;
|
|
1372
|
+
|
|
1373
|
+
exit_result_ok_clong:
|
|
1374
|
+
result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
|
|
1375
|
+
goto exit_result_ok;
|
|
1376
|
+
|
|
1377
|
+
exit_result_ok:
|
|
1378
|
+
return result;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
nuitka_bool BINARY_OPERATION_BITOR_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {
|
|
1382
|
+
return _BINARY_OPERATION_BITOR_NBOOL_INT_INT(operand1, operand2);
|
|
1383
|
+
}
|
|
1384
|
+
#endif
|
|
1385
|
+
|
|
1386
|
+
#if PYTHON_VERSION < 0x300
|
|
1387
|
+
/* Code referring to "OBJECT" corresponds to any Python object and "INT" to Python2 'int'. */
|
|
1388
|
+
static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITOR_NBOOL_OBJECT_INT(PyObject *operand1,
|
|
1389
|
+
PyObject *operand2) {
|
|
1390
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
1391
|
+
|
|
1392
|
+
#ifdef _MSC_VER
|
|
1393
|
+
#pragma warning(push)
|
|
1394
|
+
#pragma warning(disable : 4101)
|
|
1395
|
+
#endif
|
|
1396
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1397
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1398
|
+
#ifdef _MSC_VER
|
|
1399
|
+
#pragma warning(pop)
|
|
1400
|
+
#endif
|
|
1401
|
+
|
|
1402
|
+
binaryfunc slot1 =
|
|
1403
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;
|
|
1404
|
+
binaryfunc slot2 = NULL;
|
|
1405
|
+
|
|
1406
|
+
if (!(type1 == &PyInt_Type)) {
|
|
1407
|
+
// Different types, need to consider second value slot.
|
|
1408
|
+
|
|
1409
|
+
slot2 = PyInt_Type.tp_as_number->nb_or;
|
|
1410
|
+
|
|
1411
|
+
if (slot1 == slot2) {
|
|
1412
|
+
slot2 = NULL;
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
if (slot1 != NULL) {
|
|
1417
|
+
PyObject *x = slot1(operand1, operand2);
|
|
1418
|
+
|
|
1419
|
+
if (x != Py_NotImplemented) {
|
|
1420
|
+
obj_result = x;
|
|
1421
|
+
goto exit_binary_result_object;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
Py_DECREF_IMMORTAL(x);
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
if (slot2 != NULL) {
|
|
1428
|
+
PyObject *x = slot2(operand1, operand2);
|
|
1429
|
+
|
|
1430
|
+
if (x != Py_NotImplemented) {
|
|
1431
|
+
obj_result = x;
|
|
1432
|
+
goto exit_binary_result_object;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
Py_DECREF_IMMORTAL(x);
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
#if PYTHON_VERSION < 0x300
|
|
1439
|
+
if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
|
|
1440
|
+
coercion c1 =
|
|
1441
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
|
|
1442
|
+
|
|
1443
|
+
if (c1 != NULL) {
|
|
1444
|
+
PyObject *coerced1 = operand1;
|
|
1445
|
+
PyObject *coerced2 = operand2;
|
|
1446
|
+
|
|
1447
|
+
int err = c1(&coerced1, &coerced2);
|
|
1448
|
+
|
|
1449
|
+
if (unlikely(err < 0)) {
|
|
1450
|
+
goto exit_binary_exception;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
if (err == 0) {
|
|
1454
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
1455
|
+
|
|
1456
|
+
if (likely(mv == NULL)) {
|
|
1457
|
+
binaryfunc slot = mv->nb_or;
|
|
1458
|
+
|
|
1459
|
+
if (likely(slot != NULL)) {
|
|
1460
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
1461
|
+
|
|
1462
|
+
Py_DECREF(coerced1);
|
|
1463
|
+
Py_DECREF(coerced2);
|
|
1464
|
+
|
|
1465
|
+
obj_result = x;
|
|
1466
|
+
goto exit_binary_result_object;
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
// nb_coerce took a reference.
|
|
1471
|
+
Py_DECREF(coerced1);
|
|
1472
|
+
Py_DECREF(coerced2);
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
coercion c2 = PyInt_Type.tp_as_number->nb_coerce;
|
|
1476
|
+
|
|
1477
|
+
if (c2 != NULL) {
|
|
1478
|
+
PyObject *coerced1 = operand1;
|
|
1479
|
+
PyObject *coerced2 = operand2;
|
|
1480
|
+
|
|
1481
|
+
int err = c2(&coerced2, &coerced1);
|
|
1482
|
+
|
|
1483
|
+
if (unlikely(err < 0)) {
|
|
1484
|
+
goto exit_binary_exception;
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
if (err == 0) {
|
|
1488
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
1489
|
+
|
|
1490
|
+
if (likely(mv == NULL)) {
|
|
1491
|
+
binaryfunc slot = mv->nb_or;
|
|
1492
|
+
|
|
1493
|
+
if (likely(slot != NULL)) {
|
|
1494
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
1495
|
+
|
|
1496
|
+
Py_DECREF(coerced1);
|
|
1497
|
+
Py_DECREF(coerced2);
|
|
1498
|
+
|
|
1499
|
+
obj_result = x;
|
|
1500
|
+
goto exit_binary_result_object;
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
// nb_coerce took a reference.
|
|
1505
|
+
Py_DECREF(coerced1);
|
|
1506
|
+
Py_DECREF(coerced2);
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
#endif
|
|
1511
|
+
|
|
1512
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: '%s' and 'int'", type1->tp_name);
|
|
1513
|
+
goto exit_binary_exception;
|
|
1514
|
+
|
|
1515
|
+
exit_binary_result_object:
|
|
1516
|
+
if (unlikely(obj_result == NULL)) {
|
|
1517
|
+
return NUITKA_BOOL_EXCEPTION;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
{
|
|
1521
|
+
nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
|
|
1522
|
+
Py_DECREF(obj_result);
|
|
1523
|
+
return r;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
exit_binary_exception:
|
|
1527
|
+
return NUITKA_BOOL_EXCEPTION;
|
|
1528
|
+
}
|
|
1529
|
+
static nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
|
|
1530
|
+
CHECK_OBJECT(operand1);
|
|
1531
|
+
CHECK_OBJECT(operand2);
|
|
1532
|
+
assert(PyInt_CheckExact(operand2));
|
|
1533
|
+
|
|
1534
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
1535
|
+
|
|
1536
|
+
if (type1 == &PyInt_Type) {
|
|
1537
|
+
nuitka_bool result;
|
|
1538
|
+
|
|
1539
|
+
// return _BINARY_OPERATION_BITOR_NBOOL_INT_INT(operand1, operand2);
|
|
1540
|
+
|
|
1541
|
+
// Not every code path will make use of all possible results.
|
|
1542
|
+
#ifdef _MSC_VER
|
|
1543
|
+
#pragma warning(push)
|
|
1544
|
+
#pragma warning(disable : 4101)
|
|
1545
|
+
#endif
|
|
1546
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1547
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1548
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
1549
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
1550
|
+
#ifdef _MSC_VER
|
|
1551
|
+
#pragma warning(pop)
|
|
1552
|
+
#endif
|
|
1553
|
+
|
|
1554
|
+
CHECK_OBJECT(operand1);
|
|
1555
|
+
assert(PyInt_CheckExact(operand1));
|
|
1556
|
+
CHECK_OBJECT(operand2);
|
|
1557
|
+
assert(PyInt_CheckExact(operand2));
|
|
1558
|
+
|
|
1559
|
+
const long a = PyInt_AS_LONG(operand1);
|
|
1560
|
+
const long b = PyInt_AS_LONG(operand2);
|
|
1561
|
+
|
|
1562
|
+
const long r = a | b;
|
|
1563
|
+
|
|
1564
|
+
clong_result = r;
|
|
1565
|
+
goto exit_result_ok_clong;
|
|
1566
|
+
|
|
1567
|
+
exit_result_ok_clong:
|
|
1568
|
+
result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
|
|
1569
|
+
goto exit_result_ok;
|
|
1570
|
+
|
|
1571
|
+
exit_result_ok:
|
|
1572
|
+
return result;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
return __BINARY_OPERATION_BITOR_NBOOL_OBJECT_INT(operand1, operand2);
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
nuitka_bool BINARY_OPERATION_BITOR_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
|
|
1579
|
+
return _BINARY_OPERATION_BITOR_NBOOL_OBJECT_INT(operand1, operand2);
|
|
1580
|
+
}
|
|
1581
|
+
#endif
|
|
1582
|
+
|
|
1583
|
+
#if PYTHON_VERSION < 0x300
|
|
1584
|
+
/* Code referring to "INT" corresponds to Python2 'int' and "OBJECT" to any Python object. */
|
|
1585
|
+
static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITOR_NBOOL_INT_OBJECT(PyObject *operand1,
|
|
1586
|
+
PyObject *operand2) {
|
|
1587
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
1588
|
+
|
|
1589
|
+
#ifdef _MSC_VER
|
|
1590
|
+
#pragma warning(push)
|
|
1591
|
+
#pragma warning(disable : 4101)
|
|
1592
|
+
#endif
|
|
1593
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1594
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1595
|
+
#ifdef _MSC_VER
|
|
1596
|
+
#pragma warning(pop)
|
|
1597
|
+
#endif
|
|
1598
|
+
|
|
1599
|
+
binaryfunc slot1 = PyInt_Type.tp_as_number->nb_or;
|
|
1600
|
+
binaryfunc slot2 = NULL;
|
|
1601
|
+
|
|
1602
|
+
if (!(&PyInt_Type == type2)) {
|
|
1603
|
+
// Different types, need to consider second value slot.
|
|
1604
|
+
|
|
1605
|
+
slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;
|
|
1606
|
+
|
|
1607
|
+
if (slot1 == slot2) {
|
|
1608
|
+
slot2 = NULL;
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
if (slot1 != NULL) {
|
|
1613
|
+
if (slot2 != NULL) {
|
|
1614
|
+
if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
|
|
1615
|
+
PyObject *x = slot2(operand1, operand2);
|
|
1616
|
+
|
|
1617
|
+
if (x != Py_NotImplemented) {
|
|
1618
|
+
obj_result = x;
|
|
1619
|
+
goto exit_binary_result_object;
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
Py_DECREF_IMMORTAL(x);
|
|
1623
|
+
slot2 = NULL;
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
PyObject *x = slot1(operand1, operand2);
|
|
1628
|
+
|
|
1629
|
+
if (x != Py_NotImplemented) {
|
|
1630
|
+
obj_result = x;
|
|
1631
|
+
goto exit_binary_result_object;
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
Py_DECREF_IMMORTAL(x);
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
if (slot2 != NULL) {
|
|
1638
|
+
PyObject *x = slot2(operand1, operand2);
|
|
1639
|
+
|
|
1640
|
+
if (x != Py_NotImplemented) {
|
|
1641
|
+
obj_result = x;
|
|
1642
|
+
goto exit_binary_result_object;
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
Py_DECREF_IMMORTAL(x);
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
#if PYTHON_VERSION < 0x300
|
|
1649
|
+
if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
|
|
1650
|
+
coercion c1 = PyInt_Type.tp_as_number->nb_coerce;
|
|
1651
|
+
|
|
1652
|
+
if (c1 != NULL) {
|
|
1653
|
+
PyObject *coerced1 = operand1;
|
|
1654
|
+
PyObject *coerced2 = operand2;
|
|
1655
|
+
|
|
1656
|
+
int err = c1(&coerced1, &coerced2);
|
|
1657
|
+
|
|
1658
|
+
if (unlikely(err < 0)) {
|
|
1659
|
+
goto exit_binary_exception;
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
if (err == 0) {
|
|
1663
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
1664
|
+
|
|
1665
|
+
if (likely(mv == NULL)) {
|
|
1666
|
+
binaryfunc slot = mv->nb_or;
|
|
1667
|
+
|
|
1668
|
+
if (likely(slot != NULL)) {
|
|
1669
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
1670
|
+
|
|
1671
|
+
Py_DECREF(coerced1);
|
|
1672
|
+
Py_DECREF(coerced2);
|
|
1673
|
+
|
|
1674
|
+
obj_result = x;
|
|
1675
|
+
goto exit_binary_result_object;
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
// nb_coerce took a reference.
|
|
1680
|
+
Py_DECREF(coerced1);
|
|
1681
|
+
Py_DECREF(coerced2);
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1684
|
+
coercion c2 =
|
|
1685
|
+
(type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
|
|
1686
|
+
|
|
1687
|
+
if (c2 != NULL) {
|
|
1688
|
+
PyObject *coerced1 = operand1;
|
|
1689
|
+
PyObject *coerced2 = operand2;
|
|
1690
|
+
|
|
1691
|
+
int err = c2(&coerced2, &coerced1);
|
|
1692
|
+
|
|
1693
|
+
if (unlikely(err < 0)) {
|
|
1694
|
+
goto exit_binary_exception;
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
if (err == 0) {
|
|
1698
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
1699
|
+
|
|
1700
|
+
if (likely(mv == NULL)) {
|
|
1701
|
+
binaryfunc slot = mv->nb_or;
|
|
1702
|
+
|
|
1703
|
+
if (likely(slot != NULL)) {
|
|
1704
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
1705
|
+
|
|
1706
|
+
Py_DECREF(coerced1);
|
|
1707
|
+
Py_DECREF(coerced2);
|
|
1708
|
+
|
|
1709
|
+
obj_result = x;
|
|
1710
|
+
goto exit_binary_result_object;
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
// nb_coerce took a reference.
|
|
1715
|
+
Py_DECREF(coerced1);
|
|
1716
|
+
Py_DECREF(coerced2);
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
#endif
|
|
1721
|
+
|
|
1722
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: 'int' and '%s'", type2->tp_name);
|
|
1723
|
+
goto exit_binary_exception;
|
|
1724
|
+
|
|
1725
|
+
exit_binary_result_object:
|
|
1726
|
+
if (unlikely(obj_result == NULL)) {
|
|
1727
|
+
return NUITKA_BOOL_EXCEPTION;
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
{
|
|
1731
|
+
nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
|
|
1732
|
+
Py_DECREF(obj_result);
|
|
1733
|
+
return r;
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
exit_binary_exception:
|
|
1737
|
+
return NUITKA_BOOL_EXCEPTION;
|
|
1738
|
+
}
|
|
1739
|
+
static nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
1740
|
+
CHECK_OBJECT(operand1);
|
|
1741
|
+
assert(PyInt_CheckExact(operand1));
|
|
1742
|
+
CHECK_OBJECT(operand2);
|
|
1743
|
+
|
|
1744
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
1745
|
+
|
|
1746
|
+
if (&PyInt_Type == type2) {
|
|
1747
|
+
nuitka_bool result;
|
|
1748
|
+
|
|
1749
|
+
// return _BINARY_OPERATION_BITOR_NBOOL_INT_INT(operand1, operand2);
|
|
1750
|
+
|
|
1751
|
+
// Not every code path will make use of all possible results.
|
|
1752
|
+
#ifdef _MSC_VER
|
|
1753
|
+
#pragma warning(push)
|
|
1754
|
+
#pragma warning(disable : 4101)
|
|
1755
|
+
#endif
|
|
1756
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1757
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1758
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
1759
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
1760
|
+
#ifdef _MSC_VER
|
|
1761
|
+
#pragma warning(pop)
|
|
1762
|
+
#endif
|
|
1763
|
+
|
|
1764
|
+
CHECK_OBJECT(operand1);
|
|
1765
|
+
assert(PyInt_CheckExact(operand1));
|
|
1766
|
+
CHECK_OBJECT(operand2);
|
|
1767
|
+
assert(PyInt_CheckExact(operand2));
|
|
1768
|
+
|
|
1769
|
+
const long a = PyInt_AS_LONG(operand1);
|
|
1770
|
+
const long b = PyInt_AS_LONG(operand2);
|
|
1771
|
+
|
|
1772
|
+
const long r = a | b;
|
|
1773
|
+
|
|
1774
|
+
clong_result = r;
|
|
1775
|
+
goto exit_result_ok_clong;
|
|
1776
|
+
|
|
1777
|
+
exit_result_ok_clong:
|
|
1778
|
+
result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
|
|
1779
|
+
goto exit_result_ok;
|
|
1780
|
+
|
|
1781
|
+
exit_result_ok:
|
|
1782
|
+
return result;
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
return __BINARY_OPERATION_BITOR_NBOOL_INT_OBJECT(operand1, operand2);
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
nuitka_bool BINARY_OPERATION_BITOR_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
1789
|
+
return _BINARY_OPERATION_BITOR_NBOOL_INT_OBJECT(operand1, operand2);
|
|
1790
|
+
}
|
|
1791
|
+
#endif
|
|
1792
|
+
|
|
1793
|
+
#if PYTHON_VERSION < 0x300
|
|
1794
|
+
/* Code referring to "INT" corresponds to Python2 'int' and "CLONG" to C platform long value. */
|
|
1795
|
+
static PyObject *_BINARY_OPERATION_BITOR_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {
|
|
1796
|
+
CHECK_OBJECT(operand1);
|
|
1797
|
+
assert(PyInt_CheckExact(operand1));
|
|
1798
|
+
|
|
1799
|
+
PyObject *result;
|
|
1800
|
+
|
|
1801
|
+
// Not every code path will make use of all possible results.
|
|
1802
|
+
#ifdef _MSC_VER
|
|
1803
|
+
#pragma warning(push)
|
|
1804
|
+
#pragma warning(disable : 4101)
|
|
1805
|
+
#endif
|
|
1806
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1807
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1808
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
1809
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
1810
|
+
#ifdef _MSC_VER
|
|
1811
|
+
#pragma warning(pop)
|
|
1812
|
+
#endif
|
|
1813
|
+
|
|
1814
|
+
CHECK_OBJECT(operand1);
|
|
1815
|
+
assert(PyInt_CheckExact(operand1));
|
|
1816
|
+
|
|
1817
|
+
const long a = PyInt_AS_LONG(operand1);
|
|
1818
|
+
const long b = operand2;
|
|
1819
|
+
|
|
1820
|
+
const long r = a | b;
|
|
1821
|
+
|
|
1822
|
+
clong_result = r;
|
|
1823
|
+
goto exit_result_ok_clong;
|
|
1824
|
+
|
|
1825
|
+
exit_result_ok_clong:
|
|
1826
|
+
result = Nuitka_PyInt_FromLong(clong_result);
|
|
1827
|
+
goto exit_result_ok;
|
|
1828
|
+
|
|
1829
|
+
exit_result_ok:
|
|
1830
|
+
return result;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
PyObject *BINARY_OPERATION_BITOR_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {
|
|
1834
|
+
return _BINARY_OPERATION_BITOR_OBJECT_INT_CLONG(operand1, operand2);
|
|
1835
|
+
}
|
|
1836
|
+
#endif
|
|
1837
|
+
|
|
1838
|
+
#if PYTHON_VERSION < 0x300
|
|
1839
|
+
/* Code referring to "INT" corresponds to Python2 'int' and "CLONG" to C platform long value. */
|
|
1840
|
+
static nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_INT_CLONG(PyObject *operand1, long operand2) {
|
|
1841
|
+
CHECK_OBJECT(operand1);
|
|
1842
|
+
assert(PyInt_CheckExact(operand1));
|
|
1843
|
+
|
|
1844
|
+
nuitka_bool result;
|
|
1845
|
+
|
|
1846
|
+
// Not every code path will make use of all possible results.
|
|
1847
|
+
#ifdef _MSC_VER
|
|
1848
|
+
#pragma warning(push)
|
|
1849
|
+
#pragma warning(disable : 4101)
|
|
1850
|
+
#endif
|
|
1851
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1852
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1853
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
1854
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
1855
|
+
#ifdef _MSC_VER
|
|
1856
|
+
#pragma warning(pop)
|
|
1857
|
+
#endif
|
|
1858
|
+
|
|
1859
|
+
CHECK_OBJECT(operand1);
|
|
1860
|
+
assert(PyInt_CheckExact(operand1));
|
|
1861
|
+
|
|
1862
|
+
const long a = PyInt_AS_LONG(operand1);
|
|
1863
|
+
const long b = operand2;
|
|
1864
|
+
|
|
1865
|
+
const long r = a | b;
|
|
1866
|
+
|
|
1867
|
+
clong_result = r;
|
|
1868
|
+
goto exit_result_ok_clong;
|
|
1869
|
+
|
|
1870
|
+
exit_result_ok_clong:
|
|
1871
|
+
result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
|
|
1872
|
+
goto exit_result_ok;
|
|
1873
|
+
|
|
1874
|
+
exit_result_ok:
|
|
1875
|
+
return result;
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
nuitka_bool BINARY_OPERATION_BITOR_NBOOL_INT_CLONG(PyObject *operand1, long operand2) {
|
|
1879
|
+
return _BINARY_OPERATION_BITOR_NBOOL_INT_CLONG(operand1, operand2);
|
|
1880
|
+
}
|
|
1881
|
+
#endif
|
|
1882
|
+
|
|
1883
|
+
#if PYTHON_VERSION < 0x300
|
|
1884
|
+
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "INT" to Python2 'int'. */
|
|
1885
|
+
static PyObject *_BINARY_OPERATION_BITOR_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {
|
|
1886
|
+
CHECK_OBJECT(operand1);
|
|
1887
|
+
assert(PyLong_CheckExact(operand1));
|
|
1888
|
+
CHECK_OBJECT(operand2);
|
|
1889
|
+
assert(PyInt_CheckExact(operand2));
|
|
1890
|
+
|
|
1891
|
+
#ifdef _MSC_VER
|
|
1892
|
+
#pragma warning(push)
|
|
1893
|
+
#pragma warning(disable : 4101)
|
|
1894
|
+
#endif
|
|
1895
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1896
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1897
|
+
#ifdef _MSC_VER
|
|
1898
|
+
#pragma warning(pop)
|
|
1899
|
+
#endif
|
|
1900
|
+
|
|
1901
|
+
binaryfunc slot1 = PyLong_Type.tp_as_number->nb_or;
|
|
1902
|
+
// Slot2 ignored on purpose, type1 takes precedence.
|
|
1903
|
+
|
|
1904
|
+
if (slot1 != NULL) {
|
|
1905
|
+
PyObject *x = slot1(operand1, operand2);
|
|
1906
|
+
|
|
1907
|
+
if (x != Py_NotImplemented) {
|
|
1908
|
+
obj_result = x;
|
|
1909
|
+
goto exit_binary_result_object;
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
Py_DECREF_IMMORTAL(x);
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
// Statically recognized that coercion is not possible with these types
|
|
1916
|
+
|
|
1917
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: 'long' and 'int'");
|
|
1918
|
+
goto exit_binary_exception;
|
|
1919
|
+
|
|
1920
|
+
exit_binary_result_object:
|
|
1921
|
+
return obj_result;
|
|
1922
|
+
|
|
1923
|
+
exit_binary_exception:
|
|
1924
|
+
return NULL;
|
|
1925
|
+
}
|
|
1926
|
+
|
|
1927
|
+
PyObject *BINARY_OPERATION_BITOR_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {
|
|
1928
|
+
return _BINARY_OPERATION_BITOR_OBJECT_LONG_INT(operand1, operand2);
|
|
1929
|
+
}
|
|
1930
|
+
#endif
|
|
1931
|
+
|
|
1932
|
+
#if PYTHON_VERSION < 0x300
|
|
1933
|
+
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "INT" to Python2 'int'. */
|
|
1934
|
+
static nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {
|
|
1935
|
+
CHECK_OBJECT(operand1);
|
|
1936
|
+
assert(PyLong_CheckExact(operand1));
|
|
1937
|
+
CHECK_OBJECT(operand2);
|
|
1938
|
+
assert(PyInt_CheckExact(operand2));
|
|
1939
|
+
|
|
1940
|
+
#ifdef _MSC_VER
|
|
1941
|
+
#pragma warning(push)
|
|
1942
|
+
#pragma warning(disable : 4101)
|
|
1943
|
+
#endif
|
|
1944
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
1945
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
1946
|
+
#ifdef _MSC_VER
|
|
1947
|
+
#pragma warning(pop)
|
|
1948
|
+
#endif
|
|
1949
|
+
|
|
1950
|
+
binaryfunc slot1 = PyLong_Type.tp_as_number->nb_or;
|
|
1951
|
+
// Slot2 ignored on purpose, type1 takes precedence.
|
|
1952
|
+
|
|
1953
|
+
if (slot1 != NULL) {
|
|
1954
|
+
PyObject *x = slot1(operand1, operand2);
|
|
1955
|
+
|
|
1956
|
+
if (x != Py_NotImplemented) {
|
|
1957
|
+
obj_result = x;
|
|
1958
|
+
goto exit_binary_result_object;
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
Py_DECREF_IMMORTAL(x);
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
// Statically recognized that coercion is not possible with these types
|
|
1965
|
+
|
|
1966
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: 'long' and 'int'");
|
|
1967
|
+
goto exit_binary_exception;
|
|
1968
|
+
|
|
1969
|
+
exit_binary_result_object:
|
|
1970
|
+
if (unlikely(obj_result == NULL)) {
|
|
1971
|
+
return NUITKA_BOOL_EXCEPTION;
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
{
|
|
1975
|
+
nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
|
|
1976
|
+
Py_DECREF(obj_result);
|
|
1977
|
+
return r;
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
exit_binary_exception:
|
|
1981
|
+
return NUITKA_BOOL_EXCEPTION;
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1984
|
+
nuitka_bool BINARY_OPERATION_BITOR_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {
|
|
1985
|
+
return _BINARY_OPERATION_BITOR_NBOOL_LONG_INT(operand1, operand2);
|
|
1986
|
+
}
|
|
1987
|
+
#endif
|
|
1988
|
+
|
|
1989
|
+
/* Code referring to "SET" corresponds to Python 'set' and "SET" to Python 'set'. */
|
|
1990
|
+
static PyObject *_BINARY_OPERATION_BITOR_OBJECT_SET_SET(PyObject *operand1, PyObject *operand2) {
|
|
1991
|
+
CHECK_OBJECT(operand1);
|
|
1992
|
+
assert(PySet_CheckExact(operand1));
|
|
1993
|
+
CHECK_OBJECT(operand2);
|
|
1994
|
+
assert(PySet_CheckExact(operand2));
|
|
1995
|
+
|
|
1996
|
+
PyObject *result;
|
|
1997
|
+
|
|
1998
|
+
// Not every code path will make use of all possible results.
|
|
1999
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
2000
|
+
|
|
2001
|
+
PyObject *x = PySet_Type.tp_as_number->nb_or(operand1, operand2);
|
|
2002
|
+
|
|
2003
|
+
assert(x != Py_NotImplemented);
|
|
2004
|
+
|
|
2005
|
+
obj_result = x;
|
|
2006
|
+
goto exit_result_object;
|
|
2007
|
+
|
|
2008
|
+
exit_result_object:
|
|
2009
|
+
if (unlikely(obj_result == NULL)) {
|
|
2010
|
+
goto exit_result_exception;
|
|
2011
|
+
}
|
|
2012
|
+
result = obj_result;
|
|
2013
|
+
goto exit_result_ok;
|
|
2014
|
+
|
|
2015
|
+
exit_result_ok:
|
|
2016
|
+
return result;
|
|
2017
|
+
|
|
2018
|
+
exit_result_exception:
|
|
2019
|
+
return NULL;
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
PyObject *BINARY_OPERATION_BITOR_OBJECT_SET_SET(PyObject *operand1, PyObject *operand2) {
|
|
2023
|
+
return _BINARY_OPERATION_BITOR_OBJECT_SET_SET(operand1, operand2);
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
/* Code referring to "OBJECT" corresponds to any Python object and "SET" to Python 'set'. */
|
|
2027
|
+
static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITOR_OBJECT_OBJECT_SET(PyObject *operand1,
|
|
2028
|
+
PyObject *operand2) {
|
|
2029
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
2030
|
+
|
|
2031
|
+
#ifdef _MSC_VER
|
|
2032
|
+
#pragma warning(push)
|
|
2033
|
+
#pragma warning(disable : 4101)
|
|
2034
|
+
#endif
|
|
2035
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
2036
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
2037
|
+
#ifdef _MSC_VER
|
|
2038
|
+
#pragma warning(pop)
|
|
2039
|
+
#endif
|
|
2040
|
+
|
|
2041
|
+
binaryfunc slot1 =
|
|
2042
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;
|
|
2043
|
+
binaryfunc slot2 = NULL;
|
|
2044
|
+
|
|
2045
|
+
if (!(type1 == &PySet_Type)) {
|
|
2046
|
+
// Different types, need to consider second value slot.
|
|
2047
|
+
|
|
2048
|
+
slot2 = PySet_Type.tp_as_number->nb_or;
|
|
2049
|
+
|
|
2050
|
+
if (slot1 == slot2) {
|
|
2051
|
+
slot2 = NULL;
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
if (slot1 != NULL) {
|
|
2056
|
+
PyObject *x = slot1(operand1, operand2);
|
|
2057
|
+
|
|
2058
|
+
if (x != Py_NotImplemented) {
|
|
2059
|
+
obj_result = x;
|
|
2060
|
+
goto exit_binary_result_object;
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
Py_DECREF_IMMORTAL(x);
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
if (slot2 != NULL) {
|
|
2067
|
+
PyObject *x = slot2(operand1, operand2);
|
|
2068
|
+
|
|
2069
|
+
if (x != Py_NotImplemented) {
|
|
2070
|
+
obj_result = x;
|
|
2071
|
+
goto exit_binary_result_object;
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
Py_DECREF_IMMORTAL(x);
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
#if PYTHON_VERSION < 0x300
|
|
2078
|
+
if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {
|
|
2079
|
+
coercion c1 =
|
|
2080
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
|
|
2081
|
+
|
|
2082
|
+
if (c1 != NULL) {
|
|
2083
|
+
PyObject *coerced1 = operand1;
|
|
2084
|
+
PyObject *coerced2 = operand2;
|
|
2085
|
+
|
|
2086
|
+
int err = c1(&coerced1, &coerced2);
|
|
2087
|
+
|
|
2088
|
+
if (unlikely(err < 0)) {
|
|
2089
|
+
goto exit_binary_exception;
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
if (err == 0) {
|
|
2093
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
2094
|
+
|
|
2095
|
+
if (likely(mv == NULL)) {
|
|
2096
|
+
binaryfunc slot = mv->nb_or;
|
|
2097
|
+
|
|
2098
|
+
if (likely(slot != NULL)) {
|
|
2099
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
2100
|
+
|
|
2101
|
+
Py_DECREF(coerced1);
|
|
2102
|
+
Py_DECREF(coerced2);
|
|
2103
|
+
|
|
2104
|
+
obj_result = x;
|
|
2105
|
+
goto exit_binary_result_object;
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
// nb_coerce took a reference.
|
|
2110
|
+
Py_DECREF(coerced1);
|
|
2111
|
+
Py_DECREF(coerced2);
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
#endif
|
|
2116
|
+
|
|
2117
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: '%s' and 'set'", type1->tp_name);
|
|
2118
|
+
goto exit_binary_exception;
|
|
2119
|
+
|
|
2120
|
+
exit_binary_result_object:
|
|
2121
|
+
return obj_result;
|
|
2122
|
+
|
|
2123
|
+
exit_binary_exception:
|
|
2124
|
+
return NULL;
|
|
2125
|
+
}
|
|
2126
|
+
static PyObject *_BINARY_OPERATION_BITOR_OBJECT_OBJECT_SET(PyObject *operand1, PyObject *operand2) {
|
|
2127
|
+
CHECK_OBJECT(operand1);
|
|
2128
|
+
CHECK_OBJECT(operand2);
|
|
2129
|
+
assert(PySet_CheckExact(operand2));
|
|
2130
|
+
|
|
2131
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
2132
|
+
|
|
2133
|
+
if (type1 == &PySet_Type) {
|
|
2134
|
+
PyObject *result;
|
|
2135
|
+
|
|
2136
|
+
// return _BINARY_OPERATION_BITOR_OBJECT_SET_SET(operand1, operand2);
|
|
2137
|
+
|
|
2138
|
+
// Not every code path will make use of all possible results.
|
|
2139
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
2140
|
+
|
|
2141
|
+
PyObject *x = PySet_Type.tp_as_number->nb_or(operand1, operand2);
|
|
2142
|
+
|
|
2143
|
+
assert(x != Py_NotImplemented);
|
|
2144
|
+
|
|
2145
|
+
obj_result = x;
|
|
2146
|
+
goto exit_result_object;
|
|
2147
|
+
|
|
2148
|
+
exit_result_object:
|
|
2149
|
+
if (unlikely(obj_result == NULL)) {
|
|
2150
|
+
goto exit_result_exception;
|
|
2151
|
+
}
|
|
2152
|
+
result = obj_result;
|
|
2153
|
+
goto exit_result_ok;
|
|
2154
|
+
|
|
2155
|
+
exit_result_ok:
|
|
2156
|
+
return result;
|
|
2157
|
+
|
|
2158
|
+
exit_result_exception:
|
|
2159
|
+
return NULL;
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
return __BINARY_OPERATION_BITOR_OBJECT_OBJECT_SET(operand1, operand2);
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
PyObject *BINARY_OPERATION_BITOR_OBJECT_OBJECT_SET(PyObject *operand1, PyObject *operand2) {
|
|
2166
|
+
return _BINARY_OPERATION_BITOR_OBJECT_OBJECT_SET(operand1, operand2);
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
/* Code referring to "SET" corresponds to Python 'set' and "OBJECT" to any Python object. */
|
|
2170
|
+
static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITOR_OBJECT_SET_OBJECT(PyObject *operand1,
|
|
2171
|
+
PyObject *operand2) {
|
|
2172
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
2173
|
+
|
|
2174
|
+
#ifdef _MSC_VER
|
|
2175
|
+
#pragma warning(push)
|
|
2176
|
+
#pragma warning(disable : 4101)
|
|
2177
|
+
#endif
|
|
2178
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
2179
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
2180
|
+
#ifdef _MSC_VER
|
|
2181
|
+
#pragma warning(pop)
|
|
2182
|
+
#endif
|
|
2183
|
+
|
|
2184
|
+
binaryfunc slot1 = PySet_Type.tp_as_number->nb_or;
|
|
2185
|
+
binaryfunc slot2 = NULL;
|
|
2186
|
+
|
|
2187
|
+
if (!(&PySet_Type == type2)) {
|
|
2188
|
+
// Different types, need to consider second value slot.
|
|
2189
|
+
|
|
2190
|
+
slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;
|
|
2191
|
+
|
|
2192
|
+
if (slot1 == slot2) {
|
|
2193
|
+
slot2 = NULL;
|
|
2194
|
+
}
|
|
2195
|
+
}
|
|
2196
|
+
|
|
2197
|
+
if (slot1 != NULL) {
|
|
2198
|
+
if (slot2 != NULL) {
|
|
2199
|
+
if (Nuitka_Type_IsSubtype(type2, &PySet_Type)) {
|
|
2200
|
+
PyObject *x = slot2(operand1, operand2);
|
|
2201
|
+
|
|
2202
|
+
if (x != Py_NotImplemented) {
|
|
2203
|
+
obj_result = x;
|
|
2204
|
+
goto exit_binary_result_object;
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2207
|
+
Py_DECREF_IMMORTAL(x);
|
|
2208
|
+
slot2 = NULL;
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
PyObject *x = slot1(operand1, operand2);
|
|
2213
|
+
|
|
2214
|
+
if (x != Py_NotImplemented) {
|
|
2215
|
+
obj_result = x;
|
|
2216
|
+
goto exit_binary_result_object;
|
|
2217
|
+
}
|
|
2218
|
+
|
|
2219
|
+
Py_DECREF_IMMORTAL(x);
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
if (slot2 != NULL) {
|
|
2223
|
+
PyObject *x = slot2(operand1, operand2);
|
|
2224
|
+
|
|
2225
|
+
if (x != Py_NotImplemented) {
|
|
2226
|
+
obj_result = x;
|
|
2227
|
+
goto exit_binary_result_object;
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2230
|
+
Py_DECREF_IMMORTAL(x);
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2233
|
+
#if PYTHON_VERSION < 0x300
|
|
2234
|
+
if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {
|
|
2235
|
+
coercion c2 =
|
|
2236
|
+
(type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
|
|
2237
|
+
|
|
2238
|
+
if (c2 != NULL) {
|
|
2239
|
+
PyObject *coerced1 = operand1;
|
|
2240
|
+
PyObject *coerced2 = operand2;
|
|
2241
|
+
|
|
2242
|
+
int err = c2(&coerced2, &coerced1);
|
|
2243
|
+
|
|
2244
|
+
if (unlikely(err < 0)) {
|
|
2245
|
+
goto exit_binary_exception;
|
|
2246
|
+
}
|
|
2247
|
+
|
|
2248
|
+
if (err == 0) {
|
|
2249
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
2250
|
+
|
|
2251
|
+
if (likely(mv == NULL)) {
|
|
2252
|
+
binaryfunc slot = mv->nb_or;
|
|
2253
|
+
|
|
2254
|
+
if (likely(slot != NULL)) {
|
|
2255
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
2256
|
+
|
|
2257
|
+
Py_DECREF(coerced1);
|
|
2258
|
+
Py_DECREF(coerced2);
|
|
2259
|
+
|
|
2260
|
+
obj_result = x;
|
|
2261
|
+
goto exit_binary_result_object;
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
// nb_coerce took a reference.
|
|
2266
|
+
Py_DECREF(coerced1);
|
|
2267
|
+
Py_DECREF(coerced2);
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
#endif
|
|
2272
|
+
|
|
2273
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: 'set' and '%s'", type2->tp_name);
|
|
2274
|
+
goto exit_binary_exception;
|
|
2275
|
+
|
|
2276
|
+
exit_binary_result_object:
|
|
2277
|
+
return obj_result;
|
|
2278
|
+
|
|
2279
|
+
exit_binary_exception:
|
|
2280
|
+
return NULL;
|
|
2281
|
+
}
|
|
2282
|
+
static PyObject *_BINARY_OPERATION_BITOR_OBJECT_SET_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
2283
|
+
CHECK_OBJECT(operand1);
|
|
2284
|
+
assert(PySet_CheckExact(operand1));
|
|
2285
|
+
CHECK_OBJECT(operand2);
|
|
2286
|
+
|
|
2287
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
2288
|
+
|
|
2289
|
+
if (&PySet_Type == type2) {
|
|
2290
|
+
PyObject *result;
|
|
2291
|
+
|
|
2292
|
+
// return _BINARY_OPERATION_BITOR_OBJECT_SET_SET(operand1, operand2);
|
|
2293
|
+
|
|
2294
|
+
// Not every code path will make use of all possible results.
|
|
2295
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
2296
|
+
|
|
2297
|
+
PyObject *x = PySet_Type.tp_as_number->nb_or(operand1, operand2);
|
|
2298
|
+
|
|
2299
|
+
assert(x != Py_NotImplemented);
|
|
2300
|
+
|
|
2301
|
+
obj_result = x;
|
|
2302
|
+
goto exit_result_object;
|
|
2303
|
+
|
|
2304
|
+
exit_result_object:
|
|
2305
|
+
if (unlikely(obj_result == NULL)) {
|
|
2306
|
+
goto exit_result_exception;
|
|
2307
|
+
}
|
|
2308
|
+
result = obj_result;
|
|
2309
|
+
goto exit_result_ok;
|
|
2310
|
+
|
|
2311
|
+
exit_result_ok:
|
|
2312
|
+
return result;
|
|
2313
|
+
|
|
2314
|
+
exit_result_exception:
|
|
2315
|
+
return NULL;
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
return __BINARY_OPERATION_BITOR_OBJECT_SET_OBJECT(operand1, operand2);
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
PyObject *BINARY_OPERATION_BITOR_OBJECT_SET_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
2322
|
+
return _BINARY_OPERATION_BITOR_OBJECT_SET_OBJECT(operand1, operand2);
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2325
|
+
/* Code referring to "OBJECT" corresponds to any Python object and "OBJECT" to any Python object. */
|
|
2326
|
+
static PyObject *_BINARY_OPERATION_BITOR_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
2327
|
+
CHECK_OBJECT(operand1);
|
|
2328
|
+
CHECK_OBJECT(operand2);
|
|
2329
|
+
|
|
2330
|
+
#if PYTHON_VERSION < 0x300
|
|
2331
|
+
if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {
|
|
2332
|
+
PyObject *result;
|
|
2333
|
+
|
|
2334
|
+
// Not every code path will make use of all possible results.
|
|
2335
|
+
#ifdef _MSC_VER
|
|
2336
|
+
#pragma warning(push)
|
|
2337
|
+
#pragma warning(disable : 4101)
|
|
2338
|
+
#endif
|
|
2339
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
2340
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
2341
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
2342
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
2343
|
+
#ifdef _MSC_VER
|
|
2344
|
+
#pragma warning(pop)
|
|
2345
|
+
#endif
|
|
2346
|
+
|
|
2347
|
+
CHECK_OBJECT(operand1);
|
|
2348
|
+
assert(PyInt_CheckExact(operand1));
|
|
2349
|
+
CHECK_OBJECT(operand2);
|
|
2350
|
+
assert(PyInt_CheckExact(operand2));
|
|
2351
|
+
|
|
2352
|
+
const long a = PyInt_AS_LONG(operand1);
|
|
2353
|
+
const long b = PyInt_AS_LONG(operand2);
|
|
2354
|
+
|
|
2355
|
+
const long r = a | b;
|
|
2356
|
+
|
|
2357
|
+
clong_result = r;
|
|
2358
|
+
goto exit_result_ok_clong;
|
|
2359
|
+
|
|
2360
|
+
exit_result_ok_clong:
|
|
2361
|
+
result = Nuitka_PyInt_FromLong(clong_result);
|
|
2362
|
+
goto exit_result_ok;
|
|
2363
|
+
|
|
2364
|
+
exit_result_ok:
|
|
2365
|
+
return result;
|
|
2366
|
+
}
|
|
2367
|
+
#endif
|
|
2368
|
+
|
|
2369
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
2370
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
2371
|
+
|
|
2372
|
+
#ifdef _MSC_VER
|
|
2373
|
+
#pragma warning(push)
|
|
2374
|
+
#pragma warning(disable : 4101)
|
|
2375
|
+
#endif
|
|
2376
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
2377
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
2378
|
+
#ifdef _MSC_VER
|
|
2379
|
+
#pragma warning(pop)
|
|
2380
|
+
#endif
|
|
2381
|
+
|
|
2382
|
+
binaryfunc slot1 =
|
|
2383
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;
|
|
2384
|
+
binaryfunc slot2 = NULL;
|
|
2385
|
+
|
|
2386
|
+
if (!(type1 == type2)) {
|
|
2387
|
+
// Different types, need to consider second value slot.
|
|
2388
|
+
|
|
2389
|
+
slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;
|
|
2390
|
+
|
|
2391
|
+
if (slot1 == slot2) {
|
|
2392
|
+
slot2 = NULL;
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2396
|
+
if (slot1 != NULL) {
|
|
2397
|
+
if (slot2 != NULL) {
|
|
2398
|
+
if (Nuitka_Type_IsSubtype(type2, type1)) {
|
|
2399
|
+
PyObject *x = slot2(operand1, operand2);
|
|
2400
|
+
|
|
2401
|
+
if (x != Py_NotImplemented) {
|
|
2402
|
+
obj_result = x;
|
|
2403
|
+
goto exit_binary_result_object;
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2406
|
+
Py_DECREF_IMMORTAL(x);
|
|
2407
|
+
slot2 = NULL;
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
PyObject *x = slot1(operand1, operand2);
|
|
2412
|
+
|
|
2413
|
+
if (x != Py_NotImplemented) {
|
|
2414
|
+
obj_result = x;
|
|
2415
|
+
goto exit_binary_result_object;
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2418
|
+
Py_DECREF_IMMORTAL(x);
|
|
2419
|
+
}
|
|
2420
|
+
|
|
2421
|
+
if (slot2 != NULL) {
|
|
2422
|
+
PyObject *x = slot2(operand1, operand2);
|
|
2423
|
+
|
|
2424
|
+
if (x != Py_NotImplemented) {
|
|
2425
|
+
obj_result = x;
|
|
2426
|
+
goto exit_binary_result_object;
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
Py_DECREF_IMMORTAL(x);
|
|
2430
|
+
}
|
|
2431
|
+
|
|
2432
|
+
#if PYTHON_VERSION < 0x300
|
|
2433
|
+
if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {
|
|
2434
|
+
coercion c1 =
|
|
2435
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
|
|
2436
|
+
|
|
2437
|
+
if (c1 != NULL) {
|
|
2438
|
+
PyObject *coerced1 = operand1;
|
|
2439
|
+
PyObject *coerced2 = operand2;
|
|
2440
|
+
|
|
2441
|
+
int err = c1(&coerced1, &coerced2);
|
|
2442
|
+
|
|
2443
|
+
if (unlikely(err < 0)) {
|
|
2444
|
+
goto exit_binary_exception;
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
if (err == 0) {
|
|
2448
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
2449
|
+
|
|
2450
|
+
if (likely(mv == NULL)) {
|
|
2451
|
+
binaryfunc slot = mv->nb_or;
|
|
2452
|
+
|
|
2453
|
+
if (likely(slot != NULL)) {
|
|
2454
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
2455
|
+
|
|
2456
|
+
Py_DECREF(coerced1);
|
|
2457
|
+
Py_DECREF(coerced2);
|
|
2458
|
+
|
|
2459
|
+
obj_result = x;
|
|
2460
|
+
goto exit_binary_result_object;
|
|
2461
|
+
}
|
|
2462
|
+
}
|
|
2463
|
+
|
|
2464
|
+
// nb_coerce took a reference.
|
|
2465
|
+
Py_DECREF(coerced1);
|
|
2466
|
+
Py_DECREF(coerced2);
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
coercion c2 =
|
|
2470
|
+
(type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
|
|
2471
|
+
|
|
2472
|
+
if (c2 != NULL) {
|
|
2473
|
+
PyObject *coerced1 = operand1;
|
|
2474
|
+
PyObject *coerced2 = operand2;
|
|
2475
|
+
|
|
2476
|
+
int err = c2(&coerced2, &coerced1);
|
|
2477
|
+
|
|
2478
|
+
if (unlikely(err < 0)) {
|
|
2479
|
+
goto exit_binary_exception;
|
|
2480
|
+
}
|
|
2481
|
+
|
|
2482
|
+
if (err == 0) {
|
|
2483
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
2484
|
+
|
|
2485
|
+
if (likely(mv == NULL)) {
|
|
2486
|
+
binaryfunc slot = mv->nb_or;
|
|
2487
|
+
|
|
2488
|
+
if (likely(slot != NULL)) {
|
|
2489
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
2490
|
+
|
|
2491
|
+
Py_DECREF(coerced1);
|
|
2492
|
+
Py_DECREF(coerced2);
|
|
2493
|
+
|
|
2494
|
+
obj_result = x;
|
|
2495
|
+
goto exit_binary_result_object;
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2499
|
+
// nb_coerce took a reference.
|
|
2500
|
+
Py_DECREF(coerced1);
|
|
2501
|
+
Py_DECREF(coerced2);
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
#endif
|
|
2506
|
+
|
|
2507
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: '%s' and '%s'", type1->tp_name, type2->tp_name);
|
|
2508
|
+
goto exit_binary_exception;
|
|
2509
|
+
|
|
2510
|
+
exit_binary_result_object:
|
|
2511
|
+
return obj_result;
|
|
2512
|
+
|
|
2513
|
+
exit_binary_exception:
|
|
2514
|
+
return NULL;
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
PyObject *BINARY_OPERATION_BITOR_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
2518
|
+
return _BINARY_OPERATION_BITOR_OBJECT_OBJECT_OBJECT(operand1, operand2);
|
|
2519
|
+
}
|
|
2520
|
+
|
|
2521
|
+
/* Code referring to "OBJECT" corresponds to any Python object and "OBJECT" to any Python object. */
|
|
2522
|
+
static nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
2523
|
+
CHECK_OBJECT(operand1);
|
|
2524
|
+
CHECK_OBJECT(operand2);
|
|
2525
|
+
|
|
2526
|
+
#if PYTHON_VERSION < 0x300
|
|
2527
|
+
if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {
|
|
2528
|
+
nuitka_bool result;
|
|
2529
|
+
|
|
2530
|
+
// Not every code path will make use of all possible results.
|
|
2531
|
+
#ifdef _MSC_VER
|
|
2532
|
+
#pragma warning(push)
|
|
2533
|
+
#pragma warning(disable : 4101)
|
|
2534
|
+
#endif
|
|
2535
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
2536
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
2537
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
2538
|
+
NUITKA_MAY_BE_UNUSED double cfloat_result;
|
|
2539
|
+
#ifdef _MSC_VER
|
|
2540
|
+
#pragma warning(pop)
|
|
2541
|
+
#endif
|
|
2542
|
+
|
|
2543
|
+
CHECK_OBJECT(operand1);
|
|
2544
|
+
assert(PyInt_CheckExact(operand1));
|
|
2545
|
+
CHECK_OBJECT(operand2);
|
|
2546
|
+
assert(PyInt_CheckExact(operand2));
|
|
2547
|
+
|
|
2548
|
+
const long a = PyInt_AS_LONG(operand1);
|
|
2549
|
+
const long b = PyInt_AS_LONG(operand2);
|
|
2550
|
+
|
|
2551
|
+
const long r = a | b;
|
|
2552
|
+
|
|
2553
|
+
clong_result = r;
|
|
2554
|
+
goto exit_result_ok_clong;
|
|
2555
|
+
|
|
2556
|
+
exit_result_ok_clong:
|
|
2557
|
+
result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
|
|
2558
|
+
goto exit_result_ok;
|
|
2559
|
+
|
|
2560
|
+
exit_result_ok:
|
|
2561
|
+
return result;
|
|
2562
|
+
}
|
|
2563
|
+
#endif
|
|
2564
|
+
|
|
2565
|
+
PyTypeObject *type1 = Py_TYPE(operand1);
|
|
2566
|
+
PyTypeObject *type2 = Py_TYPE(operand2);
|
|
2567
|
+
|
|
2568
|
+
#ifdef _MSC_VER
|
|
2569
|
+
#pragma warning(push)
|
|
2570
|
+
#pragma warning(disable : 4101)
|
|
2571
|
+
#endif
|
|
2572
|
+
NUITKA_MAY_BE_UNUSED bool cbool_result;
|
|
2573
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
2574
|
+
#ifdef _MSC_VER
|
|
2575
|
+
#pragma warning(pop)
|
|
2576
|
+
#endif
|
|
2577
|
+
|
|
2578
|
+
binaryfunc slot1 =
|
|
2579
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;
|
|
2580
|
+
binaryfunc slot2 = NULL;
|
|
2581
|
+
|
|
2582
|
+
if (!(type1 == type2)) {
|
|
2583
|
+
// Different types, need to consider second value slot.
|
|
2584
|
+
|
|
2585
|
+
slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;
|
|
2586
|
+
|
|
2587
|
+
if (slot1 == slot2) {
|
|
2588
|
+
slot2 = NULL;
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
|
|
2592
|
+
if (slot1 != NULL) {
|
|
2593
|
+
if (slot2 != NULL) {
|
|
2594
|
+
if (Nuitka_Type_IsSubtype(type2, type1)) {
|
|
2595
|
+
PyObject *x = slot2(operand1, operand2);
|
|
2596
|
+
|
|
2597
|
+
if (x != Py_NotImplemented) {
|
|
2598
|
+
obj_result = x;
|
|
2599
|
+
goto exit_binary_result_object;
|
|
2600
|
+
}
|
|
2601
|
+
|
|
2602
|
+
Py_DECREF_IMMORTAL(x);
|
|
2603
|
+
slot2 = NULL;
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
PyObject *x = slot1(operand1, operand2);
|
|
2608
|
+
|
|
2609
|
+
if (x != Py_NotImplemented) {
|
|
2610
|
+
obj_result = x;
|
|
2611
|
+
goto exit_binary_result_object;
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
Py_DECREF_IMMORTAL(x);
|
|
2615
|
+
}
|
|
2616
|
+
|
|
2617
|
+
if (slot2 != NULL) {
|
|
2618
|
+
PyObject *x = slot2(operand1, operand2);
|
|
2619
|
+
|
|
2620
|
+
if (x != Py_NotImplemented) {
|
|
2621
|
+
obj_result = x;
|
|
2622
|
+
goto exit_binary_result_object;
|
|
2623
|
+
}
|
|
2624
|
+
|
|
2625
|
+
Py_DECREF_IMMORTAL(x);
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
#if PYTHON_VERSION < 0x300
|
|
2629
|
+
if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {
|
|
2630
|
+
coercion c1 =
|
|
2631
|
+
(type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
|
|
2632
|
+
|
|
2633
|
+
if (c1 != NULL) {
|
|
2634
|
+
PyObject *coerced1 = operand1;
|
|
2635
|
+
PyObject *coerced2 = operand2;
|
|
2636
|
+
|
|
2637
|
+
int err = c1(&coerced1, &coerced2);
|
|
2638
|
+
|
|
2639
|
+
if (unlikely(err < 0)) {
|
|
2640
|
+
goto exit_binary_exception;
|
|
2641
|
+
}
|
|
2642
|
+
|
|
2643
|
+
if (err == 0) {
|
|
2644
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
2645
|
+
|
|
2646
|
+
if (likely(mv == NULL)) {
|
|
2647
|
+
binaryfunc slot = mv->nb_or;
|
|
2648
|
+
|
|
2649
|
+
if (likely(slot != NULL)) {
|
|
2650
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
2651
|
+
|
|
2652
|
+
Py_DECREF(coerced1);
|
|
2653
|
+
Py_DECREF(coerced2);
|
|
2654
|
+
|
|
2655
|
+
obj_result = x;
|
|
2656
|
+
goto exit_binary_result_object;
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
|
|
2660
|
+
// nb_coerce took a reference.
|
|
2661
|
+
Py_DECREF(coerced1);
|
|
2662
|
+
Py_DECREF(coerced2);
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2665
|
+
coercion c2 =
|
|
2666
|
+
(type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
|
|
2667
|
+
|
|
2668
|
+
if (c2 != NULL) {
|
|
2669
|
+
PyObject *coerced1 = operand1;
|
|
2670
|
+
PyObject *coerced2 = operand2;
|
|
2671
|
+
|
|
2672
|
+
int err = c2(&coerced2, &coerced1);
|
|
2673
|
+
|
|
2674
|
+
if (unlikely(err < 0)) {
|
|
2675
|
+
goto exit_binary_exception;
|
|
2676
|
+
}
|
|
2677
|
+
|
|
2678
|
+
if (err == 0) {
|
|
2679
|
+
PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
|
|
2680
|
+
|
|
2681
|
+
if (likely(mv == NULL)) {
|
|
2682
|
+
binaryfunc slot = mv->nb_or;
|
|
2683
|
+
|
|
2684
|
+
if (likely(slot != NULL)) {
|
|
2685
|
+
PyObject *x = slot(coerced1, coerced2);
|
|
2686
|
+
|
|
2687
|
+
Py_DECREF(coerced1);
|
|
2688
|
+
Py_DECREF(coerced2);
|
|
2689
|
+
|
|
2690
|
+
obj_result = x;
|
|
2691
|
+
goto exit_binary_result_object;
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
|
|
2695
|
+
// nb_coerce took a reference.
|
|
2696
|
+
Py_DECREF(coerced1);
|
|
2697
|
+
Py_DECREF(coerced2);
|
|
2698
|
+
}
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
#endif
|
|
2702
|
+
|
|
2703
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for |: '%s' and '%s'", type1->tp_name, type2->tp_name);
|
|
2704
|
+
goto exit_binary_exception;
|
|
2705
|
+
|
|
2706
|
+
exit_binary_result_object:
|
|
2707
|
+
if (unlikely(obj_result == NULL)) {
|
|
2708
|
+
return NUITKA_BOOL_EXCEPTION;
|
|
2709
|
+
}
|
|
2710
|
+
|
|
2711
|
+
{
|
|
2712
|
+
nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
|
|
2713
|
+
Py_DECREF(obj_result);
|
|
2714
|
+
return r;
|
|
2715
|
+
}
|
|
2716
|
+
|
|
2717
|
+
exit_binary_exception:
|
|
2718
|
+
return NUITKA_BOOL_EXCEPTION;
|
|
2719
|
+
}
|
|
2720
|
+
|
|
2721
|
+
nuitka_bool BINARY_OPERATION_BITOR_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
|
|
2722
|
+
return _BINARY_OPERATION_BITOR_NBOOL_OBJECT_OBJECT(operand1, operand2);
|
|
2723
|
+
}
|
|
2724
|
+
|
|
2725
|
+
// Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
2726
|
+
// integrates with CPython, but also works on its own.
|
|
2727
|
+
//
|
|
2728
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
2729
|
+
// you may not use this file except in compliance with the License.
|
|
2730
|
+
// You may obtain a copy of the License at
|
|
2731
|
+
//
|
|
2732
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
2733
|
+
//
|
|
2734
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
2735
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
2736
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2737
|
+
// See the License for the specific language governing permissions and
|
|
2738
|
+
// limitations under the License.
|