Bug 476042 - Integrate sparc nanojit intro tracemonkey. Put the flush instruction cache code to the correct place. r=gal

This commit is contained in:
Leon Sha<leon.sha@sun.com> 2009-02-24 12:46:27 +08:00
parent d8bfd089e8
commit 604e62a813

View File

@ -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);