зеркало из https://github.com/github/ruby.git
_mjit_compile_insn.erb: move pc on JIT cancel
if and only if it's not moved yet, to avoid potential bugs in the future. _mjit_compile_send.erb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
9f6e9b40d3
Коммит
0325145f4c
|
@ -7,6 +7,7 @@
|
||||||
% # details.
|
% # details.
|
||||||
fprintf(f, "{\n");
|
fprintf(f, "{\n");
|
||||||
{
|
{
|
||||||
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
||||||
% # compiler: Prepare operands which may be used by `insn.call_attribute`
|
% # compiler: Prepare operands which may be used by `insn.call_attribute`
|
||||||
% insn.opes.each_with_index do |ope, i|
|
% insn.opes.each_with_index do |ope, i|
|
||||||
MAYBE_UNUSED(<%= ope.fetch(:decl) %>) = (<%= ope.fetch(:type) %>)operands[<%= i %>];
|
MAYBE_UNUSED(<%= ope.fetch(:decl) %>) = (<%= ope.fetch(:type) %>)operands[<%= i %>];
|
||||||
|
@ -62,7 +63,7 @@
|
||||||
% unless insn.always_leaf?
|
% unless insn.always_leaf?
|
||||||
fprintf(f, " if (UNLIKELY(ruby_vm_event_enabled_flags & ISEQ_TRACE_EVENTS)) {\n");
|
fprintf(f, " if (UNLIKELY(ruby_vm_event_enabled_flags & ISEQ_TRACE_EVENTS)) {\n");
|
||||||
fprintf(f, " reg_cfp->sp = (VALUE *)reg_cfp->bp + %d;\n", b->stack_size + (int)<%= insn.call_attribute('sp_inc') %> + 1);
|
fprintf(f, " reg_cfp->sp = (VALUE *)reg_cfp->bp + %d;\n", b->stack_size + (int)<%= insn.call_attribute('sp_inc') %> + 1);
|
||||||
if (!body->catch_except_p) {
|
if (!pc_moved_p) {
|
||||||
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
||||||
}
|
}
|
||||||
fprintf(f, " goto cancel;\n");
|
fprintf(f, " goto cancel;\n");
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
% # JIT: Move pc for catch table on catch_except_p, and for #caller_locations and rb_profile_frames on !insn.always_leaf?
|
% # JIT: Move pc for catch table on catch_except_p, and for #caller_locations and rb_profile_frames on !insn.always_leaf?
|
||||||
if (body->catch_except_p || <%= insn.always_leaf? ? 'FALSE' : 'TRUE' %>) {
|
if (body->catch_except_p || <%= insn.always_leaf? ? 'FALSE' : 'TRUE' %>) {
|
||||||
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
||||||
|
pc_moved_p = TRUE;
|
||||||
}
|
}
|
||||||
%
|
%
|
||||||
% # JIT: move sp to use or preserve stack variables
|
% # JIT: move sp to use or preserve stack variables
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
%
|
%
|
||||||
% # Optimized case of send / opt_send_without_block instructions.
|
% # Optimized case of send / opt_send_without_block instructions.
|
||||||
{
|
{
|
||||||
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
||||||
% # compiler: Prepare operands which may be used by `insn.call_attribute`
|
% # compiler: Prepare operands which may be used by `insn.call_attribute`
|
||||||
% insn.opes.each_with_index do |ope, i|
|
% insn.opes.each_with_index do |ope, i|
|
||||||
MAYBE_UNUSED(<%= ope.fetch(:decl) %>) = (<%= ope.fetch(:type) %>)operands[<%= i %>];
|
MAYBE_UNUSED(<%= ope.fetch(:decl) %>) = (<%= ope.fetch(:type) %>)operands[<%= i %>];
|
||||||
|
@ -72,7 +73,7 @@
|
||||||
% # JIT: We should evaluate ISeq modified for TracePoint if it's enabled. Note: This is slow.
|
% # JIT: We should evaluate ISeq modified for TracePoint if it's enabled. Note: This is slow.
|
||||||
fprintf(f, " if (UNLIKELY(ruby_vm_event_enabled_flags & ISEQ_TRACE_EVENTS)) {\n");
|
fprintf(f, " if (UNLIKELY(ruby_vm_event_enabled_flags & ISEQ_TRACE_EVENTS)) {\n");
|
||||||
fprintf(f, " reg_cfp->sp = (VALUE *)reg_cfp->bp + %d;\n", b->stack_size + (int)<%= insn.call_attribute('sp_inc') %> + 1);
|
fprintf(f, " reg_cfp->sp = (VALUE *)reg_cfp->bp + %d;\n", b->stack_size + (int)<%= insn.call_attribute('sp_inc') %> + 1);
|
||||||
if (!body->catch_except_p) {
|
if (!pc_moved_p) {
|
||||||
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
||||||
}
|
}
|
||||||
fprintf(f, " goto cancel;\n");
|
fprintf(f, " goto cancel;\n");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче