Skip to content

Commit

Permalink
[devdocs] update AST.md#CodeInfo descriptions (JuliaLang#43382)
Browse files Browse the repository at this point in the history
Co-authored-by: Shuhei Kadowaki <[email protected]>
  • Loading branch information
inkydragon and aviatesk committed May 9, 2022
1 parent acea75b commit 177bf28
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions doc/src/devdocs/ast.md
Original file line number Diff line number Diff line change
Expand Up @@ -699,11 +699,13 @@ A (usually temporary) container for holding lowered source code.

Statement-level flags for each expression in the function. Many of these are reserved, but not yet implemented:

* 0 = inbounds
* 1,2 = <reserved> inlinehint,always-inline,noinline
* 3 = <reserved> strict-ieee (strictfp)
* 4-6 = <unused>
* 7 = <reserved> has out-of-band info
* 0x01 << 0 = statement is marked as `@inbounds`
* 0x01 << 1 = statement is marked as `@inline`
* 0x01 << 2 = statement is marked as `@noinline`
* 0x01 << 3 = statement is within a block that leads to `throw` call
* 0x01 << 4 = statement may be removed if its result is unused, in particular it is thus be both pure and effect free
* 0x01 << 5-6 = <unused>
* 0x01 << 7 = <reserved> has out-of-band info

* `linetable`

Expand Down Expand Up @@ -733,6 +735,10 @@ Optional Fields:

The `MethodInstance` that "owns" this object (if applicable).

* `edges`

Forward edges to method instances that must be invalidated.

* `min_world`/`max_world`

The range of world ages for which this code was valid at the time when it had been inferred.
Expand All @@ -757,3 +763,23 @@ Boolean properties:

Whether this is known to be a pure function of its arguments, without respect to the
state of the method caches or other mutable global state.


`UInt8` settings:

* `constprop`

* 0 = use heuristic
* 1 = aggressive
* 2 = none

* `purity`
Constructed from 5 bit flags:

* 0x01 << 0 = this method is guaranteed to return or terminate consistently (`:consistent`)
* 0x01 << 1 = this method is free from externally semantically visible side effects (`:effect_free`)
* 0x01 << 2 = this method is guaranteed to not throw an exception (`:nothrow`)
* 0x01 << 3 = this method is guaranteed to terminate (`:terminates_globally`)
* 0x01 << 4 = the syntactic control flow within this method is guaranteed to terminate (`:terminates_locally`)

See the documentation of `Base.@assume_effects` for more details.

0 comments on commit 177bf28

Please sign in to comment.