[llvm-commits] CVS: llvm/tools/lli/JIT/Emitter.cpp

Misha Brukman brukman at cs.uiuc.edu
Tue Jul 29 11:58:01 PDT 2003


Changes in directory llvm/tools/lli/JIT:

Emitter.cpp updated: 1.19 -> 1.20

---
Log message:

* Stop hard-coding a value for beginning of emitted code on Sparc since we can
  now handle far calls (i.e., beyond the 30-bit limit in call instructions).
* As a side-effect, this allows us to unify and clean up the mmap() call and
  code around it.


---
Diffs of the changes:

Index: llvm/tools/lli/JIT/Emitter.cpp
diff -u llvm/tools/lli/JIT/Emitter.cpp:1.19 llvm/tools/lli/JIT/Emitter.cpp:1.20
--- llvm/tools/lli/JIT/Emitter.cpp:1.19	Mon Jul 28 14:26:19 2003
+++ llvm/tools/lli/JIT/Emitter.cpp	Tue Jul 29 11:57:16 2003
@@ -76,20 +76,16 @@
   /* Linux and *BSD tend to have these flags named differently. */
 #if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
 # define MAP_ANONYMOUS MAP_ANON
-#endif
-  pa = mmap(0, pageSize*NumPages, PROT_READ|PROT_WRITE|PROT_EXEC,
-            MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);  /* fd = 0  */
+#endif /* defined(MAP_ANON) && !defined(MAP_ANONYMOUS) */
+#define fd  0
 #elif defined(sparc) || defined(__sparc__) || defined(__sparcv9)
-  static unsigned long Counter = 0;
-  pa = mmap((void*)(0x140000000UL+Counter), pageSize*NumPages,
-            PROT_READ|PROT_WRITE|PROT_EXEC,
-            MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, -1, 0); /* fd = -1 */
-  Counter += pageSize*NumPages;
+#define fd -1
 #else
-  std::cerr << "This architecture is not supported by the JIT\n";
+  std::cerr << "This architecture is not supported by the JIT!\n";
   abort();
 #endif
-
+  pa = mmap(0, pageSize*NumPages, PROT_READ|PROT_WRITE|PROT_EXEC,
+            MAP_PRIVATE|MAP_ANONYMOUS, fd, 0);
   if (pa == MAP_FAILED) {
     perror("mmap");
     abort();





More information about the llvm-commits mailing list