Commit Graph

22 Commits

Author SHA1 Message Date
David Nadlinger 08eea09d44 compiler: Catch escaping numpy.{array, full, transpose}() results
Function calls in general can still be used to hide escaping
allocations from the compiler (issue #1497), but these calls in
particular always allocate, so we can easily and accurately handle
them.
2023-10-09 09:00:26 +08:00
David Nadlinger d37503f21d compiler: T{C -> External}Function, clarify docs [nfc] 2020-08-09 03:54:41 +01:00
David Nadlinger 4426e4144f compiler: Implement unary plus/minus for arrays
Implementation is needlessly generic to anticipate
coercion/transcendental functions.
2020-08-09 03:54:41 +01:00
David Nadlinger ae999db8f6 compiler: Revert function call lifetime tracking fix
This reverts commits f8d1506922
and cf19c9512d.

While the commit just fixes a clear typo in the implementation,
it turns out the original algorithm isn't flexible enough to
capture functions that transitively return references to
long-lived data. For instance, while cache_get() is special-cased
in the compiler to be recognised as returning a value of Global()
lifetime, a function just forwarding to it (as seen in the
embedding tests) isn't anymore.

A separate issue is also that this makes implementing functions
that take lists and return references to global data in user code
impossible, which central parts of the Oxford codebase rely on.

Just reverting for now to unblock master; a fix is easily designed,
but needs testing.
2020-07-30 16:40:39 +01:00
David Nadlinger f8d1506922 compiler: Fix lifetime tracking for function call return values
GitHub: Fixes #1497.
2020-07-28 00:33:28 +01:00
David Nadlinger 88fd5c8440 compiler: Fix crash in escape analysis for assigning string literals 2019-03-31 17:10:27 +01:00
whitequark ca254ec55e compiler: disallow op= on mutable lists only (fix #835).
This only really applies to lists since those use fat pointers.
`x.y += z` is fine.
2017-10-02 07:21:14 +00:00
whitequark e59b301a3b compiler: disallow op= on mutable values (fix #835).
In general, we can't reallocate a value in earlier stack frames,
or fixup references to it. This mainly impacts lists.
2017-10-02 01:55:26 +00:00
whitequark 1a518ea7eb compiler.embedding: implement string concatenation.
Fixes #526.
2016-08-08 04:05:52 +00:00
whitequark 186a564ba8 compiler: make quoted functions independent of outer environment. 2016-03-26 20:46:45 +00:00
whitequark ac5061c205 validators.escape: track region of arguments.
Fixes #232.
2016-03-18 03:08:14 +00:00
whitequark 211af77e77 validators.escape: cache_get result lives forever. 2016-01-10 14:43:21 +00:00
whitequark 25e2824709 validators.escape: infer correct region for arguments. 2015-12-30 16:19:35 +08:00
whitequark 35acc33ef6 validators.escape: don't fail on quoted values in lhs. 2015-12-16 13:57:02 +08:00
whitequark e755e1ba9e validators.escape: support arrays in multiple assignment. 2015-12-14 16:31:03 +08:00
whitequark 51c591f01a Unbreak tests. 2015-08-18 22:44:09 -07:00
whitequark 00efc8c636 Implement class definitions and class attribute access. 2015-08-15 09:45:16 -04:00
whitequark ece52062f2 Implement code generation for exception handling. 2015-07-25 05:37:37 +03:00
whitequark f2a6110cc4 Add integration tests for every language construct. 2015-07-22 18:34:52 +03:00
whitequark 49ece6a12a Add support for string literals. 2015-07-21 14:27:48 +03:00
whitequark 16432d2652 Implement escape analysis. 2015-07-04 04:16:37 +03:00
whitequark bfabca494b Remove regions from types.
Unification-based inference for regions is useful with a language
that has let bindings (which would propagate the regions) and
functions polymorphic over regions. For reasons of simplicity,
ARTIQ has neither, and making unification-based inference work would
essentially mean adding region coercions between most AST nodes,
and having every source subexpression have its own region variable,
with the appropriate subtyping relationship.

It's simpler to just keep that state outside of typedtree.
2015-07-02 22:55:12 +03:00