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

Unified Diff: src/type-feedback-vector.cc

Issue 2650853008: [TypeFeedbackVector] Remove unnecessary Parameters metadata (Closed)
Patch Set: compilation failure. Created 3 years, 11 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/type-feedback-vector.h ('k') | src/type-feedback-vector-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/type-feedback-vector.cc
diff --git a/src/type-feedback-vector.cc b/src/type-feedback-vector.cc
index 267fd862edc8bed19ffbae4468767e4f5b23c73f..546139e481e63a154198592c084029b3dcf3bbd9 100644
--- a/src/type-feedback-vector.cc
+++ b/src/type-feedback-vector.cc
@@ -37,11 +37,6 @@ FeedbackVectorSlotKind TypeFeedbackMetadata::GetKind(
return VectorICComputer::decode(data, slot.ToInt());
}
-int TypeFeedbackMetadata::GetParameter(int parameter_index) const {
- FixedArray* parameters = FixedArray::cast(get(kParametersTableIndex));
- return Smi::cast(parameters->get(parameter_index))->value();
-}
-
void TypeFeedbackMetadata::SetKind(FeedbackVectorSlot slot,
FeedbackVectorSlotKind kind) {
int index = VectorICComputer::index(kReservedIndexCount, slot.ToInt());
@@ -96,18 +91,6 @@ Handle<TypeFeedbackMetadata> TypeFeedbackMetadata::New(Isolate* isolate,
metadata->SetKind(FeedbackVectorSlot(i), kind);
}
- if (spec->parameters_count() > 0) {
- const int parameters_count = spec->parameters_count();
- Handle<FixedArray> params_array =
- factory->NewFixedArray(parameters_count, TENURED);
- for (int i = 0; i < parameters_count; i++) {
- params_array->set(i, Smi::FromInt(spec->GetParameter(i)));
- }
- metadata->set(kParametersTableIndex, *params_array);
- } else {
- metadata->set(kParametersTableIndex, *factory->empty_fixed_array());
- }
-
// It's important that the TypeFeedbackMetadata have a COW map, since it's
// pointed to by both a SharedFunctionInfo and indirectly by closures through
// the TypeFeedbackVector. The serializer uses the COW map type to decide
@@ -125,7 +108,6 @@ bool TypeFeedbackMetadata::SpecDiffersFrom(
}
int slots = slot_count();
- int parameter_index = 0;
for (int i = 0; i < slots;) {
FeedbackVectorSlot slot(i);
FeedbackVectorSlotKind kind = GetKind(slot);
@@ -134,14 +116,6 @@ bool TypeFeedbackMetadata::SpecDiffersFrom(
if (kind != other_spec->GetKind(i)) {
return true;
}
- if (SlotRequiresParameter(kind)) {
- int parameter = GetParameter(parameter_index);
- int other_parameter = other_spec->GetParameter(parameter_index);
- if (parameter != other_parameter) {
- return true;
- }
- parameter_index++;
- }
i += entry_size;
}
return false;
@@ -154,7 +128,6 @@ bool TypeFeedbackMetadata::DiffersFrom(
}
int slots = slot_count();
- int parameter_index = 0;
for (int i = 0; i < slots;) {
FeedbackVectorSlot slot(i);
FeedbackVectorSlotKind kind = GetKind(slot);
@@ -162,13 +135,6 @@ bool TypeFeedbackMetadata::DiffersFrom(
if (GetKind(slot) != other_metadata->GetKind(slot)) {
return true;
}
- if (SlotRequiresParameter(kind)) {
- if (GetParameter(parameter_index) !=
- other_metadata->GetParameter(parameter_index)) {
- return true;
- }
- parameter_index++;
- }
i += entry_size;
}
return false;
@@ -213,13 +179,6 @@ FeedbackVectorSlotKind TypeFeedbackVector::GetKind(
return metadata()->GetKind(slot);
}
-int TypeFeedbackVector::GetParameter(FeedbackVectorSlot slot) const {
- DCHECK(!is_empty());
- DCHECK(
- TypeFeedbackMetadata::SlotRequiresParameter(metadata()->GetKind(slot)));
- return FixedArray::cast(Get(slot))->length();
-}
-
// static
Handle<TypeFeedbackVector> TypeFeedbackVector::New(
Isolate* isolate, Handle<TypeFeedbackMetadata> metadata) {
@@ -236,7 +195,6 @@ Handle<TypeFeedbackVector> TypeFeedbackVector::New(
array->set_map_no_write_barrier(isolate->heap()->type_feedback_vector_map());
array->set(kMetadataIndex, *metadata);
array->set(kInvocationCountIndex, Smi::kZero);
- int parameter_index = 0;
for (int i = 0; i < slot_count;) {
FeedbackVectorSlot slot(i);
FeedbackVectorSlotKind kind = metadata->GetKind(slot);
@@ -244,18 +202,8 @@ Handle<TypeFeedbackVector> TypeFeedbackVector::New(
int entry_size = TypeFeedbackMetadata::GetSlotSize(kind);
if (kind == FeedbackVectorSlotKind::CREATE_CLOSURE) {
- // This fixed array is filled with undefined.
- int length = metadata->GetParameter(parameter_index++);
- if (length == 0) {
- // This is a native function literal. We can always point to
- // the empty literals array here.
- array->set(index, *factory->empty_literals_array(), SKIP_WRITE_BARRIER);
- } else {
- // TODO(mvstanton): Create the array.
- // Handle<FixedArray> value = factory->NewFixedArray(length);
- // array->set(index, *value);
- array->set(index, *factory->empty_literals_array(), SKIP_WRITE_BARRIER);
- }
+ // TODO(mvstanton): Root literal arrays in this location.
+ array->set(index, *factory->empty_literals_array(), SKIP_WRITE_BARRIER);
}
i += entry_size;
}
« no previous file with comments | « src/type-feedback-vector.h ('k') | src/type-feedback-vector-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698