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 |
214 // Constants used for mmap. | 228 // Constants used for mmap. |
215 static const int kMmapFd = -1; | 229 static const int kMmapFd = -1; |
216 static const int kMmapFdOffset = 0; | 230 static const int kMmapFdOffset = 0; |
217 | 231 |
218 | 232 |
219 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } | 233 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } |
220 | 234 |
221 | 235 |
222 VirtualMemory::VirtualMemory(size_t size) | 236 VirtualMemory::VirtualMemory(size_t size) |
223 : address_(ReserveRegion(size)), size_(size) { } | 237 : address_(ReserveRegion(size)), size_(size) { } |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 return munmap(base, size) == 0; | 355 return munmap(base, size) == 0; |
342 } | 356 } |
343 | 357 |
344 | 358 |
345 bool VirtualMemory::HasLazyCommits() { | 359 bool VirtualMemory::HasLazyCommits() { |
346 // TODO(alph): implement for the platform. | 360 // TODO(alph): implement for the platform. |
347 return false; | 361 return false; |
348 } | 362 } |
349 | 363 |
350 } } // namespace v8::internal | 364 } } // namespace v8::internal |
OLD | NEW |