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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 frames_seen++; | 646 frames_seen++; |
647 } | 647 } |
648 it.Advance(); | 648 it.Advance(); |
649 } | 649 } |
650 | 650 |
651 stack_trace->set_length(Smi::FromInt(frames_seen)); | 651 stack_trace->set_length(Smi::FromInt(frames_seen)); |
652 return stack_trace; | 652 return stack_trace; |
653 } | 653 } |
654 | 654 |
655 | 655 |
656 void Isolate::PrintStack() { | |
657 PrintStack(stdout); | |
658 } | |
659 | |
660 | |
661 void Isolate::PrintStack(FILE* out) { | 656 void Isolate::PrintStack(FILE* out) { |
662 if (stack_trace_nesting_level_ == 0) { | 657 if (stack_trace_nesting_level_ == 0) { |
663 stack_trace_nesting_level_++; | 658 stack_trace_nesting_level_++; |
664 StringStream::ClearMentionedObjectCache(this); | 659 StringStream::ClearMentionedObjectCache(this); |
665 HeapStringAllocator allocator; | 660 HeapStringAllocator allocator; |
666 StringStream accumulator(&allocator); | 661 StringStream accumulator(&allocator); |
667 incomplete_message_ = &accumulator; | 662 incomplete_message_ = &accumulator; |
668 PrintStack(&accumulator); | 663 PrintStack(&accumulator); |
669 accumulator.OutputToFile(out); | 664 accumulator.OutputToFile(out); |
670 InitializeLoggingAndCounters(); | 665 InitializeLoggingAndCounters(); |
(...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2310 | 2305 |
2311 #ifdef DEBUG | 2306 #ifdef DEBUG |
2312 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2307 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
2313 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2308 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
2314 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2309 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
2315 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2310 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
2316 #undef ISOLATE_FIELD_OFFSET | 2311 #undef ISOLATE_FIELD_OFFSET |
2317 #endif | 2312 #endif |
2318 | 2313 |
2319 } } // namespace v8::internal | 2314 } } // namespace v8::internal |
OLD | NEW |