Nuitka-winsvc 2.3.11__cp311-cp311-win_amd64.whl → 2.4.5__cp311-cp311-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Nuitka-winsvc might be problematic. Click here for more details.
- Nuitka_winsvc-2.3.11.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.4.5.data/scripts/nuitka-run.cmd +1 -1
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/METADATA +1 -1
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/RECORD +213 -210
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/WHEEL +1 -1
- nuitka/CacheCleanup.py +6 -1
- nuitka/HardImportRegistry.py +30 -2
- nuitka/MainControl.py +62 -35
- nuitka/ModuleRegistry.py +11 -3
- nuitka/OptionParsing.py +78 -39
- nuitka/Options.py +142 -35
- nuitka/OutputDirectories.py +5 -0
- nuitka/PostProcessing.py +23 -14
- nuitka/Progress.py +2 -1
- nuitka/PythonFlavors.py +22 -4
- nuitka/PythonVersions.py +18 -0
- nuitka/Tracing.py +1 -0
- nuitka/TreeXML.py +6 -3
- nuitka/Version.py +1 -1
- nuitka/__main__.py +55 -10
- nuitka/__past__.py +5 -0
- nuitka/build/Backend.scons +6 -1
- nuitka/build/CCompilerVersion.scons +1 -0
- nuitka/build/Onefile.scons +4 -0
- nuitka/build/SconsCaching.py +2 -1
- nuitka/build/SconsCompilerSettings.py +1 -0
- nuitka/build/SconsHacks.py +5 -1
- nuitka/build/SconsInterface.py +2 -0
- nuitka/build/SconsUtils.py +4 -1
- nuitka/build/include/nuitka/allocator.h +27 -5
- nuitka/build/include/nuitka/calling.h +1 -1
- nuitka/build/include/nuitka/compiled_frame.h +23 -23
- nuitka/build/include/nuitka/compiled_method.h +1 -1
- nuitka/build/include/nuitka/exception_groups.h +0 -2
- nuitka/build/include/nuitka/helper/attributes.h +7 -1
- nuitka/build/include/nuitka/helper/subscripts.h +1 -1
- nuitka/build/include/nuitka/helpers.h +10 -3
- nuitka/build/include/nuitka/prelude.h +6 -15
- nuitka/build/include/nuitka/printing.h +2 -0
- nuitka/build/include/nuitka/unfreezing.h +11 -5
- nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +4 -1
- nuitka/build/static_src/CompiledAsyncgenType.c +2 -4
- nuitka/build/static_src/CompiledCellType.c +7 -7
- nuitka/build/static_src/CompiledCodeHelpers.c +49 -36
- nuitka/build/static_src/CompiledCoroutineType.c +2 -4
- nuitka/build/static_src/CompiledFrameType.c +109 -82
- nuitka/build/static_src/CompiledFunctionType.c +36 -9
- nuitka/build/static_src/CompiledGeneratorType.c +12 -10
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2 -2
- nuitka/build/static_src/CompiledMethodType.c +14 -13
- nuitka/build/static_src/HelpersAttributes.c +13 -15
- nuitka/build/static_src/HelpersBuiltin.c +16 -7
- nuitka/build/static_src/HelpersCalling.c +13 -13
- nuitka/build/static_src/HelpersCallingGenerated.c +22 -22
- nuitka/build/static_src/HelpersComparisonEq.c +110 -110
- nuitka/build/static_src/HelpersComparisonEqUtils.c +1 -1
- nuitka/build/static_src/HelpersComparisonGe.c +110 -110
- nuitka/build/static_src/HelpersComparisonGt.c +110 -110
- nuitka/build/static_src/HelpersComparisonLe.c +110 -110
- nuitka/build/static_src/HelpersComparisonLt.c +110 -110
- nuitka/build/static_src/HelpersComparisonNe.c +110 -110
- nuitka/build/static_src/HelpersConstantsBlob.c +480 -481
- nuitka/build/static_src/HelpersDictionaries.c +9 -0
- nuitka/build/static_src/HelpersFilesystemPaths.c +28 -13
- nuitka/build/static_src/HelpersImport.c +1 -1
- nuitka/build/static_src/HelpersLists.c +5 -1
- nuitka/build/static_src/HelpersMatching.c +95 -35
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +23 -23
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -0
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +9 -9
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +10 -10
- nuitka/build/static_src/HelpersOperationInplaceMod.c +47 -47
- nuitka/build/static_src/HelpersOperationInplaceMult.c +28 -28
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +17 -17
- nuitka/build/static_src/HelpersOperationInplacePow.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +9 -9
- nuitka/build/static_src/HelpersOperationInplaceSub.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +17 -17
- nuitka/build/static_src/HelpersSequences.c +1 -1
- nuitka/build/static_src/HelpersTypes.c +8 -4
- nuitka/build/static_src/InspectPatcher.c +14 -2
- nuitka/build/static_src/MainProgram.c +20 -1
- nuitka/build/static_src/MetaPathBasedLoader.c +163 -140
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +13 -4
- nuitka/build/static_src/OnefileBootstrap.c +100 -6
- nuitka/code_generation/AttributeCodes.py +12 -10
- nuitka/code_generation/CodeGeneration.py +6 -7
- nuitka/code_generation/ConstantCodes.py +53 -10
- nuitka/code_generation/Emission.py +1 -1
- nuitka/code_generation/GlobalConstants.py +6 -6
- nuitka/code_generation/Indentation.py +4 -5
- nuitka/code_generation/LoaderCodes.py +3 -0
- nuitka/code_generation/LocalsDictCodes.py +36 -14
- nuitka/code_generation/MatchCodes.py +23 -4
- nuitka/code_generation/ModuleCodes.py +1 -8
- nuitka/code_generation/Namify.py +2 -0
- nuitka/code_generation/PackageResourceCodes.py +5 -1
- nuitka/code_generation/templates/CodeTemplatesConstants.py +22 -4
- nuitka/code_generation/templates/CodeTemplatesLoader.py +1 -1
- nuitka/code_generation/templates/CodeTemplatesModules.py +27 -9
- nuitka/code_generation/templates/CodeTemplatesVariables.py +16 -2
- nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +2 -2
- nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +7 -7
- nuitka/freezer/DependsExe.py +3 -1
- nuitka/freezer/DllDependenciesMacOS.py +5 -12
- nuitka/freezer/IncludedDataFiles.py +15 -4
- nuitka/freezer/IncludedEntryPoints.py +8 -2
- nuitka/freezer/Onefile.py +6 -1
- nuitka/freezer/Standalone.py +9 -2
- nuitka/importing/Importing.py +14 -5
- nuitka/importing/Recursion.py +3 -0
- nuitka/nodes/AttributeNodesGenerated.py +21 -12
- nuitka/nodes/BuiltinOpenNodes.py +5 -0
- nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +11 -11
- nuitka/nodes/BuiltinRefNodes.py +41 -1
- nuitka/nodes/ChildrenHavingMixins.py +143 -355
- nuitka/nodes/ClassNodes.py +30 -12
- nuitka/nodes/CodeObjectSpecs.py +9 -0
- nuitka/nodes/ExpressionBasesGenerated.py +11 -11
- nuitka/nodes/FunctionNodes.py +7 -11
- nuitka/nodes/FutureSpecs.py +16 -3
- nuitka/nodes/GeneratorNodes.py +2 -2
- nuitka/nodes/HardImportNodesGenerated.py +11 -134
- nuitka/nodes/LocalsScopes.py +19 -23
- nuitka/nodes/MatchNodes.py +18 -7
- nuitka/nodes/ModuleAttributeNodes.py +1 -20
- nuitka/nodes/ModuleNodes.py +23 -6
- nuitka/nodes/NodeBases.py +3 -2
- nuitka/nodes/NodeMetaClasses.py +26 -10
- nuitka/nodes/ReturnNodes.py +1 -1
- nuitka/nodes/StatementBasesGenerated.py +11 -11
- nuitka/nodes/SubscriptNodes.py +4 -4
- nuitka/nodes/VariableAssignNodes.py +1 -1
- nuitka/nodes/VariableRefNodes.py +28 -2
- nuitka/optimizations/FunctionInlining.py +3 -6
- nuitka/optimizations/Optimization.py +13 -12
- nuitka/optimizations/TraceCollections.py +19 -4
- nuitka/plugins/PluginBase.py +121 -133
- nuitka/plugins/Plugins.py +92 -4
- nuitka/plugins/YamlPluginBase.py +121 -0
- nuitka/plugins/standard/AntiBloatPlugin.py +87 -28
- nuitka/plugins/standard/DataFilesPlugin.py +15 -6
- nuitka/plugins/standard/DelvewheelPlugin.py +7 -3
- nuitka/plugins/standard/DllFilesPlugin.py +5 -3
- nuitka/plugins/standard/ImplicitImports.py +34 -20
- nuitka/plugins/standard/MatplotlibPlugin.py +3 -1
- nuitka/plugins/standard/MultiprocessingPlugin.py +2 -2
- nuitka/plugins/standard/OptionsNannyPlugin.py +1 -1
- nuitka/plugins/standard/PySidePyQtPlugin.py +11 -12
- nuitka/plugins/standard/SpacyPlugin.py +136 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +489 -182
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +6 -0
- nuitka/reports/Reports.py +53 -5
- nuitka/specs/BuiltinParameterSpecs.py +1 -1
- nuitka/specs/HardImportSpecs.py +0 -6
- nuitka/tools/data_composer/DataComposer.py +29 -27
- nuitka/tools/environments/CreateEnvironment.py +1 -0
- nuitka/tools/environments/Virtualenv.py +25 -11
- nuitka/tools/general/find_module/FindModuleCode.py +13 -3
- nuitka/tools/onefile_compressor/OnefileCompressor.py +21 -4
- nuitka/tools/scanning/DisplayPackageDLLs.py +17 -3
- nuitka/tools/specialize/CTypeDescriptions.py +13 -7
- nuitka/tools/specialize/SpecializePython.py +18 -1
- nuitka/tools/testing/Common.py +19 -6
- nuitka/tools/testing/check_reference_counts/__main__.py +1 -1
- nuitka/tools/testing/run_nuitka_tests/__main__.py +0 -20
- nuitka/tools/watch/AutoStage.py +144 -0
- nuitka/tools/watch/__main__.py +79 -32
- nuitka/tree/Building.py +105 -104
- nuitka/tree/ComplexCallHelperFunctions.py +16 -26
- nuitka/tree/InternalModule.py +8 -0
- nuitka/tree/ReformulationAssignmentStatements.py +29 -59
- nuitka/tree/ReformulationClasses.py +10 -17
- nuitka/tree/ReformulationClasses3.py +69 -43
- nuitka/tree/ReformulationComparisonExpressions.py +6 -16
- nuitka/tree/ReformulationContractionExpressions.py +14 -23
- nuitka/tree/ReformulationDictionaryCreation.py +6 -10
- nuitka/tree/ReformulationExecStatements.py +10 -10
- nuitka/tree/ReformulationForLoopStatements.py +6 -12
- nuitka/tree/ReformulationFunctionStatements.py +21 -28
- nuitka/tree/ReformulationImportStatements.py +8 -10
- nuitka/tree/ReformulationLambdaExpressions.py +3 -6
- nuitka/tree/ReformulationMatchStatements.py +166 -60
- nuitka/tree/ReformulationMultidist.py +3 -1
- nuitka/tree/ReformulationNamespacePackages.py +1 -1
- nuitka/tree/ReformulationPrintStatements.py +3 -6
- nuitka/tree/ReformulationSequenceCreation.py +13 -26
- nuitka/tree/ReformulationTryFinallyStatements.py +15 -0
- nuitka/tree/ReformulationWithStatements.py +12 -16
- nuitka/tree/SourceHandling.py +13 -8
- nuitka/tree/VariableClosure.py +5 -21
- nuitka/utils/Distributions.py +80 -11
- nuitka/utils/Download.py +38 -31
- nuitka/utils/Execution.py +13 -2
- nuitka/utils/FileOperations.py +55 -28
- nuitka/utils/Images.py +6 -1
- nuitka/utils/Importing.py +1 -1
- nuitka/utils/ModuleNames.py +11 -5
- nuitka/utils/ReExecute.py +17 -13
- nuitka/utils/SharedLibraries.py +32 -8
- nuitka/utils/Signing.py +3 -1
- nuitka/utils/StaticLibraries.py +51 -41
- nuitka/utils/Timing.py +1 -1
- nuitka/utils/Utils.py +29 -7
- /Nuitka_winsvc-2.3.11.data/scripts/nuitka.bat → /Nuitka_winsvc-2.4.5.data/scripts/nuitka.cmd +0 -0
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/top_level.txt +0 -0
nuitka/nodes/NodeBases.py
CHANGED
|
@@ -319,8 +319,9 @@ class NodeBase(NodeMetaClassBase):
|
|
|
319
319
|
# For overload by module nodes
|
|
320
320
|
return False
|
|
321
321
|
|
|
322
|
-
|
|
323
|
-
|
|
322
|
+
@staticmethod
|
|
323
|
+
def isExpressionBuiltin():
|
|
324
|
+
return False
|
|
324
325
|
|
|
325
326
|
@staticmethod
|
|
326
327
|
def isStatementAssignmentVariable():
|
nuitka/nodes/NodeMetaClasses.py
CHANGED
|
@@ -36,6 +36,16 @@ def _checkBases(name, bases):
|
|
|
36
36
|
raise NuitkaNodeDesignError(name, "All bases must set __slots__.", base)
|
|
37
37
|
|
|
38
38
|
|
|
39
|
+
@staticmethod
|
|
40
|
+
def returnTrueShared():
|
|
41
|
+
return True
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@staticmethod
|
|
45
|
+
def returnFalseShared():
|
|
46
|
+
return False
|
|
47
|
+
|
|
48
|
+
|
|
39
49
|
class NodeCheckMetaClass(ABCMeta):
|
|
40
50
|
kinds = {}
|
|
41
51
|
|
|
@@ -113,22 +123,28 @@ class NodeCheckMetaClass(ABCMeta):
|
|
|
113
123
|
|
|
114
124
|
# Automatically add checker methods for everything to the common
|
|
115
125
|
# base class
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
# TODO: How about making these two functions, one to statically
|
|
119
|
-
# return True and False, and put one in the base class, and one
|
|
120
|
-
# in the new class, would be slightly faster.
|
|
121
|
-
def checkKind(self):
|
|
122
|
-
return self.kind == kind
|
|
126
|
+
checker_method_name = "is" + kind_to_name_part
|
|
123
127
|
|
|
124
|
-
# Add automatic checker
|
|
128
|
+
# Add automatic checker "False" to the node base class.
|
|
125
129
|
from .NodeBases import NodeBase
|
|
126
130
|
|
|
127
|
-
if not hasattr(NodeBase,
|
|
128
|
-
setattr(NodeBase,
|
|
131
|
+
if not hasattr(NodeBase, checker_method_name):
|
|
132
|
+
setattr(NodeBase, checker_method_name, returnFalseShared)
|
|
129
133
|
|
|
130
134
|
ABCMeta.__init__(cls, name, bases, dictionary)
|
|
131
135
|
|
|
136
|
+
if not name.endswith(("Base", "Mixin")):
|
|
137
|
+
if kind.startswith("EXPRESSION_BUILTIN_"):
|
|
138
|
+
cls.isExpressionBuiltin = returnTrueShared
|
|
139
|
+
|
|
140
|
+
# Add automatic checker "True" to the node class.
|
|
141
|
+
if getattr(cls, checker_method_name) is returnFalseShared.__func__:
|
|
142
|
+
|
|
143
|
+
def checkKind(self):
|
|
144
|
+
return self.kind == kind
|
|
145
|
+
|
|
146
|
+
setattr(cls, checker_method_name, checkKind)
|
|
147
|
+
|
|
132
148
|
|
|
133
149
|
# For every node type, there is a test, and then some more members,
|
|
134
150
|
|
nuitka/nodes/ReturnNodes.py
CHANGED
|
@@ -10,18 +10,18 @@
|
|
|
10
10
|
|
|
11
11
|
WARNING, this code is GENERATED. Modify the template ChildrenHavingMixin.py.j2 instead!
|
|
12
12
|
|
|
13
|
-
spell-checker: ignore __prepare__ append args autograph
|
|
14
|
-
spell-checker: ignore
|
|
15
|
-
spell-checker: ignore
|
|
16
|
-
spell-checker: ignore
|
|
13
|
+
spell-checker: ignore __prepare__ append args autograph capitalize casefold center chars
|
|
14
|
+
spell-checker: ignore clear copy count decode default delete dist distribution_name encode
|
|
15
|
+
spell-checker: ignore encoding end endswith errors exit_code expandtabs
|
|
16
|
+
spell-checker: ignore experimental_attributes experimental_autograph_options
|
|
17
17
|
spell-checker: ignore experimental_compile experimental_follow_type_hints
|
|
18
|
-
spell-checker: ignore experimental_implements experimental_relax_shapes extend
|
|
19
|
-
spell-checker: ignore
|
|
20
|
-
spell-checker: ignore
|
|
21
|
-
spell-checker: ignore
|
|
22
|
-
spell-checker: ignore
|
|
23
|
-
spell-checker: ignore
|
|
24
|
-
spell-checker: ignore
|
|
18
|
+
spell-checker: ignore experimental_implements experimental_relax_shapes extend fillchar
|
|
19
|
+
spell-checker: ignore find format format_map formatmap fromkeys func get group handle
|
|
20
|
+
spell-checker: ignore has_key haskey index input_signature insert isalnum isalpha isascii
|
|
21
|
+
spell-checker: ignore isdecimal isdigit isidentifier islower isnumeric isprintable isspace
|
|
22
|
+
spell-checker: ignore istitle isupper item items iterable iteritems iterkeys itervalues
|
|
23
|
+
spell-checker: ignore jit_compile join keepends key keys kwargs ljust lower lstrip
|
|
24
|
+
spell-checker: ignore maketrans maxsplit mode name new old p package
|
|
25
25
|
spell-checker: ignore package_or_requirement pairs partition path pop popitem prefix
|
|
26
26
|
spell-checker: ignore prepare reduce_retracing remove replace resource resource_name
|
|
27
27
|
spell-checker: ignore reverse rfind rindex rjust rpartition rsplit rstrip s sep setdefault
|
nuitka/nodes/SubscriptNodes.py
CHANGED
|
@@ -161,13 +161,13 @@ class ExpressionMatchSubscriptCheck(
|
|
|
161
161
|
|
|
162
162
|
return result, tags, change_desc
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
if subscript.mayRaiseException(BaseException):
|
|
165
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
165
166
|
|
|
166
167
|
return self, None, None
|
|
167
168
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
return False
|
|
169
|
+
def mayRaiseException(self, exception_type):
|
|
170
|
+
return self.subnode_subscript.mayRaiseException(exception_type)
|
|
171
171
|
|
|
172
172
|
|
|
173
173
|
class ExpressionSubscriptLookupForUnpack(ExpressionSubscriptLookup):
|
nuitka/nodes/VariableRefNodes.py
CHANGED
|
@@ -318,6 +318,23 @@ Subscript del to dictionary lowered to dictionary del."""
|
|
|
318
318
|
Subscript look-up to dictionary lowered to dictionary look-up.""",
|
|
319
319
|
)
|
|
320
320
|
|
|
321
|
+
if subscript.isCompileTimeConstant():
|
|
322
|
+
attribute_node = self.variable_trace.getAttributeNode()
|
|
323
|
+
|
|
324
|
+
if attribute_node is not None:
|
|
325
|
+
# TODO: That could probably be one single question.
|
|
326
|
+
if (
|
|
327
|
+
attribute_node.isCompileTimeConstant()
|
|
328
|
+
and not attribute_node.isMutable()
|
|
329
|
+
):
|
|
330
|
+
return trace_collection.getCompileTimeComputationResult(
|
|
331
|
+
node=lookup_node,
|
|
332
|
+
computation=lambda: attribute_node.getCompileTimeConstant()[
|
|
333
|
+
subscript.getCompileTimeConstant()
|
|
334
|
+
],
|
|
335
|
+
description="Subscript of variable immutable value.",
|
|
336
|
+
)
|
|
337
|
+
|
|
321
338
|
# Any code could be run, note that.
|
|
322
339
|
trace_collection.onControlFlowEscape(self)
|
|
323
340
|
|
|
@@ -420,6 +437,15 @@ class ExpressionVariableRef(ExpressionVariableRefBase):
|
|
|
420
437
|
# could be decided from context.
|
|
421
438
|
trace_collection.onExceptionRaiseExit(BaseException)
|
|
422
439
|
|
|
440
|
+
very_trusted_node = self.variable_trace.getAttributeNodeVeryTrusted()
|
|
441
|
+
if very_trusted_node is not None:
|
|
442
|
+
return (
|
|
443
|
+
very_trusted_node.makeClone(),
|
|
444
|
+
"new_expression",
|
|
445
|
+
lambda: "Forward propagating value of %s from very trusted %s value."
|
|
446
|
+
% (self.getVariableName(), very_trusted_node.kind),
|
|
447
|
+
)
|
|
448
|
+
|
|
423
449
|
if variable.isModuleVariable() and (
|
|
424
450
|
variable.hasDefiniteWrites() is False or variable.getName() == "super"
|
|
425
451
|
):
|
|
@@ -494,7 +520,7 @@ Replaced read-only module attribute '__package__' with module attribute referenc
|
|
|
494
520
|
change_tags = "new_expression"
|
|
495
521
|
change_desc = """\
|
|
496
522
|
Replaced read-only module attribute '__loader__' with module attribute reference."""
|
|
497
|
-
elif variable_name == "__spec__" and python_version >=
|
|
523
|
+
elif variable_name == "__spec__" and python_version >= 0x300:
|
|
498
524
|
new_node = ExpressionModuleAttributeSpecRef(
|
|
499
525
|
variable=variable, source_ref=self.source_ref
|
|
500
526
|
)
|
|
@@ -586,7 +612,7 @@ Replaced read-only module attribute '__spec__' with module attribute reference."
|
|
|
586
612
|
return (
|
|
587
613
|
bool(attribute_node.getCompileTimeConstant()),
|
|
588
614
|
attribute_node.makeClone(),
|
|
589
|
-
"Using
|
|
615
|
+
"Using trusted constant's truth value.",
|
|
590
616
|
)
|
|
591
617
|
|
|
592
618
|
# TODO: This is probably only default stuff here, that could be compressed.
|
|
@@ -9,10 +9,9 @@ from the in-lined function.
|
|
|
9
9
|
|
|
10
10
|
from nuitka.nodes.OutlineNodes import ExpressionOutlineBody
|
|
11
11
|
from nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable
|
|
12
|
-
from nuitka.nodes.VariableReleaseNodes import makeStatementsReleaseVariables
|
|
13
12
|
from nuitka.tree.Operations import VisitorNoopMixin, visitTree
|
|
14
13
|
from nuitka.tree.ReformulationTryFinallyStatements import (
|
|
15
|
-
|
|
14
|
+
makeTryFinallyReleaseStatement,
|
|
16
15
|
)
|
|
17
16
|
from nuitka.tree.TreeHelpers import makeStatementsSequence
|
|
18
17
|
|
|
@@ -83,12 +82,10 @@ def convertFunctionCallToOutline(provider, function_body, values, call_source_re
|
|
|
83
82
|
|
|
84
83
|
# TODO: Not possible to auto release with outline bodies too?
|
|
85
84
|
if auto_releases:
|
|
86
|
-
body =
|
|
85
|
+
body = makeTryFinallyReleaseStatement(
|
|
87
86
|
provider=outline_body,
|
|
88
87
|
tried=body,
|
|
89
|
-
|
|
90
|
-
variables=auto_releases, source_ref=function_source_ref
|
|
91
|
-
),
|
|
88
|
+
variables=auto_releases,
|
|
92
89
|
source_ref=function_source_ref,
|
|
93
90
|
)
|
|
94
91
|
|
|
@@ -26,7 +26,7 @@ from nuitka.utils.Timing import TimerReport
|
|
|
26
26
|
from . import Graphs
|
|
27
27
|
from .BytecodeDemotion import demoteCompiledModuleToBytecode
|
|
28
28
|
from .Tags import TagSet
|
|
29
|
-
from .TraceCollections import withChangeIndicationsTo
|
|
29
|
+
from .TraceCollections import fetchMergeCounts, withChangeIndicationsTo
|
|
30
30
|
|
|
31
31
|
tag_set = None
|
|
32
32
|
|
|
@@ -68,7 +68,12 @@ def optimizeCompiledPythonModule(module):
|
|
|
68
68
|
# allow to continue the loop even without changes one more time.
|
|
69
69
|
unchanged_count = 0
|
|
70
70
|
|
|
71
|
+
# Count the micro passes, so we can see how often we looped
|
|
72
|
+
micro_pass = 0
|
|
73
|
+
|
|
71
74
|
while True:
|
|
75
|
+
micro_pass += 1
|
|
76
|
+
|
|
72
77
|
tag_set.clear()
|
|
73
78
|
|
|
74
79
|
try:
|
|
@@ -120,7 +125,7 @@ def optimizeCompiledPythonModule(module):
|
|
|
120
125
|
|
|
121
126
|
considerUsedModules(module=module, pass_count=pass_count)
|
|
122
127
|
|
|
123
|
-
return touched
|
|
128
|
+
return touched, micro_pass
|
|
124
129
|
|
|
125
130
|
|
|
126
131
|
def optimizeUncompiledPythonModule(module):
|
|
@@ -156,14 +161,12 @@ def optimizeModule(module):
|
|
|
156
161
|
|
|
157
162
|
if module.isPythonExtensionModule():
|
|
158
163
|
optimizeExtensionModule(module)
|
|
159
|
-
|
|
164
|
+
return False, 0
|
|
160
165
|
elif module.isCompiledPythonModule():
|
|
161
|
-
|
|
166
|
+
return optimizeCompiledPythonModule(module)
|
|
162
167
|
else:
|
|
163
168
|
optimizeUncompiledPythonModule(module)
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
return changed
|
|
169
|
+
return False, 0
|
|
167
170
|
|
|
168
171
|
|
|
169
172
|
pass_count = 0
|
|
@@ -250,8 +253,6 @@ def restoreFromXML(text):
|
|
|
250
253
|
def makeOptimizationPass():
|
|
251
254
|
"""Make a single pass for optimization, indication potential completion."""
|
|
252
255
|
|
|
253
|
-
# Controls complex optimization
|
|
254
|
-
|
|
255
256
|
finished = True
|
|
256
257
|
|
|
257
258
|
ModuleRegistry.startTraversal()
|
|
@@ -284,14 +285,14 @@ def makeOptimizationPass():
|
|
|
284
285
|
with TimerReport(
|
|
285
286
|
message="Optimizing %s" % module_name, decider=False
|
|
286
287
|
) as module_timer:
|
|
287
|
-
changed = optimizeModule(current_module)
|
|
288
|
-
|
|
289
|
-
# module_timer=module_time_report.getTimer()
|
|
288
|
+
changed, micro_passes = optimizeModule(current_module)
|
|
290
289
|
|
|
291
290
|
ModuleRegistry.addModuleOptimizationTimeInformation(
|
|
292
291
|
module_name=module_name,
|
|
293
292
|
pass_number=pass_count,
|
|
294
293
|
time_used=module_timer.getDelta(),
|
|
294
|
+
micro_passes=micro_passes,
|
|
295
|
+
merge_counts=fetchMergeCounts(),
|
|
295
296
|
)
|
|
296
297
|
|
|
297
298
|
_traceProgressModuleEnd(current_module)
|
|
@@ -51,6 +51,16 @@ from .ValueTraces import (
|
|
|
51
51
|
ValueTraceUnknown,
|
|
52
52
|
)
|
|
53
53
|
|
|
54
|
+
# Keeping trace of how often branches are merged between calls
|
|
55
|
+
_merge_counts = defaultdict(int)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def fetchMergeCounts():
|
|
59
|
+
result = dict(_merge_counts)
|
|
60
|
+
_merge_counts.clear()
|
|
61
|
+
return result
|
|
62
|
+
|
|
63
|
+
|
|
54
64
|
signalChange = None
|
|
55
65
|
|
|
56
66
|
|
|
@@ -189,10 +199,10 @@ class CollectionStartPointMixin(CollectionUpdateMixin):
|
|
|
189
199
|
|
|
190
200
|
# TODO: We might want to track per exception, pylint: disable=unused-argument
|
|
191
201
|
|
|
192
|
-
if collection is None:
|
|
193
|
-
collection = self
|
|
194
|
-
|
|
195
202
|
if self.exception_collections is not None:
|
|
203
|
+
if collection is None:
|
|
204
|
+
collection = self
|
|
205
|
+
|
|
196
206
|
self.exception_collections.append(
|
|
197
207
|
TraceCollectionBranch(parent=collection, name="exception")
|
|
198
208
|
)
|
|
@@ -754,6 +764,8 @@ class TraceCollectionBase(object):
|
|
|
754
764
|
collection1 = collection_yes
|
|
755
765
|
collection2 = collection_no
|
|
756
766
|
|
|
767
|
+
_merge_counts[2] += 1
|
|
768
|
+
|
|
757
769
|
variable_versions = {}
|
|
758
770
|
|
|
759
771
|
for variable, version in iterItems(collection1.variable_actives):
|
|
@@ -816,7 +828,8 @@ class TraceCollectionBase(object):
|
|
|
816
828
|
elif merge_size == 2:
|
|
817
829
|
return self.mergeBranches(*collections)
|
|
818
830
|
|
|
819
|
-
|
|
831
|
+
_merge_counts[len(collections)] += 1
|
|
832
|
+
|
|
820
833
|
with TimerReport(
|
|
821
834
|
message="Running merge for %s took %%.2f seconds" % collections,
|
|
822
835
|
decider=False,
|
|
@@ -874,6 +887,8 @@ class TraceCollectionBase(object):
|
|
|
874
887
|
self.variable_actives.update(collection_replace.variable_actives)
|
|
875
888
|
collection_replace.variable_actives = None
|
|
876
889
|
|
|
890
|
+
_merge_counts[1] += 1
|
|
891
|
+
|
|
877
892
|
def onLoopBreak(self, collection=None):
|
|
878
893
|
if collection is None:
|
|
879
894
|
collection = self
|