From f830d55ec776871b0a18fd1c98feb2e2d3d84c8c Mon Sep 17 00:00:00 2001 From: rofl0r Date: Sun, 8 Dec 2019 00:14:50 +0000 Subject: [PATCH] agssim: move label_check out of vm_step removes a couple instructions and a branch from the most performance-sensitive part. --- agssim.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/agssim.c b/agssim.c index ef9c925..9bbaa0b 100644 --- a/agssim.c +++ b/agssim.c @@ -287,7 +287,6 @@ static int label_check() { #define REGF(X) registers[CODE_INT(X)].f static int vm_step(int run_context) { - if(!run_context && !label_check()) return 0; /* we use register AR_NULL as instruction pointer */ #define EIP registers[AR_NULL].i int *eip = &text.code[EIP]; @@ -602,7 +601,7 @@ enum UserCommand { }; static void execute_user_command_i(int uc) { switch(uc) { - case UC_STEP: vm_step(0); break; + case UC_STEP: if(label_check()) vm_step(0); break; case UC_RUN : vm_run(); break; case UC_INIT: vm_init(); break; case UC_QUIT: exit(0); break; -- 2.11.4.GIT