Commit c9e22a98 authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

Make heap snapshot string limit configurable.

R=ulan@chromium.org

Bug: v8:7402
Change-Id: Ia9d79723ebf63d30528b0d8e639555d08be38531
Reviewed-on: https://chromium-review.googlesource.com/899063Reviewed-by: 's avatarAlexei Filippov <alph@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51226}
parent 8d1b4374
......@@ -917,6 +917,8 @@ DEFINE_BOOL(heap_profiler_trace_objects, false,
"Dump heap object allocations/movements/size_updates")
DEFINE_BOOL(heap_profiler_use_embedder_graph, true,
"Use the new EmbedderGraph API to get embedder nodes")
DEFINE_INT(heap_snapshot_string_limit, 1024,
"truncate strings to this length in the heap snapshot")
// sampling-heap-profiler.cc
DEFINE_BOOL(sampling_heap_profiler_suppress_randomness, false,
......
......@@ -80,7 +80,7 @@ const char* StringsStorage::GetVFormatted(const char* format, va_list args) {
const char* StringsStorage::GetName(Name* name) {
if (name->IsString()) {
String* str = String::cast(name);
int length = Min(kMaxNameSize, str->length());
int length = Min(FLAG_heap_snapshot_string_limit, str->length());
int actual_length = 0;
std::unique_ptr<char[]> data = str->ToCString(
DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL, 0, length, &actual_length);
......
......@@ -31,8 +31,6 @@ class StringsStorage {
const char* GetFunctionName(const char* name);
private:
static const int kMaxNameSize = 1024;
static bool StringsMatch(void* key1, void* key2);
const char* AddOrDisposeString(char* str, int len);
base::CustomMatcherHashMap::Entry* GetEntry(const char* str, int len);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment