-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Introduce an "Inline IVAR cache" struct #2697
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
Conversation
@@ -16,6 +16,7 @@ | |||
"CDHASH" => %w[H TS_CDHASH], | |||
"GENTRY" => %w[G TS_GENTRY], | |||
"IC" => %w[K TS_IC], |
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.
IC should be also renamed.
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 have a suggestion? IC
is still used for opt_getinlinecache
and opt_setinlinecache
Lines 1038 to 1062 in e530cfd
/* push inline-cached value and go to dst if it is valid */ | |
DEFINE_INSN | |
opt_getinlinecache | |
(OFFSET dst, IC ic) | |
() | |
(VALUE val) | |
{ | |
if (vm_ic_hit_p(ic, GET_EP())) { | |
val = ic->ic_value.value; | |
JUMP(dst); | |
} | |
else { | |
val = Qnil; | |
} | |
} | |
/* set inline cache */ | |
DEFINE_INSN | |
opt_setinlinecache | |
(IC ic) | |
(VALUE val) | |
(VALUE val) | |
{ | |
vm_ic_update(ic, val, GET_EP()); | |
} |
I could rename, but IC
matches the instruction names.
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.
reading related code, we need to refactoring overall. I'll do it so you don't need to change them. thanks.
|
62c89fd
to
69d0c27
Compare
69d0c27
to
772f882
Compare
This commit introduces an "inline ivar cache" struct. The reason we need this is so compaction can differentiate from an ivar cache and a regular inline cache. Regular inline caches contain references to `VALUE` and ivar caches just contain references to the ivar index. With this new struct we can easily update references for inline caches (but not inline var caches as they just contain an int)
772f882
to
1a7bf3d
Compare
This commit introduces an "inline ivar cache" struct. The reason we
need this is so compaction can differentiate from an ivar cache and a
regular inline cache. Regular inline caches contain references to
VALUE
and ivar caches just contain references to the ivar index. Withthis new struct we can easily update references for inline caches (but
not inline var caches as they just contain an int)