Skip to content

Commit ba34a49

Browse files
committed
Docs fixup
1 parent b6393e0 commit ba34a49

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

base/loading.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,7 @@ function _include_from_serialized(pkg::PkgId, path::String, ocachepath::Union{No
12961296

12971297
for M in restored
12981298
M = M::Module
1299-
if parentmodule(M) === M && PkgId(M) == pkg
1299+
if is_root_module(M) && PkgId(M) == pkg
13001300
register && register_root_module(M)
13011301
if timing_imports
13021302
elapsed_time = time_ns() - t_before

base/runtime_internals.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Base
2020
"""
2121
parentmodule(m::Module) = (@_total_meta; ccall(:jl_module_parent, Ref{Module}, (Any,), m))
2222

23-
is_root_module(m::Module) = parentmodule(m) === m || (isdefined(Main, :Base) && m === Main.Base)
23+
is_root_module(m::Module) = parentmodule(m) === m || m === Compiler || (isdefined(Main, :Base) && m === Main.Base)
2424

2525
"""
2626
moduleroot(m::Module) -> Module

doc/src/devdocs/EscapeAnalysis.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# `EscapeAnalysis`
22

3-
`Core.Compiler.EscapeAnalysis` is a compiler utility module that aims to analyze
3+
`Compiler.EscapeAnalysis` is a compiler utility module that aims to analyze
44
escape information of [Julia's SSA-form IR](@ref Julia-SSA-form-IR) a.k.a. `IRCode`.
55

66
This escape analysis aims to:
@@ -59,7 +59,7 @@ The symbols on the side of each call argument and SSA statements represent the f
5959
- `` (green or cyan): this value never escapes (`has_no_escape(result.state[x])` holds), colored blue if it has arg escape also (`has_arg_escape(result.state[x])` holds)
6060
- `` (blue or yellow): this value can escape to the caller via return (`has_return_escape(result.state[x])` holds), colored yellow if it has unhandled thrown escape also (`has_thrown_escape(result.state[x])` holds)
6161
- `X` (red): this value can escape to somewhere the escape analysis can't reason about like escapes to a global memory (`has_all_escape(result.state[x])` holds)
62-
- `*` (bold): this value's escape state is between the `ReturnEscape` and `AllEscape` in the partial order of [`EscapeInfo`](@ref Core.Compiler.EscapeAnalysis.EscapeInfo), colored yellow if it has unhandled thrown escape also (`has_thrown_escape(result.state[x])` holds)
62+
- `*` (bold): this value's escape state is between the `ReturnEscape` and `AllEscape` in the partial order of [`EscapeInfo`](@ref Base.Compiler.EscapeAnalysis.EscapeInfo), colored yellow if it has unhandled thrown escape also (`has_thrown_escape(result.state[x])` holds)
6363
- ``: this value has additional object field / array element information in its `AliasInfo` property
6464

6565
Escape information of each call argument and SSA value can be inspected programmatically as like:
@@ -74,7 +74,7 @@ result.state[Core.SSAValue(3)] # get EscapeInfo of `r3`
7474
### Lattice Design
7575

7676
`EscapeAnalysis` is implemented as a [data-flow analysis](https://en.wikipedia.org/wiki/Data-flow_analysis)
77-
that works on a lattice of [`x::EscapeInfo`](@ref Core.Compiler.EscapeAnalysis.EscapeInfo),
77+
that works on a lattice of [`x::EscapeInfo`](@ref Base.Compiler.EscapeAnalysis.EscapeInfo),
7878
which is composed of the following properties:
7979
- `x.Analyzed::Bool`: not formally part of the lattice, only indicates `x` has not been analyzed or not
8080
- `x.ReturnEscape::BitSet`: records SSA statements where `x` can escape to the caller via return
@@ -366,9 +366,9 @@ More interestingly, it is also valid to use `IPO EA` escape information for type
366366
e.g., inference accuracy can be improved by forming `Const`/`PartialStruct`/`MustAlias` of mutable object.
367367

368368
```@docs
369-
Core.Compiler.EscapeAnalysis.analyze_escapes
370-
Core.Compiler.EscapeAnalysis.EscapeState
371-
Core.Compiler.EscapeAnalysis.EscapeInfo
369+
Base.Compiler.EscapeAnalysis.analyze_escapes
370+
Base.Compiler.EscapeAnalysis.EscapeState
371+
Base.Compiler.EscapeAnalysis.EscapeInfo
372372
```
373373

374374
--------------------------------------------------------------------------------------------

stdlib/Compiler/src/Compiler.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ else
2525
# Needs to match UUID defined in Project.toml
2626
ccall(:jl_set_module_uuid, Cvoid, (Any, NTuple{2, UInt64}), Compiler,
2727
(0x807dbc54_b67e_4c79, 0x8afb_eafe4df6f2e1))
28-
ccall(:jl_set_module_parent, Cvoid, (Any, Any), Compiler, Compiler)
2928

3029
# The interactive reflection utilities (`code_`, etc.) look for this symbol
3130
# in Main and if present use that Compiler instead of the builtin one. By

stdlib/REPL/src/REPLCompletions.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ module REPLCompletions
55
export completions, shell_completions, bslash_completions, completion_text
66

77
using Core: Const
8+
# We want to insulate the REPLCompletion module from any changes the user may
9+
# make to the compiler, since it runs by default and the system becomes unusable
10+
# if it breaks.
811
const CC = Base.Compiler
912
using Base.Meta
1013
using Base: propertynames, something, IdSet

0 commit comments

Comments
 (0)