Rename function and variable
This commit is contained in:
parent
fa04478e9e
commit
ec42378196
@ -56,7 +56,7 @@ typedef struct ctx_struct
|
|||||||
uint8_t *code_ptr;
|
uint8_t *code_ptr;
|
||||||
|
|
||||||
// Whether we know self is a heap object
|
// Whether we know self is a heap object
|
||||||
bool self_is_heap_object;
|
bool self_is_object;
|
||||||
|
|
||||||
} ctx_t;
|
} ctx_t;
|
||||||
|
|
||||||
@ -627,17 +627,17 @@ 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
|
// Check that `self` is a pointer to an object on the GC heap
|
||||||
static void
|
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.
|
// `self` is constant throughout the entire region, so we only need to do this check once.
|
||||||
if (!ctx->self_is_heap_object) {
|
if (!ctx->self_is_object) {
|
||||||
test(cb, storage_for_self, imm_opnd(RUBY_IMMEDIATE_MASK));
|
test(cb, self_opnd, imm_opnd(RUBY_IMMEDIATE_MASK));
|
||||||
jnz_ptr(cb, side_exit);
|
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);
|
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);
|
je_ptr(cb, side_exit);
|
||||||
ctx->self_is_heap_object = true;
|
ctx->self_is_object = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -669,7 +669,7 @@ gen_getinstancevariable(codeblock_t* cb, codeblock_t* ocb, ctx_t* ctx)
|
|||||||
// Load self from CFP
|
// Load self from CFP
|
||||||
mov(cb, REG0, member_opnd(REG_CFP, rb_control_frame_t, self));
|
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
|
// Bail if receiver class is different from compiled time call cache class
|
||||||
x86opnd_t klass_opnd = mem_opnd(64, REG0, offsetof(struct RBasic, klass));
|
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
|
// Load self from CFP
|
||||||
mov(cb, REG0, member_opnd(REG_CFP, rb_control_frame_t, self));
|
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
|
// Bail if receiver class is different from compiled time call cache class
|
||||||
x86opnd_t klass_opnd = mem_opnd(64, REG0, offsetof(struct RBasic, klass));
|
x86opnd_t klass_opnd = mem_opnd(64, REG0, offsetof(struct RBasic, klass));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user