| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 } | 200 } |
| 201 | 201 |
| 202 | 202 |
| 203 void* OS::GetRandomMmapAddr() { | 203 void* OS::GetRandomMmapAddr() { |
| 204 #if defined(__native_client__) | 204 #if defined(__native_client__) |
| 205 // TODO(bradchen): restore randomization once Native Client gets | 205 // TODO(bradchen): restore randomization once Native Client gets |
| 206 // smarter about using mmap address hints. | 206 // smarter about using mmap address hints. |
| 207 // See http://code.google.com/p/nativeclient/issues/3341 | 207 // See http://code.google.com/p/nativeclient/issues/3341 |
| 208 return NULL; | 208 return NULL; |
| 209 #endif | 209 #endif |
| 210 #if defined(ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER) ||\ |
| 211 defined(THREAD_SANITIZER) |
| 212 // Dynamic tools do not support custom mmap addresses. |
| 213 return NULL; |
| 214 #endif |
| 210 Isolate* isolate = Isolate::UncheckedCurrent(); | 215 Isolate* isolate = Isolate::UncheckedCurrent(); |
| 211 // Note that the current isolate isn't set up in a call path via | 216 // Note that the current isolate isn't set up in a call path via |
| 212 // CpuFeatures::Probe. We don't care about randomization in this case because | 217 // CpuFeatures::Probe. We don't care about randomization in this case because |
| 213 // the code page is immediately freed. | 218 // the code page is immediately freed. |
| 214 if (isolate != NULL) { | 219 if (isolate != NULL) { |
| 215 uintptr_t raw_addr; | 220 uintptr_t raw_addr; |
| 216 isolate->random_number_generator()->NextBytes(&raw_addr, sizeof(raw_addr)); | 221 isolate->random_number_generator()->NextBytes(&raw_addr, sizeof(raw_addr)); |
| 217 #if V8_TARGET_ARCH_X64 | 222 #if V8_TARGET_ARCH_X64 |
| 218 // Currently available CPUs have 48 bits of virtual addressing. Truncate | 223 // Currently available CPUs have 48 bits of virtual addressing. Truncate |
| 219 // the hint address to 46 bits to give the kernel a fighting chance of | 224 // the hint address to 46 bits to give the kernel a fighting chance of |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 | 776 |
| 772 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { | 777 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { |
| 773 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); | 778 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); |
| 774 int result = pthread_setspecific(pthread_key, value); | 779 int result = pthread_setspecific(pthread_key, value); |
| 775 ASSERT_EQ(0, result); | 780 ASSERT_EQ(0, result); |
| 776 USE(result); | 781 USE(result); |
| 777 } | 782 } |
| 778 | 783 |
| 779 | 784 |
| 780 } } // namespace v8::internal | 785 } } // namespace v8::internal |
| OLD | NEW |