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

Unified Diff: src/string-stream.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/string-stream.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string-stream.cc
diff --git a/src/string-stream.cc b/src/string-stream.cc
index 00deaea31820174a4552fc15eba5bdbc1d94ef73..5f61e0da1d2357004ae3deaca38a33b7110da390 100644
--- a/src/string-stream.cc
+++ b/src/string-stream.cc
@@ -18,6 +18,18 @@ char* HeapStringAllocator::allocate(unsigned bytes) {
}
+char* FixedStringAllocator::allocate(unsigned bytes) {
+ CHECK_LE(bytes, length_);
+ return buffer_;
+}
+
+
+char* FixedStringAllocator::grow(unsigned* old) {
+ *old = length_;
+ return buffer_;
+}
+
+
bool StringStream::Put(char c) {
if (full()) return false;
DCHECK(length_ < capacity_);
@@ -170,7 +182,7 @@ void StringStream::PrintObject(Object* o) {
} else if (o->IsNumber() || o->IsOddball()) {
return;
}
- if (o->IsHeapObject()) {
+ if (o->IsHeapObject() && object_print_mode_ == kPrintObjectVerbose) {
HeapObject* ho = HeapObject::cast(o);
DebugObjectCache* debug_object_cache = ho->GetIsolate()->
string_stream_debug_object_cache();
@@ -284,7 +296,8 @@ void StringStream::ClearMentionedObjectCache(Isolate* isolate) {
#ifdef DEBUG
bool StringStream::IsMentionedObjectCacheClear(Isolate* isolate) {
- return isolate->string_stream_debug_object_cache()->length() == 0;
+ return object_print_mode_ == kPrintObjectConcise ||
+ isolate->string_stream_debug_object_cache()->length() == 0;
}
#endif
@@ -403,6 +416,7 @@ void StringStream::PrintByteArray(ByteArray* byte_array) {
void StringStream::PrintMentionedObjectCache(Isolate* isolate) {
+ if (object_print_mode_ == kPrintObjectConcise) return;
DebugObjectCache* debug_object_cache =
isolate->string_stream_debug_object_cache();
Add("==== Key ============================================\n\n");
« no previous file with comments | « src/string-stream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698