Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make :enter a proper node type #52300

Merged
merged 1 commit into from
Nov 26, 2023
Merged

Make :enter a proper node type #52300

merged 1 commit into from
Nov 26, 2023

Conversation

Keno
Copy link
Member

@Keno Keno commented Nov 25, 2023

This is a prepratory commit in anticipation of giving :enter additional responsibilities of entering and restoring dynamic scopes for ScopedValue (c.f. #51352). This commit simply turns :enter into its own node type (like the other terminators). The changes are largely mechanical from the Expr version, but will make it easier to add additional semantics in a follow up PR.

@@ -965,4 +966,7 @@ arraysize(a::Array) = a.size
arraysize(a::Array, i::Int) = sle_int(i, nfields(a.size)) ? getfield(a.size, i) : 1
export arrayref, arrayset, arraysize, const_arrayref

# For convenience
EnterNode(old::EnterNode, new_dest::Int) = EnterNode(new_dest)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method probably looks confusing here, but it helps minimize the diff when extra fields are added to EnterNode, because a lot of places just need to rename the dest without touching the rest of the fields.

This is a prepratory commit in anticipation of giving :enter additional
responsibilities of entering and restoring dynamic scopes for ScopedValue
(c.f. #51352). This commit simply turns `:enter` into its own node type
(like the other terminators). The changes are largely mechanical from
the `Expr` version, but will make it easier to add additional semantics
in a follow up PR.
@@ -2,7 +2,7 @@

Core.PhiNode() = Core.PhiNode(Int32[], Any[])

isterminator(@nospecialize(stmt)) = isa(stmt, GotoNode) || isa(stmt, GotoIfNot) || isa(stmt, ReturnNode)
isterminator(@nospecialize(stmt)) = isa(stmt, GotoNode) || isa(stmt, GotoIfNot) || isa(stmt, ReturnNode) || isa(stmt, EnterNode)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also add isa(stmt, Expr) && stmt.head === :leave?

Leave seems to also be a terminator, but is inconsistently handled.
An an example below we have is_terminator_or_phi = (isa(stmt, PhiNode) || isterminator(stmt)).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:leave is not a terminator. You can have other things in the same BB

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then the comment in L71 is wrong.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is indeed inconsistent - I'm not sure why we did that, but I suspect we can probably remove that code.

@Keno
Copy link
Member Author

Keno commented Nov 26, 2023

Since this is approved and I have more work on top of this, I'm planning to merge this fairly soon. That said, I recognize this happened over Thanksgiving/weekend, so if there's any more post-commit review, I'll take that in a separate PR.

@Keno Keno merged commit c30d45d into master Nov 26, 2023
7 checks passed
@Keno Keno deleted the kf/enternode branch November 26, 2023 16:05
aviatesk added a commit to JuliaDebug/JuliaInterpreter.jl that referenced this pull request Nov 28, 2023
I don't expect this commit to fix the CI on 🔥, but since these
changes are straightforward, we should be able to go ahead and merge
this as is.
aviatesk added a commit to JuliaDebug/JuliaInterpreter.jl that referenced this pull request Nov 28, 2023
I don't expect this commit to fix the CI on 🔥, but since these
changes are straightforward, we should be able to go ahead and merge
this as is.
aviatesk added a commit to JuliaDebug/JuliaInterpreter.jl that referenced this pull request Nov 28, 2023
I don't expect this commit to fix the CI on 🔥, but since these
changes are straightforward, we should be able to go ahead and merge
this as is.
Pangoraw added a commit to Pangoraw/IRTools.jl that referenced this pull request Nov 29, 2023
the EnterNode struct was added in JuliaLang/julia#52300
This commit adds support for ingesting and exporting CodeInfo with EnterNode
but still uses `Expr(:enter)` inside IRTools IR. We may want to switch
the representation to `IRTools.EnterNode` similarly to `IRTools.Slot` if
more fields are added to the `Core.EnterNode` struct.
Pangoraw added a commit to Pangoraw/IRTools.jl that referenced this pull request Dec 4, 2023
the EnterNode struct was added in JuliaLang/julia#52300
This commit adds support for ingesting and exporting CodeInfo with EnterNode
but still uses `Expr(:enter)` inside IRTools IR. We may want to switch
the representation to `IRTools.EnterNode` similarly to `IRTools.Slot` if
more fields are added to the `Core.EnterNode` struct.
Pangoraw added a commit to Pangoraw/IRTools.jl that referenced this pull request Dec 4, 2023
the EnterNode struct was added in JuliaLang/julia#52300
This commit adds support for ingesting and exporting CodeInfo with EnterNode
but still uses `Expr(:enter)` inside IRTools IR. We may want to switch
the representation to `IRTools.EnterNode` similarly to `IRTools.Slot` if
more fields are added to the `Core.EnterNode` struct.
mkitti pushed a commit to mkitti/julia that referenced this pull request Dec 9, 2023
This is a prepratory commit in anticipation of giving :enter additional
responsibilities of entering and restoring dynamic scopes for
ScopedValue (c.f. JuliaLang#51352). This commit simply turns `:enter` into its
own node type (like the other terminators). The changes are largely
mechanical from the `Expr` version, but will make it easier to add
additional semantics in a follow up PR.
davidanthoff added a commit to julia-vscode/TestItemRunner2.jl that referenced this pull request Jul 4, 2024
96ed09c version 0.9.32
0a8da3a minimum adjustments to make JuliaInterpreter work with v1.12 (#631)
397ea70 `public` as an identifier is deprecated (#612)
ce6e341 update builtins.jl (#628)
1024848 Merge pull request #629 from JuliaDebug/avi/54678
5700dcc adjustments to JuliaLang/julia#54428
ea522b8 adjustments to JuliaLang/julia#54678
eae3b4c Some more 1.12 compat (#625)
fc4aeca version 0.9.31
a265c14 [incomplete] changes needed to adapt to compressed line table format in Julia (#606)
31253a0 version 0.9.30
1b1b6d6 adjustments for Julia v1.11 (#615)
8043dbc add support for preset `current_scope` (#619)
55e33d0 use child `@testset` to get nicer test summary (#618)
e0e34be adapt to implicit leave change in Julia (#614)
f7138f9 v0.9.29
82b1552 Adjust to upcoming compiler change (#611)
011edf9 improve test code
78f766b minor improvements
713c768 implement support for `current_scope` (#605)
580b95c version 0.9.28
d7d4ced Fix revise#718 (#609)
0089e4b update docs and convert `jldoctest` to `@repl` blocks (#607)
d319168 Remove buggy linearization pass (#604)
1efae18 remove `AbstractFrameInstance` (#608)
0138e60 update CI.yml
6b1c476 version 0.9.27
ce20820 adjust to the `:enter` IR changes made in JuliaLang/julia#52300 (#599)
9afdf71 follow up #596 (#600)
9d50726 adapt to array changes in Julia base (#596)
68fa8be NFC: harden some internal ccalls (#595)
ccc1c95 remove old compats (#598)
15ad1c7 set CI timeout (#597)
7beca92 version 0.9.26
a0d0d33 Adjust to upcoming julia lowering change (#592)
a3cf18e Add a second link to the docs from the README (#589)
6da0b26 version 0.9.25
c8d1ef7 adjust to JuliaLang/julia#50943 (#585)
c93dedf adjust tests for latest Julia master (#584)
910cb6f Align arguments number in breakpoints hook docstring (#583)
7849d4a Bump actions/checkout from 2 to 3 (#576)
0169df2 Version 0.9.24
14e454b Ignore `:aliasscope` and `:popaliasscope` (#581)
3ab2674 Bump codecov/codecov-action from 1 to 3 (#577)
cc1bace Bump actions/cache from 1 to 3 (#578)
1d87867 Update some failing doctests (#579)
43f2041 enable dependabot for GitHub actions (#575)
aefaa30 use an explicit Any comprehension (#572)
475512b Version 0.9.23
8fecf35 Fix kw pattern matching, other changes on 1.9+ (#568)
cf7f437 also test on 1.9
57dbc98 version 0.9.22
d7a3dd4 fixup
b4d133d adjust to JuliaLang/julia#48693 (#566)
9026819 fix test on nightly (#564)
9c5454c Protect `error` calls from invalidation (#565)
da3fee2 remove unused import
2a1c076 bump version
6d2fbaf rejigger the code to compute the method instance in stacktraces (#563)

git-subtree-dir: packages/JuliaInterpreter
git-subtree-split: 96ed09c7127475d391b1a4f20906072f482278eb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants