Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: src/heap/heap.cc

Issue 1149623010: Print and save JS stacktrace on OOM crash. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/heap.h ('k') | src/isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 5348 matching lines...) Expand 10 before | Expand all | Expand 10 after
5359 for (HeapObject* obj = iterator.next(); obj != NULL; 5359 for (HeapObject* obj = iterator.next(); obj != NULL;
5360 obj = iterator.next()) { 5360 obj = iterator.next()) {
5361 InstanceType type = obj->map()->instance_type(); 5361 InstanceType type = obj->map()->instance_type();
5362 DCHECK(0 <= type && type <= LAST_TYPE); 5362 DCHECK(0 <= type && type <= LAST_TYPE);
5363 stats->objects_per_type[type]++; 5363 stats->objects_per_type[type]++;
5364 stats->size_per_type[type] += obj->Size(); 5364 stats->size_per_type[type] += obj->Size();
5365 } 5365 }
5366 } 5366 }
5367 if (stats->last_few_messages != NULL) 5367 if (stats->last_few_messages != NULL)
5368 GetFromRingBuffer(stats->last_few_messages); 5368 GetFromRingBuffer(stats->last_few_messages);
5369 if (stats->js_stacktrace != NULL) {
5370 FixedStringAllocator fixed(stats->js_stacktrace, kStacktraceBufferSize - 1);
5371 StringStream accumulator(&fixed);
5372 isolate()->PrintStack(&accumulator, Isolate::kPrintStackVerbose);
5373 }
5369 } 5374 }
5370 5375
5371 5376
5372 intptr_t Heap::PromotedSpaceSizeOfObjects() { 5377 intptr_t Heap::PromotedSpaceSizeOfObjects() {
5373 return old_space_->SizeOfObjects() + code_space_->SizeOfObjects() + 5378 return old_space_->SizeOfObjects() + code_space_->SizeOfObjects() +
5374 map_space_->SizeOfObjects() + lo_space_->SizeOfObjects(); 5379 map_space_->SizeOfObjects() + lo_space_->SizeOfObjects();
5375 } 5380 }
5376 5381
5377 5382
5378 int64_t Heap::PromotedExternalMemorySize() { 5383 int64_t Heap::PromotedExternalMemorySize() {
(...skipping 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after
6671 *object_type = "CODE_TYPE"; \ 6676 *object_type = "CODE_TYPE"; \
6672 *object_sub_type = "CODE_AGE/" #name; \ 6677 *object_sub_type = "CODE_AGE/" #name; \
6673 return true; 6678 return true;
6674 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) 6679 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME)
6675 #undef COMPARE_AND_RETURN_NAME 6680 #undef COMPARE_AND_RETURN_NAME
6676 } 6681 }
6677 return false; 6682 return false;
6678 } 6683 }
6679 } // namespace internal 6684 } // namespace internal
6680 } // namespace v8 6685 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698