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 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
714 // Capture stack trace for a detailed exception message. | 714 // Capture stack trace for a detailed exception message. |
715 Handle<String> key = factory()->hidden_stack_trace_string(); | 715 Handle<String> key = factory()->hidden_stack_trace_string(); |
716 Handle<JSArray> stack_trace = CaptureCurrentStackTrace( | 716 Handle<JSArray> stack_trace = CaptureCurrentStackTrace( |
717 stack_trace_for_uncaught_exceptions_frame_limit_, | 717 stack_trace_for_uncaught_exceptions_frame_limit_, |
718 stack_trace_for_uncaught_exceptions_options_); | 718 stack_trace_for_uncaught_exceptions_options_); |
719 JSObject::SetHiddenProperty(error_object, key, stack_trace); | 719 JSObject::SetHiddenProperty(error_object, key, stack_trace); |
720 } | 720 } |
721 } | 721 } |
722 | 722 |
723 | 723 |
724 StackFrame* Isolate::TopOptimizedFrame() { | |
725 for (StackFrameIterator it(this, thread_local_top()); | |
726 !it.done(); it.Advance()) { | |
727 if (it.frame()->type() == StackFrame::OPTIMIZED) { | |
Michael Starzinger
2013/07/02 14:20:54
Shouldn't this actually just look whether the top-
ulan
2013/07/02 14:45:41
Added a check for non-optimized frame.
On 2013/07
| |
728 return it.frame(); | |
729 } | |
730 } | |
731 return NULL; | |
732 } | |
733 | |
734 | |
724 Handle<JSArray> Isolate::CaptureCurrentStackTrace( | 735 Handle<JSArray> Isolate::CaptureCurrentStackTrace( |
725 int frame_limit, StackTrace::StackTraceOptions options) { | 736 int frame_limit, StackTrace::StackTraceOptions options) { |
726 // Ensure no negative values. | 737 // Ensure no negative values. |
727 int limit = Max(frame_limit, 0); | 738 int limit = Max(frame_limit, 0); |
728 Handle<JSArray> stack_trace = factory()->NewJSArray(frame_limit); | 739 Handle<JSArray> stack_trace = factory()->NewJSArray(frame_limit); |
729 | 740 |
730 Handle<String> column_key = | 741 Handle<String> column_key = |
731 factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("column")); | 742 factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("column")); |
732 Handle<String> line_key = | 743 Handle<String> line_key = |
733 factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("lineNumber")); | 744 factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("lineNumber")); |
(...skipping 1737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2471 | 2482 |
2472 #ifdef DEBUG | 2483 #ifdef DEBUG |
2473 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2484 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
2474 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2485 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
2475 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2486 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
2476 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2487 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
2477 #undef ISOLATE_FIELD_OFFSET | 2488 #undef ISOLATE_FIELD_OFFSET |
2478 #endif | 2489 #endif |
2479 | 2490 |
2480 } } // namespace v8::internal | 2491 } } // namespace v8::internal |
OLD | NEW |