From 604e62a81360c9ff516ced32728ac0bffb9dd98b Mon Sep 17 00:00:00 2001 From: Leon Sha Date: Tue, 24 Feb 2009 12:46:27 +0800 Subject: [PATCH] Bug 476042 - Integrate sparc nanojit intro tracemonkey. Put the flush instruction cache code to the correct place. r=gal --- js/src/nanojit/Assembler.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/js/src/nanojit/Assembler.cpp b/js/src/nanojit/Assembler.cpp index 1ee276daf31..ea72ad37444 100644 --- a/js/src/nanojit/Assembler.cpp +++ b/js/src/nanojit/Assembler.cpp @@ -936,20 +936,6 @@ namespace nanojit // to execute junk # if defined(UNDER_CE) FlushInstructionCache(GetCurrentProcess(), NULL, NULL); -#elif defined AVMPLUS_SPARC - // Clear Instruction Cache - for (int i = 0; i < 2; i++) { - Page *p = (i == 0) ? _nativePages : _nativeExitPages; - - Page *first = p; - while (p) { - if (!p->next || p->next != p+1) { - sync_instruction_memory((char *)first, NJ_PAGE_SIZE); - first = p->next; - } - p = p->next; - } - } # elif defined(AVMPLUS_UNIX) for (int i = 0; i < 2; i++) { Page *p = (i == 0) ? _nativePages : _nativeExitPages; @@ -966,6 +952,22 @@ namespace nanojit # endif #endif +#ifdef AVMPLUS_SPARC + // Clear Instruction Cache + for (int i = 0; i < 2; i++) { + Page *p = (i == 0) ? _nativePages : _nativeExitPages; + + Page *first = p; + while (p) { + if (!p->next || p->next != p+1) { + sync_instruction_memory((char *)first, NJ_PAGE_SIZE); + first = p->next; + } + p = p->next; + } + } +#endif + # ifdef AVMPLUS_PORTING_API NanoJIT_PortAPI_FlushInstructionCache(_nIns, _startingIns); NanoJIT_PortAPI_FlushInstructionCache(_nExitIns, _endJit2Addr);