Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/zjit-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
rustup install ${{ matrix.rust_version }} --profile minimal
rustup default ${{ matrix.rust_version }}

- uses: taiki-e/install-action@c7eb1735f09259a5035e8e5d44b1406b1cddc0fb # v2.83.0
- uses: taiki-e/install-action@43aecc8d72668fbcfe75c31400bc4f890f1c5853 # v2.83.2
with:
tool: nextest@0.9
if: ${{ matrix.test_task == 'zjit-check' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zjit-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
ruby-version: '3.1'
bundler: none

- uses: taiki-e/install-action@c7eb1735f09259a5035e8e5d44b1406b1cddc0fb # v2.83.0
- uses: taiki-e/install-action@43aecc8d72668fbcfe75c31400bc4f890f1c5853 # v2.83.2
with:
tool: nextest@0.9
if: ${{ matrix.test_task == 'zjit-check' }}
Expand Down
5 changes: 2 additions & 3 deletions eval_intern.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,8 @@ extern int select_large_fdset(int, fd_set *, fd_set *, fd_set *, struct timeval

#define EC_REPUSH_TAG() (void)(_ec->tag = &_tag)

#if defined __GNUC__ && __GNUC__ == 4 && (__GNUC_MINOR__ >= 6 && __GNUC_MINOR__ <= 8) || defined __clang__
/* This macro prevents GCC 4.6--4.8 from emitting maybe-uninitialized warnings.
* This macro also prevents Clang from dumping core in EC_EXEC_TAG().
#if defined __clang__
/* This macro prevents Clang from dumping core in EC_EXEC_TAG().
* (I confirmed Clang 4.0.1 and 5.0.0.)
*/
# define VAR_FROM_MEMORY(var) __extension__(*(__typeof__(var) volatile *)&(var))
Expand Down
4 changes: 2 additions & 2 deletions iseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1359,8 +1359,8 @@ rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE realpath, VALUE line, V
{
rb_iseq_t *iseq = NULL;
rb_compile_option_t option;
#if !defined(__GNUC__) || (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
# define INITIALIZED volatile /* suppress warnings by gcc 4.8 */
#if !defined(__GNUC__)
# define INITIALIZED volatile /* suppress warnings */
#else
# define INITIALIZED /* volatile */
#endif
Expand Down
9 changes: 0 additions & 9 deletions vm_exec.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,7 @@ error !
/* token threaded code */

/* dispatcher */
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && __GNUC__ == 3
#define DISPATCH_ARCH_DEPEND_WAY(addr) \
__asm__ __volatile__("jmp *%0;\t# -- inserted by vm.h\t[length = 2]" : : "r" (addr))

#else
#define DISPATCH_ARCH_DEPEND_WAY(addr) \
/* do nothing */
#endif
#define TC_DISPATCH(insn) \
DISPATCH_ARCH_DEPEND_WAY(insns_address_table[GET_CURRENT_INSN()]); \
INSN_DISPATCH_SIG(insn); \
RB_GNUC_EXTENSION_BLOCK(goto *insns_address_table[GET_CURRENT_INSN()]); \
rb_bug("tc error");
Expand Down
9 changes: 4 additions & 5 deletions win32/setup.mak
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,10 @@ main(void)
return c != value_nan();
}
<<
@( \
$(CC) -O2 $@.c && .\$@ || \
(set bug=%ERRORLEVEL% & \
echo This compiler has an optimization bug) \
) & $(WIN32DIR:/=\)\rm.bat $@.* & exit /b %bug%
@($(CC) -O2 $@.c && .\$@) || \
(echo This compiler has an optimization bug & \
$(WIN32DIR:/=\)\rm.bat $@.* & exit /b 1)
@$(WIN32DIR:/=\)\rm.bat $@.*

-version-: nul verconf.mk

Expand Down
11 changes: 9 additions & 2 deletions zjit/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2980,6 +2980,13 @@ impl Function {
}
}

/// Return whether the representative of `insn_id` is a `SendDirect` without
/// cloning the instruction or resolving its operands.
fn is_send_direct(&self, insn_id: InsnId) -> bool {
let insn_id = self.union_find.borrow().find_const(insn_id);
matches!(&self.insns[insn_id.0], Insn::SendDirect(..))
}

fn new_block(&mut self, insn_idx: u32) -> BlockId {
let id = BlockId(self.blocks.len());
let block = Block {
Expand Down Expand Up @@ -5062,7 +5069,7 @@ impl Function {
let mut search_start = 0;
loop {
let Some(offset) = self.blocks[block.0].insns[search_start..].iter()
.position(|&id| matches!(self.find(id), Insn::SendDirect(..)))
.position(|&id| self.is_send_direct(id))
else {
break;
};
Expand Down Expand Up @@ -5171,7 +5178,7 @@ impl Function {
// pre-Send body, before the PushLightweightFrame and Jump we add
// last).
let tail = self.blocks[block.0].insns.split_off(send_pos);
debug_assert!(matches!(self.find(tail[0]), Insn::SendDirect(..)));
debug_assert!(self.is_send_direct(tail[0]));

let omitted_opt_num = opt_num - passed_opt_num;
let positional_kw_end = lead_num + opt_num + rest_slots + post_num + kw_num;
Expand Down