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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 #endif | 306 #endif |
307 MAP_PRIVATE, | 307 MAP_PRIVATE, |
308 fileno(f), | 308 fileno(f), |
309 0); | 309 0); |
310 ASSERT(addr != MAP_FAILED); | 310 ASSERT(addr != MAP_FAILED); |
311 OS::Free(addr, size); | 311 OS::Free(addr, size); |
312 fclose(f); | 312 fclose(f); |
313 } | 313 } |
314 | 314 |
315 | 315 |
| 316 int OS::StackWalk(Vector<OS::StackFrame> frames) { |
| 317 // backtrace is a glibc extension. |
| 318 #if defined(__GLIBC__) && !defined(__UCLIBC__) |
| 319 return POSIXBacktraceHelper<backtrace, backtrace_symbols>::StackWalk(frames); |
| 320 #else |
| 321 return 0; |
| 322 #endif |
| 323 } |
| 324 |
| 325 |
316 // Constants used for mmap. | 326 // Constants used for mmap. |
317 static const int kMmapFd = -1; | 327 static const int kMmapFd = -1; |
318 static const int kMmapFdOffset = 0; | 328 static const int kMmapFdOffset = 0; |
319 | 329 |
320 | 330 |
321 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } | 331 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } |
322 | 332 |
323 | 333 |
324 VirtualMemory::VirtualMemory(size_t size) | 334 VirtualMemory::VirtualMemory(size_t size) |
325 : address_(ReserveRegion(size)), size_(size) { } | 335 : address_(ReserveRegion(size)), size_(size) { } |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 bool VirtualMemory::ReleaseRegion(void* base, size_t size) { | 459 bool VirtualMemory::ReleaseRegion(void* base, size_t size) { |
450 return munmap(base, size) == 0; | 460 return munmap(base, size) == 0; |
451 } | 461 } |
452 | 462 |
453 | 463 |
454 bool VirtualMemory::HasLazyCommits() { | 464 bool VirtualMemory::HasLazyCommits() { |
455 return true; | 465 return true; |
456 } | 466 } |
457 | 467 |
458 } } // namespace v8::internal | 468 } } // namespace v8::internal |
OLD | NEW |