Index: src/feedback-vector.cc |
diff --git a/src/feedback-vector.cc b/src/feedback-vector.cc |
index ef62a634fd55c93b9547869505eec7b44e3def25..4bdf4823ce9395e825c1b3c69106d40b78fa67ee 100644 |
--- a/src/feedback-vector.cc |
+++ b/src/feedback-vector.cc |
@@ -1049,7 +1049,7 @@ InlineCacheState CollectTypeProfileNexus::StateFromFeedback() const { |
return MONOMORPHIC; |
} |
-void CollectTypeProfileNexus::Collect(Handle<Name> type) { |
+void CollectTypeProfileNexus::Collect(Handle<Name> type, int position) { |
Isolate* isolate = GetIsolate(); |
Object* const feedback = GetFeedback(); |
@@ -1060,9 +1060,13 @@ void CollectTypeProfileNexus::Collect(Handle<Name> type) { |
} else { |
types = Handle<ArrayList>(ArrayList::cast(feedback), isolate); |
} |
+ |
+ Handle<Tuple2> entry = isolate->factory()->NewTuple2( |
+ type, Handle<Smi>(Smi::FromInt(position), isolate)); |
+ |
// TODO(franzih): Somehow sort this list. Either avoid duplicates |
// or use the common base type. |
- SetFeedback(*ArrayList::Add(types, type)); |
+ SetFeedback(*ArrayList::Add(types, entry)); |
} |
void CollectTypeProfileNexus::Print() const { |
@@ -1078,8 +1082,13 @@ void CollectTypeProfileNexus::Print() const { |
list = Handle<ArrayList>(ArrayList::cast(feedback), isolate); |
for (int i = 0; i < list->Length(); i++) { |
- String* name = String::cast(list->Get(i)); |
- PrintF("%s\n", name->ToCString().get()); |
+ Handle<Object> maybe_entry = Handle<Object>(list->Get(i), isolate); |
+ DCHECK(maybe_entry->IsTuple2()); |
+ Handle<Tuple2> entry = Handle<Tuple2>::cast(maybe_entry); |
+ Handle<String> type = |
+ Handle<String>(String::cast(entry->value1()), isolate); |
+ int position = Smi::cast(entry->value2())->value(); |
+ PrintF("%d: %s\n", position, type->ToCString().get()); |
} |
} |