Commit b88d132f authored by mvstanton's avatar mvstanton Committed by Commit bot

[TypeFeedbackVector] special ic slots for interpreter compare/binary ops.

Full code uses patching ICs for this feedback, and the interpreter uses
the type feedback vector. It's a good idea to code the vector slots
appropriately as ICs so that the runtime profiler can better gauge if
the function is ready for tiering up from Ignition to TurboFan.

As is, the feedback is stored in "general" slots which can't be
characterized by the runtime profiler into feedback states.

This CL addresses that problem. Note that it's also important to
carefully exclude these slots from the profiler's consideration when
determining if you want to optimize from Full code.

BUG=

Review-Url: https://codereview.chromium.org/2342853002
Cr-Commit-Position: refs/heads/master@{#39555}
parent 05a00a93
......@@ -1159,8 +1159,6 @@ v8_source_set("v8_base") {
"src/compiler/type-cache.h",
"src/compiler/type-hint-analyzer.cc",
"src/compiler/type-hint-analyzer.h",
"src/compiler/type-hints.cc",
"src/compiler/type-hints.h",
"src/compiler/typed-optimization.cc",
"src/compiler/typed-optimization.h",
"src/compiler/typer.cc",
......@@ -1643,6 +1641,8 @@ v8_source_set("v8_base") {
"src/type-feedback-vector-inl.h",
"src/type-feedback-vector.cc",
"src/type-feedback-vector.h",
"src/type-hints.cc",
"src/type-hints.h",
"src/type-info.cc",
"src/type-info.h",
"src/unicode-cache-inl.h",
......
......@@ -269,7 +269,7 @@ void CountOperation::AssignFeedbackVectorSlots(Isolate* isolate,
AssignVectorSlots(expression(), spec, &slot_);
// Assign a slot to collect feedback about binary operations. Used only in
// ignition. Fullcodegen uses AstId to record type feedback.
binary_operation_slot_ = spec->AddGeneralSlot();
binary_operation_slot_ = spec->AddInterpreterBinaryOpICSlot();
}
......@@ -719,7 +719,7 @@ void BinaryOperation::AssignFeedbackVectorSlots(
case Token::OR:
return;
default:
type_feedback_slot_ = spec->AddGeneralSlot();
type_feedback_slot_ = spec->AddInterpreterBinaryOpICSlot();
return;
}
}
......@@ -740,7 +740,7 @@ void CompareOperation::AssignFeedbackVectorSlots(
case Token::IN:
return;
default:
type_feedback_slot_ = spec->AddGeneralSlot();
type_feedback_slot_ = spec->AddInterpreterCompareICSlot();
}
}
......@@ -947,7 +947,7 @@ CaseClause::CaseClause(Expression* label, ZoneList<Statement*>* statements,
void CaseClause::AssignFeedbackVectorSlots(Isolate* isolate,
FeedbackVectorSpec* spec,
FeedbackVectorSlotCache* cache) {
type_feedback_slot_ = spec->AddGeneralSlot();
type_feedback_slot_ = spec->AddInterpreterCompareICSlot();
}
uint32_t Literal::Hash() {
......
......@@ -3637,30 +3637,15 @@ void CodeStubAssembler::UpdateFeedback(compiler::Node* feedback,
compiler::Node* slot_id) {
Label combine_feedback(this), record_feedback(this), end(this);
// This method is used for binary op and compare feedback. These
// vector nodes are initialized with a smi 0, so we can simply OR
// our new feedback in place.
Node* previous_feedback =
LoadFixedArrayElement(type_feedback_vector, slot_id);
Node* is_uninitialized = WordEqual(
previous_feedback,
HeapConstant(TypeFeedbackVector::UninitializedSentinel(isolate())));
BranchIf(is_uninitialized, &record_feedback, &combine_feedback);
Bind(&record_feedback);
{
StoreFixedArrayElement(type_feedback_vector, slot_id, SmiTag(feedback),
SKIP_WRITE_BARRIER);
Goto(&end);
}
Bind(&combine_feedback);
{
Node* untagged_previous_feedback = SmiUntag(previous_feedback);
Node* combined_feedback = Word32Or(untagged_previous_feedback, feedback);
StoreFixedArrayElement(type_feedback_vector, slot_id,
SmiTag(combined_feedback), SKIP_WRITE_BARRIER);
Goto(&end);
}
Bind(&end);
Node* untagged_previous_feedback = SmiUntag(previous_feedback);
Node* combined_feedback = Word32Or(untagged_previous_feedback, feedback);
StoreFixedArrayElement(type_feedback_vector, slot_id,
SmiTag(combined_feedback), SKIP_WRITE_BARRIER);
}
compiler::Node* CodeStubAssembler::LoadReceiverMap(compiler::Node* receiver) {
......
......@@ -1380,13 +1380,10 @@ BinaryOperationHint BytecodeGraphBuilder::GetBinaryOperationHint(
int operand_index) {
FeedbackVectorSlot slot = feedback_vector()->ToSlot(
bytecode_iterator().GetIndexOperand(operand_index));
DCHECK_EQ(FeedbackVectorSlotKind::GENERAL, feedback_vector()->GetKind(slot));
Object* feedback = feedback_vector()->Get(slot);
BinaryOperationHint hint = BinaryOperationHint::kAny;
if (feedback->IsSmi()) {
hint = BinaryOperationHintFromFeedback((Smi::cast(feedback))->value());
}
return hint;
DCHECK_EQ(FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC,
feedback_vector()->GetKind(slot));
BinaryOpICNexus nexus(feedback_vector(), slot);
return nexus.GetBinaryOperationFeedback();
}
// Helper function to create compare operation hint from the recorded type
......@@ -1398,13 +1395,10 @@ CompareOperationHint BytecodeGraphBuilder::GetCompareOperationHint() {
}
FeedbackVectorSlot slot =
feedback_vector()->ToSlot(bytecode_iterator().GetIndexOperand(1));
DCHECK_EQ(FeedbackVectorSlotKind::GENERAL, feedback_vector()->GetKind(slot));
Object* feedback = feedback_vector()->Get(slot);
CompareOperationHint hint = CompareOperationHint::kAny;
if (feedback->IsSmi()) {
hint = CompareOperationHintFromFeedback((Smi::cast(feedback))->value());
}
return hint;
DCHECK_EQ(FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC,
feedback_vector()->GetKind(slot));
CompareICNexus nexus(feedback_vector(), slot);
return nexus.GetCompareOperationFeedback();
}
float BytecodeGraphBuilder::ComputeCallFrequency(int slot_id) const {
......
......@@ -5,8 +5,8 @@
#ifndef V8_COMPILER_JS_OPERATOR_H_
#define V8_COMPILER_JS_OPERATOR_H_
#include "src/compiler/type-hints.h"
#include "src/runtime/runtime.h"
#include "src/type-hints.h"
namespace v8 {
namespace internal {
......
......@@ -6,8 +6,8 @@
#include "src/assembler.h"
#include "src/code-stubs.h"
#include "src/compiler/type-hints.h"
#include "src/ic/ic-state.h"
#include "src/type-hints.h"
namespace v8 {
namespace internal {
......@@ -136,32 +136,6 @@ TypeHintAnalysis* TypeHintAnalyzer::Analyze(Handle<Code> code) {
return new (zone()) TypeHintAnalysis(infos, zone());
}
// Helper function to transform the feedback to BinaryOperationHint.
BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback) {
switch (type_feedback) {
case BinaryOperationFeedback::kSignedSmall:
return BinaryOperationHint::kSignedSmall;
case BinaryOperationFeedback::kNumber:
return BinaryOperationHint::kNumberOrOddball;
case BinaryOperationFeedback::kAny:
default:
return BinaryOperationHint::kAny;
}
UNREACHABLE();
return BinaryOperationHint::kNone;
}
// Helper function to transform the feedback to CompareOperationHint.
CompareOperationHint CompareOperationHintFromFeedback(int type_feedback) {
switch (type_feedback) {
case CompareOperationFeedback::kSignedSmall:
return CompareOperationHint::kSignedSmall;
case CompareOperationFeedback::kNumber:
return CompareOperationHint::kNumber;
default:
return CompareOperationHint::kAny;
}
}
} // namespace compiler
} // namespace internal
......
......@@ -5,8 +5,8 @@
#ifndef V8_COMPILER_TYPE_HINT_ANALYZER_H_
#define V8_COMPILER_TYPE_HINT_ANALYZER_H_
#include "src/compiler/type-hints.h"
#include "src/handles.h"
#include "src/type-hints.h"
#include "src/zone-containers.h"
namespace v8 {
......@@ -50,9 +50,6 @@ class TypeHintAnalyzer final {
DISALLOW_COPY_AND_ASSIGN(TypeHintAnalyzer);
};
BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback);
CompareOperationHint CompareOperationHintFromFeedback(int type_feedback);
} // namespace compiler
} // namespace internal
} // namespace v8
......
......@@ -750,6 +750,16 @@ void TypeFeedbackVector::TypeFeedbackVectorPrint(std::ostream& os) { // NOLINT
os << Code::ICState2String(nexus.StateFromFeedback());
break;
}
case FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC: {
BinaryOpICNexus nexus(this, slot);
os << Code::ICState2String(nexus.StateFromFeedback());
break;
}
case FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC: {
CompareICNexus nexus(this, slot);
os << Code::ICState2String(nexus.StateFromFeedback());
break;
}
case FeedbackVectorSlotKind::GENERAL:
break;
case FeedbackVectorSlotKind::INVALID:
......
......@@ -81,7 +81,10 @@ static void GetICCounts(JSFunction* function, int* ic_with_type_info_count,
// Harvest vector-ics as well
TypeFeedbackVector* vector = function->feedback_vector();
int with = 0, gen = 0;
vector->ComputeCounts(&with, &gen);
const bool is_interpreted =
function->shared()->code()->is_interpreter_trampoline_builtin();
vector->ComputeCounts(&with, &gen, is_interpreted);
*ic_with_type_info_count += with;
*ic_generic_count += gen;
......
......@@ -5,6 +5,7 @@
#ifndef V8_TYPE_FEEDBACK_VECTOR_INL_H_
#define V8_TYPE_FEEDBACK_VECTOR_INL_H_
#include "src/globals.h"
#include "src/type-feedback-vector.h"
namespace v8 {
......@@ -52,7 +53,13 @@ TypeFeedbackVector* TypeFeedbackVector::cast(Object* obj) {
int TypeFeedbackMetadata::GetSlotSize(FeedbackVectorSlotKind kind) {
DCHECK_NE(FeedbackVectorSlotKind::INVALID, kind);
DCHECK_NE(FeedbackVectorSlotKind::KINDS_NUMBER, kind);
return kind == FeedbackVectorSlotKind::GENERAL ? 1 : 2;
if (kind == FeedbackVectorSlotKind::GENERAL ||
kind == FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC ||
kind == FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC) {
return 1;
}
return 2;
}
bool TypeFeedbackMetadata::SlotRequiresName(FeedbackVectorSlotKind kind) {
......@@ -65,6 +72,8 @@ bool TypeFeedbackMetadata::SlotRequiresName(FeedbackVectorSlotKind kind) {
case FeedbackVectorSlotKind::KEYED_LOAD_IC:
case FeedbackVectorSlotKind::STORE_IC:
case FeedbackVectorSlotKind::KEYED_STORE_IC:
case FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC:
case FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC:
case FeedbackVectorSlotKind::GENERAL:
case FeedbackVectorSlotKind::INVALID:
return false;
......@@ -111,8 +120,35 @@ void TypeFeedbackVector::Set(FeedbackVectorSlot slot, Object* value,
set(GetIndex(slot), value, mode);
}
// Helper function to transform the feedback to BinaryOperationHint.
BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback) {
switch (type_feedback) {
case BinaryOperationFeedback::kSignedSmall:
return BinaryOperationHint::kSignedSmall;
case BinaryOperationFeedback::kNumber:
return BinaryOperationHint::kNumberOrOddball;
case BinaryOperationFeedback::kAny:
default:
return BinaryOperationHint::kAny;
}
UNREACHABLE();
return BinaryOperationHint::kNone;
}
// Helper function to transform the feedback to CompareOperationHint.
CompareOperationHint CompareOperationHintFromFeedback(int type_feedback) {
switch (type_feedback) {
case CompareOperationFeedback::kSignedSmall:
return CompareOperationHint::kSignedSmall;
case CompareOperationFeedback::kNumber:
return CompareOperationHint::kNumber;
default:
return CompareOperationHint::kAny;
}
}
void TypeFeedbackVector::ComputeCounts(int* with_type_info, int* generic) {
void TypeFeedbackVector::ComputeCounts(int* with_type_info, int* generic,
bool code_is_interpreted) {
Object* uninitialized_sentinel =
TypeFeedbackVector::RawUninitializedSentinel(GetIsolate());
Object* megamorphic_sentinel =
......@@ -127,7 +163,36 @@ void TypeFeedbackVector::ComputeCounts(int* with_type_info, int* generic) {
Object* obj = Get(slot);
if (obj != uninitialized_sentinel &&
kind != FeedbackVectorSlotKind::GENERAL) {
if (obj->IsWeakCell() || obj->IsFixedArray() || obj->IsString()) {
if (kind == FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC ||
kind == FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC) {
// If we are not running interpreted code, we need to ignore
// the special ic slots for binaryop/compare used by the
// interpreter.
// TODO(mvstanton): Remove code_is_interpreted when full code
// is retired from service.
if (code_is_interpreted) continue;
DCHECK(obj->IsSmi());
int op_feedback = static_cast<int>(Smi::cast(obj)->value());
if (kind == FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC) {
CompareOperationHint hint =
CompareOperationHintFromFeedback(op_feedback);
if (hint == CompareOperationHint::kAny) {
gen++;
} else if (hint != CompareOperationHint::kNone) {
with++;
}
} else {
DCHECK(kind == FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC);
BinaryOperationHint hint =
BinaryOperationHintFromFeedback(op_feedback);
if (hint == BinaryOperationHint::kAny) {
gen++;
} else if (hint != BinaryOperationHint::kNone) {
with++;
}
}
} else if (obj->IsWeakCell() || obj->IsFixedArray() || obj->IsString()) {
with++;
} else if (obj == megamorphic_sentinel) {
gen++;
......
......@@ -202,6 +202,10 @@ const char* TypeFeedbackMetadata::Kind2String(FeedbackVectorSlotKind kind) {
return "STORE_IC";
case FeedbackVectorSlotKind::KEYED_STORE_IC:
return "KEYED_STORE_IC";
case FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC:
return "INTERPRETER_BINARYOP_IC";
case FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC:
return "INTERPRETER_COMPARE_IC";
case FeedbackVectorSlotKind::GENERAL:
return "STUB";
case FeedbackVectorSlotKind::KINDS_NUMBER:
......@@ -252,6 +256,9 @@ Handle<TypeFeedbackVector> TypeFeedbackVector::New(
Object* value;
if (kind == FeedbackVectorSlotKind::LOAD_GLOBAL_IC) {
value = *factory->empty_weak_cell();
} else if (kind == FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC ||
kind == FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC) {
value = Smi::FromInt(0);
} else {
value = *uninitialized_sentinel;
}
......@@ -339,6 +346,13 @@ void TypeFeedbackVector::ClearSlotsImpl(SharedFunctionInfo* shared,
nexus.Clear(shared->code());
break;
}
case FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC:
case FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC: {
DCHECK(Get(slot)->IsSmi());
// don't clear these smi slots.
// Set(slot, Smi::FromInt(0));
break;
}
case FeedbackVectorSlotKind::GENERAL: {
if (obj->IsHeapObject()) {
InstanceType instance_type =
......@@ -1037,5 +1051,38 @@ IcCheckType KeyedStoreICNexus::GetKeyType() const {
}
return IsPropertyNameFeedback(feedback) ? PROPERTY : ELEMENT;
}
InlineCacheState BinaryOpICNexus::StateFromFeedback() const {
BinaryOperationHint hint = GetBinaryOperationFeedback();
if (hint == BinaryOperationHint::kNone) {
return UNINITIALIZED;
} else if (hint == BinaryOperationHint::kAny) {
return GENERIC;
}
return MONOMORPHIC;
}
InlineCacheState CompareICNexus::StateFromFeedback() const {
CompareOperationHint hint = GetCompareOperationFeedback();
if (hint == CompareOperationHint::kNone) {
return UNINITIALIZED;
} else if (hint == CompareOperationHint::kAny) {
return GENERIC;
}
return MONOMORPHIC;
}
BinaryOperationHint BinaryOpICNexus::GetBinaryOperationFeedback() const {
int feedback = Smi::cast(GetFeedback())->value();
return BinaryOperationHintFromFeedback(feedback);
}
CompareOperationHint CompareICNexus::GetCompareOperationFeedback() const {
int feedback = Smi::cast(GetFeedback())->value();
return CompareOperationHintFromFeedback(feedback);
}
} // namespace internal
} // namespace v8
......@@ -10,6 +10,7 @@
#include "src/base/logging.h"
#include "src/elements-kind.h"
#include "src/objects.h"
#include "src/type-hints.h"
#include "src/zone-containers.h"
namespace v8 {
......@@ -27,6 +28,8 @@ enum class FeedbackVectorSlotKind {
KEYED_LOAD_IC,
STORE_IC,
KEYED_STORE_IC,
INTERPRETER_BINARYOP_IC,
INTERPRETER_COMPARE_IC,
// This is a general purpose slot that occupies one feedback vector element.
GENERAL,
......@@ -67,6 +70,14 @@ class FeedbackVectorSpecBase {
return AddSlot(FeedbackVectorSlotKind::KEYED_STORE_IC);
}
FeedbackVectorSlot AddInterpreterBinaryOpICSlot() {
return AddSlot(FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC);
}
FeedbackVectorSlot AddInterpreterCompareICSlot() {
return AddSlot(FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC);
}
FeedbackVectorSlot AddGeneralSlot() {
return AddSlot(FeedbackVectorSlotKind::GENERAL);
}
......@@ -207,7 +218,7 @@ class TypeFeedbackMetadata : public FixedArray {
static const char* Kind2String(FeedbackVectorSlotKind kind);
private:
static const int kFeedbackVectorSlotKindBits = 4;
static const int kFeedbackVectorSlotKindBits = 5;
STATIC_ASSERT(static_cast<int>(FeedbackVectorSlotKind::KINDS_NUMBER) <
(1 << kFeedbackVectorSlotKindBits));
......@@ -236,7 +247,8 @@ class TypeFeedbackVector : public FixedArray {
static const int kInvocationCountIndex = 1;
static const int kReservedIndexCount = 2;
inline void ComputeCounts(int* with_type_info, int* generic);
inline void ComputeCounts(int* with_type_info, int* generic,
bool code_is_interpreted);
inline bool is_empty() const;
......@@ -636,6 +648,72 @@ class KeyedStoreICNexus : public FeedbackNexus {
InlineCacheState StateFromFeedback() const override;
Name* FindFirstName() const override;
};
class BinaryOpICNexus final : public FeedbackNexus {
public:
BinaryOpICNexus(Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot)
: FeedbackNexus(vector, slot) {
DCHECK_EQ(FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC,
vector->GetKind(slot));
}
BinaryOpICNexus(TypeFeedbackVector* vector, FeedbackVectorSlot slot)
: FeedbackNexus(vector, slot) {
DCHECK_EQ(FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC,
vector->GetKind(slot));
}
void Clear(Code* host);
InlineCacheState StateFromFeedback() const final;
BinaryOperationHint GetBinaryOperationFeedback() const;
int ExtractMaps(MapHandleList* maps) const final {
// BinaryOpICs don't record map feedback.
return 0;
}
MaybeHandle<Object> FindHandlerForMap(Handle<Map> map) const final {
return MaybeHandle<Code>();
}
bool FindHandlers(List<Handle<Object>>* code_list,
int length = -1) const final {
return length == 0;
}
};
class CompareICNexus final : public FeedbackNexus {
public:
CompareICNexus(Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot)
: FeedbackNexus(vector, slot) {
DCHECK_EQ(FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC,
vector->GetKind(slot));
}
CompareICNexus(TypeFeedbackVector* vector, FeedbackVectorSlot slot)
: FeedbackNexus(vector, slot) {
DCHECK_EQ(FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC,
vector->GetKind(slot));
}
void Clear(Code* host);
InlineCacheState StateFromFeedback() const final;
CompareOperationHint GetCompareOperationFeedback() const;
int ExtractMaps(MapHandleList* maps) const final {
// BinaryOpICs don't record map feedback.
return 0;
}
MaybeHandle<Object> FindHandlerForMap(Handle<Map> map) const final {
return MaybeHandle<Code>();
}
bool FindHandlers(List<Handle<Object>>* code_list,
int length = -1) const final {
return length == 0;
}
};
inline BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback);
inline CompareOperationHint CompareOperationHintFromFeedback(int type_feedback);
} // namespace internal
} // namespace v8
......
......@@ -2,11 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/compiler/type-hints.h"
#include "src/type-hints.h"
namespace v8 {
namespace internal {
namespace compiler {
std::ostream& operator<<(std::ostream& os, BinaryOperationHint hint) {
switch (hint) {
......@@ -88,6 +87,5 @@ std::ostream& operator<<(std::ostream& os, ToBooleanHints hints) {
return os;
}
} // namespace compiler
} // namespace internal
} // namespace v8
......@@ -2,15 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMPILER_TYPE_HINTS_H_
#define V8_COMPILER_TYPE_HINTS_H_
#ifndef V8_TYPE_HINTS_H_
#define V8_TYPE_HINTS_H_
#include "src/base/flags.h"
#include "src/utils.h"
namespace v8 {
namespace internal {
namespace compiler {
// Type hints for an binary operation.
enum class BinaryOperationHint : uint8_t {
......@@ -67,8 +66,7 @@ std::ostream& operator<<(std::ostream&, ToBooleanHints);
DEFINE_OPERATORS_FOR_FLAGS(ToBooleanHints)
} // namespace compiler
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_TYPE_HINTS_H_
#endif // V8_TYPE_HINTS_H_
......@@ -725,8 +725,6 @@
'compiler/type-cache.h',
'compiler/type-hint-analyzer.cc',
'compiler/type-hint-analyzer.h',
'compiler/type-hints.cc',
'compiler/type-hints.h',
'compiler/typed-optimization.cc',
'compiler/typed-optimization.h',
'compiler/typer.cc',
......@@ -1213,6 +1211,8 @@
'type-feedback-vector-inl.h',
'type-feedback-vector.cc',
'type-feedback-vector.h',
'type-hints.cc',
'type-hints.h',
'type-info.cc',
'type-info.h',
'unicode-inl.h',
......
......@@ -269,7 +269,7 @@ TEST(InterpreterShiftOpsSmi) {
BytecodeArrayBuilder builder(isolate, handles.main_zone(), 1, 0, 1);
FeedbackVectorSpec feedback_spec(&zone);
FeedbackVectorSlot slot = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot();
Handle<i::TypeFeedbackVector> vector =
NewTypeFeedbackVector(isolate, &feedback_spec);
......@@ -308,7 +308,7 @@ TEST(InterpreterBinaryOpsSmi) {
BytecodeArrayBuilder builder(isolate, handles.main_zone(), 1, 0, 1);
FeedbackVectorSpec feedback_spec(&zone);
FeedbackVectorSlot slot = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot();
Handle<i::TypeFeedbackVector> vector =
NewTypeFeedbackVector(isolate, &feedback_spec);
......@@ -349,7 +349,7 @@ TEST(InterpreterBinaryOpsHeapNumber) {
BytecodeArrayBuilder builder(isolate, handles.main_zone(), 1, 0, 1);
FeedbackVectorSpec feedback_spec(&zone);
FeedbackVectorSlot slot = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot();
Handle<i::TypeFeedbackVector> vector =
NewTypeFeedbackVector(isolate, &feedback_spec);
......@@ -463,13 +463,13 @@ TEST(InterpreterParameter8) {
BytecodeArrayBuilder builder(isolate, handles.main_zone(), 8, 0, 0);
FeedbackVectorSpec feedback_spec(&zone);
FeedbackVectorSlot slot = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot1 = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot2 = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot3 = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot4 = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot5 = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot6 = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackVectorSlot slot1 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackVectorSlot slot2 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackVectorSlot slot3 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackVectorSlot slot4 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackVectorSlot slot5 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackVectorSlot slot6 = feedback_spec.AddInterpreterBinaryOpICSlot();
Handle<i::TypeFeedbackVector> vector =
NewTypeFeedbackVector(isolate, &feedback_spec);
......@@ -632,7 +632,7 @@ TEST(InterpreterBinaryOpTypeFeedback) {
BytecodeArrayBuilder builder(isolate, handles.main_zone(), 1, 0, 1);
i::FeedbackVectorSpec feedback_spec(&zone);
i::FeedbackVectorSlot slot0 = feedback_spec.AddGeneralSlot();
i::FeedbackVectorSlot slot0 = feedback_spec.AddInterpreterBinaryOpICSlot();
Handle<i::TypeFeedbackVector> vector =
i::NewTypeFeedbackVector(isolate, &feedback_spec);
......@@ -736,7 +736,7 @@ TEST(InterpreterBinaryOpSmiTypeFeedback) {
BytecodeArrayBuilder builder(isolate, handles.main_zone(), 1, 0, 1);
i::FeedbackVectorSpec feedback_spec(&zone);
i::FeedbackVectorSlot slot0 = feedback_spec.AddGeneralSlot();
i::FeedbackVectorSlot slot0 = feedback_spec.AddInterpreterBinaryOpICSlot();
Handle<i::TypeFeedbackVector> vector =
i::NewTypeFeedbackVector(isolate, &feedback_spec);
......@@ -786,10 +786,10 @@ TEST(InterpreterUnaryOpFeedback) {
BytecodeArrayBuilder builder(isolate, handles.main_zone(), 4, 0, 0);
i::FeedbackVectorSpec feedback_spec(&zone);
i::FeedbackVectorSlot slot0 = feedback_spec.AddGeneralSlot();
i::FeedbackVectorSlot slot1 = feedback_spec.AddGeneralSlot();
i::FeedbackVectorSlot slot2 = feedback_spec.AddGeneralSlot();
i::FeedbackVectorSlot slot3 = feedback_spec.AddGeneralSlot();
i::FeedbackVectorSlot slot0 = feedback_spec.AddInterpreterBinaryOpICSlot();
i::FeedbackVectorSlot slot1 = feedback_spec.AddInterpreterBinaryOpICSlot();
i::FeedbackVectorSlot slot2 = feedback_spec.AddInterpreterBinaryOpICSlot();
i::FeedbackVectorSlot slot3 = feedback_spec.AddInterpreterBinaryOpICSlot();
Handle<i::TypeFeedbackVector> vector =
i::NewTypeFeedbackVector(isolate, &feedback_spec);
......@@ -850,9 +850,9 @@ TEST(InterpreterBitwiseTypeFeedback) {
BytecodeArrayBuilder builder(isolate, handles.main_zone(), 4, 0, 0);
i::FeedbackVectorSpec feedback_spec(&zone);
i::FeedbackVectorSlot slot0 = feedback_spec.AddGeneralSlot();
i::FeedbackVectorSlot slot1 = feedback_spec.AddGeneralSlot();
i::FeedbackVectorSlot slot2 = feedback_spec.AddGeneralSlot();
i::FeedbackVectorSlot slot0 = feedback_spec.AddInterpreterBinaryOpICSlot();
i::FeedbackVectorSlot slot1 = feedback_spec.AddInterpreterBinaryOpICSlot();
i::FeedbackVectorSlot slot2 = feedback_spec.AddInterpreterBinaryOpICSlot();
Handle<i::TypeFeedbackVector> vector =
i::NewTypeFeedbackVector(isolate, &feedback_spec);
......@@ -1392,9 +1392,9 @@ TEST(InterpreterJumps) {
BytecodeArrayBuilder builder(isolate, handles.main_zone(), 0, 0, 2);
FeedbackVectorSpec feedback_spec(&zone);
FeedbackVectorSlot slot = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot1 = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot2 = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackVectorSlot slot1 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackVectorSlot slot2 = feedback_spec.AddInterpreterBinaryOpICSlot();
Handle<i::TypeFeedbackVector> vector =
NewTypeFeedbackVector(isolate, &feedback_spec);
......@@ -1431,11 +1431,11 @@ TEST(InterpreterConditionalJumps) {
BytecodeArrayBuilder builder(isolate, handles.main_zone(), 0, 0, 2);
FeedbackVectorSpec feedback_spec(&zone);
FeedbackVectorSlot slot = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot1 = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot2 = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot3 = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot4 = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackVectorSlot slot1 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackVectorSlot slot2 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackVectorSlot slot3 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackVectorSlot slot4 = feedback_spec.AddInterpreterBinaryOpICSlot();
Handle<i::TypeFeedbackVector> vector =
NewTypeFeedbackVector(isolate, &feedback_spec);
......@@ -1481,11 +1481,11 @@ TEST(InterpreterConditionalJumps2) {
BytecodeArrayBuilder builder(isolate, handles.main_zone(), 0, 0, 2);
FeedbackVectorSpec feedback_spec(&zone);
FeedbackVectorSlot slot = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot1 = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot2 = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot3 = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot4 = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackVectorSlot slot1 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackVectorSlot slot2 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackVectorSlot slot3 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackVectorSlot slot4 = feedback_spec.AddInterpreterBinaryOpICSlot();
Handle<i::TypeFeedbackVector> vector =
NewTypeFeedbackVector(isolate, &feedback_spec);
......@@ -1531,7 +1531,7 @@ TEST(InterpreterJumpConstantWith16BitOperand) {
Zone zone(isolate->allocator());
FeedbackVectorSpec feedback_spec(&zone);
FeedbackVectorSlot slot = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot();
Handle<i::TypeFeedbackVector> vector =
NewTypeFeedbackVector(isolate, &feedback_spec);
......@@ -1677,7 +1677,7 @@ TEST(InterpreterSmiComparisons) {
BytecodeArrayBuilder builder(isolate, handles.main_zone(), 0, 0, 1);
FeedbackVectorSpec feedback_spec(&zone);
FeedbackVectorSlot slot = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot = feedback_spec.AddInterpreterCompareICSlot();
Handle<i::TypeFeedbackVector> vector =
NewTypeFeedbackVector(isolate, &feedback_spec);
......@@ -1724,7 +1724,7 @@ TEST(InterpreterHeapNumberComparisons) {
BytecodeArrayBuilder builder(isolate, handles.main_zone(), 0, 0, 1);
FeedbackVectorSpec feedback_spec(&zone);
FeedbackVectorSlot slot = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot = feedback_spec.AddInterpreterCompareICSlot();
Handle<i::TypeFeedbackVector> vector =
NewTypeFeedbackVector(isolate, &feedback_spec);
......@@ -1769,7 +1769,7 @@ TEST(InterpreterStringComparisons) {
const char* rhs = inputs[j].c_str();
FeedbackVectorSpec feedback_spec(&zone);
FeedbackVectorSlot slot = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot = feedback_spec.AddInterpreterCompareICSlot();
Handle<i::TypeFeedbackVector> vector =
NewTypeFeedbackVector(isolate, &feedback_spec);
......@@ -1825,7 +1825,7 @@ TEST(InterpreterMixedComparisons) {
Zone zone(isolate->allocator());
FeedbackVectorSpec feedback_spec(&zone);
FeedbackVectorSlot slot = feedback_spec.AddGeneralSlot();
FeedbackVectorSlot slot = feedback_spec.AddInterpreterCompareICSlot();
Handle<i::TypeFeedbackVector> vector =
NewTypeFeedbackVector(isolate, &feedback_spec);
......
......@@ -559,8 +559,7 @@ TEST(ReferenceContextAllocatesNoSlots) {
CHECK_SLOT_KIND(helper, 3, FeedbackVectorSlotKind::STORE_IC);
CHECK_SLOT_KIND(helper, 4, FeedbackVectorSlotKind::LOAD_IC);
CHECK_SLOT_KIND(helper, 5, FeedbackVectorSlotKind::LOAD_IC);
// Binary operation feedback is a general slot.
CHECK_SLOT_KIND(helper, 6, FeedbackVectorSlotKind::GENERAL);
CHECK_SLOT_KIND(helper, 6, FeedbackVectorSlotKind::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