Revision 20a3e85388c5a20f5dfcf3798c0a6d96c62ed379 authored by Shuhei Kadowaki on 10 January 2022, 10:24:26 UTC, committed by Shuhei Kadowaki on 10 January 2022, 13:11:51 UTC
This commit changes the semantics of `BoundsError` so that it doesn't capture arrays/tuples passed to its constructor. The change wouldn't improve any performance by itself because the `BoundsError` constructor is mostly called on error paths and thus it is opaque to analyses/optimizers when compiling a caller context. Rather it's supposed to be a building block for broadening the possibility of certain memory optimizations in the future such as copy elision for `ImmutableArray` construction and stack allocation of `Array`s, by allowing us to assume the invariant that primitive indexing operations into array/tuple indexing don't escape it so that our escape analyses can achieve further accuracy. Specifically, when `BoundsError` constructor will now compute the "summary" of its `Array`/`Tuple` argument, rather than capturing it for the later inspection. Assuming `Base.summary(x::Array)` or `Base.summary(x::Tuple)` don't escape `x`, we can assume that `BoundsError` doesn't escape `x`. This change won't appear as breaking in most cases since `showerror` will print the exact same error message as before, but obviously this is technically breaking since we can no longer access to the original arrays/tuples by catching `BoundsError`. I'd say this breaking semantic change would be still acceptable, since I think it's enough if we can know size/type of arrays/tuples from `BoundsError` in most cases. As a last note, I didn't change the semantics for arbitrary user objects, since we still don't have a good infrastructure to tell the compiler some primitive assumptions/rules about user type objects anyway.
1 parent dbd10e0
File | Mode | Size |
---|---|---|
Artifacts | ||
Base64 | ||
CRC32c | ||
CompilerSupportLibraries_jll | ||
Dates | ||
DelimitedFiles | ||
Distributed | ||
FileWatching | ||
Future | ||
GMP_jll | ||
InteractiveUtils | ||
LLVMLibUnwind_jll | ||
LazyArtifacts | ||
LibCURL_jll | ||
LibGit2 | ||
LibGit2_jll | ||
LibSSH2_jll | ||
LibUV_jll | ||
LibUnwind_jll | ||
Libdl | ||
LinearAlgebra | ||
Logging | ||
MPFR_jll | ||
Markdown | ||
MbedTLS_jll | ||
Mmap | ||
MozillaCACerts_jll | ||
OpenBLAS_jll | ||
OpenLibm_jll | ||
PCRE2_jll | ||
Printf | ||
Profile | ||
REPL | ||
Random | ||
Serialization | ||
SharedArrays | ||
Sockets | ||
SparseArrays | ||
SuiteSparse_jll | ||
TOML | ||
Test | ||
UUIDs | ||
Unicode | ||
Zlib_jll | ||
dSFMT_jll | ||
libLLVM_jll | ||
libblastrampoline_jll | ||
nghttp2_jll | ||
p7zip_jll | ||
.gitignore | -rw-r--r-- | 245 bytes |
ArgTools.version | -rw-r--r-- | 224 bytes |
Downloads.version | -rw-r--r-- | 234 bytes |
LibCURL.version | -rw-r--r-- | 220 bytes |
Makefile | -rw-r--r-- | 3.0 KB |
NetworkOptions.version | -rw-r--r-- | 264 bytes |
Pkg.version | -rw-r--r-- | 198 bytes |
SHA.version | -rw-r--r-- | 202 bytes |
Statistics.version | -rw-r--r-- | 240 bytes |
SuiteSparse.version | -rw-r--r-- | 246 bytes |
Tar.version | -rw-r--r-- | 194 bytes |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...