OLD | NEW |
1 //===- Unix/Memory.cpp - Generic UNIX System Configuration ------*- C++ -*-===// | 1 //===- Unix/Memory.cpp - Generic UNIX System Configuration ------*- C++ -*-===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file defines some functions for various memory management utilities. | 10 // This file defines some functions for various memory management utilities. |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 const intptr_t StartLine = ((intptr_t) Addr) & Mask; | 326 const intptr_t StartLine = ((intptr_t) Addr) & Mask; |
327 const intptr_t EndLine = ((intptr_t) Addr + Len + LineSize - 1) & Mask; | 327 const intptr_t EndLine = ((intptr_t) Addr + Len + LineSize - 1) & Mask; |
328 | 328 |
329 for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize) | 329 for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize) |
330 asm volatile("dcbf 0, %0" : : "r"(Line)); | 330 asm volatile("dcbf 0, %0" : : "r"(Line)); |
331 asm volatile("sync"); | 331 asm volatile("sync"); |
332 | 332 |
333 for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize) | 333 for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize) |
334 asm volatile("icbi 0, %0" : : "r"(Line)); | 334 asm volatile("icbi 0, %0" : : "r"(Line)); |
335 asm volatile("isync"); | 335 asm volatile("isync"); |
| 336 // @LOCALMOD-START |
| 337 # elif defined(__native_client__) |
| 338 exit(1); // Native Client disallows JIT-compilation. |
| 339 // @LOCALMOD-END |
336 # elif (defined(__arm__) || defined(__aarch64__)) && defined(__GNUC__) | 340 # elif (defined(__arm__) || defined(__aarch64__)) && defined(__GNUC__) |
337 // FIXME: Can we safely always call this for __GNUC__ everywhere? | 341 // FIXME: Can we safely always call this for __GNUC__ everywhere? |
338 const char *Start = static_cast<const char *>(Addr); | 342 const char *Start = static_cast<const char *>(Addr); |
339 const char *End = Start + Len; | 343 const char *End = Start + Len; |
340 __clear_cache(const_cast<char *>(Start), const_cast<char *>(End)); | 344 __clear_cache(const_cast<char *>(Start), const_cast<char *>(End)); |
341 # elif defined(__mips__) | 345 # elif defined(__mips__) |
342 const char *Start = static_cast<const char *>(Addr); | 346 const char *Start = static_cast<const char *>(Addr); |
343 # if defined(ANDROID) | 347 # if defined(ANDROID) |
344 // The declaration of "cacheflush" in Android bionic: | 348 // The declaration of "cacheflush" in Android bionic: |
345 // extern int cacheflush(long start, long end, long flags); | 349 // extern int cacheflush(long start, long end, long flags); |
346 const char *End = Start + Len; | 350 const char *End = Start + Len; |
347 long LStart = reinterpret_cast<long>(const_cast<char *>(Start)); | 351 long LStart = reinterpret_cast<long>(const_cast<char *>(Start)); |
348 long LEnd = reinterpret_cast<long>(const_cast<char *>(End)); | 352 long LEnd = reinterpret_cast<long>(const_cast<char *>(End)); |
349 cacheflush(LStart, LEnd, BCACHE); | 353 cacheflush(LStart, LEnd, BCACHE); |
350 # else | 354 # else |
351 cacheflush(const_cast<char *>(Start), Len, BCACHE); | 355 cacheflush(const_cast<char *>(Start), Len, BCACHE); |
352 # endif | 356 # endif |
353 # endif | 357 # endif |
354 | 358 |
355 #endif // end apple | 359 #endif // end apple |
356 | 360 |
357 ValgrindDiscardTranslations(Addr, Len); | 361 ValgrindDiscardTranslations(Addr, Len); |
358 } | 362 } |
359 | 363 |
360 } // namespace sys | 364 } // namespace sys |
361 } // namespace llvm | 365 } // namespace llvm |
OLD | NEW |