aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2021-10-06 17:44:19 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:42 -0400
commit7c08538aa3a366409784f6a8b7aa013b85633803 (patch)
treecae00db737ff8fa27ba347f9a2960fe4f7e8fadd
parent884b6f3dbb33ef98fbfe96e7c70ccc8bb5735829 (diff)
downloadruby-7c08538aa3a366409784f6a8b7aa013b85633803.tar.gz
Cleanup diff against upstream. Add comments
I did a `git diff --stat` against upstream and looked at all the files that are outside of YJIT to come up with these minor changes.
-rw-r--r--iseq.h2
-rw-r--r--mjit.h1
-rw-r--r--proc.c4
-rw-r--r--tool/ruby_vm/models/instructions.rb1
-rw-r--r--vm.c2
-rw-r--r--vm_core.h4
-rw-r--r--vm_exec.c5
-rw-r--r--vm_insnhelper.c2
8 files changed, 8 insertions, 13 deletions
diff --git a/iseq.h b/iseq.h
index 9d8735bad1..8387f90e9a 100644
--- a/iseq.h
+++ b/iseq.h
@@ -315,8 +315,6 @@ VALUE rb_iseq_defined_string(enum defined_type type);
/* vm.c */
VALUE rb_iseq_local_variables(const rb_iseq_t *iseq);
-NOINLINE(void rb_yjit_empty_func_with_ec(rb_control_frame_t *cfp, rb_execution_context_t *ec));
-
RUBY_SYMBOL_EXPORT_END
#endif /* RUBY_ISEQ_H */
diff --git a/mjit.h b/mjit.h
index acb8b22e25..4e91decb01 100644
--- a/mjit.h
+++ b/mjit.h
@@ -193,6 +193,7 @@ mjit_exec(rb_execution_context_t *ec)
RB_DEBUG_COUNTER_INC(mjit_frame_VM2JT);
# endif
RB_DEBUG_COUNTER_INC(mjit_exec_call_func);
+ // Under SystemV x64 calling convention
// ec -> RDI
// cfp -> RSI
return func(ec, ec->cfp);
diff --git a/proc.c b/proc.c
index 99b522d95f..2e9307e53e 100644
--- a/proc.c
+++ b/proc.c
@@ -347,7 +347,7 @@ rb_binding_alloc(VALUE klass)
VALUE obj;
rb_binding_t *bind;
obj = TypedData_Make_Struct(klass, rb_binding_t, &ruby_binding_data_type, bind);
-#if RUBY_DEBUG
+#if YJIT_STATS
rb_yjit_collect_binding_alloc();
#endif
return obj;
@@ -614,7 +614,7 @@ bind_local_variable_set(VALUE bindval, VALUE sym, VALUE val)
env = VM_ENV_ENVVAL_PTR(vm_block_ep(&bind->block));
}
-#if RUBY_DEBUG
+#if YJIT_STATS
rb_yjit_collect_binding_set();
#endif
diff --git a/tool/ruby_vm/models/instructions.rb b/tool/ruby_vm/models/instructions.rb
index d782f10af0..1198c7a4a6 100644
--- a/tool/ruby_vm/models/instructions.rb
+++ b/tool/ruby_vm/models/instructions.rb
@@ -18,6 +18,5 @@ RubyVM::Instructions = RubyVM::BareInstructions.to_a + \
RubyVM::OperandsUnifications.to_a + \
RubyVM::InstructionsUnifications.to_a
-
require_relative 'trace_instructions'
RubyVM::Instructions.freeze
diff --git a/vm.c b/vm.c
index f535c19722..ce7d4c66d3 100644
--- a/vm.c
+++ b/vm.c
@@ -1853,7 +1853,7 @@ rb_vm_check_redefinition_opt_method(const rb_method_entry_t *me, VALUE klass)
if (st_lookup(vm_opt_method_def_table, (st_data_t)me->def, &bop)) {
int flag = vm_redefinition_check_flag(klass);
rb_yjit_bop_redefined(klass, me, (enum ruby_basic_operators)bop);
- ruby_vm_redefined_flag[bop] |= flag;
+ ruby_vm_redefined_flag[bop] |= flag;
}
}
}
diff --git a/vm_core.h b/vm_core.h
index 6fd24e962f..79aa22d3de 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -236,8 +236,8 @@ STATIC_ASSERT(sizeof_iseq_inline_constant_cache_entry,
struct iseq_inline_constant_cache {
struct iseq_inline_constant_cache_entry *entry;
- // For YJIT: the index to the opt_getinlinecache instruction in the same iseq.
- // It's set during compile time and constant once set.
+ // For YJIT: the index to the opt_getinlinecache instruction in the same iseq.
+ // It's set during compile time and constant once set.
unsigned get_insn_idx;
};
diff --git a/vm_exec.c b/vm_exec.c
index 33a1ed29d7..8931799c2e 100644
--- a/vm_exec.c
+++ b/vm_exec.c
@@ -93,13 +93,8 @@ vm_exec_core(rb_execution_context_t *ec, VALUE initial)
#define USE_MACHINE_REGS 1
#elif defined(__GNUC__) && defined(__powerpc64__)
-#if 0
DECL_SC_REG(const VALUE *, pc, "14");
DECL_SC_REG(rb_control_frame_t *, cfp, "15");
-#else
- register rb_control_frame_t *reg_cfp;
- const VALUE *reg_pc;
-#endif
#define USE_MACHINE_REGS 1
#elif defined(__GNUC__) && defined(__aarch64__)
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index aafd5a28d2..d068beb8be 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -4808,6 +4808,8 @@ vm_ic_update(const rb_iseq_t *iseq, IC ic, VALUE val, const VALUE *reg_ep)
ruby_vm_const_missing_count = 0;
RB_OBJ_WRITE(iseq, &ic->entry, ice);
#ifndef MJIT_HEADER
+ // MJIT and YJIT can't be on at the same time, so there is no need to
+ // notify YJIT about changes to the IC when running inside MJIT code.
rb_yjit_constant_ic_update(iseq, ic);
#endif
}