| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 "%s'0x%p [0x%p]", | 204 "%s'0x%p [0x%p]", |
| 205 info.dli_fname, | 205 info.dli_fname, |
| 206 pc - reinterpret_cast<uintptr_t>(info.dli_fbase), | 206 pc - reinterpret_cast<uintptr_t>(info.dli_fbase), |
| 207 pc); | 207 pc); |
| 208 } | 208 } |
| 209 walker->index++; | 209 walker->index++; |
| 210 return 0; | 210 return 0; |
| 211 } | 211 } |
| 212 | 212 |
| 213 | 213 |
| 214 int OS::StackWalk(Vector<OS::StackFrame> frames) { | |
| 215 ucontext_t ctx; | |
| 216 struct StackWalker walker = { frames, 0 }; | |
| 217 | |
| 218 if (getcontext(&ctx) < 0) return kStackWalkError; | |
| 219 | |
| 220 if (!walkcontext(&ctx, StackWalkCallback, &walker)) { | |
| 221 return kStackWalkError; | |
| 222 } | |
| 223 | |
| 224 return walker.index; | |
| 225 } | |
| 226 | |
| 227 | |
| 228 // Constants used for mmap. | 214 // Constants used for mmap. |
| 229 static const int kMmapFd = -1; | 215 static const int kMmapFd = -1; |
| 230 static const int kMmapFdOffset = 0; | 216 static const int kMmapFdOffset = 0; |
| 231 | 217 |
| 232 | 218 |
| 233 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } | 219 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } |
| 234 | 220 |
| 235 | 221 |
| 236 VirtualMemory::VirtualMemory(size_t size) | 222 VirtualMemory::VirtualMemory(size_t size) |
| 237 : address_(ReserveRegion(size)), size_(size) { } | 223 : address_(ReserveRegion(size)), size_(size) { } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 return munmap(base, size) == 0; | 341 return munmap(base, size) == 0; |
| 356 } | 342 } |
| 357 | 343 |
| 358 | 344 |
| 359 bool VirtualMemory::HasLazyCommits() { | 345 bool VirtualMemory::HasLazyCommits() { |
| 360 // TODO(alph): implement for the platform. | 346 // TODO(alph): implement for the platform. |
| 361 return false; | 347 return false; |
| 362 } | 348 } |
| 363 | 349 |
| 364 } } // namespace v8::internal | 350 } } // namespace v8::internal |
| OLD | NEW |