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

Add duparray to YJIT codegen #70

Merged
merged 3 commits into from Jun 7, 2021
Merged

Add duparray to YJIT codegen #70

merged 3 commits into from Jun 7, 2021

Conversation

jhawthorn
Copy link
Contributor

duparray is used similarly to newarray, but when all the values are literals known at compile time.

For example

[1,2]

compiles into the bytecode

duparray [1, 2]

which this now compiles into

  ; duparray
  55817d1fcddd:  movabs rax, 0x55817cf0e6c0
  55817d1fcde7:  mov    qword ptr [rdi], rax
  55817d1fcdea:  push   rdi
  55817d1fcdeb:  push   rsi
  55817d1fcdec:  push   rdx
  55817d1fcded:  push   rdx
  55817d1fcdee:  movabs rdi, 0x7fa79f195bb0 (pointer to the array)
  55817d1fcdf8:  call   0x55817c56eaf0 (rb_ary_resurrect)
  55817d1fcdfd:  pop    rdx
  55817d1fcdfe:  pop    rdx
  55817d1fcdff:  pop    rsi
  55817d1fce00:  pop    rdi
  55817d1fce01:  mov    qword ptr [rdx], rax

@maximecb maximecb added this to In Progress in YJIT via automation Jun 7, 2021
@maximecb
Copy link
Contributor

maximecb commented Jun 7, 2021

Well done :)

@maximecb maximecb merged commit ae0ae0e into Shopify:main Jun 7, 2021
YJIT automation moved this from In Progress to Done Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
YJIT
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants