Bug 476042 - Integrate sparc nanojit intro tracemonkey. Put the flush instruction cache code to the correct place. r=gal
authorLeon Sha<leon.sha@sun.com>
Tue, 24 Feb 2009 12:46:27 +0800
changeset 25485 678bb683e1c254f29c2007699e6441e5b6ccd6dd
parent 25484 4d2d2fca8c0da6c8e14026fddba692e4bc9ddeb3
child 25486 569dd876fb161a3723050bf9493ea3c9bdcdab50
push id5575
push userrsayre@mozilla.com
push dateWed, 25 Feb 2009 09:05:38 +0000
treeherdermozilla-central@8eba35e62d92 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgal
bugs476042
milestone1.9.2a1pre
Bug 476042 - Integrate sparc nanojit intro tracemonkey. Put the flush instruction cache code to the correct place. r=gal
js/src/nanojit/Assembler.cpp
--- a/js/src/nanojit/Assembler.cpp
+++ b/js/src/nanojit/Assembler.cpp
@@ -931,46 +931,48 @@ namespace nanojit
 		NanoAssert( !_branchStateMap || _branchStateMap->isEmpty());
 		_branchStateMap = 0;
 
 #ifdef AVMPLUS_ARM
 		// If we've modified the code, we need to flush so we don't end up trying 
 		// 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;
 
 			Page *first = p;
 			while (p) {
 				if (!p->next || p->next != p+1) {
 					__clear_cache((char*)first, (char*)(p+1));
 					first = p->next;
 				}
 				p = p->next;
 			}
 		}
 # 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);
 # endif
 	}
 	
 	void Assembler::copyRegisters(RegAlloc* copyTo)
 	{