summaryrefslogtreecommitdiff
path: root/tool/ruby_vm
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-17 16:20:15 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-17 16:20:15 +0000
commit80dac806cc84bb1eab7e3752d9dff3d152281861 (patch)
tree2755dc100485c7de06b6cec73c4f6c6aacc6c9c1 /tool/ruby_vm
parent5aa52587e86b9e2b03cad8b78307e53b777f1df2 (diff)
revert r63988
Due to trunk-mjit CI failures: http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1130097 http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1130196 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/ruby_vm')
-rwxr-xr-xtool/ruby_vm/models/bare_instructions.rb5
-rw-r--r--tool/ruby_vm/views/_mjit_compile_insn.erb10
-rw-r--r--tool/ruby_vm/views/_mjit_compile_insn_body.erb20
-rw-r--r--tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb17
-rw-r--r--tool/ruby_vm/views/_mjit_compile_send.erb5
-rw-r--r--tool/ruby_vm/views/mjit_compile.inc.erb6
6 files changed, 4 insertions, 59 deletions
diff --git a/tool/ruby_vm/models/bare_instructions.rb b/tool/ruby_vm/models/bare_instructions.rb
index f540295531..297a93f5b2 100755
--- a/tool/ruby_vm/models/bare_instructions.rb
+++ b/tool/ruby_vm/models/bare_instructions.rb
@@ -101,10 +101,6 @@ class RubyVM::BareInstructions
}.join
end
- def handles_stack?
- /\b(false|0)\b/ !~ @attrs['handles_stack'].expr.expr
- end
-
def inspect
sprintf "#<%s %s@%s:%d>", self.class.name, @name, @loc[0], @loc[1]
end
@@ -129,7 +125,6 @@ class RubyVM::BareInstructions
generate_attribute 'rb_num_t', 'retn', rets.size
generate_attribute 'rb_num_t', 'width', width
generate_attribute 'rb_snum_t', 'sp_inc', rets.size - pops.size
- generate_attribute 'bool', 'handles_stack', false
end
def typesplit a
diff --git a/tool/ruby_vm/views/_mjit_compile_insn.erb b/tool/ruby_vm/views/_mjit_compile_insn.erb
index 9f18aefe20..90127aa330 100644
--- a/tool/ruby_vm/views/_mjit_compile_insn.erb
+++ b/tool/ruby_vm/views/_mjit_compile_insn.erb
@@ -20,16 +20,6 @@
MAYBE_UNUSED(<%= ope.fetch(:decl) %>) = (<%= ope.fetch(:type) %>)operands[<%= i %>];
% end
%
-% # JIT: Declare stack_size to be used in some macro of _mjit_compile_insn_body.erb
- if (status->local_stack_p) {
-% # TODO: can we use some functions to calculate this?
-% if insn.name == 'send' || insn.name == 'invokesuper'
- fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size - <%= insn.pops.size %> - ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0));
-% else
- fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size - <%= insn.pops.size %>);
-% end
- }
-%
% # JIT: Declare variables for operands, popped values and return values
% insn.declarations.each do |decl|
fprintf(f, " <%= decl %>;\n");
diff --git a/tool/ruby_vm/views/_mjit_compile_insn_body.erb b/tool/ruby_vm/views/_mjit_compile_insn_body.erb
index c40756c9da..0fef07da25 100644
--- a/tool/ruby_vm/views/_mjit_compile_insn_body.erb
+++ b/tool/ruby_vm/views/_mjit_compile_insn_body.erb
@@ -69,28 +69,8 @@
% end
% when /\A\s+DISPATCH_ORIGINAL_INSN\([^)]+\);\s+\z/
% # For `opt_xxx`'s fallbacks.
- fprintf(f, " reg_cfp->sp = (VALUE *)reg_cfp->bp + %d;\n", b->stack_size + 1);
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
fprintf(f, " goto cancel;\n");
-% # If local_stack_p is TRUE, stack values are only available in local variables
-% # for stack. So we need to replace those macros if local_stack_p is TRUE here.
-% when /\bGET_SP\(\)/
-% # reg_cfp->sp
- fprintf(f, <%= to_cstr.call(line.sub(/\bGET_SP\(\)/, '%s')) %>, (status->local_stack_p ? "(stack + stack_size)" : "GET_SP()"));
-% when /\bSTACK_ADDR_FROM_TOP\((?<num>[^)]+)\)/
-% # #define STACK_ADDR_FROM_TOP(n) (GET_SP()-(n))
-% num = Regexp.last_match[:num]
- fprintf(f, <%= to_cstr.call(line.sub(/\bSTACK_ADDR_FROM_TOP\(([^)]+)\)/, '%s')) %>,
- (status->local_stack_p ? "stack + (stack_size - (<%= num %>))" : "STACK_ADDR_FROM_TOP(<%= num %>)"));
-% when /\bTOPN\((?<num>[^)]+)\)/
-% # #define TOPN(n) (*(GET_SP()-(n)-1))
-% num = Regexp.last_match[:num]
- fprintf(f, <%= to_cstr.call(line.sub(/\bTOPN\(([^)]+)\)/, '%s')) %>,
- (status->local_stack_p ? "*(stack + (stack_size - (<%= num %>) - 1))" : "TOPN(<%= num %>)"));
-% when /\bPOPN\([^)]+\)/ # skip sp motion on JIT
- fprintf(f, <%= to_cstr.call(line.sub(/\bPOPN\((?<num>[^)]+)\)/) { Regexp.last_match[:num] }) %>);
-% when /\bINC_SP\([^)]+\)/ # skip sp motion on JIT
- fprintf(f, <%= to_cstr.call(line.sub(/\bINC_SP\((?<num>[^)]+)\)/) { Regexp.last_match[:num] }) %>);
% else
fprintf(f, <%= to_cstr.call(line) %>);
% end
diff --git a/tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb b/tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb
index 64a31c65d1..6004504c06 100644
--- a/tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb
+++ b/tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb
@@ -12,19 +12,4 @@
}
%
% # JIT: move sp to use or preserve stack variables
- if (status->local_stack_p) {
-% # sp motion is optimized away for `handles_frame? #=> false` case.
-% # Thus sp should be set properly before `goto cancel`.
-% if insn.handles_stack?
-% # JIT-only behavior (pushing JIT's local variables to VM's stack):
- rb_snum_t i, push_size;
- push_size = -<%= insn.call_attribute('sp_inc') %> + <%= insn.rets.size %> - <%= insn.pops.size %>;
- fprintf(f, " reg_cfp->sp = (VALUE *)reg_cfp->bp + %d;\n", b->stack_size + 1 - <%= insn.pops.size %>); /* POPN(INSN_ATTR(popn)); */
- for (i = 0; i < push_size; i++) { /* TODO: use memcpy? */
- fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
- }
-% end
- }
- else {
- fprintf(f, " reg_cfp->sp = (VALUE *)reg_cfp->bp + %d;\n", b->stack_size + 1 - <%= insn.pops.size %>); /* POPN(INSN_ATTR(popn)); */
- }
+ fprintf(f, " reg_cfp->sp = (VALUE *)reg_cfp->bp + %d;\n", b->stack_size + 1 - <%= insn.pops.size %>); /* POPN(INSN_ATTR(popn)); */
diff --git a/tool/ruby_vm/views/_mjit_compile_send.erb b/tool/ruby_vm/views/_mjit_compile_send.erb
index 5fd5a403fd..6944903821 100644
--- a/tool/ruby_vm/views/_mjit_compile_send.erb
+++ b/tool/ruby_vm/views/_mjit_compile_send.erb
@@ -24,11 +24,6 @@
int param_size = iseq->body->param.size; /* TODO: check calling->argc for argument_arity_error */
fprintf(f, "{\n");
-% # JIT: Declare stack_size to be used in some macro of _mjit_compile_insn_body.erb
- if (status->local_stack_p) {
- /* TODO: can we use some functions to calculate this? */
- fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size - <%= insn.pops.size %> - ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0));
- }
% # JIT: Invalidate call cache if it requires vm_search_method. This allows to inline some of following things.
<%= render 'mjit_compile_send_guard' -%>
diff --git a/tool/ruby_vm/views/mjit_compile.inc.erb b/tool/ruby_vm/views/mjit_compile.inc.erb
index ee29693894..7749984c36 100644
--- a/tool/ruby_vm/views/mjit_compile.inc.erb
+++ b/tool/ruby_vm/views/mjit_compile.inc.erb
@@ -31,13 +31,13 @@
% # reg_cfp: the second argument of _mjitXXX
% # GET_CFP(): refers to `reg_cfp`
% # GET_EP(): refers to `reg_cfp->ep`
-% # GET_SP(): refers to `reg_cfp->sp`, or `(stack + stack_size)` if local_stack_p
+% # GET_SP(): refers to `reg_cfp->sp`
% # GET_SELF(): refers to `reg_cfp->self`
% # GET_LEP(): refers to `VM_EP_LEP(reg_cfp->ep)`
% # EXEC_EC_CFP(): refers to `val = vm_exec(ec, TRUE)` with frame setup
% # CALL_METHOD(): using `GET_CFP()` and `EXEC_EC_CFP()`
-% # TOPN(): refers to `reg_cfp->sp`, or `*(stack + (stack_size - num - 1))` if local_stack_p
-% # STACK_ADDR_FROM_TOP(): refers to `reg_cfp->sp`, or `stack + (stack_size - num)` if local_stack_p
+% # TOPN(): refers to `reg_cfp->sp`
+% # STACK_ADDR_FROM_TOP(): refers to `reg_cfp->sp`
% # DISPATCH_ORIGINAL_INSN(): expanded in _mjit_compile_insn.erb
% # THROW_EXCEPTION(): specially defined for JIT
% # RESTORE_REGS(): specially defined for `leave`