Commit 5f98a061 authored by Franziska Hinkelmann's avatar Franziska Hinkelmann Committed by Commit Bot

[cleanup] Make DebugObjectCache an std::vector.

There's no point in using our own implemention of List for this.

Bug:v8:6333

Change-Id: Ic239c9348bb17d61e41130a18e1c9f16cab9d8ee
Reviewed-on: https://chromium-review.googlesource.com/489503Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Franziska Hinkelmann <franzih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45192}
parent a74ac8fa
......@@ -395,7 +395,7 @@ class ThreadLocalTop BASE_EMBEDDED {
V(int, suffix_table, (kBMMaxShift + 1)) \
ISOLATE_INIT_DEBUG_ARRAY_LIST(V)
typedef List<HeapObject*> DebugObjectCache;
typedef std::vector<HeapObject*> DebugObjectCache;
#define ISOLATE_INIT_LIST(V) \
/* Assembler state. */ \
......
......@@ -190,15 +190,15 @@ void StringStream::PrintObject(Object* o) {
HeapObject* ho = HeapObject::cast(o);
DebugObjectCache* debug_object_cache = ho->GetIsolate()->
string_stream_debug_object_cache();
for (int i = 0; i < debug_object_cache->length(); i++) {
for (size_t i = 0; i < debug_object_cache->size(); i++) {
if ((*debug_object_cache)[i] == o) {
Add("#%d#", i);
Add("#%d#", static_cast<int>(i));
return;
}
}
if (debug_object_cache->length() < kMentionedObjectCacheMaxSize) {
Add("#%d#", debug_object_cache->length());
debug_object_cache->Add(HeapObject::cast(o));
if (debug_object_cache->size() < kMentionedObjectCacheMaxSize) {
Add("#%d#", static_cast<int>(debug_object_cache->size()));
debug_object_cache->push_back(HeapObject::cast(o));
} else {
Add("@%p", o);
}
......@@ -244,16 +244,16 @@ Handle<String> StringStream::ToString(Isolate* isolate) {
void StringStream::ClearMentionedObjectCache(Isolate* isolate) {
isolate->set_string_stream_current_security_token(NULL);
if (isolate->string_stream_debug_object_cache() == NULL) {
isolate->set_string_stream_debug_object_cache(new DebugObjectCache(0));
isolate->set_string_stream_debug_object_cache(new DebugObjectCache());
}
isolate->string_stream_debug_object_cache()->Clear();
isolate->string_stream_debug_object_cache()->clear();
}
#ifdef DEBUG
bool StringStream::IsMentionedObjectCacheClear(Isolate* isolate) {
return object_print_mode_ == kPrintObjectConcise ||
isolate->string_stream_debug_object_cache()->length() == 0;
isolate->string_stream_debug_object_cache()->size() == 0;
}
#endif
......@@ -377,9 +377,9 @@ void StringStream::PrintMentionedObjectCache(Isolate* isolate) {
DebugObjectCache* debug_object_cache =
isolate->string_stream_debug_object_cache();
Add("==== Key ============================================\n\n");
for (int i = 0; i < debug_object_cache->length(); i++) {
for (size_t i = 0; i < debug_object_cache->size(); i++) {
HeapObject* printee = (*debug_object_cache)[i];
Add(" #%d# %p: ", i, printee);
Add(" #%d# %p: ", static_cast<int>(i), printee);
printee->ShortPrint(this);
Add("\n");
if (printee->IsJSObject()) {
......
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