Index: src/type-feedback-vector.cc |
diff --git a/src/type-feedback-vector.cc b/src/type-feedback-vector.cc |
index 698f2a6d17380d6e0771c5194e2259819b864542..857db854d15eb7d6467689511367c0e63cbcd396 100644 |
--- a/src/type-feedback-vector.cc |
+++ b/src/type-feedback-vector.cc |
@@ -156,6 +156,28 @@ |
int TypeFeedbackVector::GetIndexFromSpec(const FeedbackVectorSpec* spec, |
FeedbackVectorSlot slot) { |
return kReservedIndexCount + slot.ToInt(); |
+} |
+ |
+ |
+// static |
+int TypeFeedbackVector::PushAppliedArgumentsIndex() { |
+ return kReservedIndexCount; |
+} |
+ |
+ |
+// static |
+Handle<TypeFeedbackVector> TypeFeedbackVector::CreatePushAppliedArgumentsVector( |
+ Isolate* isolate) { |
+ StaticFeedbackVectorSpec spec; |
+ FeedbackVectorSlot slot = spec.AddKeyedLoadICSlot(); |
+ // TODO(ishell): allocate this metadata only once. |
+ Handle<TypeFeedbackMetadata> feedback_metadata = |
+ TypeFeedbackMetadata::New(isolate, &spec); |
+ Handle<TypeFeedbackVector> feedback_vector = |
+ TypeFeedbackVector::New(isolate, feedback_metadata); |
+ DCHECK_EQ(PushAppliedArgumentsIndex(), feedback_vector->GetIndex(slot)); |
+ USE(slot); |
+ return feedback_vector; |
} |