mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Allow upgrading first N types when stack is large
This commit is contained in:
parent
5d155fc8a1
commit
641ef34dde
1 changed files with 7 additions and 6 deletions
13
yjit_core.c
13
yjit_core.c
|
@ -175,13 +175,14 @@ void ctx_upgrade_opnd_type(ctx_t* ctx, insn_opnd_t opnd, val_type_t type)
|
|||
return;
|
||||
}
|
||||
|
||||
if (ctx->stack_size >= MAX_TEMP_TYPES)
|
||||
RUBY_ASSERT(opnd.idx < ctx->stack_size);
|
||||
int stack_idx = ctx->stack_size - 1 - opnd.idx;
|
||||
|
||||
// If outside of tracked range, do nothing
|
||||
if (stack_idx >= MAX_TEMP_TYPES)
|
||||
return;
|
||||
|
||||
RUBY_ASSERT(opnd.idx < ctx->stack_size);
|
||||
int stack_index = ctx->stack_size - 1 - opnd.idx;
|
||||
RUBY_ASSERT(stack_index < MAX_TEMP_TYPES);
|
||||
temp_mapping_t mapping = ctx->temp_mapping[stack_index];
|
||||
temp_mapping_t mapping = ctx->temp_mapping[stack_idx];
|
||||
|
||||
switch (mapping.kind)
|
||||
{
|
||||
|
@ -190,7 +191,7 @@ void ctx_upgrade_opnd_type(ctx_t* ctx, insn_opnd_t opnd, val_type_t type)
|
|||
break;
|
||||
|
||||
case TEMP_STACK:
|
||||
UPGRADE_TYPE(ctx->temp_types[stack_index], type);
|
||||
UPGRADE_TYPE(ctx->temp_types[stack_idx], type);
|
||||
break;
|
||||
|
||||
case TEMP_LOCAL:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue