зеркало из https://github.com/github/ruby.git
Enable VM_ASSERT in --jit CIs (#4543)
This commit is contained in:
Родитель
0d32a18f5b
Коммит
e1b03b0c2b
|
@ -38,7 +38,7 @@ jobs:
|
|||
- run: ./autogen.sh
|
||||
working-directory: src
|
||||
- name: Run configure
|
||||
run: ../src/configure -C --disable-install-doc
|
||||
run: ../src/configure -C --disable-install-doc cppflags=-DVM_CHECK_MODE
|
||||
- run: make $JOBS incs
|
||||
- run: make $JOBS
|
||||
- run: sudo make $JOBS -s install
|
||||
|
|
6
ractor.c
6
ractor.c
|
@ -34,7 +34,7 @@ ASSERT_ractor_unlocking(rb_ractor_t *r)
|
|||
{
|
||||
#if RACTOR_CHECK_MODE > 0
|
||||
// GET_EC is NULL in an MJIT worker
|
||||
if (GET_EC() != NULL && r->sync.locked_by == rb_ractor_self(GET_RACTOR())) {
|
||||
if (rb_current_execution_context(false) != NULL && r->sync.locked_by == rb_ractor_self(GET_RACTOR())) {
|
||||
rb_bug("recursive ractor locking");
|
||||
}
|
||||
#endif
|
||||
|
@ -45,7 +45,7 @@ ASSERT_ractor_locking(rb_ractor_t *r)
|
|||
{
|
||||
#if RACTOR_CHECK_MODE > 0
|
||||
// GET_EC is NULL in an MJIT worker
|
||||
if (GET_EC() != NULL && r->sync.locked_by != rb_ractor_self(GET_RACTOR())) {
|
||||
if (rb_current_execution_context(false) != NULL && r->sync.locked_by != rb_ractor_self(GET_RACTOR())) {
|
||||
rp(r->sync.locked_by);
|
||||
rb_bug("ractor lock is not acquired.");
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ ractor_lock(rb_ractor_t *r, const char *file, int line)
|
|||
rb_native_mutex_lock(&r->sync.lock);
|
||||
|
||||
#if RACTOR_CHECK_MODE > 0
|
||||
if (GET_EC() != NULL) { // GET_EC is NULL in an MJIT worker
|
||||
if (rb_current_execution_context(false) != NULL) { // GET_EC is NULL in an MJIT worker
|
||||
r->sync.locked_by = rb_ractor_self(GET_RACTOR());
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1777,7 +1777,7 @@ RUBY_SYMBOL_EXPORT_END
|
|||
#define GET_VM() rb_current_vm()
|
||||
#define GET_RACTOR() rb_current_ractor()
|
||||
#define GET_THREAD() rb_current_thread()
|
||||
#define GET_EC() rb_current_execution_context()
|
||||
#define GET_EC() rb_current_execution_context(true)
|
||||
|
||||
static inline rb_thread_t *
|
||||
rb_ec_thread_ptr(const rb_execution_context_t *ec)
|
||||
|
@ -1811,7 +1811,7 @@ rb_ec_vm_ptr(const rb_execution_context_t *ec)
|
|||
}
|
||||
|
||||
static inline rb_execution_context_t *
|
||||
rb_current_execution_context(void)
|
||||
rb_current_execution_context(bool expect_ec)
|
||||
{
|
||||
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
||||
#ifdef __APPLE__
|
||||
|
@ -1822,7 +1822,7 @@ rb_current_execution_context(void)
|
|||
#else
|
||||
rb_execution_context_t *ec = native_tls_get(ruby_current_ec_key);
|
||||
#endif
|
||||
VM_ASSERT(ec != NULL);
|
||||
VM_ASSERT(!expect_ec || ec != NULL);
|
||||
return ec;
|
||||
}
|
||||
|
||||
|
|
|
@ -1490,7 +1490,7 @@ static void
|
|||
scope_visibility_check(void)
|
||||
{
|
||||
/* Check for public/protected/private/module_function called inside a method */
|
||||
rb_control_frame_t *cfp = rb_current_execution_context()->cfp+1;
|
||||
rb_control_frame_t *cfp = GET_EC()->cfp+1;
|
||||
if (cfp && cfp->iseq && cfp->iseq->body->type == ISEQ_TYPE_METHOD) {
|
||||
rb_warn("calling %s without arguments inside a method may not have the intended effect",
|
||||
rb_id2name(rb_frame_this_func()));
|
||||
|
|
Загрузка…
Ссылка в новой задаче