Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: runtime/szrt_asan.c

Issue 2235023002: Subzero: Elide redundant access checks within basic blocks (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Turned asan runtime debug back off Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/IceASanInstrumentation.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/runtime/szrt_asan.c - AddressSanitizer Runtime -----*- C -*-===// 1 //===- subzero/runtime/szrt_asan.c - AddressSanitizer Runtime -----*- C -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
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 /// \file 10 /// \file
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 while (__sync_swap((mutex), 1) != 0) { \ 43 while (__sync_swap((mutex), 1) != 0) { \
44 sched_yield(); \ 44 sched_yield(); \
45 } 45 }
46 #define MUTEX_UNLOCK(mutex) (__sync_swap((mutex), 0)) 46 #define MUTEX_UNLOCK(mutex) (__sync_swap((mutex), 0))
47 47
48 #endif // _POSIX_THREADS 48 #endif // _POSIX_THREADS
49 49
50 #define RZ_SIZE (32) 50 #define RZ_SIZE (32)
51 #define SHADOW_SCALE_LOG2 (3) 51 #define SHADOW_SCALE_LOG2 (3)
52 #define SHADOW_SCALE ((size_t)1 << SHADOW_SCALE_LOG2) 52 #define SHADOW_SCALE ((size_t)1 << SHADOW_SCALE_LOG2)
53 #define DEBUG (1) 53 #define DEBUG (0)
54 54
55 // Assuming 48 bit address space on 64 bit systems 55 // Assuming 48 bit address space on 64 bit systems
56 #define SHADOW_LENGTH_64 (1u << (48 - SHADOW_SCALE_LOG2)) 56 #define SHADOW_LENGTH_64 (1u << (48 - SHADOW_SCALE_LOG2))
57 #define SHADOW_LENGTH_32 (1u << (32 - SHADOW_SCALE_LOG2)) 57 #define SHADOW_LENGTH_32 (1u << (32 - SHADOW_SCALE_LOG2))
58 #define WORD_SIZE (sizeof(uint32_t)) 58 #define WORD_SIZE (sizeof(uint32_t))
59 #define IS_32_BIT (sizeof(void *) == WORD_SIZE) 59 #define IS_32_BIT (sizeof(void *) == WORD_SIZE)
60 60
61 #define SHADOW_OFFSET(p) ((uintptr_t)(p) % SHADOW_SCALE) 61 #define SHADOW_OFFSET(p) ((uintptr_t)(p) % SHADOW_SCALE)
62 #define IS_SHADOW_ALIGNED(p) (SHADOW_OFFSET(p) == 0) 62 #define IS_SHADOW_ALIGNED(p) (SHADOW_OFFSET(p) == 0)
63 63
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 void __asan_unpoison(char *ptr, int size) { 305 void __asan_unpoison(char *ptr, int size) {
306 char *end = ptr + size; 306 char *end = ptr + size;
307 assert(IS_SHADOW_ALIGNED(end)); 307 assert(IS_SHADOW_ALIGNED(end));
308 DUMP("unpoison %d bytes at %p: %p - %p\n", size, ptr, MEM2SHADOW(ptr), 308 DUMP("unpoison %d bytes at %p: %p - %p\n", size, ptr, MEM2SHADOW(ptr),
309 MEM2SHADOW(end)); 309 MEM2SHADOW(end));
310 *(char *)MEM2SHADOW(ptr) = 0; 310 *(char *)MEM2SHADOW(ptr) = 0;
311 ptr += SHADOW_OFFSET(size); 311 ptr += SHADOW_OFFSET(size);
312 assert(IS_SHADOW_ALIGNED(ptr)); 312 assert(IS_SHADOW_ALIGNED(ptr));
313 memset(MEM2SHADOW(ptr), 0, (end - ptr) >> SHADOW_SCALE_LOG2); 313 memset(MEM2SHADOW(ptr), 0, (end - ptr) >> SHADOW_SCALE_LOG2);
314 } 314 }
OLDNEW
« no previous file with comments | « no previous file | src/IceASanInstrumentation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698