OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 // There may be no filename in this line. Skip to next. | 255 // There may be no filename in this line. Skip to next. |
256 if (start_of_path == NULL) continue; | 256 if (start_of_path == NULL) continue; |
257 buffer[bytes_read] = 0; | 257 buffer[bytes_read] = 0; |
258 LOG(SharedLibraryEvent(start_of_path, start, end)); | 258 LOG(SharedLibraryEvent(start_of_path, start, end)); |
259 } | 259 } |
260 close(fd); | 260 close(fd); |
261 #endif | 261 #endif |
262 } | 262 } |
263 | 263 |
264 | 264 |
265 int OS::StackWalk(OS::StackFrame* frames, int frames_size) { | 265 int OS::StackWalk(Vector<OS::StackFrame> frames) { |
266 // backtrace is a glibc extension. | 266 // backtrace is a glibc extension. |
267 #ifdef __GLIBC__ | 267 #ifdef __GLIBC__ |
| 268 int frames_size = frames.length(); |
268 void** addresses = NewArray<void*>(frames_size); | 269 void** addresses = NewArray<void*>(frames_size); |
269 | 270 |
270 int frames_count = backtrace(addresses, frames_size); | 271 int frames_count = backtrace(addresses, frames_size); |
271 | 272 |
272 char** symbols; | 273 char** symbols; |
273 symbols = backtrace_symbols(addresses, frames_count); | 274 symbols = backtrace_symbols(addresses, frames_count); |
274 if (symbols == NULL) { | 275 if (symbols == NULL) { |
275 DeleteArray(addresses); | 276 DeleteArray(addresses); |
276 return kStackWalkError; | 277 return kStackWalkError; |
277 } | 278 } |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 } | 669 } |
669 | 670 |
670 // This sampler is no longer the active sampler. | 671 // This sampler is no longer the active sampler. |
671 active_sampler_ = NULL; | 672 active_sampler_ = NULL; |
672 active_ = false; | 673 active_ = false; |
673 } | 674 } |
674 | 675 |
675 #endif // ENABLE_LOGGING_AND_PROFILING | 676 #endif // ENABLE_LOGGING_AND_PROFILING |
676 | 677 |
677 } } // namespace v8::internal | 678 } } // namespace v8::internal |
OLD | NEW |