Commit Graph

28 Commits

Author SHA1 Message Date
Kay Hayen
b4e603ab7c Optimization: Faster variable trace maintenance
* We now trace variables in trace collection as a dictionary
  per variable with a dictionary of the versions, this is
  closer to out frequent usage per variable.

* That makes it a lot easier to update variables after the
  tracing is finished to know their users and writers.

* Requires a lot less work, but also makes work less memory
  local such that the performance gain is relatively small
  despite less work being done.

* Also avoids that a set for the users is to be maintained.
2025-11-26 11:19:43 +00:00
Kay Hayen
718ab60539 Bump copyright year 2025-04-28 11:04:36 +02:00
Kay Hayen
78caa6a6a2 Debugging: Make sure there are no duplicates names for internal helpers 2024-12-18 11:08:18 +01:00
Kay Hayen
5f5062942b Optimization: Avoid changing code names for complex call helpers
* The numbering of function causes issues when code
  is used from cache, because then unused helpers
  never come to exist.

* This avoids a re-compilation for some modules the
  second time around a compilation happens and not
  all complex helpers are added at all.
2024-12-18 10:54:59 +01:00
Kay Hayen
695d23ca76 Quality: Updated to latest version of black
* Many improvements, esp. for the ternary expressions
  that are frequently used, they are now formatted
  much better.
2024-12-18 10:51:12 +01:00
Kay Hayen
f34f8d0c63 Bump copyright year
* Also split copyright notices between the top and bottom,
  such that readability of just opened files is not harmed
  by license text.
2024-12-18 10:48:16 +01:00
Kay Hayen
fa2928b4d1 Cleanup: Spelling improvements found by codespell 2024-12-18 10:35:19 +01:00
Kay Hayen
909d41f02d Bump copyright year 2023-06-02 15:07:22 +02:00
Kay Hayen
4cfdd9f9c0 Bump copyright year 2022-05-23 10:28:11 +02:00
Kay Hayen
a76e012e8d Optimization: Make sure to only optimize internal helpers once
* Also optimize them repeatedly, so they are immediately complete.
2021-02-24 19:56:39 +01:00
Kay Hayen
e43b72e087 Bump copyright year to 2021. 2021-01-22 09:58:00 +01:00
Kay Hayen
1dc1519b7b Fix, was memory leaking arguments of all helper functions. 2020-11-04 08:32:07 +01:00
Kay Hayen
8dd8ed93c6 Quality: Updated to latest versions of black and isort 2020-11-02 18:43:05 +01:00
Kay Hayen
9521d9a93f Fix, locals scope needs to be attached to usage and loop optimization
could hang

* The locals could refer to the wrong scope if it is not attached at
  creation time, which it now is.

* To get to the optimization, variable references for builtin names
  have the scope attached just in case they later use it, this has
  a dedicated node to save the attribute for the general case.

* Also for Optimization, prepare inlining of helper function bodies,
  with local scopes, this should now be easy to accomplish later.

* For loops, we were not considering the initial trace state reliably,
  esp. not if it was an uninit trace, which has been fixed.

* Compare traces instead of type shapes to decide if we stablized in
  a loop analysis, that is more telling and faster to do.

* More correct annotation of trace escaping, doing away with loop usage
  and potential usage.

* Make sure construct the type shapes with alternatives in place, so
  we don't have do unmerge them later in code that uses the set of
  shapes for a trace or variable.
2020-11-02 18:41:53 +01:00
Kay Hayen
d7f4e33098 Optimization: Refactor constant code generation heavily
* Constants are now externally processed and accessed via per-module constant indexes.

* Added dedicated binary for merging constant values from all modules.

* Make sure built-in dictionaries are sorted so their position can be used for reference.

* Removed special internal module and made it normal with automatic parameter variable
  releases.

* Built-in loopup helpers now use strings instead of premade strings. This allows to use
  them for constant creation too.

* Global constants are no longer special and are created in the same way, referenced with
  defines that are indexes to global constants array.

* Freezer and meta path based importer now share their data by using the same stream
  and are in the same files.
2020-07-24 00:53:59 +02:00
Kay Hayen
b2083575cf Bump copyright year to 2020. 2020-02-01 07:42:45 +01:00
Kay Hayen
c6f442b7e0 Optimization: Add auto_release variables to function details
* This wasn't done previously and will otherwise break XML storage
  by loosing this information.

