-
Notifications
You must be signed in to change notification settings - Fork 5.4k
ZJIT: Add newrange support #13505
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
ZJIT: Add newrange support #13505
Conversation
This comment has been minimized.
This comment has been minimized.
a093af0
to
d73b3ab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm pending some comments!
flag: u32, | ||
state: &FrameState, | ||
) -> lir::Opnd { | ||
asm_comment!(asm, "call rb_range_new"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this should go by the ccall
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In gen_array_dup
it also uses call rb_ary_resurrect
while doing asm.ccall
. Should we be consistent and update that and other occurrences like this to use ccall {instruction name}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we should probably move the comments. I think it is a quirk of the PC saving being added later
zjit/src/hir.rs
Outdated
@@ -334,6 +334,7 @@ pub enum Insn { | |||
NewArray { elements: Vec<InsnId>, state: InsnId }, | |||
/// NewHash contains a vec of (key, value) pairs | |||
NewHash { elements: Vec<(InsnId,InsnId)>, state: InsnId }, | |||
NewRange { low: InsnId, high: InsnId, flag: u32, state: InsnId }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please convert flag
into a Rust-style enum if it's just Inclusive|Exclusive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(What are the options?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, it's a bool called exclude_end
. i think enum { Inclusive, Exclusive }
makes sense here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last, we don't have this yet, but in a stack @tenderlove and I are working on, we have an ObjectAlloc
instruction, so we can probably eventually split this into ObjectAlloc
+FieldSet
+FieldSet
or something similar. But again, these instructions don't exist now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean we will be splitting new_something
instructions into a combination of field set instructions + ObjectAlloc
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely yes
Oh also I think PR/comment should be prefixed with "ZJIT:" like "ZJIT: Parse newrange into HIR" |
27447c4
to
fb9f3d4
Compare
fb9f3d4
to
207ee93
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
cc @tekknolagi