From 94a922af1f015da6c24ba6c81aeace0c7e6d80bf Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 4 Dec 2020 19:09:15 -0600 Subject: [PATCH] vm: Move arm to arm64. --- vm/cpu-arm.hpp | 8 +------- vm/os-linux-arm.64.hpp | 31 ------------------------------- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/vm/cpu-arm.hpp b/vm/cpu-arm.hpp index a0d4de56ec..cfa8e8c52c 100644 --- a/vm/cpu-arm.hpp +++ b/vm/cpu-arm.hpp @@ -5,13 +5,7 @@ namespace factor { // void c_to_factor(cell quot); // void lazy_jit_compile(cell quot); -static const fixnum xt_tail_pic_offset = 4 + 1; // or 4 or whatever else... - - -static const unsigned char call_opcode = 0xe8; // omg, these are x86 values -static const unsigned char jmp_opcode = 0xe9; // omg - -static const unsigned SIGNAL_HANDLER_STACK_FRAME_SIZE = 64; // omg +// static const fixnum xt_tail_pic_offset = 4 + 1; // or 4 or whatever else... // omg diff --git a/vm/os-linux-arm.64.hpp b/vm/os-linux-arm.64.hpp index 9ba9587925..d2a10d3e84 100644 --- a/vm/os-linux-arm.64.hpp +++ b/vm/os-linux-arm.64.hpp @@ -73,37 +73,6 @@ static const unsigned JIT_FRAME_SIZE = 32; static const unsigned char call_opcode = 0xe8; static const unsigned char jmp_opcode = 0xe9; -inline static unsigned char call_site_opcode(cell return_address) { - return *(unsigned char*)(return_address - 5); -} - -inline static void check_call_site(cell return_address) { - unsigned char opcode = call_site_opcode(return_address); - FACTOR_ASSERT(opcode == call_opcode || opcode == jmp_opcode); - (void)opcode; // suppress warning when compiling without assertions -} - -inline static void* get_call_target(cell return_address) { - check_call_site(return_address); - return (void*)(*(int*)(return_address - 4) + return_address); -} - -inline static void set_call_target(cell return_address, cell target) { - check_call_site(return_address); - *(int*)(return_address - 4) = (uint32_t)(target - return_address); -} - -inline static bool tail_call_site_p(cell return_address) { - switch (call_site_opcode(return_address)) { - case jmp_opcode: - return true; - case call_opcode: - return false; - default: - abort(); - return false; - } -} static const unsigned SIGNAL_HANDLER_STACK_FRAME_SIZE = 192; -- 2.34.1