Enable VM_ASSERT in --jit CIs (#4543)
This commit is contained in:
parent
0d32a18f5b
commit
e1b03b0c2b
Notes:
git
2021-06-01 16:16:13 +09:00
Merged-By: k0kubun <takashikkbn@gmail.com>
2
.github/workflows/mjit.yml
vendored
2
.github/workflows/mjit.yml
vendored
@ -38,7 +38,7 @@ jobs:
|
|||||||
- run: ./autogen.sh
|
- run: ./autogen.sh
|
||||||
working-directory: src
|
working-directory: src
|
||||||
- name: Run configure
|
- 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 incs
|
||||||
- run: make $JOBS
|
- run: make $JOBS
|
||||||
- run: sudo make $JOBS -s install
|
- 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
|
#if RACTOR_CHECK_MODE > 0
|
||||||
// GET_EC is NULL in an MJIT worker
|
// 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");
|
rb_bug("recursive ractor locking");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -45,7 +45,7 @@ ASSERT_ractor_locking(rb_ractor_t *r)
|
|||||||
{
|
{
|
||||||
#if RACTOR_CHECK_MODE > 0
|
#if RACTOR_CHECK_MODE > 0
|
||||||
// GET_EC is NULL in an MJIT worker
|
// 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);
|
rp(r->sync.locked_by);
|
||||||
rb_bug("ractor lock is not acquired.");
|
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);
|
rb_native_mutex_lock(&r->sync.lock);
|
||||||
|
|
||||||
#if RACTOR_CHECK_MODE > 0
|
#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());
|
r->sync.locked_by = rb_ractor_self(GET_RACTOR());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1777,7 +1777,7 @@ RUBY_SYMBOL_EXPORT_END
|
|||||||
#define GET_VM() rb_current_vm()
|
#define GET_VM() rb_current_vm()
|
||||||
#define GET_RACTOR() rb_current_ractor()
|
#define GET_RACTOR() rb_current_ractor()
|
||||||
#define GET_THREAD() rb_current_thread()
|
#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 *
|
static inline rb_thread_t *
|
||||||
rb_ec_thread_ptr(const rb_execution_context_t *ec)
|
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 *
|
static inline rb_execution_context_t *
|
||||||
rb_current_execution_context(void)
|
rb_current_execution_context(bool expect_ec)
|
||||||
{
|
{
|
||||||
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
@ -1822,7 +1822,7 @@ rb_current_execution_context(void)
|
|||||||
#else
|
#else
|
||||||
rb_execution_context_t *ec = native_tls_get(ruby_current_ec_key);
|
rb_execution_context_t *ec = native_tls_get(ruby_current_ec_key);
|
||||||
#endif
|
#endif
|
||||||
VM_ASSERT(ec != NULL);
|
VM_ASSERT(!expect_ec || ec != NULL);
|
||||||
return ec;
|
return ec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1490,7 +1490,7 @@ static void
|
|||||||
scope_visibility_check(void)
|
scope_visibility_check(void)
|
||||||
{
|
{
|
||||||
/* Check for public/protected/private/module_function called inside a method */
|
/* 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) {
|
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_warn("calling %s without arguments inside a method may not have the intended effect",
|
||||||
rb_id2name(rb_frame_this_func()));
|
rb_id2name(rb_frame_this_func()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user