summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2020-11-20 14:05:36 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:26 -0400
commitec42378196db02936cd521305dc5940f598370d0 (patch)
treed23d59fd5db8ec0d5f8427c175b4d885dfdf71cf
parentfa04478e9e2e478e6a66e1b4b0bb4fd762a367f8 (diff)
Rename function and variable
-rw-r--r--ujit_compile.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ujit_compile.c b/ujit_compile.c
index c75431e9de..45ead62f3b 100644
--- a/ujit_compile.c
+++ b/ujit_compile.c
@@ -56,7 +56,7 @@ typedef struct ctx_struct
uint8_t *code_ptr;
// Whether we know self is a heap object
- bool self_is_heap_object;
+ bool self_is_object;
} ctx_t;
@@ -627,18 +627,18 @@ gen_setlocal_wc0(codeblock_t* cb, codeblock_t* ocb, ctx_t* ctx)
// Check that `self` is a pointer to an object on the GC heap
static void
-ensure_self_is_heap_object(codeblock_t *cb, x86opnd_t storage_for_self, uint8_t *side_exit, ctx_t *ctx)
+guard_self_is_object(codeblock_t *cb, x86opnd_t self_opnd, uint8_t *side_exit, ctx_t *ctx)
{
// `self` is constant throughout the entire region, so we only need to do this check once.
- if (!ctx->self_is_heap_object) {
- test(cb, storage_for_self, imm_opnd(RUBY_IMMEDIATE_MASK));
+ if (!ctx->self_is_object) {
+ test(cb, self_opnd, imm_opnd(RUBY_IMMEDIATE_MASK));
jnz_ptr(cb, side_exit);
- cmp(cb, storage_for_self, imm_opnd(Qfalse));
+ cmp(cb, self_opnd, imm_opnd(Qfalse));
je_ptr(cb, side_exit);
- cmp(cb, storage_for_self, imm_opnd(Qnil));
+ cmp(cb, self_opnd, imm_opnd(Qnil));
je_ptr(cb, side_exit);
- ctx->self_is_heap_object = true;
- }
+ ctx->self_is_object = true;
+ }
}
static bool
@@ -669,7 +669,7 @@ gen_getinstancevariable(codeblock_t* cb, codeblock_t* ocb, ctx_t* ctx)
// Load self from CFP
mov(cb, REG0, member_opnd(REG_CFP, rb_control_frame_t, self));
- ensure_self_is_heap_object(cb, REG0, side_exit, ctx);
+ guard_self_is_object(cb, REG0, side_exit, ctx);
// Bail if receiver class is different from compiled time call cache class
x86opnd_t klass_opnd = mem_opnd(64, REG0, offsetof(struct RBasic, klass));
@@ -731,7 +731,7 @@ gen_setinstancevariable(codeblock_t* cb, codeblock_t* ocb, ctx_t* ctx)
// Load self from CFP
mov(cb, REG0, member_opnd(REG_CFP, rb_control_frame_t, self));
- ensure_self_is_heap_object(cb, REG0, side_exit, ctx);
+ guard_self_is_object(cb, REG0, side_exit, ctx);
// Bail if receiver class is different from compiled time call cache class
x86opnd_t klass_opnd = mem_opnd(64, REG0, offsetof(struct RBasic, klass));