* Also use "None" for no flags, to save creating a set object without
  need.
2019-09-18 18:03:37 +02:00
Kay Hayen
f3752e381d Quality: Reformated code to black
* Autoformat currently only sorts pylint disable comments, and does
  not call black yet.

* This also adds a few doc strings that I failed to keep separate as a
  commit, but who cares.
2019-02-13 16:27:25 +01:00
Kay Hayen
47c99d377e Bump copyright year to 2019. 2019-01-24 16:28:13 +01:00
luz.paz
551e7a5444 Fix misc. typos
Found via `codespell -q 3 --skip="./nuitka/build/inline_copy,./tests"`
2018-10-03 10:30:51 +02:00
Kay Hayen
47524b7618 Goto Generators: More refactorings towards heap usage
* Make raising codes work as well with variable descriptions instead
  of hard coded variable names.

* Instead of preserving the code object in the generator making, we
  attach it to all kinds of functions and provide a simple C function
  to create generators. This makes that code ligher too. We now would
  need to know even more information, e.g. the heap storage size, that
  we do not have there.

* For internal helper functions, we now have a factory function that
  does the always same details, e.g. inernal module, and now having
  no code object, so things are less verbose.

* Add argument for heap size to generator, coroutine, asyncgen creation
  and have a member pointer "heap_storage" to the space and use it for
  heap storage.
2018-08-10 12:14:41 +02:00
Kay Hayen
3957ee8628 Updated copyright year to 2018. 2018-04-30 09:46:54 +02:00
Kay Hayen
064df32ff0 Updated copyright year to 2017. 2017-01-09 07:25:38 +01:00
Kay Hayen
3de6dea658 Minor cleanups 2017-01-07 12:24:39 +01:00
Kay Hayen
7aaa9bdda7 Persistence: Get rid of variable registry.
* Now global variable traces are attached to be variable itself, no
  need to look up traces from anywhere else.

* This probably fixes a couple of bugs that were caused by the two
  views of variable information and traces not being consistent at
  all times.

* This gives a correct view on more variables sooner, giving a better
  chance to fast optimization.

* Saves 0.5% memory for large compilations. Not much at this time,
  but should make it possible to unload modules no more needed.
2016-08-08 08:21:46 +02:00
Kay Hayen
72ac16cfd9 Updated copyright year to 2016 2016-01-04 09:34:48 +01:00
Kay Hayen
f750157ac1 Minor cleanups
* Moved internal module source ref to its module, so it can be reused
  by future users.

* Style cleanups
2015-10-24 07:40:51 +02:00
Kay Hayen
b49e5f8c16 Major refactoring and cleanups
* Unified try node used to re-formulation both try/finally and try/except
  nodes.

* Much improved SSA for loop exits and try exits, this will lead to much
  better SSA results. In case of try/finally statements, this is now even
  much more correct too.

* Duplicating final blocks nodes, implemented by generic cloning via a
  new method that calls the constructor with childrent and details. This
  required many modifications to make them unified.

* The exception line number is no longer taken from the frame, but has
  its own storage.

* Making more use of unwanted non-abort checks in code generation.

* Detach frames only when they are in fact used for an exception traceback.

* Also added support for values trailing a star assignment. This is allowed
  in Python3, and so far was ignored. As were syntax errors with double
  star usages, also Python3 only.

* Many code generation functions were moved to dedicated modules, using the
  expression registry more often.

* Finalization needs to no longer care about try statements, and they do not
  have a flag to indicate exception publication. This is all now done in a
  consistent way.

* Target updates in context now return the old value consistently, so it's
  easier to update them.

* The "internal" module handling also got its own dedicated module to
  manage itself.

* More whitelisting for CPython3.x test suites with Python2.

* Distributed remaining code and uses of "nuitka.codegen.Generator" to
  modules.

* Stop having a unified "nuitka.codegen.CodeTemplates" and import from
  the respective templates module directly. Also split up more according
  to the desired topic more often.

* The code generation of "or"/"and" nodes was leaking references, and
  potentially even loosing references, and therefore corrupting. Too
  old to rebase though.
2015-07-16 07:39:32 +02:00