Commit 0190a00f authored by ishell@chromium.org's avatar ishell@chromium.org Committed by Commit Bot

[ic] Rename FeedbackSlotKind values to better reflect reality.

BUG=v8:5917

Change-Id: I9611ace4ba73f18cb90f95f9c81eeb19c74e06f4
Reviewed-on: https://chromium-review.googlesource.com/439327Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43032}
parent 8cbe27e7
...@@ -1483,8 +1483,7 @@ BinaryOperationHint BytecodeGraphBuilder::GetBinaryOperationHint( ...@@ -1483,8 +1483,7 @@ BinaryOperationHint BytecodeGraphBuilder::GetBinaryOperationHint(
int operand_index) { int operand_index) {
FeedbackSlot slot = feedback_vector()->ToSlot( FeedbackSlot slot = feedback_vector()->ToSlot(
bytecode_iterator().GetIndexOperand(operand_index)); bytecode_iterator().GetIndexOperand(operand_index));
DCHECK_EQ(FeedbackSlotKind::INTERPRETER_BINARYOP_IC, DCHECK_EQ(FeedbackSlotKind::kBinaryOp, feedback_vector()->GetKind(slot));
feedback_vector()->GetKind(slot));
BinaryOpICNexus nexus(feedback_vector(), slot); BinaryOpICNexus nexus(feedback_vector(), slot);
return nexus.GetBinaryOperationFeedback(); return nexus.GetBinaryOperationFeedback();
} }
...@@ -1498,8 +1497,7 @@ CompareOperationHint BytecodeGraphBuilder::GetCompareOperationHint() { ...@@ -1498,8 +1497,7 @@ CompareOperationHint BytecodeGraphBuilder::GetCompareOperationHint() {
} }
FeedbackSlot slot = FeedbackSlot slot =
feedback_vector()->ToSlot(bytecode_iterator().GetIndexOperand(1)); feedback_vector()->ToSlot(bytecode_iterator().GetIndexOperand(1));
DCHECK_EQ(FeedbackSlotKind::INTERPRETER_COMPARE_IC, DCHECK_EQ(FeedbackSlotKind::kCompareOp, feedback_vector()->GetKind(slot));
feedback_vector()->GetKind(slot));
CompareICNexus nexus(feedback_vector(), slot); CompareICNexus nexus(feedback_vector(), slot);
return nexus.GetCompareOperationFeedback(); return nexus.GetCompareOperationFeedback();
} }
......
...@@ -18,7 +18,7 @@ FeedbackSlot FeedbackVectorSpecBase<Derived>::AddSlot(FeedbackSlotKind kind) { ...@@ -18,7 +18,7 @@ FeedbackSlot FeedbackVectorSpecBase<Derived>::AddSlot(FeedbackSlotKind kind) {
int entries_per_slot = FeedbackMetadata::GetSlotSize(kind); int entries_per_slot = FeedbackMetadata::GetSlotSize(kind);
This()->append(kind); This()->append(kind);
for (int i = 1; i < entries_per_slot; i++) { for (int i = 1; i < entries_per_slot; i++) {
This()->append(FeedbackSlotKind::INVALID); This()->append(FeedbackSlotKind::kInvalid);
} }
return FeedbackSlot(slot); return FeedbackSlot(slot);
} }
...@@ -48,28 +48,28 @@ FeedbackVector* FeedbackVector::cast(Object* obj) { ...@@ -48,28 +48,28 @@ FeedbackVector* FeedbackVector::cast(Object* obj) {
int FeedbackMetadata::GetSlotSize(FeedbackSlotKind kind) { int FeedbackMetadata::GetSlotSize(FeedbackSlotKind kind) {
switch (kind) { switch (kind) {
case FeedbackSlotKind::GENERAL: case FeedbackSlotKind::kGeneral:
case FeedbackSlotKind::INTERPRETER_COMPARE_IC: case FeedbackSlotKind::kCompareOp:
case FeedbackSlotKind::INTERPRETER_BINARYOP_IC: case FeedbackSlotKind::kBinaryOp:
case FeedbackSlotKind::TO_BOOLEAN_IC: case FeedbackSlotKind::kToBoolean:
case FeedbackSlotKind::LITERAL: case FeedbackSlotKind::kLiteral:
case FeedbackSlotKind::CREATE_CLOSURE: case FeedbackSlotKind::kCreateClosure:
return 1; return 1;
case FeedbackSlotKind::CALL_IC: case FeedbackSlotKind::kCall:
case FeedbackSlotKind::LOAD_IC: case FeedbackSlotKind::kLoadProperty:
case FeedbackSlotKind::LOAD_GLOBAL_INSIDE_TYPEOF_IC: case FeedbackSlotKind::kLoadGlobalInsideTypeof:
case FeedbackSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC: case FeedbackSlotKind::kLoadGlobalNotInsideTypeof:
case FeedbackSlotKind::KEYED_LOAD_IC: case FeedbackSlotKind::kLoadKeyed:
case FeedbackSlotKind::STORE_SLOPPY_IC: case FeedbackSlotKind::kStorePropertySloppy:
case FeedbackSlotKind::STORE_STRICT_IC: case FeedbackSlotKind::kStorePropertyStrict:
case FeedbackSlotKind::KEYED_STORE_SLOPPY_IC: case FeedbackSlotKind::kStoreKeyedSloppy:
case FeedbackSlotKind::KEYED_STORE_STRICT_IC: case FeedbackSlotKind::kStoreKeyedStrict:
case FeedbackSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC: case FeedbackSlotKind::kStoreDataPropertyInLiteral:
return 2; return 2;
case FeedbackSlotKind::INVALID: case FeedbackSlotKind::kInvalid:
case FeedbackSlotKind::KINDS_NUMBER: case FeedbackSlotKind::kKindsNumber:
UNREACHABLE(); UNREACHABLE();
break; break;
} }
...@@ -171,16 +171,16 @@ void FeedbackVector::ComputeCounts(int* with_type_info, int* generic, ...@@ -171,16 +171,16 @@ void FeedbackVector::ComputeCounts(int* with_type_info, int* generic,
Object* const obj = Get(slot); Object* const obj = Get(slot);
switch (kind) { switch (kind) {
case FeedbackSlotKind::CALL_IC: case FeedbackSlotKind::kCall:
case FeedbackSlotKind::LOAD_IC: case FeedbackSlotKind::kLoadProperty:
case FeedbackSlotKind::LOAD_GLOBAL_INSIDE_TYPEOF_IC: case FeedbackSlotKind::kLoadGlobalInsideTypeof:
case FeedbackSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC: case FeedbackSlotKind::kLoadGlobalNotInsideTypeof:
case FeedbackSlotKind::KEYED_LOAD_IC: case FeedbackSlotKind::kLoadKeyed:
case FeedbackSlotKind::STORE_SLOPPY_IC: case FeedbackSlotKind::kStorePropertySloppy:
case FeedbackSlotKind::STORE_STRICT_IC: case FeedbackSlotKind::kStorePropertyStrict:
case FeedbackSlotKind::KEYED_STORE_SLOPPY_IC: case FeedbackSlotKind::kStoreKeyedSloppy:
case FeedbackSlotKind::KEYED_STORE_STRICT_IC: case FeedbackSlotKind::kStoreKeyedStrict:
case FeedbackSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC: { case FeedbackSlotKind::kStoreDataPropertyInLiteral: {
if (obj->IsWeakCell() || obj->IsFixedArray() || obj->IsString()) { if (obj->IsWeakCell() || obj->IsFixedArray() || obj->IsString()) {
with++; with++;
} else if (obj == megamorphic_sentinel) { } else if (obj == megamorphic_sentinel) {
...@@ -190,7 +190,7 @@ void FeedbackVector::ComputeCounts(int* with_type_info, int* generic, ...@@ -190,7 +190,7 @@ void FeedbackVector::ComputeCounts(int* with_type_info, int* generic,
total++; total++;
break; break;
} }
case FeedbackSlotKind::INTERPRETER_BINARYOP_IC: case FeedbackSlotKind::kBinaryOp:
// If we are not running interpreted code, we need to ignore the special // If we are not running interpreted code, we need to ignore the special
// IC slots for binaryop/compare used by the interpreter. // IC slots for binaryop/compare used by the interpreter.
// TODO(mvstanton): Remove code_is_interpreted when full code is retired // TODO(mvstanton): Remove code_is_interpreted when full code is retired
...@@ -207,7 +207,7 @@ void FeedbackVector::ComputeCounts(int* with_type_info, int* generic, ...@@ -207,7 +207,7 @@ void FeedbackVector::ComputeCounts(int* with_type_info, int* generic,
total++; total++;
} }
break; break;
case FeedbackSlotKind::INTERPRETER_COMPARE_IC: { case FeedbackSlotKind::kCompareOp: {
// If we are not running interpreted code, we need to ignore the special // If we are not running interpreted code, we need to ignore the special
// IC slots for binaryop/compare used by the interpreter. // IC slots for binaryop/compare used by the interpreter.
// TODO(mvstanton): Remove code_is_interpreted when full code is retired // TODO(mvstanton): Remove code_is_interpreted when full code is retired
...@@ -226,13 +226,13 @@ void FeedbackVector::ComputeCounts(int* with_type_info, int* generic, ...@@ -226,13 +226,13 @@ void FeedbackVector::ComputeCounts(int* with_type_info, int* generic,
} }
break; break;
} }
case FeedbackSlotKind::TO_BOOLEAN_IC: case FeedbackSlotKind::kToBoolean:
case FeedbackSlotKind::CREATE_CLOSURE: case FeedbackSlotKind::kCreateClosure:
case FeedbackSlotKind::GENERAL: case FeedbackSlotKind::kGeneral:
case FeedbackSlotKind::LITERAL: case FeedbackSlotKind::kLiteral:
break; break;
case FeedbackSlotKind::INVALID: case FeedbackSlotKind::kInvalid:
case FeedbackSlotKind::KINDS_NUMBER: case FeedbackSlotKind::kKindsNumber:
UNREACHABLE(); UNREACHABLE();
break; break;
} }
......
...@@ -62,7 +62,7 @@ Handle<FeedbackMetadata> FeedbackMetadata::New(Isolate* isolate, ...@@ -62,7 +62,7 @@ Handle<FeedbackMetadata> FeedbackMetadata::New(Isolate* isolate,
int entry_size = FeedbackMetadata::GetSlotSize(kind); int entry_size = FeedbackMetadata::GetSlotSize(kind);
for (int j = 1; j < entry_size; j++) { for (int j = 1; j < entry_size; j++) {
FeedbackSlotKind kind = spec->GetKind(FeedbackSlot(i + j)); FeedbackSlotKind kind = spec->GetKind(FeedbackSlot(i + j));
DCHECK_EQ(FeedbackSlotKind::INVALID, kind); DCHECK_EQ(FeedbackSlotKind::kInvalid, kind);
} }
i += entry_size; i += entry_size;
} }
...@@ -115,41 +115,41 @@ bool FeedbackMetadata::SpecDiffersFrom( ...@@ -115,41 +115,41 @@ bool FeedbackMetadata::SpecDiffersFrom(
const char* FeedbackMetadata::Kind2String(FeedbackSlotKind kind) { const char* FeedbackMetadata::Kind2String(FeedbackSlotKind kind) {
switch (kind) { switch (kind) {
case FeedbackSlotKind::INVALID: case FeedbackSlotKind::kInvalid:
return "INVALID"; return "INVALID";
case FeedbackSlotKind::CALL_IC: case FeedbackSlotKind::kCall:
return "CALL_IC"; return "CALL_IC";
case FeedbackSlotKind::LOAD_IC: case FeedbackSlotKind::kLoadProperty:
return "LOAD_IC"; return "LOAD_IC";
case FeedbackSlotKind::LOAD_GLOBAL_INSIDE_TYPEOF_IC: case FeedbackSlotKind::kLoadGlobalInsideTypeof:
return "LOAD_GLOBAL_INSIDE_TYPEOF_IC"; return "LOAD_GLOBAL_INSIDE_TYPEOF_IC";
case FeedbackSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC: case FeedbackSlotKind::kLoadGlobalNotInsideTypeof:
return "LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC"; return "LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC";
case FeedbackSlotKind::KEYED_LOAD_IC: case FeedbackSlotKind::kLoadKeyed:
return "KEYED_LOAD_IC"; return "KEYED_LOAD_IC";
case FeedbackSlotKind::STORE_SLOPPY_IC: case FeedbackSlotKind::kStorePropertySloppy:
return "STORE_SLOPPY_IC"; return "STORE_SLOPPY_IC";
case FeedbackSlotKind::STORE_STRICT_IC: case FeedbackSlotKind::kStorePropertyStrict:
return "STORE_STRICT_IC"; return "STORE_STRICT_IC";
case FeedbackSlotKind::KEYED_STORE_SLOPPY_IC: case FeedbackSlotKind::kStoreKeyedSloppy:
return "KEYED_STORE_SLOPPY_IC"; return "KEYED_STORE_SLOPPY_IC";
case FeedbackSlotKind::KEYED_STORE_STRICT_IC: case FeedbackSlotKind::kStoreKeyedStrict:
return "KEYED_STORE_STRICT_IC"; return "KEYED_STORE_STRICT_IC";
case FeedbackSlotKind::INTERPRETER_BINARYOP_IC: case FeedbackSlotKind::kBinaryOp:
return "INTERPRETER_BINARYOP_IC"; return "INTERPRETER_BINARYOP_IC";
case FeedbackSlotKind::INTERPRETER_COMPARE_IC: case FeedbackSlotKind::kCompareOp:
return "INTERPRETER_COMPARE_IC"; return "INTERPRETER_COMPARE_IC";
case FeedbackSlotKind::TO_BOOLEAN_IC: case FeedbackSlotKind::kToBoolean:
return "TO_BOOLEAN_IC"; return "TO_BOOLEAN_IC";
case FeedbackSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC: case FeedbackSlotKind::kStoreDataPropertyInLiteral:
return "STORE_DATA_PROPERTY_IN_LITERAL_IC"; return "STORE_DATA_PROPERTY_IN_LITERAL_IC";
case FeedbackSlotKind::CREATE_CLOSURE: case FeedbackSlotKind::kCreateClosure:
return "CREATE_CLOSURE"; return "kCreateClosure";
case FeedbackSlotKind::LITERAL: case FeedbackSlotKind::kLiteral:
return "LITERAL"; return "LITERAL";
case FeedbackSlotKind::GENERAL: case FeedbackSlotKind::kGeneral:
return "STUB"; return "STUB";
case FeedbackSlotKind::KINDS_NUMBER: case FeedbackSlotKind::kKindsNumber:
break; break;
} }
UNREACHABLE(); UNREACHABLE();
...@@ -186,41 +186,41 @@ Handle<FeedbackVector> FeedbackVector::New(Isolate* isolate, ...@@ -186,41 +186,41 @@ Handle<FeedbackVector> FeedbackVector::New(Isolate* isolate,
Object* extra_value = *uninitialized_sentinel; Object* extra_value = *uninitialized_sentinel;
switch (kind) { switch (kind) {
case FeedbackSlotKind::LOAD_GLOBAL_INSIDE_TYPEOF_IC: case FeedbackSlotKind::kLoadGlobalInsideTypeof:
case FeedbackSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC: case FeedbackSlotKind::kLoadGlobalNotInsideTypeof:
array->set(index, isolate->heap()->empty_weak_cell(), array->set(index, isolate->heap()->empty_weak_cell(),
SKIP_WRITE_BARRIER); SKIP_WRITE_BARRIER);
break; break;
case FeedbackSlotKind::INTERPRETER_COMPARE_IC: case FeedbackSlotKind::kCompareOp:
case FeedbackSlotKind::INTERPRETER_BINARYOP_IC: case FeedbackSlotKind::kBinaryOp:
case FeedbackSlotKind::TO_BOOLEAN_IC: case FeedbackSlotKind::kToBoolean:
array->set(index, Smi::kZero, SKIP_WRITE_BARRIER); array->set(index, Smi::kZero, SKIP_WRITE_BARRIER);
break; break;
case FeedbackSlotKind::CREATE_CLOSURE: { case FeedbackSlotKind::kCreateClosure: {
Handle<Cell> cell = factory->NewCell(undefined_value); Handle<Cell> cell = factory->NewCell(undefined_value);
array->set(index, *cell); array->set(index, *cell);
break; break;
} }
case FeedbackSlotKind::LITERAL: case FeedbackSlotKind::kLiteral:
array->set(index, *undefined_value, SKIP_WRITE_BARRIER); array->set(index, *undefined_value, SKIP_WRITE_BARRIER);
break; break;
case FeedbackSlotKind::CALL_IC: case FeedbackSlotKind::kCall:
array->set(index, *uninitialized_sentinel, SKIP_WRITE_BARRIER); array->set(index, *uninitialized_sentinel, SKIP_WRITE_BARRIER);
extra_value = Smi::kZero; extra_value = Smi::kZero;
break; break;
case FeedbackSlotKind::LOAD_IC: case FeedbackSlotKind::kLoadProperty:
case FeedbackSlotKind::KEYED_LOAD_IC: case FeedbackSlotKind::kLoadKeyed:
case FeedbackSlotKind::STORE_SLOPPY_IC: case FeedbackSlotKind::kStorePropertySloppy:
case FeedbackSlotKind::STORE_STRICT_IC: case FeedbackSlotKind::kStorePropertyStrict:
case FeedbackSlotKind::KEYED_STORE_SLOPPY_IC: case FeedbackSlotKind::kStoreKeyedSloppy:
case FeedbackSlotKind::KEYED_STORE_STRICT_IC: case FeedbackSlotKind::kStoreKeyedStrict:
case FeedbackSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC: case FeedbackSlotKind::kStoreDataPropertyInLiteral:
case FeedbackSlotKind::GENERAL: case FeedbackSlotKind::kGeneral:
array->set(index, *uninitialized_sentinel, SKIP_WRITE_BARRIER); array->set(index, *uninitialized_sentinel, SKIP_WRITE_BARRIER);
break; break;
case FeedbackSlotKind::INVALID: case FeedbackSlotKind::kInvalid:
case FeedbackSlotKind::KINDS_NUMBER: case FeedbackSlotKind::kKindsNumber:
UNREACHABLE(); UNREACHABLE();
array->set(index, Smi::kZero, SKIP_WRITE_BARRIER); array->set(index, Smi::kZero, SKIP_WRITE_BARRIER);
break; break;
...@@ -265,50 +265,50 @@ void FeedbackVector::ClearSlotsImpl(SharedFunctionInfo* shared, ...@@ -265,50 +265,50 @@ void FeedbackVector::ClearSlotsImpl(SharedFunctionInfo* shared,
Object* obj = Get(slot); Object* obj = Get(slot);
if (obj != uninitialized_sentinel) { if (obj != uninitialized_sentinel) {
switch (kind) { switch (kind) {
case FeedbackSlotKind::CALL_IC: { case FeedbackSlotKind::kCall: {
CallICNexus nexus(this, slot); CallICNexus nexus(this, slot);
nexus.Clear(shared->code()); nexus.Clear(shared->code());
break; break;
} }
case FeedbackSlotKind::LOAD_IC: { case FeedbackSlotKind::kLoadProperty: {
LoadICNexus nexus(this, slot); LoadICNexus nexus(this, slot);
nexus.Clear(shared->code()); nexus.Clear(shared->code());
break; break;
} }
case FeedbackSlotKind::LOAD_GLOBAL_INSIDE_TYPEOF_IC: case FeedbackSlotKind::kLoadGlobalInsideTypeof:
case FeedbackSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC: { case FeedbackSlotKind::kLoadGlobalNotInsideTypeof: {
LoadGlobalICNexus nexus(this, slot); LoadGlobalICNexus nexus(this, slot);
nexus.Clear(shared->code()); nexus.Clear(shared->code());
break; break;
} }
case FeedbackSlotKind::KEYED_LOAD_IC: { case FeedbackSlotKind::kLoadKeyed: {
KeyedLoadICNexus nexus(this, slot); KeyedLoadICNexus nexus(this, slot);
nexus.Clear(shared->code()); nexus.Clear(shared->code());
break; break;
} }
case FeedbackSlotKind::STORE_SLOPPY_IC: case FeedbackSlotKind::kStorePropertySloppy:
case FeedbackSlotKind::STORE_STRICT_IC: { case FeedbackSlotKind::kStorePropertyStrict: {
StoreICNexus nexus(this, slot); StoreICNexus nexus(this, slot);
nexus.Clear(shared->code()); nexus.Clear(shared->code());
break; break;
} }
case FeedbackSlotKind::KEYED_STORE_SLOPPY_IC: case FeedbackSlotKind::kStoreKeyedSloppy:
case FeedbackSlotKind::KEYED_STORE_STRICT_IC: { case FeedbackSlotKind::kStoreKeyedStrict: {
KeyedStoreICNexus nexus(this, slot); KeyedStoreICNexus nexus(this, slot);
nexus.Clear(shared->code()); nexus.Clear(shared->code());
break; break;
} }
case FeedbackSlotKind::INTERPRETER_BINARYOP_IC: case FeedbackSlotKind::kBinaryOp:
case FeedbackSlotKind::INTERPRETER_COMPARE_IC: { case FeedbackSlotKind::kCompareOp: {
DCHECK(Get(slot)->IsSmi()); DCHECK(Get(slot)->IsSmi());
// don't clear these smi slots. // don't clear these smi slots.
// Set(slot, Smi::kZero); // Set(slot, Smi::kZero);
break; break;
} }
case FeedbackSlotKind::CREATE_CLOSURE: { case FeedbackSlotKind::kCreateClosure: {
break; break;
} }
case FeedbackSlotKind::GENERAL: { case FeedbackSlotKind::kGeneral: {
if (obj->IsHeapObject()) { if (obj->IsHeapObject()) {
InstanceType instance_type = InstanceType instance_type =
HeapObject::cast(obj)->map()->instance_type(); HeapObject::cast(obj)->map()->instance_type();
...@@ -321,18 +321,18 @@ void FeedbackVector::ClearSlotsImpl(SharedFunctionInfo* shared, ...@@ -321,18 +321,18 @@ void FeedbackVector::ClearSlotsImpl(SharedFunctionInfo* shared,
} }
break; break;
} }
case FeedbackSlotKind::LITERAL: { case FeedbackSlotKind::kLiteral: {
Set(slot, undefined_value, SKIP_WRITE_BARRIER); Set(slot, undefined_value, SKIP_WRITE_BARRIER);
break; break;
} }
case FeedbackSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC: { case FeedbackSlotKind::kStoreDataPropertyInLiteral: {
StoreDataPropertyInLiteralICNexus nexus(this, slot); StoreDataPropertyInLiteralICNexus nexus(this, slot);
nexus.Clear(shared->code()); nexus.Clear(shared->code());
break; break;
} }
case FeedbackSlotKind::TO_BOOLEAN_IC: case FeedbackSlotKind::kToBoolean:
case FeedbackSlotKind::INVALID: case FeedbackSlotKind::kInvalid:
case FeedbackSlotKind::KINDS_NUMBER: case FeedbackSlotKind::kKindsNumber:
UNREACHABLE(); UNREACHABLE();
break; break;
} }
......
...@@ -20,67 +20,67 @@ enum class FeedbackSlotKind { ...@@ -20,67 +20,67 @@ enum class FeedbackSlotKind {
// This kind means that the slot points to the middle of other slot // This kind means that the slot points to the middle of other slot
// which occupies more than one feedback vector element. // which occupies more than one feedback vector element.
// There must be no such slots in the system. // There must be no such slots in the system.
INVALID, kInvalid,
CALL_IC, kCall,
LOAD_IC, kLoadProperty,
LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC, kLoadGlobalNotInsideTypeof,
LOAD_GLOBAL_INSIDE_TYPEOF_IC, kLoadGlobalInsideTypeof,
KEYED_LOAD_IC, kLoadKeyed,
STORE_SLOPPY_IC, kStorePropertySloppy,
STORE_STRICT_IC, kStorePropertyStrict,
KEYED_STORE_SLOPPY_IC, kStoreKeyedSloppy,
KEYED_STORE_STRICT_IC, kStoreKeyedStrict,
INTERPRETER_BINARYOP_IC, kBinaryOp,
INTERPRETER_COMPARE_IC, kCompareOp,
TO_BOOLEAN_IC, kToBoolean,
STORE_DATA_PROPERTY_IN_LITERAL_IC, kStoreDataPropertyInLiteral,
CREATE_CLOSURE, kCreateClosure,
LITERAL, kLiteral,
// This is a general purpose slot that occupies one feedback vector element. // This is a general purpose slot that occupies one feedback vector element.
GENERAL, kGeneral,
KINDS_NUMBER // Last value indicating number of kinds. kKindsNumber // Last value indicating number of kinds.
}; };
inline bool IsCallICKind(FeedbackSlotKind kind) { inline bool IsCallICKind(FeedbackSlotKind kind) {
return kind == FeedbackSlotKind::CALL_IC; return kind == FeedbackSlotKind::kCall;
} }
inline bool IsLoadICKind(FeedbackSlotKind kind) { inline bool IsLoadICKind(FeedbackSlotKind kind) {
return kind == FeedbackSlotKind::LOAD_IC; return kind == FeedbackSlotKind::kLoadProperty;
} }
inline bool IsLoadGlobalICKind(FeedbackSlotKind kind) { inline bool IsLoadGlobalICKind(FeedbackSlotKind kind) {
return kind == FeedbackSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC || return kind == FeedbackSlotKind::kLoadGlobalNotInsideTypeof ||
kind == FeedbackSlotKind::LOAD_GLOBAL_INSIDE_TYPEOF_IC; kind == FeedbackSlotKind::kLoadGlobalInsideTypeof;
} }
inline bool IsKeyedLoadICKind(FeedbackSlotKind kind) { inline bool IsKeyedLoadICKind(FeedbackSlotKind kind) {
return kind == FeedbackSlotKind::KEYED_LOAD_IC; return kind == FeedbackSlotKind::kLoadKeyed;
} }
inline bool IsStoreICKind(FeedbackSlotKind kind) { inline bool IsStoreICKind(FeedbackSlotKind kind) {
return kind == FeedbackSlotKind::STORE_SLOPPY_IC || return kind == FeedbackSlotKind::kStorePropertySloppy ||
kind == FeedbackSlotKind::STORE_STRICT_IC; kind == FeedbackSlotKind::kStorePropertyStrict;
} }
inline bool IsKeyedStoreICKind(FeedbackSlotKind kind) { inline bool IsKeyedStoreICKind(FeedbackSlotKind kind) {
return kind == FeedbackSlotKind::KEYED_STORE_SLOPPY_IC || return kind == FeedbackSlotKind::kStoreKeyedSloppy ||
kind == FeedbackSlotKind::KEYED_STORE_STRICT_IC; kind == FeedbackSlotKind::kStoreKeyedStrict;
} }
inline TypeofMode GetTypeofModeFromSlotKind(FeedbackSlotKind kind) { inline TypeofMode GetTypeofModeFromSlotKind(FeedbackSlotKind kind) {
DCHECK(IsLoadGlobalICKind(kind)); DCHECK(IsLoadGlobalICKind(kind));
return (kind == FeedbackSlotKind::LOAD_GLOBAL_INSIDE_TYPEOF_IC) return (kind == FeedbackSlotKind::kLoadGlobalInsideTypeof)
? INSIDE_TYPEOF ? INSIDE_TYPEOF
: NOT_INSIDE_TYPEOF; : NOT_INSIDE_TYPEOF;
} }
inline LanguageMode GetLanguageModeFromSlotKind(FeedbackSlotKind kind) { inline LanguageMode GetLanguageModeFromSlotKind(FeedbackSlotKind kind) {
DCHECK(IsStoreICKind(kind) || IsKeyedStoreICKind(kind)); DCHECK(IsStoreICKind(kind) || IsKeyedStoreICKind(kind));
return (kind == FeedbackSlotKind::STORE_SLOPPY_IC || return (kind == FeedbackSlotKind::kStorePropertySloppy ||
kind == FeedbackSlotKind::KEYED_STORE_SLOPPY_IC) kind == FeedbackSlotKind::kStoreKeyedSloppy)
? SLOPPY ? SLOPPY
: STRICT; : STRICT;
} }
...@@ -90,52 +90,54 @@ std::ostream& operator<<(std::ostream& os, FeedbackSlotKind kind); ...@@ -90,52 +90,54 @@ std::ostream& operator<<(std::ostream& os, FeedbackSlotKind kind);
template <typename Derived> template <typename Derived>
class FeedbackVectorSpecBase { class FeedbackVectorSpecBase {
public: public:
FeedbackSlot AddCallICSlot() { return AddSlot(FeedbackSlotKind::CALL_IC); } FeedbackSlot AddCallICSlot() { return AddSlot(FeedbackSlotKind::kCall); }
FeedbackSlot AddLoadICSlot() { return AddSlot(FeedbackSlotKind::LOAD_IC); } FeedbackSlot AddLoadICSlot() {
return AddSlot(FeedbackSlotKind::kLoadProperty);
}
FeedbackSlot AddLoadGlobalICSlot(TypeofMode typeof_mode) { FeedbackSlot AddLoadGlobalICSlot(TypeofMode typeof_mode) {
return AddSlot(typeof_mode == INSIDE_TYPEOF return AddSlot(typeof_mode == INSIDE_TYPEOF
? FeedbackSlotKind::LOAD_GLOBAL_INSIDE_TYPEOF_IC ? FeedbackSlotKind::kLoadGlobalInsideTypeof
: FeedbackSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC); : FeedbackSlotKind::kLoadGlobalNotInsideTypeof);
} }
FeedbackSlot AddCreateClosureSlot() { FeedbackSlot AddCreateClosureSlot() {
return AddSlot(FeedbackSlotKind::CREATE_CLOSURE); return AddSlot(FeedbackSlotKind::kCreateClosure);
} }
FeedbackSlot AddKeyedLoadICSlot() { FeedbackSlot AddKeyedLoadICSlot() {
return AddSlot(FeedbackSlotKind::KEYED_LOAD_IC); return AddSlot(FeedbackSlotKind::kLoadKeyed);
} }
FeedbackSlot AddStoreICSlot(LanguageMode language_mode) { FeedbackSlot AddStoreICSlot(LanguageMode language_mode) {
STATIC_ASSERT(LANGUAGE_END == 2); STATIC_ASSERT(LANGUAGE_END == 2);
return AddSlot(is_strict(language_mode) return AddSlot(is_strict(language_mode)
? FeedbackSlotKind::STORE_STRICT_IC ? FeedbackSlotKind::kStorePropertyStrict
: FeedbackSlotKind::STORE_SLOPPY_IC); : FeedbackSlotKind::kStorePropertySloppy);
} }
FeedbackSlot AddKeyedStoreICSlot(LanguageMode language_mode) { FeedbackSlot AddKeyedStoreICSlot(LanguageMode language_mode) {
STATIC_ASSERT(LANGUAGE_END == 2); STATIC_ASSERT(LANGUAGE_END == 2);
return AddSlot(is_strict(language_mode) return AddSlot(is_strict(language_mode)
? FeedbackSlotKind::KEYED_STORE_STRICT_IC ? FeedbackSlotKind::kStoreKeyedStrict
: FeedbackSlotKind::KEYED_STORE_SLOPPY_IC); : FeedbackSlotKind::kStoreKeyedSloppy);
} }
FeedbackSlot AddInterpreterBinaryOpICSlot() { FeedbackSlot AddInterpreterBinaryOpICSlot() {
return AddSlot(FeedbackSlotKind::INTERPRETER_BINARYOP_IC); return AddSlot(FeedbackSlotKind::kBinaryOp);
} }
FeedbackSlot AddInterpreterCompareICSlot() { FeedbackSlot AddInterpreterCompareICSlot() {
return AddSlot(FeedbackSlotKind::INTERPRETER_COMPARE_IC); return AddSlot(FeedbackSlotKind::kCompareOp);
} }
FeedbackSlot AddGeneralSlot() { return AddSlot(FeedbackSlotKind::GENERAL); } FeedbackSlot AddGeneralSlot() { return AddSlot(FeedbackSlotKind::kGeneral); }
FeedbackSlot AddLiteralSlot() { return AddSlot(FeedbackSlotKind::LITERAL); } FeedbackSlot AddLiteralSlot() { return AddSlot(FeedbackSlotKind::kLiteral); }
FeedbackSlot AddStoreDataPropertyInLiteralICSlot() { FeedbackSlot AddStoreDataPropertyInLiteralICSlot() {
return AddSlot(FeedbackSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC); return AddSlot(FeedbackSlotKind::kStoreDataPropertyInLiteral);
} }
#ifdef OBJECT_PRINT #ifdef OBJECT_PRINT
...@@ -240,7 +242,7 @@ class FeedbackMetadata : public FixedArray { ...@@ -240,7 +242,7 @@ class FeedbackMetadata : public FixedArray {
private: private:
static const int kFeedbackSlotKindBits = 5; static const int kFeedbackSlotKindBits = 5;
STATIC_ASSERT(static_cast<int>(FeedbackSlotKind::KINDS_NUMBER) < STATIC_ASSERT(static_cast<int>(FeedbackSlotKind::kKindsNumber) <
(1 << kFeedbackSlotKindBits)); (1 << kFeedbackSlotKindBits));
void SetKind(FeedbackSlot slot, FeedbackSlotKind kind); void SetKind(FeedbackSlot slot, FeedbackSlotKind kind);
...@@ -373,12 +375,12 @@ class FeedbackMetadataIterator { ...@@ -373,12 +375,12 @@ class FeedbackMetadataIterator {
explicit FeedbackMetadataIterator(Handle<FeedbackMetadata> metadata) explicit FeedbackMetadataIterator(Handle<FeedbackMetadata> metadata)
: metadata_handle_(metadata), : metadata_handle_(metadata),
next_slot_(FeedbackSlot(0)), next_slot_(FeedbackSlot(0)),
slot_kind_(FeedbackSlotKind::INVALID) {} slot_kind_(FeedbackSlotKind::kInvalid) {}
explicit FeedbackMetadataIterator(FeedbackMetadata* metadata) explicit FeedbackMetadataIterator(FeedbackMetadata* metadata)
: metadata_(metadata), : metadata_(metadata),
next_slot_(FeedbackSlot(0)), next_slot_(FeedbackSlot(0)),
slot_kind_(FeedbackSlotKind::INVALID) {} slot_kind_(FeedbackSlotKind::kInvalid) {}
inline bool HasNext() const; inline bool HasNext() const;
...@@ -386,8 +388,8 @@ class FeedbackMetadataIterator { ...@@ -386,8 +388,8 @@ class FeedbackMetadataIterator {
// Returns slot kind of the last slot returned by Next(). // Returns slot kind of the last slot returned by Next().
FeedbackSlotKind kind() const { FeedbackSlotKind kind() const {
DCHECK_NE(FeedbackSlotKind::INVALID, slot_kind_); DCHECK_NE(FeedbackSlotKind::kInvalid, slot_kind_);
DCHECK_NE(FeedbackSlotKind::KINDS_NUMBER, slot_kind_); DCHECK_NE(FeedbackSlotKind::kKindsNumber, slot_kind_);
return slot_kind_; return slot_kind_;
} }
...@@ -655,11 +657,11 @@ class BinaryOpICNexus final : public FeedbackNexus { ...@@ -655,11 +657,11 @@ class BinaryOpICNexus final : public FeedbackNexus {
public: public:
BinaryOpICNexus(Handle<FeedbackVector> vector, FeedbackSlot slot) BinaryOpICNexus(Handle<FeedbackVector> vector, FeedbackSlot slot)
: FeedbackNexus(vector, slot) { : FeedbackNexus(vector, slot) {
DCHECK_EQ(FeedbackSlotKind::INTERPRETER_BINARYOP_IC, vector->GetKind(slot)); DCHECK_EQ(FeedbackSlotKind::kBinaryOp, vector->GetKind(slot));
} }
BinaryOpICNexus(FeedbackVector* vector, FeedbackSlot slot) BinaryOpICNexus(FeedbackVector* vector, FeedbackSlot slot)
: FeedbackNexus(vector, slot) { : FeedbackNexus(vector, slot) {
DCHECK_EQ(FeedbackSlotKind::INTERPRETER_BINARYOP_IC, vector->GetKind(slot)); DCHECK_EQ(FeedbackSlotKind::kBinaryOp, vector->GetKind(slot));
} }
void Clear(Code* host); void Clear(Code* host);
...@@ -684,11 +686,11 @@ class CompareICNexus final : public FeedbackNexus { ...@@ -684,11 +686,11 @@ class CompareICNexus final : public FeedbackNexus {
public: public:
CompareICNexus(Handle<FeedbackVector> vector, FeedbackSlot slot) CompareICNexus(Handle<FeedbackVector> vector, FeedbackSlot slot)
: FeedbackNexus(vector, slot) { : FeedbackNexus(vector, slot) {
DCHECK_EQ(FeedbackSlotKind::INTERPRETER_COMPARE_IC, vector->GetKind(slot)); DCHECK_EQ(FeedbackSlotKind::kCompareOp, vector->GetKind(slot));
} }
CompareICNexus(FeedbackVector* vector, FeedbackSlot slot) CompareICNexus(FeedbackVector* vector, FeedbackSlot slot)
: FeedbackNexus(vector, slot) { : FeedbackNexus(vector, slot) {
DCHECK_EQ(FeedbackSlotKind::INTERPRETER_COMPARE_IC, vector->GetKind(slot)); DCHECK_EQ(FeedbackSlotKind::kCompareOp, vector->GetKind(slot));
} }
void Clear(Code* host); void Clear(Code* host);
...@@ -714,12 +716,12 @@ class StoreDataPropertyInLiteralICNexus : public FeedbackNexus { ...@@ -714,12 +716,12 @@ class StoreDataPropertyInLiteralICNexus : public FeedbackNexus {
StoreDataPropertyInLiteralICNexus(Handle<FeedbackVector> vector, StoreDataPropertyInLiteralICNexus(Handle<FeedbackVector> vector,
FeedbackSlot slot) FeedbackSlot slot)
: FeedbackNexus(vector, slot) { : FeedbackNexus(vector, slot) {
DCHECK_EQ(FeedbackSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC, DCHECK_EQ(FeedbackSlotKind::kStoreDataPropertyInLiteral,
vector->GetKind(slot)); vector->GetKind(slot));
} }
StoreDataPropertyInLiteralICNexus(FeedbackVector* vector, FeedbackSlot slot) StoreDataPropertyInLiteralICNexus(FeedbackVector* vector, FeedbackSlot slot)
: FeedbackNexus(vector, slot) { : FeedbackNexus(vector, slot) {
DCHECK_EQ(FeedbackSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC, DCHECK_EQ(FeedbackSlotKind::kStoreDataPropertyInLiteral,
vector->GetKind(slot)); vector->GetKind(slot));
} }
......
...@@ -199,7 +199,7 @@ void IC::TraceIC(const char* type, Handle<Object> name, State old_state, ...@@ -199,7 +199,7 @@ void IC::TraceIC(const char* type, Handle<Object> name, State old_state,
IC::IC(FrameDepth depth, Isolate* isolate, FeedbackNexus* nexus) IC::IC(FrameDepth depth, Isolate* isolate, FeedbackNexus* nexus)
: isolate_(isolate), : isolate_(isolate),
vector_set_(false), vector_set_(false),
kind_(FeedbackSlotKind::INVALID), kind_(FeedbackSlotKind::kInvalid),
target_maps_set_(false), target_maps_set_(false),
nexus_(nexus) { nexus_(nexus) {
// To improve the performance of the (much used) IC code, we unfold a few // To improve the performance of the (much used) IC code, we unfold a few
...@@ -256,14 +256,14 @@ IC::IC(FrameDepth depth, Isolate* isolate, FeedbackNexus* nexus) ...@@ -256,14 +256,14 @@ IC::IC(FrameDepth depth, Isolate* isolate, FeedbackNexus* nexus)
Code* target = this->target(); Code* target = this->target();
Code::Kind kind = target->kind(); Code::Kind kind = target->kind();
if (kind == Code::BINARY_OP_IC) { if (kind == Code::BINARY_OP_IC) {
kind_ = FeedbackSlotKind::INTERPRETER_BINARYOP_IC; kind_ = FeedbackSlotKind::kBinaryOp;
} else if (kind == Code::COMPARE_IC) { } else if (kind == Code::COMPARE_IC) {
kind_ = FeedbackSlotKind::INTERPRETER_COMPARE_IC; kind_ = FeedbackSlotKind::kCompareOp;
} else if (kind == Code::TO_BOOLEAN_IC) { } else if (kind == Code::TO_BOOLEAN_IC) {
kind_ = FeedbackSlotKind::TO_BOOLEAN_IC; kind_ = FeedbackSlotKind::kToBoolean;
} else { } else {
UNREACHABLE(); UNREACHABLE();
kind_ = FeedbackSlotKind::INVALID; kind_ = FeedbackSlotKind::kInvalid;
} }
DCHECK(!UseVector()); DCHECK(!UseVector());
state_ = StateFromCode(target); state_ = StateFromCode(target);
......
...@@ -279,7 +279,7 @@ class LoadIC : public IC { ...@@ -279,7 +279,7 @@ class LoadIC : public IC {
} }
static bool ShouldThrowReferenceError(FeedbackSlotKind kind) { static bool ShouldThrowReferenceError(FeedbackSlotKind kind) {
return kind == FeedbackSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC; return kind == FeedbackSlotKind::kLoadGlobalNotInsideTypeof;
} }
bool ShouldThrowReferenceError() const { bool ShouldThrowReferenceError() const {
......
...@@ -752,61 +752,61 @@ void FeedbackVector::FeedbackVectorPrint(std::ostream& os) { // NOLINT ...@@ -752,61 +752,61 @@ void FeedbackVector::FeedbackVectorPrint(std::ostream& os) { // NOLINT
os << "\n Slot " << slot << " " << kind; os << "\n Slot " << slot << " " << kind;
os << " "; os << " ";
switch (kind) { switch (kind) {
case FeedbackSlotKind::LOAD_IC: { case FeedbackSlotKind::kLoadProperty: {
LoadICNexus nexus(this, slot); LoadICNexus nexus(this, slot);
os << Code::ICState2String(nexus.StateFromFeedback()); os << Code::ICState2String(nexus.StateFromFeedback());
break; break;
} }
case FeedbackSlotKind::LOAD_GLOBAL_INSIDE_TYPEOF_IC: case FeedbackSlotKind::kLoadGlobalInsideTypeof:
case FeedbackSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC: { case FeedbackSlotKind::kLoadGlobalNotInsideTypeof: {
LoadGlobalICNexus nexus(this, slot); LoadGlobalICNexus nexus(this, slot);
os << Code::ICState2String(nexus.StateFromFeedback()); os << Code::ICState2String(nexus.StateFromFeedback());
break; break;
} }
case FeedbackSlotKind::KEYED_LOAD_IC: { case FeedbackSlotKind::kLoadKeyed: {
KeyedLoadICNexus nexus(this, slot); KeyedLoadICNexus nexus(this, slot);
os << Code::ICState2String(nexus.StateFromFeedback()); os << Code::ICState2String(nexus.StateFromFeedback());
break; break;
} }
case FeedbackSlotKind::CALL_IC: { case FeedbackSlotKind::kCall: {
CallICNexus nexus(this, slot); CallICNexus nexus(this, slot);
os << Code::ICState2String(nexus.StateFromFeedback()); os << Code::ICState2String(nexus.StateFromFeedback());
break; break;
} }
case FeedbackSlotKind::STORE_SLOPPY_IC: case FeedbackSlotKind::kStorePropertySloppy:
case FeedbackSlotKind::STORE_STRICT_IC: { case FeedbackSlotKind::kStorePropertyStrict: {
StoreICNexus nexus(this, slot); StoreICNexus nexus(this, slot);
os << Code::ICState2String(nexus.StateFromFeedback()); os << Code::ICState2String(nexus.StateFromFeedback());
break; break;
} }
case FeedbackSlotKind::KEYED_STORE_SLOPPY_IC: case FeedbackSlotKind::kStoreKeyedSloppy:
case FeedbackSlotKind::KEYED_STORE_STRICT_IC: { case FeedbackSlotKind::kStoreKeyedStrict: {
KeyedStoreICNexus nexus(this, slot); KeyedStoreICNexus nexus(this, slot);
os << Code::ICState2String(nexus.StateFromFeedback()); os << Code::ICState2String(nexus.StateFromFeedback());
break; break;
} }
case FeedbackSlotKind::INTERPRETER_BINARYOP_IC: { case FeedbackSlotKind::kBinaryOp: {
BinaryOpICNexus nexus(this, slot); BinaryOpICNexus nexus(this, slot);
os << Code::ICState2String(nexus.StateFromFeedback()); os << Code::ICState2String(nexus.StateFromFeedback());
break; break;
} }
case FeedbackSlotKind::INTERPRETER_COMPARE_IC: { case FeedbackSlotKind::kCompareOp: {
CompareICNexus nexus(this, slot); CompareICNexus nexus(this, slot);
os << Code::ICState2String(nexus.StateFromFeedback()); os << Code::ICState2String(nexus.StateFromFeedback());
break; break;
} }
case FeedbackSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC: { case FeedbackSlotKind::kStoreDataPropertyInLiteral: {
StoreDataPropertyInLiteralICNexus nexus(this, slot); StoreDataPropertyInLiteralICNexus nexus(this, slot);
os << Code::ICState2String(nexus.StateFromFeedback()); os << Code::ICState2String(nexus.StateFromFeedback());
break; break;
} }
case FeedbackSlotKind::CREATE_CLOSURE: case FeedbackSlotKind::kCreateClosure:
case FeedbackSlotKind::LITERAL: case FeedbackSlotKind::kLiteral:
case FeedbackSlotKind::GENERAL: case FeedbackSlotKind::kGeneral:
break; break;
case FeedbackSlotKind::TO_BOOLEAN_IC: case FeedbackSlotKind::kToBoolean:
case FeedbackSlotKind::INVALID: case FeedbackSlotKind::kInvalid:
case FeedbackSlotKind::KINDS_NUMBER: case FeedbackSlotKind::kKindsNumber:
UNREACHABLE(); UNREACHABLE();
break; break;
} }
......
...@@ -79,12 +79,12 @@ TEST(VectorStructure) { ...@@ -79,12 +79,12 @@ TEST(VectorStructure) {
index = vector->GetIndex(helper.slot(7)); index = vector->GetIndex(helper.slot(7));
CHECK_EQ(FeedbackVector::kReservedIndexCount + 3 + CHECK_EQ(FeedbackVector::kReservedIndexCount + 3 +
4 * FeedbackMetadata::GetSlotSize(FeedbackSlotKind::CALL_IC), 4 * FeedbackMetadata::GetSlotSize(FeedbackSlotKind::kCall),
index); index);
CHECK_EQ(helper.slot(7), vector->ToSlot(index)); CHECK_EQ(helper.slot(7), vector->ToSlot(index));
CHECK_EQ(FeedbackVector::kReservedIndexCount + 3 + CHECK_EQ(FeedbackVector::kReservedIndexCount + 3 +
5 * FeedbackMetadata::GetSlotSize(FeedbackSlotKind::CALL_IC), 5 * FeedbackMetadata::GetSlotSize(FeedbackSlotKind::kCall),
vector->length()); vector->length());
} }
...@@ -96,7 +96,7 @@ TEST(VectorStructure) { ...@@ -96,7 +96,7 @@ TEST(VectorStructure) {
vector = NewFeedbackVector(isolate, &spec); vector = NewFeedbackVector(isolate, &spec);
FeedbackVectorHelper helper(vector); FeedbackVectorHelper helper(vector);
CHECK_EQ(1, CHECK_EQ(1,
FeedbackMetadata::GetSlotSize(FeedbackSlotKind::CREATE_CLOSURE)); FeedbackMetadata::GetSlotSize(FeedbackSlotKind::kCreateClosure));
FeedbackSlot slot = helper.slot(1); FeedbackSlot slot = helper.slot(1);
Cell* cell = Cell::cast(vector->Get(slot)); Cell* cell = Cell::cast(vector->Get(slot));
CHECK_EQ(cell->value(), *factory->undefined_value()); CHECK_EQ(cell->value(), *factory->undefined_value());
...@@ -143,16 +143,16 @@ TEST(VectorICMetadata) { ...@@ -143,16 +143,16 @@ TEST(VectorICMetadata) {
FeedbackSlotKind kind = vector->GetKind(helper.slot(i)); FeedbackSlotKind kind = vector->GetKind(helper.slot(i));
switch (i % 4) { switch (i % 4) {
case 0: case 0:
CHECK_EQ(FeedbackSlotKind::GENERAL, kind); CHECK_EQ(FeedbackSlotKind::kGeneral, kind);
break; break;
case 1: case 1:
CHECK_EQ(FeedbackSlotKind::CALL_IC, kind); CHECK_EQ(FeedbackSlotKind::kCall, kind);
break; break;
case 2: case 2:
CHECK_EQ(FeedbackSlotKind::LOAD_IC, kind); CHECK_EQ(FeedbackSlotKind::kLoadProperty, kind);
break; break;
case 3: case 3:
CHECK_EQ(FeedbackSlotKind::KEYED_LOAD_IC, kind); CHECK_EQ(FeedbackSlotKind::kLoadKeyed, kind);
break; break;
} }
} }
...@@ -390,9 +390,8 @@ TEST(VectorLoadGlobalICSlotSharing) { ...@@ -390,9 +390,8 @@ TEST(VectorLoadGlobalICSlotSharing) {
Handle<FeedbackVector>(f->feedback_vector(), isolate); Handle<FeedbackVector>(f->feedback_vector(), isolate);
FeedbackVectorHelper helper(feedback_vector); FeedbackVectorHelper helper(feedback_vector);
CHECK_EQ(2, helper.slot_count()); CHECK_EQ(2, helper.slot_count());
CHECK_SLOT_KIND(helper, 0, CHECK_SLOT_KIND(helper, 0, FeedbackSlotKind::kLoadGlobalNotInsideTypeof);
FeedbackSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC); CHECK_SLOT_KIND(helper, 1, FeedbackSlotKind::kLoadGlobalInsideTypeof);
CHECK_SLOT_KIND(helper, 1, FeedbackSlotKind::LOAD_GLOBAL_INSIDE_TYPEOF_IC);
FeedbackSlot slot1 = helper.slot(0); FeedbackSlot slot1 = helper.slot(0);
FeedbackSlot slot2 = helper.slot(1); FeedbackSlot slot2 = helper.slot(1);
CHECK_EQ(MONOMORPHIC, CHECK_EQ(MONOMORPHIC,
...@@ -485,12 +484,10 @@ TEST(ReferenceContextAllocatesNoSlots) { ...@@ -485,12 +484,10 @@ TEST(ReferenceContextAllocatesNoSlots) {
handle(f->feedback_vector(), isolate); handle(f->feedback_vector(), isolate);
FeedbackVectorHelper helper(feedback_vector); FeedbackVectorHelper helper(feedback_vector);
CHECK_EQ(4, helper.slot_count()); CHECK_EQ(4, helper.slot_count());
CHECK_SLOT_KIND(helper, 0, FeedbackSlotKind::STORE_SLOPPY_IC); CHECK_SLOT_KIND(helper, 0, FeedbackSlotKind::kStorePropertySloppy);
CHECK_SLOT_KIND(helper, 1, CHECK_SLOT_KIND(helper, 1, FeedbackSlotKind::kLoadGlobalNotInsideTypeof);
FeedbackSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC); CHECK_SLOT_KIND(helper, 2, FeedbackSlotKind::kStorePropertySloppy);
CHECK_SLOT_KIND(helper, 2, FeedbackSlotKind::STORE_SLOPPY_IC); CHECK_SLOT_KIND(helper, 3, FeedbackSlotKind::kLoadGlobalNotInsideTypeof);
CHECK_SLOT_KIND(helper, 3,
FeedbackSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC);
} }
{ {
...@@ -507,9 +504,8 @@ TEST(ReferenceContextAllocatesNoSlots) { ...@@ -507,9 +504,8 @@ TEST(ReferenceContextAllocatesNoSlots) {
Handle<FeedbackVector> feedback_vector(f->feedback_vector()); Handle<FeedbackVector> feedback_vector(f->feedback_vector());
FeedbackVectorHelper helper(feedback_vector); FeedbackVectorHelper helper(feedback_vector);
CHECK_EQ(2, helper.slot_count()); CHECK_EQ(2, helper.slot_count());
CHECK_SLOT_KIND(helper, 0, CHECK_SLOT_KIND(helper, 0, FeedbackSlotKind::kLoadGlobalNotInsideTypeof);
FeedbackSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC); CHECK_SLOT_KIND(helper, 1, FeedbackSlotKind::kStorePropertyStrict);
CHECK_SLOT_KIND(helper, 1, FeedbackSlotKind::STORE_STRICT_IC);
} }
{ {
...@@ -528,12 +524,11 @@ TEST(ReferenceContextAllocatesNoSlots) { ...@@ -528,12 +524,11 @@ TEST(ReferenceContextAllocatesNoSlots) {
Handle<FeedbackVector> feedback_vector(f->feedback_vector()); Handle<FeedbackVector> feedback_vector(f->feedback_vector());
FeedbackVectorHelper helper(feedback_vector); FeedbackVectorHelper helper(feedback_vector);
CHECK_EQ(5, helper.slot_count()); CHECK_EQ(5, helper.slot_count());
CHECK_SLOT_KIND(helper, 0, FeedbackSlotKind::CALL_IC); CHECK_SLOT_KIND(helper, 0, FeedbackSlotKind::kCall);
CHECK_SLOT_KIND(helper, 1, CHECK_SLOT_KIND(helper, 1, FeedbackSlotKind::kLoadGlobalNotInsideTypeof);
FeedbackSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC); CHECK_SLOT_KIND(helper, 2, FeedbackSlotKind::kStorePropertySloppy);
CHECK_SLOT_KIND(helper, 2, FeedbackSlotKind::STORE_SLOPPY_IC); CHECK_SLOT_KIND(helper, 3, FeedbackSlotKind::kCall);
CHECK_SLOT_KIND(helper, 3, FeedbackSlotKind::CALL_IC); CHECK_SLOT_KIND(helper, 4, FeedbackSlotKind::kLoadProperty);
CHECK_SLOT_KIND(helper, 4, FeedbackSlotKind::LOAD_IC);
} }
{ {
...@@ -551,10 +546,9 @@ TEST(ReferenceContextAllocatesNoSlots) { ...@@ -551,10 +546,9 @@ TEST(ReferenceContextAllocatesNoSlots) {
Handle<FeedbackVector> feedback_vector(f->feedback_vector()); Handle<FeedbackVector> feedback_vector(f->feedback_vector());
FeedbackVectorHelper helper(feedback_vector); FeedbackVectorHelper helper(feedback_vector);
CHECK_EQ(3, helper.slot_count()); CHECK_EQ(3, helper.slot_count());
CHECK_SLOT_KIND(helper, 0, CHECK_SLOT_KIND(helper, 0, FeedbackSlotKind::kLoadGlobalNotInsideTypeof);
FeedbackSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC); CHECK_SLOT_KIND(helper, 1, FeedbackSlotKind::kStoreKeyedSloppy);
CHECK_SLOT_KIND(helper, 1, FeedbackSlotKind::KEYED_STORE_SLOPPY_IC); CHECK_SLOT_KIND(helper, 2, FeedbackSlotKind::kLoadKeyed);
CHECK_SLOT_KIND(helper, 2, FeedbackSlotKind::KEYED_LOAD_IC);
} }
{ {
...@@ -573,10 +567,9 @@ TEST(ReferenceContextAllocatesNoSlots) { ...@@ -573,10 +567,9 @@ TEST(ReferenceContextAllocatesNoSlots) {
Handle<FeedbackVector> feedback_vector(f->feedback_vector()); Handle<FeedbackVector> feedback_vector(f->feedback_vector());
FeedbackVectorHelper helper(feedback_vector); FeedbackVectorHelper helper(feedback_vector);
CHECK_EQ(3, helper.slot_count()); CHECK_EQ(3, helper.slot_count());
CHECK_SLOT_KIND(helper, 0, CHECK_SLOT_KIND(helper, 0, FeedbackSlotKind::kLoadGlobalNotInsideTypeof);
FeedbackSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC); CHECK_SLOT_KIND(helper, 1, FeedbackSlotKind::kStoreKeyedStrict);
CHECK_SLOT_KIND(helper, 1, FeedbackSlotKind::KEYED_STORE_STRICT_IC); CHECK_SLOT_KIND(helper, 2, FeedbackSlotKind::kLoadKeyed);
CHECK_SLOT_KIND(helper, 2, FeedbackSlotKind::KEYED_LOAD_IC);
} }
{ {
...@@ -595,14 +588,13 @@ TEST(ReferenceContextAllocatesNoSlots) { ...@@ -595,14 +588,13 @@ TEST(ReferenceContextAllocatesNoSlots) {
Handle<FeedbackVector> feedback_vector(f->feedback_vector()); Handle<FeedbackVector> feedback_vector(f->feedback_vector());
FeedbackVectorHelper helper(feedback_vector); FeedbackVectorHelper helper(feedback_vector);
CHECK_EQ(7, helper.slot_count()); CHECK_EQ(7, helper.slot_count());
CHECK_SLOT_KIND(helper, 0, CHECK_SLOT_KIND(helper, 0, FeedbackSlotKind::kLoadGlobalNotInsideTypeof);
FeedbackSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC); CHECK_SLOT_KIND(helper, 1, FeedbackSlotKind::kStorePropertyStrict);
CHECK_SLOT_KIND(helper, 1, FeedbackSlotKind::STORE_STRICT_IC); CHECK_SLOT_KIND(helper, 2, FeedbackSlotKind::kStorePropertyStrict);
CHECK_SLOT_KIND(helper, 2, FeedbackSlotKind::STORE_STRICT_IC); CHECK_SLOT_KIND(helper, 3, FeedbackSlotKind::kStorePropertyStrict);
CHECK_SLOT_KIND(helper, 3, FeedbackSlotKind::STORE_STRICT_IC); CHECK_SLOT_KIND(helper, 4, FeedbackSlotKind::kLoadProperty);
CHECK_SLOT_KIND(helper, 4, FeedbackSlotKind::LOAD_IC); CHECK_SLOT_KIND(helper, 5, FeedbackSlotKind::kLoadProperty);
CHECK_SLOT_KIND(helper, 5, FeedbackSlotKind::LOAD_IC); CHECK_SLOT_KIND(helper, 6, FeedbackSlotKind::kBinaryOp);
CHECK_SLOT_KIND(helper, 6, FeedbackSlotKind::INTERPRETER_BINARYOP_IC);
} }
} }
......
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