OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // variety of ASLR modes (PAE kernel, NX compat mode, etc). | 92 // variety of ASLR modes (PAE kernel, NX compat mode, etc). |
93 raw_addr &= 0x3ffff000; | 93 raw_addr &= 0x3ffff000; |
94 raw_addr += 0x20000000; | 94 raw_addr += 0x20000000; |
95 #endif | 95 #endif |
96 return reinterpret_cast<void*>(raw_addr); | 96 return reinterpret_cast<void*>(raw_addr); |
97 } | 97 } |
98 return NULL; | 98 return NULL; |
99 } | 99 } |
100 | 100 |
101 | 101 |
102 void OS::Setup() { | 102 void OS::SetUp() { |
103 // Seed the random number generator. We preserve microsecond resolution. | 103 // Seed the random number generator. We preserve microsecond resolution. |
104 uint64_t seed = Ticks() ^ (getpid() << 16); | 104 uint64_t seed = Ticks() ^ (getpid() << 16); |
105 srandom(static_cast<unsigned int>(seed)); | 105 srandom(static_cast<unsigned int>(seed)); |
106 limit_mutex = CreateMutex(); | 106 limit_mutex = CreateMutex(); |
107 } | 107 } |
108 | 108 |
109 | 109 |
110 uint64_t OS::CpuFeaturesImpliedByPlatform() { | 110 uint64_t OS::CpuFeaturesImpliedByPlatform() { |
111 return 0; | 111 return 0; |
112 } | 112 } |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 // for a zero-length string because we know that we at least read the | 305 // for a zero-length string because we know that we at least read the |
306 // '/' character. | 306 // '/' character. |
307 lib_name[strlen(lib_name) - 1] = '\0'; | 307 lib_name[strlen(lib_name) - 1] = '\0'; |
308 } else { | 308 } else { |
309 // No library name found, just record the raw address range. | 309 // No library name found, just record the raw address range. |
310 snprintf(lib_name, kLibNameLen, | 310 snprintf(lib_name, kLibNameLen, |
311 "%08" V8PRIxPTR "-%08" V8PRIxPTR, start, end); | 311 "%08" V8PRIxPTR "-%08" V8PRIxPTR, start, end); |
312 } | 312 } |
313 LOG(isolate, SharedLibraryEvent(lib_name, start, end)); | 313 LOG(isolate, SharedLibraryEvent(lib_name, start, end)); |
314 } else { | 314 } else { |
315 // Entry not describing executable data. Skip to end of line to setup | 315 // Entry not describing executable data. Skip to end of line to set up |
316 // reading the next entry. | 316 // reading the next entry. |
317 do { | 317 do { |
318 c = getc(fp); | 318 c = getc(fp); |
319 } while ((c != EOF) && (c != '\n')); | 319 } while ((c != EOF) && (c != '\n')); |
320 if (c == EOF) break; | 320 if (c == EOF) break; |
321 } | 321 } |
322 } | 322 } |
323 free(lib_name); | 323 free(lib_name); |
324 fclose(fp); | 324 fclose(fp); |
325 } | 325 } |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 | 957 |
958 | 958 |
959 void Sampler::Stop() { | 959 void Sampler::Stop() { |
960 ASSERT(IsActive()); | 960 ASSERT(IsActive()); |
961 SignalSender::RemoveActiveSampler(this); | 961 SignalSender::RemoveActiveSampler(this); |
962 SetActive(false); | 962 SetActive(false); |
963 } | 963 } |
964 | 964 |
965 | 965 |
966 } } // namespace v8::internal | 966 } } // namespace v8::internal |
OLD | NEW |