Skip to content

Commit a763bc3

Browse files
committed
insns.def: s/handles_frame/handles_sp/
because it's more suitable to describe the current behavior now. tool/ruby_vm/models/bare_instructions.rb: ditto. tool/ruby_vm/views/_insn_entry.erb: ditto. tool/ruby_vm/views/_mjit_compile_insn_body.erb: ditto. tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 218aa03 commit a763bc3

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

insns.def

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* sp_inc: Used to dynamically calculate sp increase in
4444
`insn_stack_increase`.
4545
46-
* handles_frame: If it is true, VM deals with sp in the insn.
46+
* handles_sp: If it is true, VM deals with sp in the insn.
4747
4848
- Attributes can access operands, but not stack (push/pop) variables.
4949
@@ -687,7 +687,7 @@ defineclass
687687
(ID id, ISEQ class_iseq, rb_num_t flags)
688688
(VALUE cbase, VALUE super)
689689
(VALUE val)
690-
// attr bool handles_frame = true;
690+
// attr bool handles_sp = true;
691691
{
692692
VALUE klass = vm_find_or_create_class_by_id(id, flags, cbase, super);
693693

@@ -714,7 +714,7 @@ send
714714
(CALL_INFO ci, CALL_CACHE cc, ISEQ blockiseq)
715715
(...)
716716
(VALUE val)
717-
// attr bool handles_frame = true;
717+
// attr bool handles_sp = true;
718718
// attr rb_snum_t sp_inc = - (int)(ci->orig_argc + ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0));
719719
{
720720
struct rb_calling_info calling;
@@ -768,7 +768,7 @@ opt_send_without_block
768768
(CALL_INFO ci, CALL_CACHE cc)
769769
(...)
770770
(VALUE val)
771-
// attr bool handles_frame = true;
771+
// attr bool handles_sp = true;
772772
// attr rb_snum_t sp_inc = -ci->orig_argc;
773773
{
774774
struct rb_calling_info calling;
@@ -783,7 +783,7 @@ invokesuper
783783
(CALL_INFO ci, CALL_CACHE cc, ISEQ blockiseq)
784784
(...)
785785
(VALUE val)
786-
// attr bool handles_frame = true;
786+
// attr bool handles_sp = true;
787787
// attr rb_snum_t sp_inc = - (int)(ci->orig_argc + ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0));
788788
{
789789
struct rb_calling_info calling;
@@ -801,7 +801,7 @@ invokeblock
801801
(CALL_INFO ci)
802802
(...)
803803
(VALUE val)
804-
// attr bool handles_frame = true;
804+
// attr bool handles_sp = true;
805805
// attr rb_snum_t sp_inc = 1 - ci->orig_argc;
806806
{
807807
struct rb_calling_info calling;
@@ -828,7 +828,7 @@ leave
828828
()
829829
(VALUE val)
830830
(VALUE val)
831-
// attr bool handles_frame = true;
831+
// attr bool handles_sp = true;
832832
{
833833
if (OPT_CHECKED_RUN) {
834834
const VALUE *const bp = vm_base_ptr(reg_cfp);
@@ -1376,7 +1376,7 @@ opt_call_c_function
13761376
(rb_insn_func_t funcptr)
13771377
()
13781378
()
1379-
// attr bool handles_frame = true;
1379+
// attr bool handles_sp = true;
13801380
{
13811381
reg_cfp = (funcptr)(ec, reg_cfp);
13821382

tool/ruby_vm/models/bare_instructions.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ def operands_info
101101
}.join
102102
end
103103

104-
def handles_frame?
105-
/\b(false|0)\b/ !~ @attrs['handles_frame'].expr.expr
104+
def handles_sp?
105+
/\b(false|0)\b/ !~ @attrs['handles_sp'].expr.expr
106106
end
107107

108108
def inspect
@@ -129,7 +129,7 @@ def predefine_attributes
129129
generate_attribute 'rb_num_t', 'retn', rets.size
130130
generate_attribute 'rb_num_t', 'width', width
131131
generate_attribute 'rb_snum_t', 'sp_inc', rets.size - pops.size
132-
generate_attribute 'bool', 'handles_frame', false
132+
generate_attribute 'bool', 'handles_sp', false
133133
end
134134

135135
def typesplit a

tool/ruby_vm/views/_insn_entry.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ INSN_ENTRY(<%= insn.name %>)
3030
% end
3131
DEBUG_ENTER_INSN(INSN_ATTR(name));
3232
ADD_PC(INSN_ATTR(width));
33-
% if insn.handles_frame?
33+
% if insn.handles_sp?
3434
POPN(INSN_ATTR(popn));
3535
% end
3636
COLLECT_USAGE_INSN(INSN_ATTR(bin));
@@ -39,7 +39,7 @@ INSN_ENTRY(<%= insn.name %>)
3939
% end
4040
<%= render_c_expr insn.expr -%>
4141
CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn));
42-
% if insn.handles_frame?
42+
% if insn.handles_sp?
4343
% insn.rets.reverse_each do |ret|
4444
PUSH(<%= insn.cast_to_VALUE ret %>);
4545
% end

tool/ruby_vm/views/_mjit_compile_insn_body.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@
7575
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
7676
fprintf(f, " goto cancel;\n");
7777
% else
78-
% if insn.handles_frame?
79-
% # If insn.handles_frame? is true, cfp->sp might be changed inside insns (like vm_caller_setup_arg_block)
80-
% # and thus we need to use cfp->sp, even when local_stack_p is TRUE. When insn.handles_frame? is true,
78+
% if insn.handles_sp?
79+
% # If insn.handles_sp? is true, cfp->sp might be changed inside insns (like vm_caller_setup_arg_block)
80+
% # and thus we need to use cfp->sp, even when local_stack_p is TRUE. When insn.handles_sp? is true,
8181
% # cfp->sp should be available too because _mjit_compile_pc_and_sp.erb sets it.
8282
fprintf(f, <%= to_cstr.call(line) %>);
8383
% else
84-
% # If local_stack_p is TRUE and insn.handles_frame? is false, stack values are only available in local variables
84+
% # If local_stack_p is TRUE and insn.handles_sp? is false, stack values are only available in local variables
8585
% # for stack. So we need to replace those macros if local_stack_p is TRUE here.
8686
% case line
8787
% when /\bGET_SP\(\)/

tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
%
1414
% # JIT: move sp to use or preserve stack variables
1515
if (status->local_stack_p) {
16-
% # sp motion is optimized away for `handles_frame? #=> false` case.
16+
% # sp motion is optimized away for `handles_sp? #=> false` case.
1717
% # Thus sp should be set properly before `goto cancel`.
18-
% if insn.handles_frame?
18+
% if insn.handles_sp?
1919
% # JIT-only behavior (pushing JIT's local variables to VM's stack):
2020
{
2121
rb_snum_t i, push_size;
@@ -28,7 +28,7 @@
2828
% end
2929
}
3030
else {
31-
% if insn.handles_frame?
31+
% if insn.handles_sp?
3232
fprintf(f, " reg_cfp->sp = (VALUE *)reg_cfp->bp + %d;\n", b->stack_size + 1 - <%= insn.pops.size %>); /* POPN(INSN_ATTR(popn)); */
3333
% else
3434
fprintf(f, " reg_cfp->sp = (VALUE *)reg_cfp->bp + %d;\n", b->stack_size + 1);

0 commit comments

Comments
 (0)