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 int frames_size = frames.length(); |
266 void** addresses = NewArray<void*>(frames_size); | 267 void** addresses = NewArray<void*>(frames_size); |
267 | 268 |
268 int frames_count = backtrace(addresses, frames_size); | 269 int frames_count = backtrace(addresses, frames_size); |
269 | 270 |
270 char** symbols; | 271 char** symbols; |
271 symbols = backtrace_symbols(addresses, frames_count); | 272 symbols = backtrace_symbols(addresses, frames_count); |
272 if (symbols == NULL) { | 273 if (symbols == NULL) { |
273 DeleteArray(addresses); | 274 DeleteArray(addresses); |
274 return kStackWalkError; | 275 return kStackWalkError; |
275 } | 276 } |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 } | 631 } |
631 | 632 |
632 // This sampler is no longer the active sampler. | 633 // This sampler is no longer the active sampler. |
633 active_sampler_ = NULL; | 634 active_sampler_ = NULL; |
634 active_ = false; | 635 active_ = false; |
635 } | 636 } |
636 | 637 |
637 #endif // ENABLE_LOGGING_AND_PROFILING | 638 #endif // ENABLE_LOGGING_AND_PROFILING |
638 | 639 |
639 } } // namespace v8::internal | 640 } } // namespace v8::internal |
OLD | NEW |