diff options
author | Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> | 2022-07-22 12:18:21 -0400 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-08-29 08:47:03 -0700 |
commit | 7e22ec7439211d43aea850a4e849f37e631ed131 (patch) | |
tree | a0b32fe5a425db3a86631dfd89b4652e4c53b0fe /yjit.c | |
parent | b1ed4d9b947e650dda7bfb9578652d4edb2608b4 (diff) | |
download | ruby-7e22ec7439211d43aea850a4e849f37e631ed131.tar.gz |
Clear the icache on arm
Diffstat (limited to 'yjit.c')
-rw-r--r-- | yjit.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -78,6 +78,10 @@ rb_yjit_mark_executable(void *mem_block, uint32_t mem_size) rb_bug("Couldn't make JIT page (%p, %lu bytes) executable, errno: %s\n", mem_block, (unsigned long)mem_size, strerror(errno)); } + + // Clear/invalidate the instruction cache. Compiles to nothing on x86_64 + // but required on ARM. On Darwin it's the same as calling sys_icache_invalidate(). + __builtin___clear_cache(mem_block, (char *)mem_block + mem_size); } # define PTR2NUM(x) (rb_int2inum((intptr_t)(void *)(x))) |