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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 | 61 |
62 #if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT) | 62 #if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT) |
63 #define LOG_TAG "v8" | 63 #define LOG_TAG "v8" |
64 #include <android/log.h> | 64 #include <android/log.h> |
65 #endif | 65 #endif |
66 | 66 |
67 #include "v8.h" | 67 #include "v8.h" |
68 | 68 |
69 #include "codegen.h" | 69 #include "codegen.h" |
70 #include "isolate-inl.h" | 70 #include "isolate-inl.h" |
71 #include "msan.h" | |
danno
2013/10/10 14:18:07
Here and elsewhere: None of these includes should
Evgeniy Stepanov
2013/10/10 15:08:54
But msan.h is in fact the place where things like
| |
71 #include "platform.h" | 72 #include "platform.h" |
72 | 73 |
73 namespace v8 { | 74 namespace v8 { |
74 namespace internal { | 75 namespace internal { |
75 | 76 |
76 // 0 is never a valid thread id. | 77 // 0 is never a valid thread id. |
77 static const pthread_t kNoThread = (pthread_t) 0; | 78 static const pthread_t kNoThread = (pthread_t) 0; |
78 | 79 |
79 | 80 |
80 uint64_t OS::CpuFeaturesImpliedByPlatform() { | 81 uint64_t OS::CpuFeaturesImpliedByPlatform() { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
200 } | 201 } |
201 | 202 |
202 | 203 |
203 void* OS::GetRandomMmapAddr() { | 204 void* OS::GetRandomMmapAddr() { |
204 #if defined(__native_client__) | 205 #if defined(__native_client__) |
205 // TODO(bradchen): restore randomization once Native Client gets | 206 // TODO(bradchen): restore randomization once Native Client gets |
206 // smarter about using mmap address hints. | 207 // smarter about using mmap address hints. |
207 // See http://code.google.com/p/nativeclient/issues/3341 | 208 // See http://code.google.com/p/nativeclient/issues/3341 |
208 return NULL; | 209 return NULL; |
209 #endif | 210 #endif |
211 #if defined(ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER) || \ | |
danno
2013/10/10 14:18:07
This change been landed separately, why is this in
Evgeniy Stepanov
2013/10/10 15:08:54
That was in a different repository, I think.
| |
212 defined(THREAD_SANITIZER) | |
213 // Dynamic tools do not support custom mmap addresses. | |
214 return NULL; | |
215 #endif | |
210 Isolate* isolate = Isolate::UncheckedCurrent(); | 216 Isolate* isolate = Isolate::UncheckedCurrent(); |
211 // Note that the current isolate isn't set up in a call path via | 217 // 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 | 218 // CpuFeatures::Probe. We don't care about randomization in this case because |
213 // the code page is immediately freed. | 219 // the code page is immediately freed. |
214 if (isolate != NULL) { | 220 if (isolate != NULL) { |
215 uintptr_t raw_addr; | 221 uintptr_t raw_addr; |
216 isolate->random_number_generator()->NextBytes(&raw_addr, sizeof(raw_addr)); | 222 isolate->random_number_generator()->NextBytes(&raw_addr, sizeof(raw_addr)); |
217 #if V8_TARGET_ARCH_X64 | 223 #if V8_TARGET_ARCH_X64 |
218 // Currently available CPUs have 48 bits of virtual addressing. Truncate | 224 // 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 | 225 // 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 | 777 |
772 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { | 778 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { |
773 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); | 779 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); |
774 int result = pthread_setspecific(pthread_key, value); | 780 int result = pthread_setspecific(pthread_key, value); |
775 ASSERT_EQ(0, result); | 781 ASSERT_EQ(0, result); |
776 USE(result); | 782 USE(result); |
777 } | 783 } |
778 | 784 |
779 | 785 |
780 } } // namespace v8::internal | 786 } } // namespace v8::internal |
OLD | NEW |