Search
lxdream.org :: lxdream/src/sh4/sh4trans.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4trans.c
changeset 1149:da6124fceec6
prev1125:9dd5dee45db9
next1187:266e7a1bae90
author nkeynes
date Wed Nov 10 08:37:42 2010 +1000 (9 years ago)
permissions -rw-r--r--
last change Add chain pointer to the xlat cache, so that we can maintain multiple blocks
for the same address. This prevents thrashing in cases where we would other
keep retranslating the same blocks over and over again due to varying
xlat_sh4_mode values
file annotate diff log raw
1.1 --- a/src/sh4/sh4trans.c Mon Sep 13 10:13:42 2010 +1000
1.2 +++ b/src/sh4/sh4trans.c Wed Nov 10 08:37:42 2010 +1000
1.3 @@ -58,7 +58,15 @@
1.4 }
1.5
1.6 code = xlat_get_code_by_vma( sh4r.pc );
1.7 - if( code == NULL || sh4r.xlat_sh4_mode != XLAT_BLOCK_MODE(code) ) {
1.8 + if( code != NULL ) {
1.9 + while( sh4r.xlat_sh4_mode != XLAT_BLOCK_MODE(code) ) {
1.10 + code = XLAT_BLOCK_CHAIN(code);
1.11 + if( code == NULL ) {
1.12 + code = sh4_translate_basic_block( sh4r.pc );
1.13 + break;
1.14 + }
1.15 + }
1.16 + } else {
1.17 code = sh4_translate_basic_block( sh4r.pc );
1.18 }
1.19 code();
.