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

Post release #399

Merged
merged 8 commits into from Jan 25, 2018
Merged

Post release #399

merged 8 commits into from Jan 25, 2018

Conversation

zoffixznet
Copy link
Contributor

No description provided.

Make use of new .annotate_self
Fixes RT#132718: https://rt.perl.org/Ticket/Display.html?id=132718

When we put together the MAST for if/unless/while/until/repeat_while
/repeat_until ops, we look up which MVM conditional op to use. The
compiler did not know about non-fullwidth natives, and complained about
that with a crash. Fix by teaching it about all the types and coercing
non-fullwidth natives to fullwidth when calling the op.

- Use array lookup instead of nested ternaries; measurement showed this
  approach to be 3x faster
- Remove duplicate sub and move All The Things to the Regex compiler. the
  Operations still sees our arrays, so there's no duplication involved
- Swapping if_s0 to if_s op is OK: the if_s0 variant used to treat "0" string
  as false, but was later changed to treat it as true and after expansion
  of all the macros is now exactly equivalent to plain if_s. Same with unless_s0
- I applied the lookup of extra types in one place in the Regex compiler that
  used to use the old lookup. However, I did not add coercion as I'm unsure
  what code exercises that codepath and whether the coercion is needed at all.
Addresses some cases in rakudo/rakudo#1416

getlexref is expensive compared to plain getlex, so if we know
we're not gonna use the conditional, try coercing it to a simpler value.
This gets rid of lexref and if we got native-type value, goes to use
the native if_/unless_ op.

The perf improvement applies only nqp::if/nqp::unless/nqp::with/
nqp::without when the conditional is a variable and the conditional is
not used for anything other than deciding the branch. I would assume other
cases would've be optimizeable, but I kept getting confusing crashes
during nqp compilation when I tried.
We already know we'll need _o because we test the op's kind on
entry to the branch, so just use those without lookup. No idea
why they're reversed ("if" takes an "unless_o"), but that was the
case before I touched this part of the codebase.
…when looking through QAST dumps.

- Teach QAST::Node.dump to dump value for statement_id
- Teach QAST::WVal.dump_extra_node_info to rake for CUID
    from past_block annotation, if one's present
@zoffixznet zoffixznet merged commit dd8b1ad into master Jan 25, 2018
@zoffixznet zoffixznet deleted the post-release branch January 25, 2018 02:35
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.

None yet

2 participants