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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 free(symbols); | 379 free(symbols); |
380 | 380 |
381 return frames_count; | 381 return frames_count; |
382 } | 382 } |
383 | 383 |
384 | 384 |
385 // Constants used for mmap. | 385 // Constants used for mmap. |
386 static const int kMmapFd = -1; | 386 static const int kMmapFd = -1; |
387 static const int kMmapFdOffset = 0; | 387 static const int kMmapFdOffset = 0; |
388 | 388 |
| 389 |
389 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } | 390 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } |
390 | 391 |
391 VirtualMemory::VirtualMemory(size_t size) { | 392 |
392 address_ = ReserveRegion(size); | 393 VirtualMemory::VirtualMemory(size_t size) |
393 size_ = size; | 394 : address_(ReserveRegion(size)), size_(size) { } |
394 } | |
395 | 395 |
396 | 396 |
397 VirtualMemory::VirtualMemory(size_t size, size_t alignment) | 397 VirtualMemory::VirtualMemory(size_t size, size_t alignment) |
398 : address_(NULL), size_(0) { | 398 : address_(NULL), size_(0) { |
399 ASSERT(IsAligned(alignment, static_cast<intptr_t>(OS::AllocateAlignment()))); | 399 ASSERT(IsAligned(alignment, static_cast<intptr_t>(OS::AllocateAlignment()))); |
400 size_t request_size = RoundUp(size + alignment, | 400 size_t request_size = RoundUp(size + alignment, |
401 static_cast<intptr_t>(OS::AllocateAlignment())); | 401 static_cast<intptr_t>(OS::AllocateAlignment())); |
402 void* reservation = mmap(GetRandomMmapAddr(), | 402 void* reservation = mmap(GetRandomMmapAddr(), |
403 request_size, | 403 request_size, |
404 PROT_NONE, | 404 PROT_NONE, |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 | 979 |
980 | 980 |
981 void Sampler::Stop() { | 981 void Sampler::Stop() { |
982 ASSERT(IsActive()); | 982 ASSERT(IsActive()); |
983 SignalSender::RemoveActiveSampler(this); | 983 SignalSender::RemoveActiveSampler(this); |
984 SetActive(false); | 984 SetActive(false); |
985 } | 985 } |
986 | 986 |
987 | 987 |
988 } } // namespace v8::internal | 988 } } // namespace v8::internal |
OLD | NEW |