about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-10-25 18:34:38 +0200
committerptitSeb <sebastien.chev@gmail.com>2022-10-25 18:34:38 +0200
commit067dcbc0f75533761b430d58724df2489a678f5c (patch)
treebd4e131ee6ba3356fc5edf47078eaa5d3020575e /src
parent280bc969cef557e2e8e2cc18b4a2757cc58428d7 (diff)
downloadbox64-067dcbc0f75533761b430d58724df2489a678f5c.tar.gz
box64-067dcbc0f75533761b430d58724df2489a678f5c.zip
[DYNAREC] Added BIGBLOCK=3 level
Diffstat (limited to 'src')
-rwxr-xr-xsrc/dynarec/dynarec_native_pass.c5
-rwxr-xr-xsrc/main.c4
2 files changed, 6 insertions, 3 deletions
diff --git a/src/dynarec/dynarec_native_pass.c b/src/dynarec/dynarec_native_pass.c
index b095889a..86743179 100755
--- a/src/dynarec/dynarec_native_pass.c
+++ b/src/dynarec/dynarec_native_pass.c
@@ -18,6 +18,7 @@
 #include "dynablock.h"
 #include "dynarec_native.h"
 #include "custommem.h"
+#include "elfloader.h"
 
 #include "dynarec_arch.h"
 #include "dynarec_helper.h"
@@ -43,6 +44,7 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr)
     fpu_reset(dyn);
     int reset_n = -1;
     dyn->last_ip = (dyn->insts && dyn->insts[0].pred_sz)?0:ip;  // RIP is always set at start of block unless there is a predecessor!
+    int stopblock = 2+(FindElfAddress(my_context, addr)?0:1); // if block is in elf_memory, it can be extended with bligblocks==2, else it needs 3
     // ok, go now
     INIT;
     while(ok) {
@@ -217,7 +219,8 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr)
         if(ok<0)  {ok = 0; need_epilog=1;}
         ++ninst;
         #if STEP == 0
-        if(ok && ((!isJumpTableDefault64((void*)addr) && (box64_dynarec_bigblock<2)) || (addr>=box64_nodynarec_start && addr<box64_nodynarec_end)))
+        if(ok && (((box64_dynarec_bigblock<stopblock) && !isJumpTableDefault64((void*)addr)) 
+            || (addr>=box64_nodynarec_start && addr<box64_nodynarec_end)))
         #else
         if(ok && (ninst==dyn->size))
         #endif
diff --git a/src/main.c b/src/main.c
index b522f635..542cdea1 100755
--- a/src/main.c
+++ b/src/main.c
@@ -421,13 +421,13 @@ void LoadLogEnv()
     p = getenv("BOX64_DYNAREC_BIGBLOCK");
     if(p) {
         if(strlen(p)==1) {
-            if(p[0]>='0' && p[0]<='2')
+            if(p[0]>='0' && p[0]<='3')
                 box64_dynarec_bigblock = p[0]-'0';
         }
         if(!box64_dynarec_bigblock)
             printf_log(LOG_INFO, "Dynarec will not try to make big block\n");
         else if (box64_dynarec_bigblock>1)
-            printf_log(LOG_INFO, "Dynarec will try to make bigger blocks\n");
+            printf_log(LOG_INFO, "Dynarec will try to make bigger blocks%s\n", (box64_dynarec_bigblock>2)?" even on non-elf memory":"");
 
     }
     p = getenv("BOX64_DYNAREC_STRONGMEM");