[前][次][番号順一覧][スレッド一覧]

ruby-changes:73221

From: Maxime <ko1@a...>
Date: Tue, 30 Aug 2022 01:03:06 +0900 (JST)
Subject: [ruby-changes:73221] 7e22ec7439 (master): Clear the icache on arm

https://git.ruby-lang.org/ruby.git/commit/?id=7e22ec7439

From 7e22ec7439211d43aea850a4e849f37e631ed131 Mon Sep 17 00:00:00 2001
From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...>
Date: Fri, 22 Jul 2022 12:18:21 -0400
Subject: Clear the icache on arm

---
 yjit.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/yjit.c b/yjit.c
index 0dddcfdc5a..a0c5c09091 100644
--- a/yjit.c
+++ b/yjit.c
@@ -78,6 +78,10 @@ rb_yjit_mark_executable(void *mem_block, uint32_t mem_size) https://github.com/ruby/ruby/blob/trunk/yjit.c#L78
         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)))
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]