Revert "[turbofan] Further brokerize BytecodeGraphBuilder"

This reverts commit 8ff8ddbaf5.

Reason for revert: Causes failures on GC Stress and TSan:

https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20gc%20stress/24138
https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20TSAN/27969

Original change's description:
> [turbofan] Further brokerize BytecodeGraphBuilder
> 
> Replace all usages of VectorSlotPair with FeedbackSource.
> 
> Bug: v8:7790
> Change-Id: I0ac6e9cd8f5730154cc1842e267ca1ebfdebc874
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1763536
> Commit-Queue: Maya Lekova <mslekova@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#63378}

TBR=neis@chromium.org,mslekova@chromium.org

Change-Id: Ieb6fb24dd0626fd9eb2183844614ac5b3c8084e8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7790
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1769287
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63387}
This commit is contained in:
Bill Budge 2019-08-23 17:54:44 +00:00 committed by Commit Bot
parent 1fcbe01a04
commit 070cc9d141
47 changed files with 746 additions and 797 deletions

View File

@ -1783,8 +1783,6 @@ v8_compiler_sources = [
"src/compiler/escape-analysis-reducer.h",
"src/compiler/escape-analysis.cc",
"src/compiler/escape-analysis.h",
"src/compiler/feedback-source.cc",
"src/compiler/feedback-source.h",
"src/compiler/frame-states.cc",
"src/compiler/frame-states.h",
"src/compiler/frame.cc",
@ -1925,6 +1923,8 @@ v8_compiler_sources = [
"src/compiler/types.h",
"src/compiler/value-numbering-reducer.cc",
"src/compiler/value-numbering-reducer.h",
"src/compiler/vector-slot-pair.cc",
"src/compiler/vector-slot-pair.h",
"src/compiler/verifier.cc",
"src/compiler/verifier.h",
"src/compiler/wasm-compiler.cc",

View File

@ -1070,9 +1070,9 @@ DeoptimizationExit* CodeGenerator::BuildTranslation(
update_feedback_count, zone());
if (entry.feedback().IsValid()) {
DeoptimizationLiteral literal =
DeoptimizationLiteral(entry.feedback().vector);
DeoptimizationLiteral(entry.feedback().vector());
int literal_id = DefineDeoptimizationLiteral(literal);
translation.AddUpdateFeedback(literal_id, entry.feedback().slot.ToInt());
translation.AddUpdateFeedback(literal_id, entry.feedback().slot().ToInt());
}
InstructionOperandIterator iter(instr, frame_state_offset);
BuildTranslationForFrameStateDescriptor(descriptor, &iter, &translation,

View File

@ -762,7 +762,7 @@ Instruction* InstructionSelector::EmitWithContinuation(
void InstructionSelector::AppendDeoptimizeArguments(
InstructionOperandVector* args, DeoptimizeKind kind,
DeoptimizeReason reason, FeedbackSource const& feedback,
DeoptimizeReason reason, VectorSlotPair const& feedback,
Node* frame_state) {
OperandGenerator g(this);
FrameStateDescriptor* const descriptor = GetFrameStateDescriptor(frame_state);
@ -779,7 +779,7 @@ void InstructionSelector::AppendDeoptimizeArguments(
Instruction* InstructionSelector::EmitDeoptimize(
InstructionCode opcode, size_t output_count, InstructionOperand* outputs,
size_t input_count, InstructionOperand* inputs, DeoptimizeKind kind,
DeoptimizeReason reason, FeedbackSource const& feedback,
DeoptimizeReason reason, VectorSlotPair const& feedback,
Node* frame_state) {
InstructionOperandVector args(instruction_zone());
for (size_t i = 0; i < input_count; ++i) {
@ -990,7 +990,7 @@ void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer,
int const state_id = sequence()->AddDeoptimizationEntry(
buffer->frame_state_descriptor, DeoptimizeKind::kLazy,
DeoptimizeReason::kUnknown, FeedbackSource());
DeoptimizeReason::kUnknown, VectorSlotPair());
buffer->instruction_args.push_back(g.TempImmediate(state_id));
StateObjectDeduplicator deduplicator(instruction_zone());
@ -2978,7 +2978,7 @@ void InstructionSelector::EmitIdentity(Node* node) {
void InstructionSelector::VisitDeoptimize(DeoptimizeKind kind,
DeoptimizeReason reason,
FeedbackSource const& feedback,
VectorSlotPair const& feedback,
Node* value) {
EmitDeoptimize(kArchDeoptimize, 0, nullptr, 0, nullptr, kind, reason,
feedback, value);

View File

@ -12,7 +12,6 @@
#include "src/compiler/backend/instruction-scheduler.h"
#include "src/compiler/backend/instruction.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/feedback-source.h"
#include "src/compiler/linkage.h"
#include "src/compiler/machine-operator.h"
#include "src/compiler/node.h"
@ -61,7 +60,7 @@ class FlagsContinuation final {
static FlagsContinuation ForDeoptimize(FlagsCondition condition,
DeoptimizeKind kind,
DeoptimizeReason reason,
FeedbackSource const& feedback,
VectorSlotPair const& feedback,
Node* frame_state) {
return FlagsContinuation(kFlags_deoptimize, condition, kind, reason,
feedback, frame_state);
@ -70,7 +69,7 @@ class FlagsContinuation final {
// Creates a new flags continuation for an eager deoptimization exit.
static FlagsContinuation ForDeoptimizeAndPoison(
FlagsCondition condition, DeoptimizeKind kind, DeoptimizeReason reason,
FeedbackSource const& feedback, Node* frame_state) {
VectorSlotPair const& feedback, Node* frame_state) {
return FlagsContinuation(kFlags_deoptimize_and_poison, condition, kind,
reason, feedback, frame_state);
}
@ -111,7 +110,7 @@ class FlagsContinuation final {
DCHECK(IsDeoptimize());
return reason_;
}
FeedbackSource const& feedback() const {
VectorSlotPair const& feedback() const {
DCHECK(IsDeoptimize());
return feedback_;
}
@ -197,7 +196,7 @@ class FlagsContinuation final {
FlagsContinuation(FlagsMode mode, FlagsCondition condition,
DeoptimizeKind kind, DeoptimizeReason reason,
FeedbackSource const& feedback, Node* frame_state)
VectorSlotPair const& feedback, Node* frame_state)
: mode_(mode),
condition_(condition),
kind_(kind),
@ -227,7 +226,7 @@ class FlagsContinuation final {
FlagsCondition condition_;
DeoptimizeKind kind_; // Only valid if mode_ == kFlags_deoptimize*
DeoptimizeReason reason_; // Only valid if mode_ == kFlags_deoptimize*
FeedbackSource feedback_; // Only valid if mode_ == kFlags_deoptimize*
VectorSlotPair feedback_; // Only valid if mode_ == kFlags_deoptimize*
Node* frame_state_or_result_; // Only valid if mode_ == kFlags_deoptimize*
// or mode_ == kFlags_set.
BasicBlock* true_block_; // Only valid if mode_ == kFlags_branch*.
@ -353,7 +352,7 @@ class V8_EXPORT_PRIVATE InstructionSelector final {
InstructionOperand* outputs, size_t input_count,
InstructionOperand* inputs, DeoptimizeKind kind,
DeoptimizeReason reason,
FeedbackSource const& feedback,
VectorSlotPair const& feedback,
Node* frame_state);
// ===========================================================================
@ -498,7 +497,7 @@ class V8_EXPORT_PRIVATE InstructionSelector final {
void AppendDeoptimizeArguments(InstructionOperandVector* args,
DeoptimizeKind kind, DeoptimizeReason reason,
FeedbackSource const& feedback,
VectorSlotPair const& feedback,
Node* frame_state);
void EmitTableSwitch(
@ -632,7 +631,7 @@ class V8_EXPORT_PRIVATE InstructionSelector final {
void VisitBranch(Node* input, BasicBlock* tbranch, BasicBlock* fbranch);
void VisitSwitch(Node* node, const SwitchInfo& sw);
void VisitDeoptimize(DeoptimizeKind kind, DeoptimizeReason reason,
FeedbackSource const& feedback, Node* value);
VectorSlotPair const& feedback, Node* value);
void VisitReturn(Node* ret);
void VisitThrow(Node* node);
void VisitRetain(Node* node);

View File

@ -944,7 +944,7 @@ void InstructionSequence::MarkAsRepresentation(MachineRepresentation rep,
int InstructionSequence::AddDeoptimizationEntry(
FrameStateDescriptor* descriptor, DeoptimizeKind kind,
DeoptimizeReason reason, FeedbackSource const& feedback) {
DeoptimizeReason reason, VectorSlotPair const& feedback) {
int deoptimization_id = static_cast<int>(deoptimization_entries_.size());
deoptimization_entries_.push_back(
DeoptimizationEntry(descriptor, kind, reason, feedback));

View File

@ -17,7 +17,6 @@
#include "src/common/globals.h"
#include "src/compiler/backend/instruction-codes.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/feedback-source.h"
#include "src/compiler/frame.h"
#include "src/compiler/opcodes.h"
#include "src/numbers/double.h"
@ -1313,7 +1312,7 @@ class DeoptimizationEntry final {
public:
DeoptimizationEntry() = default;
DeoptimizationEntry(FrameStateDescriptor* descriptor, DeoptimizeKind kind,
DeoptimizeReason reason, FeedbackSource const& feedback)
DeoptimizeReason reason, VectorSlotPair const& feedback)
: descriptor_(descriptor),
kind_(kind),
reason_(reason),
@ -1322,13 +1321,13 @@ class DeoptimizationEntry final {
FrameStateDescriptor* descriptor() const { return descriptor_; }
DeoptimizeKind kind() const { return kind_; }
DeoptimizeReason reason() const { return reason_; }
FeedbackSource const& feedback() const { return feedback_; }
VectorSlotPair const& feedback() const { return feedback_; }
private:
FrameStateDescriptor* descriptor_ = nullptr;
DeoptimizeKind kind_ = DeoptimizeKind::kEager;
DeoptimizeReason reason_ = DeoptimizeReason::kUnknown;
FeedbackSource feedback_ = FeedbackSource();
VectorSlotPair feedback_ = VectorSlotPair();
};
using DeoptimizationVector = ZoneVector<DeoptimizationEntry>;
@ -1593,7 +1592,7 @@ class V8_EXPORT_PRIVATE InstructionSequence final
int AddDeoptimizationEntry(FrameStateDescriptor* descriptor,
DeoptimizeKind kind, DeoptimizeReason reason,
FeedbackSource const& feedback);
VectorSlotPair const& feedback);
DeoptimizationEntry const& GetDeoptimizationEntry(int deoptimization_id);
int GetDeoptimizationEntryCount() const {
return static_cast<int>(deoptimization_entries_.size());

View File

@ -16,6 +16,7 @@
#include "src/compiler/operator-properties.h"
#include "src/compiler/simplified-operator.h"
#include "src/compiler/state-values-utils.h"
#include "src/compiler/vector-slot-pair.h"
#include "src/interpreter/bytecode-array-iterator.h"
#include "src/interpreter/bytecode-flags.h"
#include "src/interpreter/bytecodes.h"
@ -67,9 +68,9 @@ class BytecodeGraphBuilder {
// Builder for loading the a native context field.
Node* BuildLoadNativeContextField(int index);
// Helper function for creating a feedback source containing type feedback
// vector and a feedback slot.
FeedbackSource CreateFeedbackSource(int slot_id);
// Helper function for creating a pair containing type feedback vector and
// a feedback slot.
VectorSlotPair CreateVectorSlotPair(int slot_id);
void set_environment(Environment* env) { environment_ = env; }
const Environment* environment() const { return environment_; }
@ -1015,13 +1016,14 @@ Node* BytecodeGraphBuilder::BuildLoadNativeContextField(int index) {
return result;
}
FeedbackSource BytecodeGraphBuilder::CreateFeedbackSource(int slot_id) {
VectorSlotPair BytecodeGraphBuilder::CreateVectorSlotPair(int slot_id) {
FeedbackSlot slot = FeedbackVector::ToSlot(slot_id);
return FeedbackSource(feedback_vector(), slot);
// TODO(mvstanton): eliminate this use of a FeedbackNexus.
FeedbackNexus nexus(feedback_vector().object(), slot);
return VectorSlotPair(feedback_vector().object(), slot, nexus.ic_state());
}
void BytecodeGraphBuilder::CreateGraph() {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining);
SourcePositionTable::Scope pos_scope(source_positions_, start_position_);
// Set up the basic structure of the graph. Outputs for {Start} are the formal
@ -1392,8 +1394,9 @@ void BytecodeGraphBuilder::VisitMov() {
Node* BytecodeGraphBuilder::BuildLoadGlobal(NameRef name,
uint32_t feedback_slot_index,
TypeofMode typeof_mode) {
FeedbackSource feedback = CreateFeedbackSource(feedback_slot_index);
DCHECK(IsLoadGlobalICKind(broker()->GetFeedbackSlotKind(feedback)));
VectorSlotPair feedback = CreateVectorSlotPair(feedback_slot_index);
DCHECK(
IsLoadGlobalICKind(feedback_vector().object()->GetKind(feedback.slot())));
const Operator* op =
javascript()->LoadGlobal(name.object(), feedback, typeof_mode);
return NewNode(op);
@ -1423,12 +1426,12 @@ void BytecodeGraphBuilder::VisitStaGlobal() {
PrepareEagerCheckpoint();
NameRef name(broker(),
bytecode_iterator().GetConstantForIndexOperand(0, isolate()));
FeedbackSource feedback =
CreateFeedbackSource(bytecode_iterator().GetIndexOperand(1));
VectorSlotPair feedback =
CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1));
Node* value = environment()->LookupAccumulator();
LanguageMode language_mode =
GetLanguageModeFromSlotKind(broker()->GetFeedbackSlotKind(feedback));
feedback.vector()->GetLanguageMode(feedback.slot());
const Operator* op =
javascript()->StoreGlobal(language_mode, name.object(), feedback);
Node* node = NewNode(op, value);
@ -1442,12 +1445,12 @@ void BytecodeGraphBuilder::VisitStaInArrayLiteral() {
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
Node* index =
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(1));
FeedbackSource feedback =
CreateFeedbackSource(bytecode_iterator().GetIndexOperand(2));
VectorSlotPair feedback =
CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2));
const Operator* op = javascript()->StoreInArrayLiteral(feedback);
JSTypeHintLowering::LoweringResult lowering =
TryBuildSimplifiedStoreKeyed(op, array, index, value, feedback.slot);
TryBuildSimplifiedStoreKeyed(op, array, index, value, feedback.slot());
if (lowering.IsExit()) return;
Node* node = nullptr;
@ -1470,12 +1473,12 @@ void BytecodeGraphBuilder::VisitStaDataPropertyInLiteral() {
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(1));
Node* value = environment()->LookupAccumulator();
int flags = bytecode_iterator().GetFlagOperand(2);
FeedbackSource feedback =
CreateFeedbackSource(bytecode_iterator().GetIndexOperand(3));
VectorSlotPair feedback =
CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(3));
const Operator* op = javascript()->StoreDataPropertyInLiteral(feedback);
JSTypeHintLowering::LoweringResult lowering =
TryBuildSimplifiedStoreKeyed(op, object, name, value, feedback.slot);
TryBuildSimplifiedStoreKeyed(op, object, name, value, feedback.slot());
if (lowering.IsExit()) return;
Node* node = nullptr;
@ -1755,12 +1758,12 @@ void BytecodeGraphBuilder::VisitLdaNamedProperty() {
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
NameRef name(broker(),
bytecode_iterator().GetConstantForIndexOperand(1, isolate()));
FeedbackSource feedback =
CreateFeedbackSource(bytecode_iterator().GetIndexOperand(2));
VectorSlotPair feedback =
CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2));
const Operator* op = javascript()->LoadNamed(name.object(), feedback);
JSTypeHintLowering::LoweringResult lowering =
TryBuildSimplifiedLoadNamed(op, object, feedback.slot);
TryBuildSimplifiedLoadNamed(op, object, feedback.slot());
if (lowering.IsExit()) return;
Node* node = nullptr;
@ -1779,7 +1782,7 @@ void BytecodeGraphBuilder::VisitLdaNamedPropertyNoFeedback() {
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
NameRef name(broker(),
bytecode_iterator().GetConstantForIndexOperand(1, isolate()));
const Operator* op = javascript()->LoadNamed(name.object(), FeedbackSource());
const Operator* op = javascript()->LoadNamed(name.object(), VectorSlotPair());
Node* node = NewNode(op, object);
environment()->BindAccumulator(node, Environment::kAttachFrameState);
}
@ -1789,12 +1792,12 @@ void BytecodeGraphBuilder::VisitLdaKeyedProperty() {
Node* key = environment()->LookupAccumulator();
Node* object =
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
FeedbackSource feedback =
CreateFeedbackSource(bytecode_iterator().GetIndexOperand(1));
VectorSlotPair feedback =
CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1));
const Operator* op = javascript()->LoadProperty(feedback);
JSTypeHintLowering::LoweringResult lowering =
TryBuildSimplifiedLoadKeyed(op, object, key, feedback.slot);
TryBuildSimplifiedLoadKeyed(op, object, key, feedback.slot());
if (lowering.IsExit()) return;
Node* node = nullptr;
@ -1814,24 +1817,23 @@ void BytecodeGraphBuilder::BuildNamedStore(StoreMode store_mode) {
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
NameRef name(broker(),
bytecode_iterator().GetConstantForIndexOperand(1, isolate()));
FeedbackSource feedback =
CreateFeedbackSource(bytecode_iterator().GetIndexOperand(2));
VectorSlotPair feedback =
CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2));
const Operator* op;
if (store_mode == StoreMode::kOwn) {
DCHECK_EQ(FeedbackSlotKind::kStoreOwnNamed,
broker()->GetFeedbackSlotKind(feedback));
feedback.vector()->GetKind(feedback.slot()));
op = javascript()->StoreNamedOwn(name.object(), feedback);
} else {
DCHECK_EQ(StoreMode::kNormal, store_mode);
LanguageMode language_mode =
GetLanguageModeFromSlotKind(broker()->GetFeedbackSlotKind(feedback));
feedback.vector()->GetLanguageMode(feedback.slot());
op = javascript()->StoreNamed(language_mode, name.object(), feedback);
}
JSTypeHintLowering::LoweringResult lowering =
TryBuildSimplifiedStoreNamed(op, object, value, feedback.slot);
TryBuildSimplifiedStoreNamed(op, object, value, feedback.slot());
if (lowering.IsExit()) return;
Node* node = nullptr;
@ -1858,7 +1860,7 @@ void BytecodeGraphBuilder::VisitStaNamedPropertyNoFeedback() {
LanguageMode language_mode =
static_cast<LanguageMode>(bytecode_iterator().GetFlagOperand(2));
const Operator* op =
javascript()->StoreNamed(language_mode, name.object(), FeedbackSource());
javascript()->StoreNamed(language_mode, name.object(), VectorSlotPair());
Node* node = NewNode(op, object, value);
environment()->RecordAfterState(node, Environment::kAttachFrameState);
}
@ -1874,14 +1876,14 @@ void BytecodeGraphBuilder::VisitStaKeyedProperty() {
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
Node* key =
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(1));
FeedbackSource source =
CreateFeedbackSource(bytecode_iterator().GetIndexOperand(2));
VectorSlotPair feedback =
CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2));
LanguageMode language_mode =
GetLanguageModeFromSlotKind(broker()->GetFeedbackSlotKind(source));
const Operator* op = javascript()->StoreProperty(language_mode, source);
feedback.vector()->GetLanguageMode(feedback.slot());
const Operator* op = javascript()->StoreProperty(language_mode, feedback);
JSTypeHintLowering::LoweringResult lowering =
TryBuildSimplifiedStoreKeyed(op, object, key, value, source.slot);
TryBuildSimplifiedStoreKeyed(op, object, key, value, feedback.slot());
if (lowering.IsExit()) return;
Node* node = nullptr;
@ -1927,19 +1929,15 @@ void BytecodeGraphBuilder::VisitPopContext() {
}
void BytecodeGraphBuilder::VisitCreateClosure() {
SharedFunctionInfoRef shared_info(
broker(), bytecode_iterator().GetConstantForIndexOperand(0, isolate()));
Handle<SharedFunctionInfo> shared_info = Handle<SharedFunctionInfo>::cast(
bytecode_iterator().GetConstantForIndexOperand(0, isolate()));
AllocationType allocation =
interpreter::CreateClosureFlags::PretenuredBit::decode(
bytecode_iterator().GetFlagOperand(2))
? AllocationType::kOld
: AllocationType::kYoung;
// TODO(mslekova): Remove this allocation.
AllowHandleAllocation allow_handle_alloc;
AllowHandleDereference allow_handle_deref;
const Operator* op = javascript()->CreateClosure(
shared_info.object(),
shared_info,
feedback_vector().object()->GetClosureFeedbackCell(
bytecode_iterator().GetIndexOperand(1)),
handle(jsgraph()->isolate()->builtins()->builtin(Builtins::kCompileLazy),
@ -2026,7 +2024,7 @@ void BytecodeGraphBuilder::VisitCreateRegExpLiteral() {
StringRef constant_pattern(
broker(), bytecode_iterator().GetConstantForIndexOperand(0, isolate()));
int const slot_id = bytecode_iterator().GetIndexOperand(1);
FeedbackSource pair = CreateFeedbackSource(slot_id);
VectorSlotPair pair = CreateVectorSlotPair(slot_id);
int literal_flags = bytecode_iterator().GetFlagOperand(2);
Node* literal = NewNode(javascript()->CreateLiteralRegExp(
constant_pattern.object(), pair, literal_flags));
@ -2037,7 +2035,7 @@ void BytecodeGraphBuilder::VisitCreateArrayLiteral() {
ArrayBoilerplateDescriptionRef array_boilerplate_description(
broker(), bytecode_iterator().GetConstantForIndexOperand(0, isolate()));
int const slot_id = bytecode_iterator().GetIndexOperand(1);
FeedbackSource pair = CreateFeedbackSource(slot_id);
VectorSlotPair pair = CreateVectorSlotPair(slot_id);
int bytecode_flags = bytecode_iterator().GetFlagOperand(2);
int literal_flags =
interpreter::CreateArrayLiteralFlags::FlagsBits::decode(bytecode_flags);
@ -2058,7 +2056,7 @@ void BytecodeGraphBuilder::VisitCreateArrayLiteral() {
void BytecodeGraphBuilder::VisitCreateEmptyArrayLiteral() {
int const slot_id = bytecode_iterator().GetIndexOperand(0);
FeedbackSource pair = CreateFeedbackSource(slot_id);
VectorSlotPair pair = CreateVectorSlotPair(slot_id);
Node* literal = NewNode(javascript()->CreateEmptyLiteralArray(pair));
environment()->BindAccumulator(literal);
}
@ -2073,7 +2071,7 @@ void BytecodeGraphBuilder::VisitCreateObjectLiteral() {
ObjectBoilerplateDescriptionRef constant_properties(
broker(), bytecode_iterator().GetConstantForIndexOperand(0, isolate()));
int const slot_id = bytecode_iterator().GetIndexOperand(1);
FeedbackSource pair = CreateFeedbackSource(slot_id);
VectorSlotPair pair = CreateVectorSlotPair(slot_id);
int bytecode_flags = bytecode_iterator().GetFlagOperand(2);
int literal_flags =
interpreter::CreateObjectLiteralFlags::FlagsBits::decode(bytecode_flags);
@ -2098,7 +2096,7 @@ void BytecodeGraphBuilder::VisitCloneObject() {
int flags = bytecode_iterator().GetFlagOperand(1);
int slot = bytecode_iterator().GetIndexOperand(2);
const Operator* op =
javascript()->CloneObject(CreateFeedbackSource(slot), flags);
javascript()->CloneObject(CreateVectorSlotPair(slot), flags);
Node* value = NewNode(op, source);
environment()->BindAccumulator(value, Environment::kAttachFrameState);
}
@ -2164,14 +2162,14 @@ void BytecodeGraphBuilder::BuildCall(ConvertReceiverMode receiver_mode,
receiver_mode);
PrepareEagerCheckpoint();
FeedbackSource feedback = CreateFeedbackSource(slot_id);
VectorSlotPair feedback = CreateVectorSlotPair(slot_id);
CallFrequency frequency = ComputeCallFrequency(slot_id);
SpeculationMode speculation_mode = GetSpeculationMode(slot_id);
const Operator* op = javascript()->Call(arg_count, frequency, feedback,
receiver_mode, speculation_mode);
JSTypeHintLowering::LoweringResult lowering = TryBuildSimplifiedCall(
op, args, static_cast<int>(arg_count), feedback.slot);
op, args, static_cast<int>(arg_count), feedback.slot());
if (lowering.IsExit()) return;
Node* node = nullptr;
@ -2349,13 +2347,13 @@ void BytecodeGraphBuilder::VisitCallWithSpread() {
Node* const* args = GetCallArgumentsFromRegisters(callee, receiver_node,
first_arg, arg_count);
int const slot_id = bytecode_iterator().GetIndexOperand(3);
FeedbackSource feedback = CreateFeedbackSource(slot_id);
VectorSlotPair feedback = CreateVectorSlotPair(slot_id);
CallFrequency frequency = ComputeCallFrequency(slot_id);
const Operator* op = javascript()->CallWithSpread(
static_cast<int>(reg_count + 1), frequency, feedback);
JSTypeHintLowering::LoweringResult lowering = TryBuildSimplifiedCall(
op, args, static_cast<int>(arg_count), feedback.slot);
op, args, static_cast<int>(arg_count), feedback.slot());
if (lowering.IsExit()) return;
Node* node = nullptr;
@ -2461,7 +2459,7 @@ void BytecodeGraphBuilder::VisitConstruct() {
interpreter::Register first_reg = bytecode_iterator().GetRegisterOperand(1);
size_t reg_count = bytecode_iterator().GetRegisterCountOperand(2);
int const slot_id = bytecode_iterator().GetIndexOperand(3);
FeedbackSource feedback = CreateFeedbackSource(slot_id);
VectorSlotPair feedback = CreateVectorSlotPair(slot_id);
Node* new_target = environment()->LookupAccumulator();
Node* callee = environment()->LookupRegister(callee_reg);
@ -2473,7 +2471,7 @@ void BytecodeGraphBuilder::VisitConstruct() {
Node* const* args = GetConstructArgumentsFromRegister(callee, new_target,
first_reg, arg_count);
JSTypeHintLowering::LoweringResult lowering = TryBuildSimplifiedConstruct(
op, args, static_cast<int>(arg_count), feedback.slot);
op, args, static_cast<int>(arg_count), feedback.slot());
if (lowering.IsExit()) return;
Node* node = nullptr;
@ -2492,7 +2490,7 @@ void BytecodeGraphBuilder::VisitConstructWithSpread() {
interpreter::Register first_reg = bytecode_iterator().GetRegisterOperand(1);
size_t reg_count = bytecode_iterator().GetRegisterCountOperand(2);
int const slot_id = bytecode_iterator().GetIndexOperand(3);
FeedbackSource feedback = CreateFeedbackSource(slot_id);
VectorSlotPair feedback = CreateVectorSlotPair(slot_id);
Node* new_target = environment()->LookupAccumulator();
Node* callee = environment()->LookupRegister(callee_reg);
@ -2504,7 +2502,7 @@ void BytecodeGraphBuilder::VisitConstructWithSpread() {
Node* const* args = GetConstructArgumentsFromRegister(callee, new_target,
first_reg, arg_count);
JSTypeHintLowering::LoweringResult lowering = TryBuildSimplifiedConstruct(
op, args, static_cast<int>(arg_count), feedback.slot);
op, args, static_cast<int>(arg_count), feedback.slot());
if (lowering.IsExit()) return;
Node* node = nullptr;
@ -2948,15 +2946,15 @@ void BytecodeGraphBuilder::VisitTestIn() {
Node* object = environment()->LookupAccumulator();
Node* key =
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
FeedbackSource feedback =
CreateFeedbackSource(bytecode_iterator().GetIndexOperand(1));
VectorSlotPair feedback =
CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1));
Node* node = NewNode(javascript()->HasProperty(feedback), object, key);
environment()->BindAccumulator(node, Environment::kAttachFrameState);
}
void BytecodeGraphBuilder::VisitTestInstanceOf() {
int const slot_index = bytecode_iterator().GetIndexOperand(1);
BuildCompareOp(javascript()->InstanceOf(CreateFeedbackSource(slot_index)));
BuildCompareOp(javascript()->InstanceOf(CreateVectorSlotPair(slot_index)));
}
void BytecodeGraphBuilder::VisitTestUndetectable() {
@ -3187,7 +3185,7 @@ void BytecodeGraphBuilder::VisitSwitchOnSmiNoFeedback() {
PrepareEagerCheckpoint();
Node* acc = environment()->LookupAccumulator();
Node* acc_smi = NewNode(simplified()->CheckSmi(FeedbackSource()), acc);
Node* acc_smi = NewNode(simplified()->CheckSmi(VectorSlotPair()), acc);
BuildSwitchOnSmi(acc_smi);
}
@ -3317,12 +3315,12 @@ void BytecodeGraphBuilder::VisitGetIterator() {
PrepareEagerCheckpoint();
Node* object =
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
FeedbackSource feedback =
CreateFeedbackSource(bytecode_iterator().GetIndexOperand(1));
VectorSlotPair feedback =
CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1));
const Operator* op = javascript()->GetIterator(feedback);
JSTypeHintLowering::LoweringResult lowering =
TryBuildSimplifiedLoadNamed(op, object, feedback.slot);
TryBuildSimplifiedLoadNamed(op, object, feedback.slot());
if (lowering.IsExit()) return;
DCHECK(!lowering.Changed());

View File

@ -99,8 +99,7 @@ bool operator!=(DeoptimizeParameters lhs, DeoptimizeParameters rhs) {
}
size_t hash_value(DeoptimizeParameters p) {
FeedbackSource::Hash feebdack_hash;
return base::hash_combine(p.kind(), p.reason(), feebdack_hash(p.feedback()),
return base::hash_combine(p.kind(), p.reason(), p.feedback(),
p.is_safety_check());
}
@ -729,7 +728,7 @@ struct CommonOperatorGlobalCache final {
Operator::kFoldable | Operator::kNoThrow, // properties
"Deoptimize", // name
1, 1, 1, 0, 0, 1, // counts
DeoptimizeParameters(kKind, kReason, FeedbackSource(),
DeoptimizeParameters(kKind, kReason, VectorSlotPair(),
IsSafetyCheck::kNoSafetyCheck)) {}
};
#define CACHED_DEOPTIMIZE(Kind, Reason) \
@ -747,7 +746,7 @@ struct CommonOperatorGlobalCache final {
Operator::kFoldable | Operator::kNoThrow, // properties
"DeoptimizeIf", // name
2, 1, 1, 0, 1, 1, // counts
DeoptimizeParameters(kKind, kReason, FeedbackSource(),
DeoptimizeParameters(kKind, kReason, VectorSlotPair(),
is_safety_check)) {}
};
#define CACHED_DEOPTIMIZE_IF(Kind, Reason, IsCheck) \
@ -767,7 +766,7 @@ struct CommonOperatorGlobalCache final {
Operator::kFoldable | Operator::kNoThrow, // properties
"DeoptimizeUnless", // name
2, 1, 1, 0, 1, 1, // counts
DeoptimizeParameters(kKind, kReason, FeedbackSource(),
DeoptimizeParameters(kKind, kReason, VectorSlotPair(),
is_safety_check)) {}
};
#define CACHED_DEOPTIMIZE_UNLESS(Kind, Reason, IsCheck) \
@ -948,7 +947,7 @@ const Operator* CommonOperatorBuilder::Branch(BranchHint hint,
const Operator* CommonOperatorBuilder::Deoptimize(
DeoptimizeKind kind, DeoptimizeReason reason,
FeedbackSource const& feedback) {
VectorSlotPair const& feedback) {
#define CACHED_DEOPTIMIZE(Kind, Reason) \
if (kind == DeoptimizeKind::k##Kind && \
reason == DeoptimizeReason::k##Reason && !feedback.IsValid()) { \
@ -969,7 +968,7 @@ const Operator* CommonOperatorBuilder::Deoptimize(
const Operator* CommonOperatorBuilder::DeoptimizeIf(
DeoptimizeKind kind, DeoptimizeReason reason,
FeedbackSource const& feedback, IsSafetyCheck is_safety_check) {
VectorSlotPair const& feedback, IsSafetyCheck is_safety_check) {
#define CACHED_DEOPTIMIZE_IF(Kind, Reason, IsCheck) \
if (kind == DeoptimizeKind::k##Kind && \
reason == DeoptimizeReason::k##Reason && \
@ -990,7 +989,7 @@ const Operator* CommonOperatorBuilder::DeoptimizeIf(
const Operator* CommonOperatorBuilder::DeoptimizeUnless(
DeoptimizeKind kind, DeoptimizeReason reason,
FeedbackSource const& feedback, IsSafetyCheck is_safety_check) {
VectorSlotPair const& feedback, IsSafetyCheck is_safety_check) {
#define CACHED_DEOPTIMIZE_UNLESS(Kind, Reason, IsCheck) \
if (kind == DeoptimizeKind::k##Kind && \
reason == DeoptimizeReason::k##Reason && \

View File

@ -10,8 +10,8 @@
#include "src/codegen/reloc-info.h"
#include "src/codegen/string-constants.h"
#include "src/common/globals.h"
#include "src/compiler/feedback-source.h"
#include "src/compiler/frame-states.h"
#include "src/compiler/vector-slot-pair.h"
#include "src/deoptimizer/deoptimize-reason.h"
#include "src/zone/zone-containers.h"
#include "src/zone/zone-handle-set.h"
@ -104,7 +104,7 @@ int ValueInputCountOfReturn(Operator const* const op);
class DeoptimizeParameters final {
public:
DeoptimizeParameters(DeoptimizeKind kind, DeoptimizeReason reason,
FeedbackSource const& feedback,
VectorSlotPair const& feedback,
IsSafetyCheck is_safety_check)
: kind_(kind),
reason_(reason),
@ -113,13 +113,13 @@ class DeoptimizeParameters final {
DeoptimizeKind kind() const { return kind_; }
DeoptimizeReason reason() const { return reason_; }
const FeedbackSource& feedback() const { return feedback_; }
const VectorSlotPair& feedback() const { return feedback_; }
IsSafetyCheck is_safety_check() const { return is_safety_check_; }
private:
DeoptimizeKind const kind_;
DeoptimizeReason const reason_;
FeedbackSource const feedback_;
VectorSlotPair const feedback_;
IsSafetyCheck is_safety_check_;
};
@ -468,14 +468,14 @@ class V8_EXPORT_PRIVATE CommonOperatorBuilder final
const Operator* IfDefault(BranchHint hint = BranchHint::kNone);
const Operator* Throw();
const Operator* Deoptimize(DeoptimizeKind kind, DeoptimizeReason reason,
FeedbackSource const& feedback);
VectorSlotPair const& feedback);
const Operator* DeoptimizeIf(
DeoptimizeKind kind, DeoptimizeReason reason,
FeedbackSource const& feedback,
VectorSlotPair const& feedback,
IsSafetyCheck is_safety_check = IsSafetyCheck::kSafetyCheck);
const Operator* DeoptimizeUnless(
DeoptimizeKind kind, DeoptimizeReason reason,
FeedbackSource const& feedback,
VectorSlotPair const& feedback,
IsSafetyCheck is_safety_check = IsSafetyCheck::kSafetyCheck);
const Operator* TrapIf(TrapId trap_id);
const Operator* TrapUnless(TrapId trap_id);

View File

@ -9,7 +9,6 @@
#include "src/common/ptr-compr-inl.h"
#include "src/compiler/access-builder.h"
#include "src/compiler/compiler-source-position-table.h"
#include "src/compiler/feedback-source.h"
#include "src/compiler/graph-assembler.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/linkage.h"
@ -210,13 +209,13 @@ class EffectControlLinearizer {
Node* AllocateHeapNumberWithValue(Node* node);
Node* BuildCheckedFloat64ToInt32(CheckForMinusZeroMode mode,
const FeedbackSource& feedback, Node* value,
const VectorSlotPair& feedback, Node* value,
Node* frame_state);
Node* BuildCheckedFloat64ToInt64(CheckForMinusZeroMode mode,
const FeedbackSource& feedback, Node* value,
const VectorSlotPair& feedback, Node* value,
Node* frame_state);
Node* BuildCheckedHeapNumberOrOddballToFloat64(CheckTaggedInputMode mode,
const FeedbackSource& feedback,
const VectorSlotPair& feedback,
Node* value,
Node* frame_state);
Node* BuildReverseBytes(ExternalArrayType type, Node* value);
@ -1938,7 +1937,7 @@ Node* EffectControlLinearizer::LowerCheckReceiver(Node* node,
STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE);
Node* check = __ Uint32LessThanOrEqual(
__ Uint32Constant(FIRST_JS_RECEIVER_TYPE), value_instance_type);
__ DeoptimizeIfNot(DeoptimizeReason::kNotAJavaScriptObject, FeedbackSource(),
__ DeoptimizeIfNot(DeoptimizeReason::kNotAJavaScriptObject, VectorSlotPair(),
check, frame_state);
return value;
}
@ -1957,12 +1956,12 @@ Node* EffectControlLinearizer::LowerCheckReceiverOrNullOrUndefined(
Node* check0 = __ Uint32LessThanOrEqual(__ Uint32Constant(ODDBALL_TYPE),
value_instance_type);
__ DeoptimizeIfNot(DeoptimizeReason::kNotAJavaScriptObjectOrNullOrUndefined,
FeedbackSource(), check0, frame_state);
VectorSlotPair(), check0, frame_state);
// Rule out booleans.
Node* check1 = __ TaggedEqual(value_map, __ BooleanMapConstant());
__ DeoptimizeIf(DeoptimizeReason::kNotAJavaScriptObjectOrNullOrUndefined,
FeedbackSource(), check1, frame_state);
VectorSlotPair(), check1, frame_state);
return value;
}
@ -1973,7 +1972,7 @@ Node* EffectControlLinearizer::LowerCheckSymbol(Node* node, Node* frame_state) {
Node* check =
__ TaggedEqual(value_map, __ HeapConstant(factory()->symbol_map()));
__ DeoptimizeIfNot(DeoptimizeReason::kNotASymbol, FeedbackSource(), check,
__ DeoptimizeIfNot(DeoptimizeReason::kNotASymbol, VectorSlotPair(), check,
frame_state);
return value;
}
@ -2005,7 +2004,7 @@ Node* EffectControlLinearizer::LowerCheckInternalizedString(Node* node,
__ Word32And(value_instance_type,
__ Int32Constant(kIsNotStringMask | kIsNotInternalizedMask)),
__ Int32Constant(kInternalizedTag));
__ DeoptimizeIfNot(DeoptimizeReason::kWrongInstanceType, FeedbackSource(),
__ DeoptimizeIfNot(DeoptimizeReason::kWrongInstanceType, VectorSlotPair(),
check, frame_state);
return value;
@ -2042,7 +2041,7 @@ Node* EffectControlLinearizer::LowerCheckedInt32Add(Node* node,
Node* value = __ Int32AddWithOverflow(lhs, rhs);
Node* check = __ Projection(1, value);
__ DeoptimizeIf(DeoptimizeReason::kOverflow, FeedbackSource(), check,
__ DeoptimizeIf(DeoptimizeReason::kOverflow, VectorSlotPair(), check,
frame_state);
return __ Projection(0, value);
}
@ -2054,7 +2053,7 @@ Node* EffectControlLinearizer::LowerCheckedInt32Sub(Node* node,
Node* value = __ Int32SubWithOverflow(lhs, rhs);
Node* check = __ Projection(1, value);
__ DeoptimizeIf(DeoptimizeReason::kOverflow, FeedbackSource(), check,
__ DeoptimizeIf(DeoptimizeReason::kOverflow, VectorSlotPair(), check,
frame_state);
return __ Projection(0, value);
}
@ -2077,7 +2076,7 @@ Node* EffectControlLinearizer::LowerCheckedInt32Div(Node* node,
Node* mask = __ Int32Constant(divisor - 1);
Node* shift = __ Int32Constant(WhichPowerOf2(divisor));
Node* check = __ Word32Equal(__ Word32And(lhs, mask), zero);
__ DeoptimizeIfNot(DeoptimizeReason::kLostPrecision, FeedbackSource(),
__ DeoptimizeIfNot(DeoptimizeReason::kLostPrecision, VectorSlotPair(),
check, frame_state);
return __ Word32Sar(lhs, shift);
} else {
@ -2102,12 +2101,12 @@ Node* EffectControlLinearizer::LowerCheckedInt32Div(Node* node,
// Check if {rhs} is zero.
Node* check_rhs_zero = __ Word32Equal(rhs, zero);
__ DeoptimizeIf(DeoptimizeReason::kDivisionByZero, FeedbackSource(),
__ DeoptimizeIf(DeoptimizeReason::kDivisionByZero, VectorSlotPair(),
check_rhs_zero, frame_state);
// Check if {lhs} is zero, as that would produce minus zero.
Node* check_lhs_zero = __ Word32Equal(lhs, zero);
__ DeoptimizeIf(DeoptimizeReason::kMinusZero, FeedbackSource(),
__ DeoptimizeIf(DeoptimizeReason::kMinusZero, VectorSlotPair(),
check_lhs_zero, frame_state);
// Check if {lhs} is kMinInt and {rhs} is -1, in which case we'd have
@ -2120,7 +2119,7 @@ Node* EffectControlLinearizer::LowerCheckedInt32Div(Node* node,
{
// Check that {rhs} is not -1, otherwise result would be -kMinInt.
Node* check_rhs_minusone = __ Word32Equal(rhs, __ Int32Constant(-1));
__ DeoptimizeIf(DeoptimizeReason::kOverflow, FeedbackSource(),
__ DeoptimizeIf(DeoptimizeReason::kOverflow, VectorSlotPair(),
check_rhs_minusone, frame_state);
// Perform the actual integer division.
@ -2139,7 +2138,7 @@ Node* EffectControlLinearizer::LowerCheckedInt32Div(Node* node,
// Check if the remainder is non-zero.
Node* check = __ Word32Equal(lhs, __ Int32Mul(value, rhs));
__ DeoptimizeIfNot(DeoptimizeReason::kLostPrecision, FeedbackSource(),
__ DeoptimizeIfNot(DeoptimizeReason::kLostPrecision, VectorSlotPair(),
check, frame_state);
return value;
@ -2221,7 +2220,7 @@ Node* EffectControlLinearizer::LowerCheckedInt32Mod(Node* node,
Node* vtrue0 = __ Int32Sub(zero, rhs);
// Ensure that {rhs} is not zero, otherwise we'd have to return NaN.
__ DeoptimizeIf(DeoptimizeReason::kDivisionByZero, FeedbackSource(),
__ DeoptimizeIf(DeoptimizeReason::kDivisionByZero, VectorSlotPair(),
__ Word32Equal(vtrue0, zero), frame_state);
__ Goto(&rhs_checked, vtrue0);
}
@ -2244,7 +2243,7 @@ Node* EffectControlLinearizer::LowerCheckedInt32Mod(Node* node,
Node* res = __ Uint32Mod(__ Int32Sub(zero, lhs), rhs);
// Check if we would have to return -0.
__ DeoptimizeIf(DeoptimizeReason::kMinusZero, FeedbackSource(),
__ DeoptimizeIf(DeoptimizeReason::kMinusZero, VectorSlotPair(),
__ Word32Equal(res, zero), frame_state);
__ Goto(&done, __ Int32Sub(zero, res));
}
@ -2271,13 +2270,13 @@ Node* EffectControlLinearizer::LowerCheckedUint32Div(Node* node,
Node* mask = __ Uint32Constant(divisor - 1);
Node* shift = __ Uint32Constant(WhichPowerOf2(divisor));
Node* check = __ Word32Equal(__ Word32And(lhs, mask), zero);
__ DeoptimizeIfNot(DeoptimizeReason::kLostPrecision, FeedbackSource(),
__ DeoptimizeIfNot(DeoptimizeReason::kLostPrecision, VectorSlotPair(),
check, frame_state);
return __ Word32Shr(lhs, shift);
} else {
// Ensure that {rhs} is not zero, otherwise we'd have to return NaN.
Node* check = __ Word32Equal(rhs, zero);
__ DeoptimizeIf(DeoptimizeReason::kDivisionByZero, FeedbackSource(), check,
__ DeoptimizeIf(DeoptimizeReason::kDivisionByZero, VectorSlotPair(), check,
frame_state);
// Perform the actual unsigned integer division.
@ -2285,7 +2284,7 @@ Node* EffectControlLinearizer::LowerCheckedUint32Div(Node* node,
// Check if the remainder is non-zero.
check = __ Word32Equal(lhs, __ Int32Mul(rhs, value));
__ DeoptimizeIfNot(DeoptimizeReason::kLostPrecision, FeedbackSource(),
__ DeoptimizeIfNot(DeoptimizeReason::kLostPrecision, VectorSlotPair(),
check, frame_state);
return value;
}
@ -2300,7 +2299,7 @@ Node* EffectControlLinearizer::LowerCheckedUint32Mod(Node* node,
// Ensure that {rhs} is not zero, otherwise we'd have to return NaN.
Node* check = __ Word32Equal(rhs, zero);
__ DeoptimizeIf(DeoptimizeReason::kDivisionByZero, FeedbackSource(), check,
__ DeoptimizeIf(DeoptimizeReason::kDivisionByZero, VectorSlotPair(), check,
frame_state);
// Perform the actual unsigned integer modulus.
@ -2315,7 +2314,7 @@ Node* EffectControlLinearizer::LowerCheckedInt32Mul(Node* node,
Node* projection = __ Int32MulWithOverflow(lhs, rhs);
Node* check = __ Projection(1, projection);
__ DeoptimizeIf(DeoptimizeReason::kOverflow, FeedbackSource(), check,
__ DeoptimizeIf(DeoptimizeReason::kOverflow, VectorSlotPair(), check,
frame_state);
Node* value = __ Projection(0, projection);
@ -2331,7 +2330,7 @@ Node* EffectControlLinearizer::LowerCheckedInt32Mul(Node* node,
__ Bind(&if_zero);
// We may need to return negative zero.
Node* check_or = __ Int32LessThan(__ Word32Or(lhs, rhs), zero);
__ DeoptimizeIf(DeoptimizeReason::kMinusZero, FeedbackSource(), check_or,
__ DeoptimizeIf(DeoptimizeReason::kMinusZero, VectorSlotPair(), check_or,
frame_state);
__ Goto(&check_done);
@ -2491,7 +2490,7 @@ Node* EffectControlLinearizer::LowerCheckedUint64ToTaggedSigned(
}
Node* EffectControlLinearizer::BuildCheckedFloat64ToInt32(
CheckForMinusZeroMode mode, const FeedbackSource& feedback, Node* value,
CheckForMinusZeroMode mode, const VectorSlotPair& feedback, Node* value,
Node* frame_state) {
Node* value32 = __ RoundFloat64ToInt32(value);
Node* check_same = __ Float64Equal(value, __ ChangeInt32ToFloat64(value32));
@ -2530,7 +2529,7 @@ Node* EffectControlLinearizer::LowerCheckedFloat64ToInt32(Node* node,
}
Node* EffectControlLinearizer::BuildCheckedFloat64ToInt64(
CheckForMinusZeroMode mode, const FeedbackSource& feedback, Node* value,
CheckForMinusZeroMode mode, const VectorSlotPair& feedback, Node* value,
Node* frame_state) {
Node* value64 = __ TruncateFloat64ToInt64(value);
Node* check_same = __ Float64Equal(value, __ ChangeInt64ToFloat64(value64));
@ -2639,7 +2638,7 @@ Node* EffectControlLinearizer::LowerCheckedTaggedToInt64(Node* node,
}
Node* EffectControlLinearizer::BuildCheckedHeapNumberOrOddballToFloat64(
CheckTaggedInputMode mode, const FeedbackSource& feedback, Node* value,
CheckTaggedInputMode mode, const VectorSlotPair& feedback, Node* value,
Node* frame_state) {
Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
Node* check_number = __ TaggedEqual(value_map, __ HeapNumberMapConstant());
@ -4292,7 +4291,7 @@ Node* EffectControlLinearizer::LowerBigIntAdd(Node* node, Node* frame_state) {
rhs, __ NoContextConstant());
// Check for exception sentinel: Smi is returned to signal BigIntTooBig.
__ DeoptimizeIf(DeoptimizeReason::kBigIntTooBig, FeedbackSource{},
__ DeoptimizeIf(DeoptimizeReason::kBigIntTooBig, VectorSlotPair{},
ObjectIsSmi(value), frame_state);
return value;
@ -4346,7 +4345,7 @@ Node* EffectControlLinearizer::LowerCheckNotTaggedHole(Node* node,
Node* frame_state) {
Node* value = node->InputAt(0);
Node* check = __ TaggedEqual(value, __ TheHoleConstant());
__ DeoptimizeIf(DeoptimizeReason::kHole, FeedbackSource(), check,
__ DeoptimizeIf(DeoptimizeReason::kHole, VectorSlotPair(), check,
frame_state);
return value;
}
@ -4384,7 +4383,7 @@ void EffectControlLinearizer::LowerCheckEqualsInternalizedString(
__ Bind(&if_notsame);
{
// Now {val} could still be a non-internalized String that matches {exp}.
__ DeoptimizeIf(DeoptimizeReason::kWrongName, FeedbackSource(),
__ DeoptimizeIf(DeoptimizeReason::kWrongName, VectorSlotPair(),
ObjectIsSmi(val), frame_state);
Node* val_map = __ LoadField(AccessBuilder::ForMap(), val);
Node* val_instance_type =
@ -4403,7 +4402,7 @@ void EffectControlLinearizer::LowerCheckEqualsInternalizedString(
// Check that the {val} is a non-internalized String, if it's anything
// else it cannot match the recorded feedback {exp} anyways.
__ DeoptimizeIfNot(
DeoptimizeReason::kWrongName, FeedbackSource(),
DeoptimizeReason::kWrongName, VectorSlotPair(),
__ Word32Equal(__ Word32And(val_instance_type,
__ Int32Constant(kIsNotStringMask |
kIsNotInternalizedMask)),
@ -4426,7 +4425,7 @@ void EffectControlLinearizer::LowerCheckEqualsInternalizedString(
try_internalize_string_function, isolate_ptr, val);
// Now see if the results match.
__ DeoptimizeIfNot(DeoptimizeReason::kWrongName, FeedbackSource(),
__ DeoptimizeIfNot(DeoptimizeReason::kWrongName, VectorSlotPair(),
__ TaggedEqual(exp, val_internalized), frame_state);
__ Goto(&if_same);
}
@ -4436,7 +4435,7 @@ void EffectControlLinearizer::LowerCheckEqualsInternalizedString(
// The {val} is a ThinString, let's check the actual value.
Node* val_actual =
__ LoadField(AccessBuilder::ForThinStringActual(), val);
__ DeoptimizeIfNot(DeoptimizeReason::kWrongName, FeedbackSource(),
__ DeoptimizeIfNot(DeoptimizeReason::kWrongName, VectorSlotPair(),
__ TaggedEqual(exp, val_actual), frame_state);
__ Goto(&if_same);
}
@ -4450,7 +4449,7 @@ void EffectControlLinearizer::LowerCheckEqualsSymbol(Node* node,
Node* exp = node->InputAt(0);
Node* val = node->InputAt(1);
Node* check = __ TaggedEqual(exp, val);
__ DeoptimizeIfNot(DeoptimizeReason::kWrongName, FeedbackSource(), check,
__ DeoptimizeIfNot(DeoptimizeReason::kWrongName, VectorSlotPair(), check,
frame_state);
}

View File

@ -1,45 +0,0 @@
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/compiler/feedback-source.h"
namespace v8 {
namespace internal {
namespace compiler {
FeedbackSource::FeedbackSource(Handle<FeedbackVector> vector_,
FeedbackSlot slot_)
: vector(vector_), slot(slot_) {
DCHECK(!slot.IsInvalid());
}
FeedbackSource::FeedbackSource(FeedbackVectorRef vector_, FeedbackSlot slot_)
: FeedbackSource(vector_.object(), slot_) {}
FeedbackSource::FeedbackSource(FeedbackNexus const& nexus)
: FeedbackSource(nexus.vector_handle(), nexus.slot()) {}
int FeedbackSource::index() const {
CHECK(IsValid());
return FeedbackVector::GetIndex(slot);
}
bool operator==(FeedbackSource const& lhs, FeedbackSource const& rhs) {
return FeedbackSource::Equal()(lhs, rhs);
}
bool operator!=(FeedbackSource const& lhs, FeedbackSource const& rhs) {
return !(lhs == rhs);
}
std::ostream& operator<<(std::ostream& os, const FeedbackSource& p) {
if (p.IsValid()) {
return os << "FeedbackSource(" << p.slot << ")";
}
return os << "FeedbackSource(INVALID)";
}
} // namespace compiler
} // namespace internal
} // namespace v8

View File

@ -1,52 +0,0 @@
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMPILER_FEEDBACK_SOURCE_H_
#define V8_COMPILER_FEEDBACK_SOURCE_H_
#include "src/compiler/heap-refs.h"
#include "src/objects/feedback-vector.h"
namespace v8 {
namespace internal {
namespace compiler {
struct FeedbackSource {
FeedbackSource() { DCHECK(!IsValid()); }
V8_EXPORT_PRIVATE FeedbackSource(Handle<FeedbackVector> vector_,
FeedbackSlot slot_);
FeedbackSource(FeedbackVectorRef vector_, FeedbackSlot slot_);
explicit FeedbackSource(FeedbackNexus const& nexus);
bool IsValid() const { return !vector.is_null() && !slot.IsInvalid(); }
int index() const;
Handle<FeedbackVector> vector;
FeedbackSlot slot;
struct Hash {
size_t operator()(FeedbackSource const& source) const {
return base::hash_combine(source.vector.address(), source.slot);
}
};
struct Equal {
bool operator()(FeedbackSource const& lhs,
FeedbackSource const& rhs) const {
return lhs.vector.equals(rhs.vector) && lhs.slot == rhs.slot;
}
};
};
bool operator==(FeedbackSource const&, FeedbackSource const&);
bool operator!=(FeedbackSource const&, FeedbackSource const&);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
FeedbackSource const&);
} // namespace compiler
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_FEEDBACK_SOURCE_H_

View File

@ -248,7 +248,7 @@ Node* GraphAssembler::Word32PoisonOnSpeculation(Node* value) {
}
Node* GraphAssembler::DeoptimizeIf(DeoptimizeReason reason,
FeedbackSource const& feedback,
VectorSlotPair const& feedback,
Node* condition, Node* frame_state,
IsSafetyCheck is_safety_check) {
return current_control_ = current_effect_ = graph()->NewNode(
@ -258,7 +258,7 @@ Node* GraphAssembler::DeoptimizeIf(DeoptimizeReason reason,
}
Node* GraphAssembler::DeoptimizeIfNot(DeoptimizeReason reason,
FeedbackSource const& feedback,
VectorSlotPair const& feedback,
Node* condition, Node* frame_state,
IsSafetyCheck is_safety_check) {
return current_control_ = current_effect_ = graph()->NewNode(

View File

@ -5,10 +5,10 @@
#ifndef V8_COMPILER_GRAPH_ASSEMBLER_H_
#define V8_COMPILER_GRAPH_ASSEMBLER_H_
#include "src/compiler/feedback-source.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/node.h"
#include "src/compiler/simplified-operator.h"
#include "src/compiler/vector-slot-pair.h"
namespace v8 {
namespace internal {
@ -254,11 +254,11 @@ class GraphAssembler {
Node* Word32PoisonOnSpeculation(Node* value);
Node* DeoptimizeIf(
DeoptimizeReason reason, FeedbackSource const& feedback, Node* condition,
DeoptimizeReason reason, VectorSlotPair const& feedback, Node* condition,
Node* frame_state,
IsSafetyCheck is_safety_check = IsSafetyCheck::kSafetyCheck);
Node* DeoptimizeIfNot(
DeoptimizeReason reason, FeedbackSource const& feedback, Node* condition,
DeoptimizeReason reason, VectorSlotPair const& feedback, Node* condition,
Node* frame_state,
IsSafetyCheck is_safety_check = IsSafetyCheck::kSafetyCheck);
template <typename... Args>

View File

@ -27,6 +27,7 @@ class JSRegExp;
class JSTypedArray;
class NativeContext;
class ScriptContextTable;
class VectorSlotPair;
namespace compiler {

View File

@ -14,7 +14,6 @@
#include "src/compiler/access-info.h"
#include "src/compiler/allocation-builder.h"
#include "src/compiler/compilation-dependencies.h"
#include "src/compiler/feedback-source.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/linkage.h"
#include "src/compiler/map-inference.h"
@ -22,6 +21,7 @@
#include "src/compiler/property-access-builder.h"
#include "src/compiler/simplified-operator.h"
#include "src/compiler/type-cache.h"
#include "src/compiler/vector-slot-pair.h"
#include "src/ic/call-optimization.h"
#include "src/logging/counters.h"
#include "src/objects/arguments-inl.h"
@ -390,11 +390,11 @@ Reduction JSCallReducer::ReduceFunctionPrototypeApply(Node* node) {
// TODO(mslekova): Since this introduces a Call that will get optimized by
// the JSCallReducer, we basically might have to do all the serialization
// that we do for that here as well. The only difference is that here we
// disable speculation (cf. the empty FeedbackSource above), causing the
// disable speculation (cf. the empty VectorSlotPair above), causing the
// JSCallReducer to do much less work. We should revisit this later.
NodeProperties::ChangeOp(
node,
javascript()->Call(arity, p.frequency(), FeedbackSource(), convert_mode));
javascript()->Call(arity, p.frequency(), VectorSlotPair(), convert_mode));
// Try to further reduce the JSCall {node}.
Reduction const reduction = ReduceJSCall(node);
return reduction.Changed() ? reduction : Changed(node);
@ -574,7 +574,7 @@ Reduction JSCallReducer::ReduceFunctionPrototypeCall(Node* node) {
}
NodeProperties::ChangeOp(
node,
javascript()->Call(arity, p.frequency(), FeedbackSource(), convert_mode));
javascript()->Call(arity, p.frequency(), VectorSlotPair(), convert_mode));
// Try to further reduce the JSCall {node}.
Reduction const reduction = ReduceJSCall(node);
return reduction.Changed() ? reduction : Changed(node);
@ -981,7 +981,7 @@ Reduction JSCallReducer::ReduceReflectHas(Node* node) {
{
// TODO(magardn): collect feedback so this can be optimized
vtrue = etrue = if_true =
graph()->NewNode(javascript()->HasProperty(FeedbackSource()), target,
graph()->NewNode(javascript()->HasProperty(VectorSlotPair()), target,
key, context, frame_state, etrue, if_true);
}
@ -2162,7 +2162,7 @@ Node* JSCallReducer::DoFilterPostCallbackWork(ElementsKind kind, Node** control,
IsDoubleElementsKind(kind) ? GrowFastElementsMode::kDoubleElements
: GrowFastElementsMode::kSmiOrObjectElements;
elements = etrue = graph()->NewNode(
simplified()->MaybeGrowFastElements(mode, FeedbackSource()), a,
simplified()->MaybeGrowFastElements(mode, VectorSlotPair()), a,
elements, checked_to, elements_length, etrue, if_true);
// Update the length of {a}.
@ -2232,7 +2232,7 @@ void JSCallReducer::RewirePostCallbackExceptionEdges(Node* check_throw,
Node* JSCallReducer::SafeLoadElement(ElementsKind kind, Node* receiver,
Node* control, Node** effect, Node** k,
const FeedbackSource& feedback) {
const VectorSlotPair& feedback) {
// Make sure that the access is still in bounds, since the callback could
// have changed the array's size.
Node* length = *effect = graph()->NewNode(
@ -3007,7 +3007,7 @@ bool IsSafeArgumentsElements(Node* node) {
Reduction JSCallReducer::ReduceCallOrConstructWithArrayLikeOrSpread(
Node* node, int arity, CallFrequency const& frequency,
FeedbackSource const& feedback) {
VectorSlotPair const& feedback) {
DCHECK(node->opcode() == IrOpcode::kJSCallWithArrayLike ||
node->opcode() == IrOpcode::kJSCallWithSpread ||
node->opcode() == IrOpcode::kJSConstructWithArrayLike ||
@ -3289,7 +3289,7 @@ Reduction JSCallReducer::ReduceJSCall(Node* node) {
}
NodeProperties::ChangeOp(
node, javascript()->Call(arity, p.frequency(), FeedbackSource(),
node, javascript()->Call(arity, p.frequency(), VectorSlotPair(),
convert_mode));
// Try to further reduce the JSCall {node}.
@ -3337,7 +3337,7 @@ Reduction JSCallReducer::ReduceJSCall(Node* node) {
? ConvertReceiverMode::kAny
: ConvertReceiverMode::kNotNullOrUndefined;
NodeProperties::ChangeOp(
node, javascript()->Call(arity, p.frequency(), FeedbackSource(),
node, javascript()->Call(arity, p.frequency(), VectorSlotPair(),
convert_mode));
// Try to further reduce the JSCall {node}.
@ -3738,8 +3738,9 @@ Reduction JSCallReducer::ReduceJSCall(Node* node,
Reduction JSCallReducer::ReduceJSCallWithArrayLike(Node* node) {
DCHECK_EQ(IrOpcode::kJSCallWithArrayLike, node->opcode());
CallFrequency frequency = CallFrequencyOf(node->op());
VectorSlotPair feedback;
return ReduceCallOrConstructWithArrayLikeOrSpread(node, 2, frequency,
FeedbackSource());
feedback);
}
Reduction JSCallReducer::ReduceJSCallWithSpread(Node* node) {
@ -3748,7 +3749,7 @@ Reduction JSCallReducer::ReduceJSCallWithSpread(Node* node) {
DCHECK_LE(3u, p.arity());
int arity = static_cast<int>(p.arity() - 1);
CallFrequency frequency = p.frequency();
FeedbackSource feedback = p.feedback();
VectorSlotPair feedback = p.feedback();
return ReduceCallOrConstructWithArrayLikeOrSpread(node, arity, frequency,
feedback);
}
@ -3765,7 +3766,7 @@ Reduction JSCallReducer::ReduceJSConstruct(Node* node) {
if (p.feedback().IsValid()) {
ProcessedFeedback const& feedback =
broker()->GetFeedbackForCall(p.feedback());
broker()->GetFeedbackForCall(FeedbackSource(p.feedback()));
if (feedback.IsInsufficient()) {
return ReduceSoftDeoptimize(
node, DeoptimizeReason::kInsufficientTypeFeedbackForConstruct);
@ -3935,7 +3936,7 @@ Reduction JSCallReducer::ReduceJSConstruct(Node* node) {
// Update the JSConstruct operator on {node}.
NodeProperties::ChangeOp(
node,
javascript()->Construct(arity + 2, p.frequency(), FeedbackSource()));
javascript()->Construct(arity + 2, p.frequency(), VectorSlotPair()));
// Try to further reduce the JSConstruct {node}.
Reduction const reduction = ReduceJSConstruct(node);
@ -3976,7 +3977,7 @@ Reduction JSCallReducer::ReduceJSConstruct(Node* node) {
// Update the JSConstruct operator on {node}.
NodeProperties::ChangeOp(
node,
javascript()->Construct(arity + 2, p.frequency(), FeedbackSource()));
javascript()->Construct(arity + 2, p.frequency(), VectorSlotPair()));
// Try to further reduce the JSConstruct {node}.
Reduction const reduction = ReduceJSConstruct(node);
@ -4296,8 +4297,9 @@ Reduction JSCallReducer::ReduceStringPrototypeSubstr(Node* node) {
Reduction JSCallReducer::ReduceJSConstructWithArrayLike(Node* node) {
DCHECK_EQ(IrOpcode::kJSConstructWithArrayLike, node->opcode());
CallFrequency frequency = CallFrequencyOf(node->op());
VectorSlotPair feedback;
return ReduceCallOrConstructWithArrayLikeOrSpread(node, 1, frequency,
FeedbackSource());
feedback);
}
Reduction JSCallReducer::ReduceJSConstructWithSpread(Node* node) {
@ -4306,7 +4308,7 @@ Reduction JSCallReducer::ReduceJSConstructWithSpread(Node* node) {
DCHECK_LE(3u, p.arity());
int arity = static_cast<int>(p.arity() - 2);
CallFrequency frequency = p.frequency();
FeedbackSource feedback = p.feedback();
VectorSlotPair feedback = p.feedback();
return ReduceCallOrConstructWithArrayLikeOrSpread(node, arity, frequency,
feedback);
}
@ -4327,7 +4329,7 @@ Reduction JSCallReducer::ReduceSoftDeoptimize(Node* node,
Node* frame_state =
NodeProperties::FindFrameStateBefore(node, jsgraph()->Dead());
Node* deoptimize = graph()->NewNode(
common()->Deoptimize(DeoptimizeKind::kSoft, reason, FeedbackSource()),
common()->Deoptimize(DeoptimizeKind::kSoft, reason, VectorSlotPair()),
frame_state, effect, control);
// TODO(bmeurer): This should be on the AdvancedReducer somehow.
NodeProperties::MergeControlToEnd(graph(), common(), deoptimize);
@ -5767,7 +5769,7 @@ Reduction JSCallReducer::ReducePromiseConstructor(Node* node) {
// 9. Call executor with both resolving functions
effect = control = graph()->NewNode(
javascript()->Call(4, p.frequency(), FeedbackSource(),
javascript()->Call(4, p.frequency(), VectorSlotPair(),
ConvertReceiverMode::kNullOrUndefined,
SpeculationMode::kDisallowSpeculation),
executor, jsgraph()->UndefinedConstant(), resolve, reject, context,
@ -5780,7 +5782,7 @@ Reduction JSCallReducer::ReducePromiseConstructor(Node* node) {
common()->IfException(), exception_control, exception_effect);
// 10a. Call reject if the call to executor threw.
exception_effect = exception_control = graph()->NewNode(
javascript()->Call(3, p.frequency(), FeedbackSource(),
javascript()->Call(3, p.frequency(), VectorSlotPair(),
ConvertReceiverMode::kNullOrUndefined,
SpeculationMode::kDisallowSpeculation),
reject, jsgraph()->UndefinedConstant(), reason, context, frame_state,

View File

@ -17,6 +17,7 @@ namespace internal {
// Forward declarations.
class Factory;
class JSGlobalProxy;
class VectorSlotPair;
namespace compiler {
@ -24,7 +25,6 @@ namespace compiler {
class CallFrequency;
class CommonOperatorBuilder;
class CompilationDependencies;
struct FeedbackSource;
struct FieldAccess;
class JSGraph;
class JSHeapBroker;
@ -106,7 +106,7 @@ class V8_EXPORT_PRIVATE JSCallReducer final : public AdvancedReducer {
Reduction ReduceCallOrConstructWithArrayLikeOrSpread(
Node* node, int arity, CallFrequency const& frequency,
FeedbackSource const& feedback);
VectorSlotPair const& feedback);
Reduction ReduceJSConstruct(Node* node);
Reduction ReduceJSConstructWithArrayLike(Node* node);
Reduction ReduceJSConstructWithSpread(Node* node);
@ -233,7 +233,7 @@ class V8_EXPORT_PRIVATE JSCallReducer final : public AdvancedReducer {
// k is thusly changed, and the effect is changed as well.
Node* SafeLoadElement(ElementsKind kind, Node* receiver, Node* control,
Node** effect, Node** k,
const FeedbackSource& feedback);
const VectorSlotPair& feedback);
Node* CreateArtificialFrameState(Node* node, Node* outer_frame_state,
int parameter_count, BailoutId bailout_id,

View File

@ -471,7 +471,7 @@ Reduction JSCreateLowering::ReduceNewArray(
// This has to be kept in sync with src/runtime/runtime-array.cc,
// where this limit is protected.
length = effect = graph()->NewNode(
simplified()->CheckBounds(FeedbackSource()), length,
simplified()->CheckBounds(VectorSlotPair()), length,
jsgraph()->Constant(JSArray::kInitialMaxFastElementArray), effect,
control);
@ -566,14 +566,14 @@ Reduction JSCreateLowering::ReduceNewArray(
for (auto& value : values) {
if (!NodeProperties::GetType(value).Is(Type::SignedSmall())) {
value = effect = graph()->NewNode(
simplified()->CheckSmi(FeedbackSource()), value, effect, control);
simplified()->CheckSmi(VectorSlotPair()), value, effect, control);
}
}
} else if (IsDoubleElementsKind(elements_kind)) {
for (auto& value : values) {
if (!NodeProperties::GetType(value).Is(Type::Number())) {
value = effect =
graph()->NewNode(simplified()->CheckNumber(FeedbackSource()), value,
graph()->NewNode(simplified()->CheckNumber(VectorSlotPair()), value,
effect, control);
}
// Make sure we do not store signaling NaNs into double arrays.
@ -1073,12 +1073,8 @@ Reduction JSCreateLowering::ReduceJSCreateLiteralArrayOrObject(Node* node) {
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
FeedbackVectorRef feedback_vector(broker(), p.feedback().vector);
ObjectRef feedback = feedback_vector.get(p.feedback().slot);
// TODO(turbofan): we should consider creating a ProcessedFeedback for
// allocation sites/boiler plates so that we use GetFeedback here. Then
// we can eventually get rid of the additional copy of feedback slots that
// we currently have in FeedbackVectorData.
FeedbackVectorRef feedback_vector(broker(), p.feedback().vector());
ObjectRef feedback = feedback_vector.get(p.feedback().slot());
if (feedback.IsAllocationSite()) {
AllocationSiteRef site = feedback.AsAllocationSite();
if (site.IsFastLiteral()) {
@ -1100,12 +1096,8 @@ Reduction JSCreateLowering::ReduceJSCreateLiteralArrayOrObject(Node* node) {
Reduction JSCreateLowering::ReduceJSCreateEmptyLiteralArray(Node* node) {
DCHECK_EQ(IrOpcode::kJSCreateEmptyLiteralArray, node->opcode());
FeedbackParameter const& p = FeedbackParameterOf(node->op());
FeedbackVectorRef fv(broker(), p.feedback().vector);
ObjectRef feedback = fv.get(p.feedback().slot);
// TODO(turbofan): we should consider creating a ProcessedFeedback for
// allocation sites/boiler plates so that we use GetFeedback here. Then
// we can eventually get rid of the additional copy of feedback slots that
// we currently have in FeedbackVectorData.
FeedbackVectorRef fv(broker(), p.feedback().vector());
ObjectRef feedback = fv.get(p.feedback().slot());
if (feedback.IsAllocationSite()) {
AllocationSiteRef site = feedback.AsAllocationSite();
DCHECK(!site.PointsToLiteral());
@ -1162,12 +1154,8 @@ Reduction JSCreateLowering::ReduceJSCreateLiteralRegExp(Node* node) {
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
FeedbackVectorRef feedback_vector(broker(), p.feedback().vector);
ObjectRef feedback = feedback_vector.get(p.feedback().slot);
// TODO(turbofan): we should consider creating a ProcessedFeedback for
// allocation sites/boiler plates so that we use GetFeedback here. Then
// we can eventually get rid of the additional copy of feedback slots that
// we currently have in FeedbackVectorData.
FeedbackVectorRef feedback_vector(broker(), p.feedback().vector());
ObjectRef feedback = feedback_vector.get(p.feedback().slot());
if (feedback.IsJSRegExp()) {
JSRegExpRef boilerplate = feedback.AsJSRegExp();
Node* value = effect = AllocateLiteralRegExp(effect, control, boilerplate);

View File

@ -148,14 +148,13 @@ void JSGenericLowering::LowerJSStrictEqual(Node* node) {
}
namespace {
bool ShouldUseMegamorphicLoadBuiltin(FeedbackSource const& source,
bool ShouldUseMegamorphicLoadBuiltin(VectorSlotPair const& vector_slot_pair,
JSHeapBroker* broker) {
if (!FLAG_concurrent_inlining) {
AllowHandleDereference allow_deref;
FeedbackNexus nexus(source.vector, source.slot);
return nexus.ic_state() == MEGAMORPHIC;
return vector_slot_pair.ic_state() == MEGAMORPHIC;
}
ProcessedFeedback const& feedback = broker->GetFeedback(source);
ProcessedFeedback const& feedback =
broker->GetFeedback(FeedbackSource(vector_slot_pair));
if (feedback.kind() == ProcessedFeedback::kElementAccess) {
return feedback.AsElementAccess().transition_groups().empty();
@ -185,7 +184,7 @@ void JSGenericLowering::LowerJSLoadProperty(Node* node) {
isolate(), ShouldUseMegamorphicLoadBuiltin(p.feedback(), broker())
? Builtins::kKeyedLoadIC_Megamorphic
: Builtins::kKeyedLoadIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 3, vector);
ReplaceWithStubCall(node, callable, flags);
}
@ -215,7 +214,7 @@ void JSGenericLowering::LowerJSLoadNamed(Node* node) {
isolate(), ShouldUseMegamorphicLoadBuiltin(p.feedback(), broker())
? Builtins::kLoadIC_Megamorphic
: Builtins::kLoadIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 3, vector);
ReplaceWithStubCall(node, callable, flags);
}
@ -234,7 +233,7 @@ void JSGenericLowering::LowerJSLoadGlobal(Node* node) {
} else {
Callable callable =
CodeFactory::LoadGlobalICInOptimizedCode(isolate(), p.typeof_mode());
Node* vector = jsgraph()->HeapConstant(p.feedback().vector);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 2, vector);
ReplaceWithStubCall(node, callable, flags);
}
@ -244,7 +243,7 @@ void JSGenericLowering::LowerJSGetIterator(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
const PropertyAccess& p = PropertyAccessOf(node->op());
node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.feedback().index()));
Node* vector = jsgraph()->HeapConstant(p.feedback().vector);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 2, vector);
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kGetIteratorWithFeedback);
@ -264,7 +263,7 @@ void JSGenericLowering::LowerJSStoreProperty(Node* node) {
} else {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kKeyedStoreIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 4, vector);
ReplaceWithStubCall(node, callable, flags);
}
@ -287,7 +286,7 @@ void JSGenericLowering::LowerJSStoreNamed(Node* node) {
ReplaceWithStubCall(node, callable, flags);
} else {
Callable callable = Builtins::CallableFor(isolate(), Builtins::kStoreIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 4, vector);
ReplaceWithStubCall(node, callable, flags);
}
@ -305,7 +304,7 @@ void JSGenericLowering::LowerJSStoreNamedOwn(Node* node) {
ReplaceWithStubCall(node, callable, flags);
} else {
Callable callable = CodeFactory::StoreOwnICInOptimizedCode(isolate());
Node* vector = jsgraph()->HeapConstant(p.feedback().vector);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 4, vector);
ReplaceWithStubCall(node, callable, flags);
}
@ -325,7 +324,7 @@ void JSGenericLowering::LowerJSStoreGlobal(Node* node) {
} else {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kStoreGlobalIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 3, vector);
ReplaceWithStubCall(node, callable, flags);
}
@ -335,7 +334,7 @@ void JSGenericLowering::LowerJSStoreDataPropertyInLiteral(Node* node) {
FeedbackParameter const& p = FeedbackParameterOf(node->op());
RelaxControls(node);
node->InsertInputs(zone(), 4, 2);
node->ReplaceInput(4, jsgraph()->HeapConstant(p.feedback().vector));
node->ReplaceInput(4, jsgraph()->HeapConstant(p.feedback().vector()));
node->ReplaceInput(5, jsgraph()->SmiConstant(p.feedback().index()));
ReplaceWithRuntimeCall(node, Runtime::kDefineDataPropertyInLiteral);
}
@ -347,7 +346,7 @@ void JSGenericLowering::LowerJSStoreInArrayLiteral(Node* node) {
FeedbackParameter const& p = FeedbackParameterOf(node->op());
RelaxControls(node);
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index()));
node->InsertInput(zone(), 4, jsgraph()->HeapConstant(p.feedback().vector));
node->InsertInput(zone(), 4, jsgraph()->HeapConstant(p.feedback().vector()));
ReplaceWithStubCall(node, callable, flags);
}
@ -549,7 +548,7 @@ void JSGenericLowering::LowerJSCreateTypedArray(Node* node) {
void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) {
CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op());
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.feedback().vector));
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.feedback().vector()));
node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.feedback().index()));
node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.constant()));
@ -569,7 +568,7 @@ void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) {
void JSGenericLowering::LowerJSCreateEmptyLiteralArray(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
FeedbackParameter const& p = FeedbackParameterOf(node->op());
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.feedback().vector));
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.feedback().vector()));
node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.feedback().index()));
node->RemoveInput(4); // control
Callable callable =
@ -587,7 +586,7 @@ void JSGenericLowering::LowerJSCreateArrayFromIterable(Node* node) {
void JSGenericLowering::LowerJSCreateLiteralObject(Node* node) {
CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op());
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.feedback().vector));
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.feedback().vector()));
node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.feedback().index()));
node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.constant()));
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.flags()));
@ -612,7 +611,7 @@ void JSGenericLowering::LowerJSCloneObject(Node* node) {
Builtins::CallableFor(isolate(), Builtins::kCloneObjectIC);
node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.flags()));
node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index()));
node->InsertInput(zone(), 3, jsgraph()->HeapConstant(p.feedback().vector));
node->InsertInput(zone(), 3, jsgraph()->HeapConstant(p.feedback().vector()));
ReplaceWithStubCall(node, callable, flags);
}
@ -625,7 +624,7 @@ void JSGenericLowering::LowerJSCreateLiteralRegExp(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kCreateRegExpLiteral);
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.feedback().vector));
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.feedback().vector()));
node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.feedback().index()));
node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.constant()));
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.flags()));

View File

@ -16,6 +16,7 @@
#include "src/compiler/bytecode-analysis.h"
#include "src/compiler/graph-reducer.h"
#include "src/compiler/per-isolate-compiler-cache.h"
#include "src/compiler/vector-slot-pair.h"
#include "src/init/bootstrapper.h"
#include "src/objects/allocation-site-inl.h"
#include "src/objects/api-callbacks.h"
@ -3962,9 +3963,6 @@ bool CanInlineElementAccess(MapRef const& map) {
return false;
}
ProcessedFeedback::ProcessedFeedback(Kind kind, FeedbackSlotKind slot_kind)
: kind_(kind), slot_kind_(slot_kind) {}
KeyedAccessMode ElementAccessFeedback::keyed_mode() const {
return keyed_mode_;
}
@ -3977,7 +3975,7 @@ ElementAccessFeedback::transition_groups() const {
ElementAccessFeedback const& ElementAccessFeedback::Refine(
ZoneVector<Handle<Map>> const& inferred_maps, Zone* zone) const {
ElementAccessFeedback& refined_feedback =
*new (zone) ElementAccessFeedback(zone, keyed_mode(), slot_kind());
*new (zone) ElementAccessFeedback(zone, keyed_mode());
if (inferred_maps.empty()) return refined_feedback;
ZoneUnorderedSet<Handle<Map>, Handle<Map>::hash, Handle<Map>::equal_to>
@ -4011,33 +4009,26 @@ ElementAccessFeedback const& ElementAccessFeedback::Refine(
return refined_feedback;
}
InsufficientFeedback::InsufficientFeedback(FeedbackSlotKind slot_kind)
: ProcessedFeedback(kInsufficient, slot_kind) {}
InsufficientFeedback::InsufficientFeedback()
: ProcessedFeedback(kInsufficient) {}
GlobalAccessFeedback::GlobalAccessFeedback(PropertyCellRef cell,
FeedbackSlotKind slot_kind)
: ProcessedFeedback(kGlobalAccess, slot_kind),
GlobalAccessFeedback::GlobalAccessFeedback(PropertyCellRef cell)
: ProcessedFeedback(kGlobalAccess),
cell_or_context_(cell),
index_and_immutable_(0 /* doesn't matter */) {
DCHECK(IsGlobalICKind(slot_kind));
}
index_and_immutable_(0 /* doesn't matter */) {}
GlobalAccessFeedback::GlobalAccessFeedback(FeedbackSlotKind slot_kind)
: ProcessedFeedback(kGlobalAccess, slot_kind),
index_and_immutable_(0 /* doesn't matter */) {
DCHECK(IsGlobalICKind(slot_kind));
}
GlobalAccessFeedback::GlobalAccessFeedback()
: ProcessedFeedback(kGlobalAccess),
index_and_immutable_(0 /* doesn't matter */) {}
GlobalAccessFeedback::GlobalAccessFeedback(ContextRef script_context,
int slot_index, bool immutable,
FeedbackSlotKind slot_kind)
: ProcessedFeedback(kGlobalAccess, slot_kind),
int slot_index, bool immutable)
: ProcessedFeedback(kGlobalAccess),
cell_or_context_(script_context),
index_and_immutable_(FeedbackNexus::SlotIndexBits::encode(slot_index) |
FeedbackNexus::ImmutabilityBit::encode(immutable)) {
DCHECK_EQ(this->slot_index(), slot_index);
DCHECK_EQ(this->immutable(), immutable);
DCHECK(IsGlobalICKind(slot_kind));
}
bool GlobalAccessFeedback::IsMegamorphic() const {
@ -4134,16 +4125,10 @@ KeyedAccessMode::KeyedAccessMode(AccessMode access_mode,
}
ElementAccessFeedback::ElementAccessFeedback(Zone* zone,
KeyedAccessMode const& keyed_mode,
FeedbackSlotKind slot_kind)
: ProcessedFeedback(kElementAccess, slot_kind),
KeyedAccessMode const& keyed_mode)
: ProcessedFeedback(kElementAccess),
keyed_mode_(keyed_mode),
transition_groups_(zone) {
DCHECK(IsKeyedLoadICKind(slot_kind) || IsKeyedHasICKind(slot_kind) ||
IsStoreDataPropertyInLiteralKind(slot_kind) ||
IsKeyedStoreICKind(slot_kind) ||
IsStoreInArrayLiteralICKind(slot_kind));
}
transition_groups_(zone) {}
bool ElementAccessFeedback::HasOnlyStringMaps(JSHeapBroker* broker) const {
for (auto const& group : transition_groups()) {
@ -4155,16 +4140,24 @@ bool ElementAccessFeedback::HasOnlyStringMaps(JSHeapBroker* broker) const {
}
NamedAccessFeedback::NamedAccessFeedback(NameRef const& name,
ZoneVector<Handle<Map>> const& maps,
FeedbackSlotKind slot_kind)
: ProcessedFeedback(kNamedAccess, slot_kind), name_(name), maps_(maps) {
DCHECK(IsLoadICKind(slot_kind) || IsStoreICKind(slot_kind) ||
IsStoreOwnICKind(slot_kind) || IsKeyedLoadICKind(slot_kind) ||
IsKeyedHasICKind(slot_kind) || IsKeyedStoreICKind(slot_kind) ||
IsStoreInArrayLiteralICKind(slot_kind) ||
IsStoreDataPropertyInLiteralKind(slot_kind));
ZoneVector<Handle<Map>> const& maps)
: ProcessedFeedback(kNamedAccess), name_(name), maps_(maps) {}
FeedbackSource::FeedbackSource(Handle<FeedbackVector> vector_,
FeedbackSlot slot_)
: vector(vector_), slot(slot_) {
DCHECK(!slot.IsInvalid());
}
FeedbackSource::FeedbackSource(FeedbackVectorRef vector_, FeedbackSlot slot_)
: FeedbackSource(vector_.object(), slot_) {}
FeedbackSource::FeedbackSource(FeedbackNexus const& nexus)
: FeedbackSource(nexus.vector_handle(), nexus.slot()) {}
FeedbackSource::FeedbackSource(VectorSlotPair const& pair)
: FeedbackSource(pair.vector(), pair.slot()) {}
void JSHeapBroker::SetFeedback(FeedbackSource const& source,
ProcessedFeedback const* feedback) {
auto insertion = feedback_.insert({source, feedback});
@ -4177,22 +4170,11 @@ bool JSHeapBroker::HasFeedback(FeedbackSource const& source) const {
ProcessedFeedback const& JSHeapBroker::GetFeedback(
FeedbackSource const& source) const {
DCHECK(source.IsValid());
auto it = feedback_.find(source);
CHECK_NE(it, feedback_.end());
return *it->second;
}
FeedbackSlotKind JSHeapBroker::GetFeedbackSlotKind(
FeedbackSource const& source) const {
if (FLAG_concurrent_inlining) {
ProcessedFeedback const& processed = GetFeedback(source);
return processed.slot_kind();
}
FeedbackNexus nexus(source.vector, source.slot);
return nexus.kind();
}
bool JSHeapBroker::FeedbackIsInsufficient(FeedbackSource const& source) const {
return FLAG_concurrent_inlining
? GetFeedback(source).IsInsufficient()
@ -4218,25 +4200,24 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForPropertyAccess(
FeedbackSource const& source, AccessMode mode,
base::Optional<NameRef> static_name) {
FeedbackNexus nexus(source.vector, source.slot);
FeedbackSlotKind kind = nexus.kind();
if (nexus.IsUninitialized()) return *new (zone()) InsufficientFeedback(kind);
if (nexus.IsUninitialized()) return *new (zone()) InsufficientFeedback();
MapHandles maps;
nexus.ExtractMaps(&maps);
DCHECK_NE(nexus.ic_state(), PREMONOMORPHIC);
if (!maps.empty()) {
maps = GetRelevantReceiverMaps(isolate(), maps);
if (maps.empty()) return *new (zone()) InsufficientFeedback(kind);
if (maps.empty()) return *new (zone()) InsufficientFeedback();
}
base::Optional<NameRef> name =
static_name.has_value() ? static_name : GetNameFeedback(nexus);
if (name.has_value()) {
return *new (zone()) NamedAccessFeedback(
*name, ZoneVector<Handle<Map>>(maps.begin(), maps.end(), zone()), kind);
*name, ZoneVector<Handle<Map>>(maps.begin(), maps.end(), zone()));
} else if (nexus.GetKeyType() == ELEMENT && !maps.empty()) {
return ProcessFeedbackMapsForElementAccess(
maps, KeyedAccessMode::FromNexus(nexus), kind);
maps, KeyedAccessMode::FromNexus(nexus));
} else {
// No actionable feedback.
DCHECK(maps.empty());
@ -4244,7 +4225,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForPropertyAccess(
// megamorphic (also for global accesses).
// TODO(neis): Using ElementAccessFeedback here is kind of an abuse.
return *new (zone())
ElementAccessFeedback(zone(), KeyedAccessMode::FromNexus(nexus), kind);
ElementAccessFeedback(zone(), KeyedAccessMode::FromNexus(nexus));
}
}
@ -4255,11 +4236,9 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForGlobalAccess(
nexus.kind() == FeedbackSlotKind::kLoadGlobalNotInsideTypeof ||
nexus.kind() == FeedbackSlotKind::kStoreGlobalSloppy ||
nexus.kind() == FeedbackSlotKind::kStoreGlobalStrict);
if (nexus.IsUninitialized()) {
return *new (zone()) InsufficientFeedback(nexus.kind());
}
if (nexus.IsUninitialized()) return *new (zone()) InsufficientFeedback();
if (nexus.ic_state() != MONOMORPHIC || nexus.GetFeedback()->IsCleared()) {
return *new (zone()) GlobalAccessFeedback(nexus.kind());
return *new (zone()) GlobalAccessFeedback();
}
Handle<Object> feedback_value(nexus.GetFeedback()->GetHeapObjectOrSmi(),
@ -4287,8 +4266,8 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForGlobalAccess(
context_ref.get(context_slot_index,
SerializationPolicy::kSerializeIfNeeded);
}
return *new (zone()) GlobalAccessFeedback(context_ref, context_slot_index,
immutable, nexus.kind());
return *new (zone())
GlobalAccessFeedback(context_ref, context_slot_index, immutable);
}
CHECK(feedback_value->IsPropertyCell());
@ -4296,7 +4275,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForGlobalAccess(
// object and the feedback is the cell holding its value.
PropertyCellRef cell(this, Handle<PropertyCell>::cast(feedback_value));
cell.Serialize();
return *new (zone()) GlobalAccessFeedback(cell, nexus.kind());
return *new (zone()) GlobalAccessFeedback(cell);
}
BinaryOperationHint JSHeapBroker::ReadFeedbackForBinaryOperation(
@ -4318,8 +4297,7 @@ ForInHint JSHeapBroker::ReadFeedbackForForIn(
ProcessedFeedback const& JSHeapBroker::ReadFeedbackForInstanceOf(
FeedbackSource const& source) {
FeedbackNexus nexus(source.vector, source.slot);
if (nexus.IsUninitialized())
return *new (zone()) InsufficientFeedback(nexus.kind());
if (nexus.IsUninitialized()) return *new (zone()) InsufficientFeedback();
base::Optional<JSObjectRef> optional_constructor;
{
@ -4329,14 +4307,13 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForInstanceOf(
optional_constructor = JSObjectRef(this, constructor);
}
}
return *new (zone()) InstanceOfFeedback(optional_constructor, nexus.kind());
return *new (zone()) InstanceOfFeedback(optional_constructor);
}
ProcessedFeedback const& JSHeapBroker::ReadFeedbackForCall(
FeedbackSource const& source) {
FeedbackNexus nexus(source.vector, source.slot);
if (nexus.IsUninitialized())
return *new (zone()) InsufficientFeedback(nexus.kind());
if (nexus.IsUninitialized()) return *new (zone()) InsufficientFeedback();
base::Optional<HeapObjectRef> target_ref;
{
@ -4348,7 +4325,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForCall(
}
float frequency = nexus.ComputeCallFrequency();
SpeculationMode mode = nexus.GetSpeculationMode();
return *new (zone()) CallFeedback(target_ref, frequency, mode, nexus.kind());
return *new (zone()) CallFeedback(target_ref, frequency, mode);
}
BinaryOperationHint JSHeapBroker::GetFeedbackForBinaryOperation(
@ -4407,11 +4384,9 @@ ProcessedFeedback const& JSHeapBroker::ProcessFeedbackForBinaryOperation(
BinaryOperationHint hint = ReadFeedbackForBinaryOperation(source);
ProcessedFeedback const* feedback;
if (hint == BinaryOperationHint::kNone) {
feedback =
new (zone()) InsufficientFeedback(source.vector->GetKind(source.slot));
feedback = new (zone()) InsufficientFeedback();
} else {
feedback = new (zone())
BinaryOperationFeedback(hint, source.vector->GetKind(source.slot));
feedback = new (zone()) BinaryOperationFeedback(hint);
}
SetFeedback(source, feedback);
return *feedback;
@ -4423,11 +4398,9 @@ ProcessedFeedback const& JSHeapBroker::ProcessFeedbackForCompareOperation(
CompareOperationHint hint = ReadFeedbackForCompareOperation(source);
ProcessedFeedback const* feedback;
if (hint == CompareOperationHint::kNone) {
feedback =
new (zone()) InsufficientFeedback(source.vector->GetKind(source.slot));
feedback = new (zone()) InsufficientFeedback();
} else {
feedback = new (zone())
CompareOperationFeedback(hint, source.vector->GetKind(source.slot));
feedback = new (zone()) CompareOperationFeedback(hint);
}
SetFeedback(source, feedback);
return *feedback;
@ -4439,11 +4412,9 @@ ProcessedFeedback const& JSHeapBroker::ProcessFeedbackForForIn(
ForInHint hint = ReadFeedbackForForIn(source);
ProcessedFeedback const* feedback;
if (hint == ForInHint::kNone) {
feedback =
new (zone()) InsufficientFeedback(source.vector->GetKind(source.slot));
feedback = new (zone()) InsufficientFeedback();
} else {
feedback =
new (zone()) ForInFeedback(hint, source.vector->GetKind(source.slot));
feedback = new (zone()) ForInFeedback(hint);
}
SetFeedback(source, feedback);
return *feedback;
@ -4484,8 +4455,7 @@ ProcessedFeedback const& JSHeapBroker::ProcessFeedbackForGlobalAccess(
}
ElementAccessFeedback const& JSHeapBroker::ProcessFeedbackMapsForElementAccess(
MapHandles const& maps, KeyedAccessMode const& keyed_mode,
FeedbackSlotKind slot_kind) {
MapHandles const& maps, KeyedAccessMode const& keyed_mode) {
DCHECK(!maps.empty());
// Collect possible transition targets.
@ -4527,7 +4497,7 @@ ElementAccessFeedback const& JSHeapBroker::ProcessFeedbackMapsForElementAccess(
}
ElementAccessFeedback* result =
new (zone()) ElementAccessFeedback(zone(), keyed_mode, slot_kind);
new (zone()) ElementAccessFeedback(zone(), keyed_mode);
for (auto entry : transition_groups) {
result->AddGroup(std::move(entry.second));
}

View File

@ -9,7 +9,6 @@
#include "src/base/optional.h"
#include "src/common/globals.h"
#include "src/compiler/access-info.h"
#include "src/compiler/feedback-source.h"
#include "src/compiler/processed-feedback.h"
#include "src/compiler/refs-map.h"
#include "src/handles/handles.h"
@ -28,6 +27,29 @@ class BytecodeAnalysis;
class ObjectRef;
std::ostream& operator<<(std::ostream& os, const ObjectRef& ref);
struct FeedbackSource {
FeedbackSource(Handle<FeedbackVector> vector_, FeedbackSlot slot_);
FeedbackSource(FeedbackVectorRef vector_, FeedbackSlot slot_);
explicit FeedbackSource(FeedbackNexus const& nexus);
explicit FeedbackSource(VectorSlotPair const& pair);
Handle<FeedbackVector> const vector;
FeedbackSlot const slot;
struct Hash {
size_t operator()(FeedbackSource const& source) const {
return base::hash_combine(source.vector.address(), source.slot);
}
};
struct Equal {
bool operator()(FeedbackSource const& lhs,
FeedbackSource const& rhs) const {
return lhs.vector.equals(rhs.vector) && lhs.slot == rhs.slot;
}
};
};
#define TRACE_BROKER(broker, x) \
do { \
if (broker->tracing_enabled() && FLAG_trace_heap_broker_verbose) \
@ -95,15 +117,15 @@ class V8_EXPORT_PRIVATE JSHeapBroker {
bool IsArrayOrObjectPrototype(const JSObjectRef& object) const;
bool HasFeedback(FeedbackSource const& source) const;
// The processed {feedback} can be {nullptr}, indicating that the original
// feedback didn't contain information relevant for Turbofan.
void SetFeedback(FeedbackSource const& source,
ProcessedFeedback const* feedback);
ProcessedFeedback const& GetFeedback(FeedbackSource const& source) const;
FeedbackSlotKind GetFeedbackSlotKind(FeedbackSource const& source) const;
// TODO(neis): Move these into serializer when we're always in the background.
ElementAccessFeedback const& ProcessFeedbackMapsForElementAccess(
MapHandles const& maps, KeyedAccessMode const& keyed_mode,
FeedbackSlotKind slot_kind);
MapHandles const& maps, KeyedAccessMode const& keyed_mode);
BytecodeAnalysis const& GetBytecodeAnalysis(
Handle<BytecodeArray> bytecode_array, BailoutId osr_offset,
bool analyze_liveness,

View File

@ -86,7 +86,7 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) {
case IrOpcode::kJSCreateEmptyLiteralArray: {
if (!FLAG_concurrent_inlining) {
FeedbackParameter const& p = FeedbackParameterOf(node->op());
FeedbackVectorRef(broker(), p.feedback().vector).SerializeSlots();
FeedbackVectorRef(broker(), p.feedback().vector()).SerializeSlots();
}
break;
}
@ -103,7 +103,7 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) {
if (!FLAG_concurrent_inlining) {
CreateLiteralParameters const& p =
CreateLiteralParametersOf(node->op());
FeedbackVectorRef(broker(), p.feedback().vector).SerializeSlots();
FeedbackVectorRef(broker(), p.feedback().vector()).SerializeSlots();
}
break;
}
@ -111,7 +111,7 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) {
if (!FLAG_concurrent_inlining) {
CreateLiteralParameters const& p =
CreateLiteralParametersOf(node->op());
FeedbackVectorRef(broker(), p.feedback().vector).SerializeSlots();
FeedbackVectorRef(broker(), p.feedback().vector()).SerializeSlots();
}
break;
}

View File

@ -111,7 +111,7 @@ Reduction JSIntrinsicLowering::ReduceDeoptimizeNow(Node* node) {
// TODO(bmeurer): Move MergeControlToEnd() to the AdvancedReducer.
Node* deoptimize = graph()->NewNode(
common()->Deoptimize(DeoptimizeKind::kEager,
DeoptimizeReason::kDeoptimizeNow, FeedbackSource()),
DeoptimizeReason::kDeoptimizeNow, VectorSlotPair()),
frame_state, effect, control);
NodeProperties::MergeControlToEnd(graph(), common(), deoptimize);
Revisit(graph()->end());

View File

@ -19,6 +19,7 @@
#include "src/compiler/node-matchers.h"
#include "src/compiler/property-access-builder.h"
#include "src/compiler/type-cache.h"
#include "src/compiler/vector-slot-pair.h"
#include "src/execution/isolate-inl.h"
#include "src/numbers/dtoa.h"
#include "src/objects/feedback-vector.h"
@ -487,7 +488,7 @@ Reduction JSNativeContextSpecialization::ReduceJSInstanceOf(Node* node) {
node->ReplaceInput(4, continuation_frame_state);
node->ReplaceInput(5, effect);
NodeProperties::ChangeOp(
node, javascript()->Call(3, CallFrequency(), FeedbackSource(),
node, javascript()->Call(3, CallFrequency(), VectorSlotPair(),
ConvertReceiverMode::kNotNullOrUndefined));
// Rewire the value uses of {node} to ToBoolean conversion of the result.
@ -620,7 +621,7 @@ Reduction JSNativeContextSpecialization::ReduceJSOrdinaryHasInstance(
NodeProperties::ReplaceValueInput(node, object, 0);
NodeProperties::ReplaceValueInput(
node, jsgraph()->Constant(bound_target_function), 1);
NodeProperties::ChangeOp(node, javascript()->InstanceOf(FeedbackSource()));
NodeProperties::ChangeOp(node, javascript()->InstanceOf(VectorSlotPair()));
Reduction const reduction = ReduceJSInstanceOf(node);
return reduction.Changed() ? reduction : Changed(node);
}
@ -961,7 +962,7 @@ Reduction JSNativeContextSpecialization::ReduceGlobalAccess(
} else {
// Check that the {value} is a Smi.
value = effect = graph()->NewNode(
simplified()->CheckSmi(FeedbackSource()), value, effect, control);
simplified()->CheckSmi(VectorSlotPair()), value, effect, control);
property_cell_value_type = Type::SignedSmall();
representation = MachineType::RepCompressedTaggedSigned();
}
@ -1438,7 +1439,7 @@ Reduction JSNativeContextSpecialization::ReduceElementAccessOnString(
// Ensure that the {receiver} is actually a String.
receiver = effect = graph()->NewNode(
simplified()->CheckString(FeedbackSource()), receiver, effect, control);
simplified()->CheckString(VectorSlotPair()), receiver, effect, control);
// Determine the {receiver} length.
Node* length = graph()->NewNode(simplified()->StringLength(), receiver);
@ -1851,7 +1852,7 @@ Reduction JSNativeContextSpecialization::ReduceSoftDeoptimize(
Node* frame_state =
NodeProperties::FindFrameStateBefore(node, jsgraph()->Dead());
Node* deoptimize = graph()->NewNode(
common()->Deoptimize(DeoptimizeKind::kSoft, reason, FeedbackSource()),
common()->Deoptimize(DeoptimizeKind::kSoft, reason, VectorSlotPair()),
frame_state, effect, control);
// TODO(bmeurer): This should be on the AdvancedReducer somehow.
NodeProperties::MergeControlToEnd(graph(), common(), deoptimize);
@ -2016,7 +2017,7 @@ Node* JSNativeContextSpecialization::InlinePropertyGetterCall(
Node* value;
if (constant.IsJSFunction()) {
value = *effect = *control = graph()->NewNode(
jsgraph()->javascript()->Call(2, CallFrequency(), FeedbackSource(),
jsgraph()->javascript()->Call(2, CallFrequency(), VectorSlotPair(),
ConvertReceiverMode::kNotNullOrUndefined),
target, receiver, context, frame_state, *effect, *control);
} else {
@ -2053,7 +2054,7 @@ void JSNativeContextSpecialization::InlinePropertySetterCall(
// Introduce the call to the setter function.
if (constant.IsJSFunction()) {
*effect = *control = graph()->NewNode(
jsgraph()->javascript()->Call(3, CallFrequency(), FeedbackSource(),
jsgraph()->javascript()->Call(3, CallFrequency(), VectorSlotPair(),
ConvertReceiverMode::kNotNullOrUndefined),
target, receiver, value, context, frame_state, *effect, *control);
} else {
@ -2260,7 +2261,7 @@ JSNativeContextSpecialization::BuildPropertyStore(
switch (field_representation) {
case MachineRepresentation::kFloat64: {
value = effect =
graph()->NewNode(simplified()->CheckNumber(FeedbackSource()), value,
graph()->NewNode(simplified()->CheckNumber(VectorSlotPair()), value,
effect, control);
if (!field_index.is_inobject() || !FLAG_unbox_double_fields) {
if (access_info.HasTransitionMap()) {
@ -2340,7 +2341,7 @@ JSNativeContextSpecialization::BuildPropertyStore(
if (field_representation == MachineRepresentation::kTaggedSigned ||
field_representation == MachineRepresentation::kCompressedSigned) {
value = effect = graph()->NewNode(
simplified()->CheckSmi(FeedbackSource()), value, effect, control);
simplified()->CheckSmi(VectorSlotPair()), value, effect, control);
field_access.write_barrier_kind = kNoWriteBarrier;
} else if (field_representation ==
@ -2569,7 +2570,7 @@ JSNativeContextSpecialization::BuildElementAccess(
// bounds check below and just skip the property access if it's out of
// bounds for the {receiver}.
index = effect = graph()->NewNode(
simplified()->CheckSmi(FeedbackSource()), index, effect, control);
simplified()->CheckSmi(VectorSlotPair()), index, effect, control);
// Cast the {index} to Unsigned32 range, so that the bounds checks
// below are performed on unsigned values, which means that all the
@ -2578,7 +2579,7 @@ JSNativeContextSpecialization::BuildElementAccess(
} else {
// Check that the {index} is in the valid range for the {receiver}.
index = effect =
graph()->NewNode(simplified()->CheckBounds(FeedbackSource()), index,
graph()->NewNode(simplified()->CheckBounds(VectorSlotPair()), index,
length, effect, control);
}
@ -2638,7 +2639,7 @@ JSNativeContextSpecialization::BuildElementAccess(
// and truncate it to a Number appropriately.
value = effect = graph()->NewNode(
simplified()->SpeculativeToNumber(
NumberOperationHint::kNumberOrOddball, FeedbackSource()),
NumberOperationHint::kNumberOrOddball, VectorSlotPair()),
value, effect, control);
// Introduce the appropriate truncation for {value}. Currently we
@ -2734,12 +2735,12 @@ JSNativeContextSpecialization::BuildElementAccess(
// bounds check below and just skip the store below if it's out of
// bounds for the {receiver}.
index = effect = graph()->NewNode(
simplified()->CheckBounds(FeedbackSource()), index,
simplified()->CheckBounds(VectorSlotPair()), index,
jsgraph()->Constant(Smi::kMaxValue), effect, control);
} else {
// Check that the {index} is in the valid range for the {receiver}.
index = effect =
graph()->NewNode(simplified()->CheckBounds(FeedbackSource()), index,
graph()->NewNode(simplified()->CheckBounds(VectorSlotPair()), index,
length, effect, control);
}
@ -2803,7 +2804,7 @@ JSNativeContextSpecialization::BuildElementAccess(
// truncating.
vtrue = etrue = graph()->NewNode(
simplified()->CheckFloat64Hole(
CheckFloat64HoleMode::kAllowReturnHole, FeedbackSource()),
CheckFloat64HoleMode::kAllowReturnHole, VectorSlotPair()),
vtrue, etrue, if_true);
}
}
@ -2852,7 +2853,7 @@ JSNativeContextSpecialization::BuildElementAccess(
mode = CheckFloat64HoleMode::kAllowReturnHole;
}
value = effect = graph()->NewNode(
simplified()->CheckFloat64Hole(mode, FeedbackSource()), value,
simplified()->CheckFloat64Hole(mode, VectorSlotPair()), value,
effect, control);
}
}
@ -2883,7 +2884,7 @@ JSNativeContextSpecialization::BuildElementAccess(
Node* etrue = effect;
Node* checked = etrue =
graph()->NewNode(simplified()->CheckBounds(FeedbackSource()), index,
graph()->NewNode(simplified()->CheckBounds(VectorSlotPair()), index,
length, etrue, if_true);
Node* element = etrue =
@ -2914,7 +2915,7 @@ JSNativeContextSpecialization::BuildElementAccess(
} else {
etrue = graph()->NewNode(
simplified()->CheckFloat64Hole(
CheckFloat64HoleMode::kNeverReturnHole, FeedbackSource()),
CheckFloat64HoleMode::kNeverReturnHole, VectorSlotPair()),
element, etrue, if_true);
}
@ -2934,10 +2935,10 @@ JSNativeContextSpecialization::BuildElementAccess(
if (IsSmiElementsKind(elements_kind)) {
value = effect = graph()->NewNode(
simplified()->CheckSmi(FeedbackSource()), value, effect, control);
simplified()->CheckSmi(VectorSlotPair()), value, effect, control);
} else if (IsDoubleElementsKind(elements_kind)) {
value = effect =
graph()->NewNode(simplified()->CheckNumber(FeedbackSource()), value,
graph()->NewNode(simplified()->CheckNumber(VectorSlotPair()), value,
effect, control);
// Make sure we do not store signalling NaNs into double arrays.
value = graph()->NewNode(simplified()->NumberSilenceNaN(), value);
@ -2972,7 +2973,7 @@ JSNativeContextSpecialization::BuildElementAccess(
: graph()->NewNode(simplified()->NumberAdd(), length,
jsgraph()->OneConstant());
index = effect =
graph()->NewNode(simplified()->CheckBounds(FeedbackSource()), index,
graph()->NewNode(simplified()->CheckBounds(VectorSlotPair()), index,
limit, effect, control);
// Grow {elements} backing store if necessary.
@ -2981,7 +2982,7 @@ JSNativeContextSpecialization::BuildElementAccess(
? GrowFastElementsMode::kDoubleElements
: GrowFastElementsMode::kSmiOrObjectElements;
elements = effect = graph()->NewNode(
simplified()->MaybeGrowFastElements(mode, FeedbackSource()),
simplified()->MaybeGrowFastElements(mode, VectorSlotPair()),
receiver, elements, index, elements_length, effect, control);
// If we didn't grow {elements}, it might still be COW, in which case we
@ -3041,7 +3042,7 @@ Node* JSNativeContextSpecialization::BuildIndexedStringLoad(
dependencies()->DependOnNoElementsProtector()) {
// Ensure that the {index} is a valid String length.
index = *effect = graph()->NewNode(
simplified()->CheckBounds(FeedbackSource()), index,
simplified()->CheckBounds(VectorSlotPair()), index,
jsgraph()->Constant(String::kMaxLength), *effect, *control);
// Load the single character string from {receiver} or yield
@ -3073,7 +3074,7 @@ Node* JSNativeContextSpecialization::BuildIndexedStringLoad(
} else {
// Ensure that {index} is less than {receiver} length.
index = *effect =
graph()->NewNode(simplified()->CheckBounds(FeedbackSource()), index,
graph()->NewNode(simplified()->CheckBounds(VectorSlotPair()), index,
length, *effect, *control);
Node* masked_index = graph()->NewNode(simplified()->PoisonIndex(), index);

View File

@ -9,6 +9,7 @@
#include "src/base/lazy-instance.h"
#include "src/compiler/opcodes.h"
#include "src/compiler/operator.h"
#include "src/compiler/vector-slot-pair.h"
#include "src/handles/handles-inl.h"
#include "src/objects/objects-inl.h"
@ -50,8 +51,7 @@ bool operator!=(ConstructParameters const& lhs,
}
size_t hash_value(ConstructParameters const& p) {
return base::hash_combine(p.arity(), p.frequency(),
FeedbackSource::Hash()(p.feedback()));
return base::hash_combine(p.arity(), p.frequency(), p.feedback());
}
std::ostream& operator<<(std::ostream& os, ConstructParameters const& p) {
@ -198,8 +198,7 @@ bool operator!=(StoreNamedOwnParameters const& lhs,
}
size_t hash_value(StoreNamedOwnParameters const& p) {
return base::hash_combine(p.name().location(),
FeedbackSource::Hash()(p.feedback()));
return base::hash_combine(p.name().location(), p.feedback());
}
std::ostream& operator<<(std::ostream& os, StoreNamedOwnParameters const& p) {
@ -220,7 +219,7 @@ bool operator!=(FeedbackParameter const& lhs, FeedbackParameter const& rhs) {
}
size_t hash_value(FeedbackParameter const& p) {
return FeedbackSource::Hash()(p.feedback());
return base::hash_combine(p.feedback());
}
std::ostream& operator<<(std::ostream& os, FeedbackParameter const& p) {
@ -249,7 +248,7 @@ bool operator!=(NamedAccess const& lhs, NamedAccess const& rhs) {
size_t hash_value(NamedAccess const& p) {
return base::hash_combine(p.name().location(), p.language_mode(),
FeedbackSource::Hash()(p.feedback()));
p.feedback());
}
@ -291,8 +290,7 @@ PropertyAccess const& PropertyAccessOf(const Operator* op) {
size_t hash_value(PropertyAccess const& p) {
return base::hash_combine(p.language_mode(),
FeedbackSource::Hash()(p.feedback()));
return base::hash_combine(p.language_mode(), p.feedback());
}
@ -342,7 +340,7 @@ bool operator!=(StoreGlobalParameters const& lhs,
size_t hash_value(StoreGlobalParameters const& p) {
return base::hash_combine(p.language_mode(), p.name().location(),
FeedbackSource::Hash()(p.feedback()));
p.feedback());
}
@ -521,8 +519,7 @@ bool operator!=(CreateLiteralParameters const& lhs,
size_t hash_value(CreateLiteralParameters const& p) {
return base::hash_combine(p.constant().location(),
FeedbackSource::Hash()(p.feedback()), p.length(),
return base::hash_combine(p.constant().location(), p.feedback(), p.length(),
p.flags());
}
@ -550,7 +547,7 @@ bool operator!=(CloneObjectParameters const& lhs,
}
size_t hash_value(CloneObjectParameters const& p) {
return base::hash_combine(FeedbackSource::Hash()(p.feedback()), p.flags());
return base::hash_combine(p.feedback(), p.flags());
}
std::ostream& operator<<(std::ostream& os, CloneObjectParameters const& p) {
@ -799,7 +796,7 @@ COMPARE_OP_LIST(COMPARE_OP)
#undef COMPARE_OP
const Operator* JSOperatorBuilder::StoreDataPropertyInLiteral(
const FeedbackSource& feedback) {
const VectorSlotPair& feedback) {
FeedbackParameter parameters(feedback);
return new (zone()) Operator1<FeedbackParameter>( // --
IrOpcode::kJSStoreDataPropertyInLiteral,
@ -810,7 +807,7 @@ const Operator* JSOperatorBuilder::StoreDataPropertyInLiteral(
}
const Operator* JSOperatorBuilder::StoreInArrayLiteral(
const FeedbackSource& feedback) {
const VectorSlotPair& feedback) {
FeedbackParameter parameters(feedback);
return new (zone()) Operator1<FeedbackParameter>( // --
IrOpcode::kJSStoreInArrayLiteral,
@ -832,7 +829,7 @@ const Operator* JSOperatorBuilder::CallForwardVarargs(size_t arity,
const Operator* JSOperatorBuilder::Call(size_t arity,
CallFrequency const& frequency,
FeedbackSource const& feedback,
VectorSlotPair const& feedback,
ConvertReceiverMode convert_mode,
SpeculationMode speculation_mode) {
DCHECK_IMPLIES(speculation_mode == SpeculationMode::kAllowSpeculation,
@ -857,7 +854,7 @@ const Operator* JSOperatorBuilder::CallWithArrayLike(
const Operator* JSOperatorBuilder::CallWithSpread(
uint32_t arity, CallFrequency const& frequency,
FeedbackSource const& feedback, SpeculationMode speculation_mode) {
VectorSlotPair const& feedback, SpeculationMode speculation_mode) {
DCHECK_IMPLIES(speculation_mode == SpeculationMode::kAllowSpeculation,
feedback.IsValid());
CallParameters parameters(arity, frequency, feedback,
@ -907,7 +904,7 @@ const Operator* JSOperatorBuilder::ConstructForwardVarargs(
// on AIX (v8:8193).
const Operator* JSOperatorBuilder::Construct(uint32_t arity,
CallFrequency const& frequency,
FeedbackSource const& feedback) {
VectorSlotPair const& feedback) {
ConstructParameters parameters(arity, frequency, feedback);
return new (zone()) Operator1<ConstructParameters>( // --
IrOpcode::kJSConstruct, Operator::kNoProperties, // opcode
@ -928,7 +925,7 @@ const Operator* JSOperatorBuilder::ConstructWithArrayLike(
const Operator* JSOperatorBuilder::ConstructWithSpread(
uint32_t arity, CallFrequency const& frequency,
FeedbackSource const& feedback) {
VectorSlotPair const& feedback) {
ConstructParameters parameters(arity, frequency, feedback);
return new (zone()) Operator1<ConstructParameters>( // --
IrOpcode::kJSConstructWithSpread, Operator::kNoProperties, // opcode
@ -938,7 +935,7 @@ const Operator* JSOperatorBuilder::ConstructWithSpread(
}
const Operator* JSOperatorBuilder::LoadNamed(Handle<Name> name,
const FeedbackSource& feedback) {
const VectorSlotPair& feedback) {
NamedAccess access(LanguageMode::kSloppy, name, feedback);
return new (zone()) Operator1<NamedAccess>( // --
IrOpcode::kJSLoadNamed, Operator::kNoProperties, // opcode
@ -948,7 +945,7 @@ const Operator* JSOperatorBuilder::LoadNamed(Handle<Name> name,
}
const Operator* JSOperatorBuilder::LoadProperty(
FeedbackSource const& feedback) {
VectorSlotPair const& feedback) {
PropertyAccess access(LanguageMode::kSloppy, feedback);
return new (zone()) Operator1<PropertyAccess>( // --
IrOpcode::kJSLoadProperty, Operator::kNoProperties, // opcode
@ -957,7 +954,7 @@ const Operator* JSOperatorBuilder::LoadProperty(
access); // parameter
}
const Operator* JSOperatorBuilder::GetIterator(FeedbackSource const& feedback) {
const Operator* JSOperatorBuilder::GetIterator(VectorSlotPair const& feedback) {
PropertyAccess access(LanguageMode::kSloppy, feedback);
return new (zone()) Operator1<PropertyAccess>( // --
IrOpcode::kJSGetIterator, Operator::kNoProperties, // opcode
@ -966,7 +963,7 @@ const Operator* JSOperatorBuilder::GetIterator(FeedbackSource const& feedback) {
access); // parameter
}
const Operator* JSOperatorBuilder::HasProperty(FeedbackSource const& feedback) {
const Operator* JSOperatorBuilder::HasProperty(VectorSlotPair const& feedback) {
PropertyAccess access(LanguageMode::kSloppy, feedback);
return new (zone()) Operator1<PropertyAccess>( // --
IrOpcode::kJSHasProperty, Operator::kNoProperties, // opcode
@ -975,7 +972,7 @@ const Operator* JSOperatorBuilder::HasProperty(FeedbackSource const& feedback) {
access); // parameter
}
const Operator* JSOperatorBuilder::InstanceOf(FeedbackSource const& feedback) {
const Operator* JSOperatorBuilder::InstanceOf(VectorSlotPair const& feedback) {
FeedbackParameter parameter(feedback);
return new (zone()) Operator1<FeedbackParameter>( // --
IrOpcode::kJSInstanceOf, Operator::kNoProperties, // opcode
@ -1034,7 +1031,7 @@ int RestoreRegisterIndexOf(const Operator* op) {
const Operator* JSOperatorBuilder::StoreNamed(LanguageMode language_mode,
Handle<Name> name,
FeedbackSource const& feedback) {
VectorSlotPair const& feedback) {
NamedAccess access(language_mode, name, feedback);
return new (zone()) Operator1<NamedAccess>( // --
IrOpcode::kJSStoreNamed, Operator::kNoProperties, // opcode
@ -1043,8 +1040,9 @@ const Operator* JSOperatorBuilder::StoreNamed(LanguageMode language_mode,
access); // parameter
}
const Operator* JSOperatorBuilder::StoreProperty(
LanguageMode language_mode, FeedbackSource const& feedback) {
LanguageMode language_mode, VectorSlotPair const& feedback) {
PropertyAccess access(language_mode, feedback);
return new (zone()) Operator1<PropertyAccess>( // --
IrOpcode::kJSStoreProperty, Operator::kNoProperties, // opcode
@ -1054,7 +1052,7 @@ const Operator* JSOperatorBuilder::StoreProperty(
}
const Operator* JSOperatorBuilder::StoreNamedOwn(
Handle<Name> name, FeedbackSource const& feedback) {
Handle<Name> name, VectorSlotPair const& feedback) {
StoreNamedOwnParameters parameters(name, feedback);
return new (zone()) Operator1<StoreNamedOwnParameters>( // --
IrOpcode::kJSStoreNamedOwn, Operator::kNoProperties, // opcode
@ -1078,7 +1076,7 @@ const Operator* JSOperatorBuilder::CreateGeneratorObject() {
}
const Operator* JSOperatorBuilder::LoadGlobal(const Handle<Name>& name,
const FeedbackSource& feedback,
const VectorSlotPair& feedback,
TypeofMode typeof_mode) {
LoadGlobalParameters parameters(name, feedback, typeof_mode);
return new (zone()) Operator1<LoadGlobalParameters>( // --
@ -1088,9 +1086,10 @@ const Operator* JSOperatorBuilder::LoadGlobal(const Handle<Name>& name,
parameters); // parameter
}
const Operator* JSOperatorBuilder::StoreGlobal(LanguageMode language_mode,
const Handle<Name>& name,
const FeedbackSource& feedback) {
const VectorSlotPair& feedback) {
StoreGlobalParameters parameters(language_mode, feedback, name);
return new (zone()) Operator1<StoreGlobalParameters>( // --
IrOpcode::kJSStoreGlobal, Operator::kNoProperties, // opcode
@ -1099,6 +1098,7 @@ const Operator* JSOperatorBuilder::StoreGlobal(LanguageMode language_mode,
parameters); // parameter
}
const Operator* JSOperatorBuilder::LoadContext(size_t depth, size_t index,
bool immutable) {
ContextAccess access(depth, index, immutable);
@ -1213,7 +1213,7 @@ const Operator* JSOperatorBuilder::CreateClosure(
const Operator* JSOperatorBuilder::CreateLiteralArray(
Handle<ArrayBoilerplateDescription> description,
FeedbackSource const& feedback, int literal_flags, int number_of_elements) {
VectorSlotPair const& feedback, int literal_flags, int number_of_elements) {
CreateLiteralParameters parameters(description, feedback, number_of_elements,
literal_flags);
return new (zone()) Operator1<CreateLiteralParameters>( // --
@ -1225,7 +1225,7 @@ const Operator* JSOperatorBuilder::CreateLiteralArray(
}
const Operator* JSOperatorBuilder::CreateEmptyLiteralArray(
FeedbackSource const& feedback) {
VectorSlotPair const& feedback) {
FeedbackParameter parameters(feedback);
return new (zone()) Operator1<FeedbackParameter>( // --
IrOpcode::kJSCreateEmptyLiteralArray, // opcode
@ -1245,7 +1245,7 @@ const Operator* JSOperatorBuilder::CreateArrayFromIterable() {
const Operator* JSOperatorBuilder::CreateLiteralObject(
Handle<ObjectBoilerplateDescription> constant_properties,
FeedbackSource const& feedback, int literal_flags,
VectorSlotPair const& feedback, int literal_flags,
int number_of_properties) {
CreateLiteralParameters parameters(constant_properties, feedback,
number_of_properties, literal_flags);
@ -1257,7 +1257,7 @@ const Operator* JSOperatorBuilder::CreateLiteralObject(
parameters); // parameter
}
const Operator* JSOperatorBuilder::CloneObject(FeedbackSource const& feedback,
const Operator* JSOperatorBuilder::CloneObject(VectorSlotPair const& feedback,
int literal_flags) {
CloneObjectParameters parameters(feedback, literal_flags);
return new (zone()) Operator1<CloneObjectParameters>( // --
@ -1277,7 +1277,7 @@ const Operator* JSOperatorBuilder::CreateEmptyLiteralObject() {
}
const Operator* JSOperatorBuilder::CreateLiteralRegExp(
Handle<String> constant_pattern, FeedbackSource const& feedback,
Handle<String> constant_pattern, VectorSlotPair const& feedback,
int literal_flags) {
CreateLiteralParameters parameters(constant_pattern, feedback, -1,
literal_flags);

View File

@ -7,7 +7,7 @@
#include "src/base/compiler-specific.h"
#include "src/common/globals.h"
#include "src/compiler/feedback-source.h"
#include "src/compiler/vector-slot-pair.h"
#include "src/handles/maybe-handles.h"
#include "src/objects/type-hints.h"
#include "src/runtime/runtime.h"
@ -102,17 +102,17 @@ ConstructForwardVarargsParameters const& ConstructForwardVarargsParametersOf(
class ConstructParameters final {
public:
ConstructParameters(uint32_t arity, CallFrequency const& frequency,
FeedbackSource const& feedback)
VectorSlotPair const& feedback)
: arity_(arity), frequency_(frequency), feedback_(feedback) {}
uint32_t arity() const { return arity_; }
CallFrequency const& frequency() const { return frequency_; }
FeedbackSource const& feedback() const { return feedback_; }
VectorSlotPair const& feedback() const { return feedback_; }
private:
uint32_t const arity_;
CallFrequency const frequency_;
FeedbackSource const feedback_;
VectorSlotPair const feedback_;
};
bool operator==(ConstructParameters const&, ConstructParameters const&);
@ -163,7 +163,7 @@ CallForwardVarargsParameters const& CallForwardVarargsParametersOf(
class CallParameters final {
public:
CallParameters(size_t arity, CallFrequency const& frequency,
FeedbackSource const& feedback,
VectorSlotPair const& feedback,
ConvertReceiverMode convert_mode,
SpeculationMode speculation_mode)
: bit_field_(ArityField::encode(arity) |
@ -177,7 +177,7 @@ class CallParameters final {
ConvertReceiverMode convert_mode() const {
return ConvertReceiverModeField::decode(bit_field_);
}
FeedbackSource const& feedback() const { return feedback_; }
VectorSlotPair const& feedback() const { return feedback_; }
SpeculationMode speculation_mode() const {
return SpeculationModeField::decode(bit_field_);
@ -192,9 +192,7 @@ class CallParameters final {
private:
friend size_t hash_value(CallParameters const& p) {
FeedbackSource::Hash feedback_hash;
return base::hash_combine(p.bit_field_, p.frequency_,
feedback_hash(p.feedback_));
return base::hash_combine(p.bit_field_, p.frequency_, p.feedback_);
}
using ArityField = BitField<size_t, 0, 28>;
@ -203,7 +201,7 @@ class CallParameters final {
uint32_t const bit_field_;
CallFrequency const frequency_;
FeedbackSource const feedback_;
VectorSlotPair const feedback_;
};
size_t hash_value(CallParameters const&);
@ -299,15 +297,15 @@ CreateFunctionContextParameters const& CreateFunctionContextParametersOf(
// Defines parameters for JSStoreNamedOwn operator.
class StoreNamedOwnParameters final {
public:
StoreNamedOwnParameters(Handle<Name> name, FeedbackSource const& feedback)
StoreNamedOwnParameters(Handle<Name> name, VectorSlotPair const& feedback)
: name_(name), feedback_(feedback) {}
Handle<Name> name() const { return name_; }
FeedbackSource const& feedback() const { return feedback_; }
VectorSlotPair const& feedback() const { return feedback_; }
private:
Handle<Name> const name_;
FeedbackSource const feedback_;
VectorSlotPair const feedback_;
};
bool operator==(StoreNamedOwnParameters const&, StoreNamedOwnParameters const&);
@ -324,13 +322,13 @@ const StoreNamedOwnParameters& StoreNamedOwnParametersOf(const Operator* op);
// and JSStoreDataPropertyInLiteral operators.
class FeedbackParameter final {
public:
explicit FeedbackParameter(FeedbackSource const& feedback)
explicit FeedbackParameter(VectorSlotPair const& feedback)
: feedback_(feedback) {}
FeedbackSource const& feedback() const { return feedback_; }
VectorSlotPair const& feedback() const { return feedback_; }
private:
FeedbackSource const feedback_;
VectorSlotPair const feedback_;
};
bool operator==(FeedbackParameter const&, FeedbackParameter const&);
@ -347,16 +345,16 @@ const FeedbackParameter& FeedbackParameterOf(const Operator* op);
class NamedAccess final {
public:
NamedAccess(LanguageMode language_mode, Handle<Name> name,
FeedbackSource const& feedback)
VectorSlotPair const& feedback)
: name_(name), feedback_(feedback), language_mode_(language_mode) {}
Handle<Name> name() const { return name_; }
LanguageMode language_mode() const { return language_mode_; }
FeedbackSource const& feedback() const { return feedback_; }
VectorSlotPair const& feedback() const { return feedback_; }
private:
Handle<Name> const name_;
FeedbackSource const feedback_;
VectorSlotPair const feedback_;
LanguageMode const language_mode_;
};
@ -374,18 +372,18 @@ const NamedAccess& NamedAccessOf(const Operator* op);
// used as a parameter by JSLoadGlobal operator.
class LoadGlobalParameters final {
public:
LoadGlobalParameters(const Handle<Name>& name, const FeedbackSource& feedback,
LoadGlobalParameters(const Handle<Name>& name, const VectorSlotPair& feedback,
TypeofMode typeof_mode)
: name_(name), feedback_(feedback), typeof_mode_(typeof_mode) {}
const Handle<Name>& name() const { return name_; }
TypeofMode typeof_mode() const { return typeof_mode_; }
const FeedbackSource& feedback() const { return feedback_; }
const VectorSlotPair& feedback() const { return feedback_; }
private:
const Handle<Name> name_;
const FeedbackSource feedback_;
const VectorSlotPair feedback_;
const TypeofMode typeof_mode_;
};
@ -404,18 +402,18 @@ const LoadGlobalParameters& LoadGlobalParametersOf(const Operator* op);
class StoreGlobalParameters final {
public:
StoreGlobalParameters(LanguageMode language_mode,
const FeedbackSource& feedback,
const VectorSlotPair& feedback,
const Handle<Name>& name)
: language_mode_(language_mode), name_(name), feedback_(feedback) {}
LanguageMode language_mode() const { return language_mode_; }
const FeedbackSource& feedback() const { return feedback_; }
const VectorSlotPair& feedback() const { return feedback_; }
const Handle<Name>& name() const { return name_; }
private:
const LanguageMode language_mode_;
const Handle<Name> name_;
const FeedbackSource feedback_;
const VectorSlotPair feedback_;
};
bool operator==(StoreGlobalParameters const&, StoreGlobalParameters const&);
@ -432,14 +430,14 @@ const StoreGlobalParameters& StoreGlobalParametersOf(const Operator* op);
// as a parameter by the JSLoadProperty and JSStoreProperty operators.
class PropertyAccess final {
public:
PropertyAccess(LanguageMode language_mode, FeedbackSource const& feedback)
PropertyAccess(LanguageMode language_mode, VectorSlotPair const& feedback)
: feedback_(feedback), language_mode_(language_mode) {}
LanguageMode language_mode() const { return language_mode_; }
FeedbackSource const& feedback() const { return feedback_; }
VectorSlotPair const& feedback() const { return feedback_; }
private:
FeedbackSource const feedback_;
VectorSlotPair const feedback_;
LanguageMode const language_mode_;
};
@ -604,20 +602,20 @@ const CreateClosureParameters& CreateClosureParametersOf(const Operator* op);
class CreateLiteralParameters final {
public:
CreateLiteralParameters(Handle<HeapObject> constant,
FeedbackSource const& feedback, int length, int flags)
VectorSlotPair const& feedback, int length, int flags)
: constant_(constant),
feedback_(feedback),
length_(length),
flags_(flags) {}
Handle<HeapObject> constant() const { return constant_; }
FeedbackSource const& feedback() const { return feedback_; }
VectorSlotPair const& feedback() const { return feedback_; }
int length() const { return length_; }
int flags() const { return flags_; }
private:
Handle<HeapObject> const constant_;
FeedbackSource const feedback_;
VectorSlotPair const feedback_;
int const length_;
int const flags_;
};
@ -633,14 +631,14 @@ const CreateLiteralParameters& CreateLiteralParametersOf(const Operator* op);
class CloneObjectParameters final {
public:
CloneObjectParameters(FeedbackSource const& feedback, int flags)
CloneObjectParameters(VectorSlotPair const& feedback, int flags)
: feedback_(feedback), flags_(flags) {}
FeedbackSource const& feedback() const { return feedback_; }
VectorSlotPair const& feedback() const { return feedback_; }
int flags() const { return flags_; }
private:
FeedbackSource const feedback_;
VectorSlotPair const feedback_;
int const flags_;
};
@ -737,32 +735,32 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final
const Operator* CreateTypedArray();
const Operator* CreateLiteralArray(
Handle<ArrayBoilerplateDescription> constant,
FeedbackSource const& feedback, int literal_flags,
VectorSlotPair const& feedback, int literal_flags,
int number_of_elements);
const Operator* CreateEmptyLiteralArray(FeedbackSource const& feedback);
const Operator* CreateEmptyLiteralArray(VectorSlotPair const& feedback);
const Operator* CreateArrayFromIterable();
const Operator* CreateEmptyLiteralObject();
const Operator* CreateLiteralObject(
Handle<ObjectBoilerplateDescription> constant,
FeedbackSource const& feedback, int literal_flags,
VectorSlotPair const& feedback, int literal_flags,
int number_of_properties);
const Operator* CloneObject(FeedbackSource const& feedback,
const Operator* CloneObject(VectorSlotPair const& feedback,
int literal_flags);
const Operator* CreateLiteralRegExp(Handle<String> constant_pattern,
FeedbackSource const& feedback,
VectorSlotPair const& feedback,
int literal_flags);
const Operator* CallForwardVarargs(size_t arity, uint32_t start_index);
const Operator* Call(
size_t arity, CallFrequency const& frequency = CallFrequency(),
FeedbackSource const& feedback = FeedbackSource(),
VectorSlotPair const& feedback = VectorSlotPair(),
ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny,
SpeculationMode speculation_mode = SpeculationMode::kDisallowSpeculation);
const Operator* CallWithArrayLike(CallFrequency const& frequency);
const Operator* CallWithSpread(
uint32_t arity, CallFrequency const& frequency = CallFrequency(),
FeedbackSource const& feedback = FeedbackSource(),
VectorSlotPair const& feedback = VectorSlotPair(),
SpeculationMode speculation_mode = SpeculationMode::kDisallowSpeculation);
const Operator* CallRuntime(Runtime::FunctionId id);
const Operator* CallRuntime(Runtime::FunctionId id, size_t arity);
@ -771,39 +769,39 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final
const Operator* ConstructForwardVarargs(size_t arity, uint32_t start_index);
const Operator* Construct(uint32_t arity,
CallFrequency const& frequency = CallFrequency(),
FeedbackSource const& feedback = FeedbackSource());
VectorSlotPair const& feedback = VectorSlotPair());
const Operator* ConstructWithArrayLike(CallFrequency const& frequency);
const Operator* ConstructWithSpread(
uint32_t arity, CallFrequency const& frequency = CallFrequency(),
FeedbackSource const& feedback = FeedbackSource());
VectorSlotPair const& feedback = VectorSlotPair());
const Operator* LoadProperty(FeedbackSource const& feedback);
const Operator* LoadNamed(Handle<Name> name, FeedbackSource const& feedback);
const Operator* LoadProperty(VectorSlotPair const& feedback);
const Operator* LoadNamed(Handle<Name> name, VectorSlotPair const& feedback);
const Operator* StoreProperty(LanguageMode language_mode,
FeedbackSource const& feedback);
VectorSlotPair const& feedback);
const Operator* StoreNamed(LanguageMode language_mode, Handle<Name> name,
FeedbackSource const& feedback);
VectorSlotPair const& feedback);
const Operator* StoreNamedOwn(Handle<Name> name,
FeedbackSource const& feedback);
const Operator* StoreDataPropertyInLiteral(const FeedbackSource& feedback);
const Operator* StoreInArrayLiteral(const FeedbackSource& feedback);
VectorSlotPair const& feedback);
const Operator* StoreDataPropertyInLiteral(const VectorSlotPair& feedback);
const Operator* StoreInArrayLiteral(const VectorSlotPair& feedback);
const Operator* DeleteProperty();
const Operator* HasProperty(FeedbackSource const& feedback);
const Operator* HasProperty(VectorSlotPair const& feedback);
const Operator* GetSuperConstructor();
const Operator* CreateGeneratorObject();
const Operator* LoadGlobal(const Handle<Name>& name,
const FeedbackSource& feedback,
const VectorSlotPair& feedback,
TypeofMode typeof_mode = NOT_INSIDE_TYPEOF);
const Operator* StoreGlobal(LanguageMode language_mode,
const Handle<Name>& name,
const FeedbackSource& feedback);
const VectorSlotPair& feedback);
const Operator* LoadContext(size_t depth, size_t index, bool immutable);
const Operator* StoreContext(size_t depth, size_t index);
@ -812,7 +810,7 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final
const Operator* StoreModule(int32_t cell_index);
const Operator* HasInPrototypeChain();
const Operator* InstanceOf(const FeedbackSource& feedback);
const Operator* InstanceOf(const VectorSlotPair& feedback);
const Operator* OrdinaryHasInstance();
const Operator* AsyncFunctionEnter();
@ -856,7 +854,7 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final
const Operator* ParseInt();
const Operator* RegExpTest();
const Operator* GetIterator(FeedbackSource const& feedback);
const Operator* GetIterator(VectorSlotPair const& feedback);
private:
Zone* zone() const { return zone_; }

View File

@ -449,7 +449,7 @@ JSTypeHintLowering::LoweringResult JSTypeHintLowering::ReduceToNumberOperation(
if (BinaryOperationHintToNumberOperationHint(GetBinaryOperationHint(slot),
&hint)) {
Node* node = jsgraph()->graph()->NewNode(
jsgraph()->simplified()->SpeculativeToNumber(hint, FeedbackSource()),
jsgraph()->simplified()->SpeculativeToNumber(hint, VectorSlotPair()),
input, effect, control);
return LoweringResult::SideEffectFree(node, node, control);
}
@ -549,7 +549,7 @@ Node* JSTypeHintLowering::TryBuildSoftDeopt(FeedbackSlot slot, Node* effect,
Node* deoptimize = jsgraph()->graph()->NewNode(
jsgraph()->common()->Deoptimize(DeoptimizeKind::kSoft, reason,
FeedbackSource()),
VectorSlotPair()),
jsgraph()->Dead(), effect, control);
Node* frame_state =
NodeProperties::FindFrameStateBefore(deoptimize, jsgraph()->Dead());

View File

@ -200,14 +200,14 @@ class JSBinopReduction final {
void CheckInputsToString() {
if (!left_type().Is(Type::String())) {
Node* left_input =
graph()->NewNode(simplified()->CheckString(FeedbackSource()), left(),
graph()->NewNode(simplified()->CheckString(VectorSlotPair()), left(),
effect(), control());
node_->ReplaceInput(0, left_input);
update_effect(left_input);
}
if (!right_type().Is(Type::String())) {
Node* right_input =
graph()->NewNode(simplified()->CheckString(FeedbackSource()), right(),
graph()->NewNode(simplified()->CheckString(VectorSlotPair()), right(),
effect(), control());
node_->ReplaceInput(1, right_input);
update_effect(right_input);
@ -576,7 +576,7 @@ Reduction JSTypedLowering::ReduceJSAdd(Node* node) {
// and thus potentially reduces the number of live ranges and allows for
// more truncations.
length = effect = graph()->NewNode(
simplified()->CheckBounds(FeedbackSource()), length,
simplified()->CheckBounds(VectorSlotPair()), length,
jsgraph()->Constant(String::kMaxLength + 1), effect, control);
} else {
// Check if we would overflow the allowed maximum string length.

View File

@ -5,9 +5,9 @@
#include "src/compiler/map-inference.h"
#include "src/compiler/compilation-dependencies.h"
#include "src/compiler/feedback-source.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/simplified-operator.h"
#include "src/compiler/vector-slot-pair.h"
#include "src/objects/map-inl.h"
#include "src/zone/zone-handle-set.h"
@ -93,7 +93,7 @@ MapHandles const& MapInference::GetMaps() {
void MapInference::InsertMapChecks(JSGraph* jsgraph, Node** effect,
Node* control,
const FeedbackSource& feedback) {
const VectorSlotPair& feedback) {
CHECK(HaveMaps());
CHECK(feedback.IsValid());
ZoneHandleSet<Map> maps;
@ -112,7 +112,7 @@ bool MapInference::RelyOnMapsViaStability(
bool MapInference::RelyOnMapsPreferStability(
CompilationDependencies* dependencies, JSGraph* jsgraph, Node** effect,
Node* control, const FeedbackSource& feedback) {
Node* control, const VectorSlotPair& feedback) {
CHECK(HaveMaps());
if (Safe()) return false;
if (RelyOnMapsViaStability(dependencies)) return true;
@ -123,7 +123,7 @@ bool MapInference::RelyOnMapsPreferStability(
bool MapInference::RelyOnMapsHelper(CompilationDependencies* dependencies,
JSGraph* jsgraph, Node** effect,
Node* control,
const FeedbackSource& feedback) {
const VectorSlotPair& feedback) {
if (Safe()) return true;
auto is_stable = [this](Handle<Map> map) {

View File

@ -13,11 +13,11 @@
namespace v8 {
namespace internal {
class VectorSlotPair;
namespace compiler {
class CompilationDependencies;
struct FeedbackSource;
class JSGraph;
class JSHeapBroker;
class Node;
@ -67,10 +67,10 @@ class MapInference {
// dependencies were taken.
bool RelyOnMapsPreferStability(CompilationDependencies* dependencies,
JSGraph* jsgraph, Node** effect, Node* control,
const FeedbackSource& feedback);
const VectorSlotPair& feedback);
// Inserts map checks even if maps were already reliable.
void InsertMapChecks(JSGraph* jsgraph, Node** effect, Node* control,
const FeedbackSource& feedback);
const VectorSlotPair& feedback);
// Internally marks the maps as reliable (thus bypassing the safety check) and
// returns the NoChange reduction. USE THIS ONLY WHEN RETURNING, e.g.:
@ -98,7 +98,7 @@ class MapInference {
std::function<bool(InstanceType)> f) const;
V8_WARN_UNUSED_RESULT bool RelyOnMapsHelper(
CompilationDependencies* dependencies, JSGraph* jsgraph, Node** effect,
Node* control, const FeedbackSource& feedback);
Node* control, const VectorSlotPair& feedback);
};
} // namespace compiler

View File

@ -35,7 +35,6 @@ class ProcessedFeedback : public ZoneObject {
};
Kind kind() const { return kind_; }
FeedbackSlotKind slot_kind() const { return slot_kind_; }
bool IsInsufficient() const { return kind() == kInsufficient; }
BinaryOperationFeedback const& AsBinaryOperation() const;
@ -48,24 +47,23 @@ class ProcessedFeedback : public ZoneObject {
NamedAccessFeedback const& AsNamedAccess() const;
protected:
ProcessedFeedback(Kind kind, FeedbackSlotKind slot_kind);
explicit ProcessedFeedback(Kind kind) : kind_(kind) {}
private:
Kind const kind_;
FeedbackSlotKind const slot_kind_;
};
class InsufficientFeedback final : public ProcessedFeedback {
public:
explicit InsufficientFeedback(FeedbackSlotKind slot_kind);
InsufficientFeedback();
};
class GlobalAccessFeedback : public ProcessedFeedback {
public:
GlobalAccessFeedback(PropertyCellRef cell, FeedbackSlotKind slot_kind);
explicit GlobalAccessFeedback(PropertyCellRef cell);
GlobalAccessFeedback(ContextRef script_context, int slot_index,
bool immutable, FeedbackSlotKind slot_kind);
explicit GlobalAccessFeedback(FeedbackSlotKind slot_kind); // Megamorphic
bool immutable);
GlobalAccessFeedback(); // Megamorphic
bool IsMegamorphic() const;
@ -109,8 +107,7 @@ class KeyedAccessMode {
class ElementAccessFeedback : public ProcessedFeedback {
public:
ElementAccessFeedback(Zone* zone, KeyedAccessMode const& keyed_mode,
FeedbackSlotKind slot_kind);
ElementAccessFeedback(Zone* zone, KeyedAccessMode const& keyed_mode);
KeyedAccessMode keyed_mode() const;
@ -148,8 +145,7 @@ class ElementAccessFeedback : public ProcessedFeedback {
class NamedAccessFeedback : public ProcessedFeedback {
public:
NamedAccessFeedback(NameRef const& name, ZoneVector<Handle<Map>> const& maps,
FeedbackSlotKind slot_kind);
NamedAccessFeedback(NameRef const& name, ZoneVector<Handle<Map>> const& maps);
NameRef const& name() const { return name_; }
ZoneVector<Handle<Map>> const& maps() const { return maps_; }
@ -162,8 +158,8 @@ class NamedAccessFeedback : public ProcessedFeedback {
class CallFeedback : public ProcessedFeedback {
public:
CallFeedback(base::Optional<HeapObjectRef> target, float frequency,
SpeculationMode mode, FeedbackSlotKind slot_kind)
: ProcessedFeedback(kCall, slot_kind),
SpeculationMode mode)
: ProcessedFeedback(kCall),
target_(target),
frequency_(frequency),
mode_(mode) {}
@ -181,14 +177,7 @@ class CallFeedback : public ProcessedFeedback {
template <class T, ProcessedFeedback::Kind K>
class SingleValueFeedback : public ProcessedFeedback {
public:
explicit SingleValueFeedback(T value, FeedbackSlotKind slot_kind)
: ProcessedFeedback(K, slot_kind), value_(value) {
DCHECK(
(K == kBinaryOperation && slot_kind == FeedbackSlotKind::kBinaryOp) ||
(K == kCompareOperation && slot_kind == FeedbackSlotKind::kCompareOp) ||
(K == kForIn && slot_kind == FeedbackSlotKind::kForIn) ||
(K == kInstanceOf && slot_kind == FeedbackSlotKind::kInstanceOf));
}
explicit SingleValueFeedback(T value) : ProcessedFeedback(K), value_(value) {}
T value() const { return value_; }

View File

@ -61,7 +61,7 @@ bool PropertyAccessBuilder::TryBuildStringCheck(
// Monormorphic string access (ignoring the fact that there are multiple
// String maps).
*receiver = *effect =
graph()->NewNode(simplified()->CheckString(FeedbackSource()), *receiver,
graph()->NewNode(simplified()->CheckString(VectorSlotPair()), *receiver,
*effect, control);
return true;
}
@ -74,7 +74,7 @@ bool PropertyAccessBuilder::TryBuildNumberCheck(
if (HasOnlyNumberMaps(broker, maps)) {
// Monomorphic number access (we also deal with Smis here).
*receiver = *effect =
graph()->NewNode(simplified()->CheckNumber(FeedbackSource()), *receiver,
graph()->NewNode(simplified()->CheckNumber(VectorSlotPair()), *receiver,
*effect, control);
return true;
}

View File

@ -1778,7 +1778,7 @@ Node* RepresentationChanger::InsertChangeCompressedToTagged(Node* node) {
}
Node* RepresentationChanger::InsertCheckedFloat64ToInt32(
Node* node, CheckForMinusZeroMode check, const FeedbackSource& feedback,
Node* node, CheckForMinusZeroMode check, const VectorSlotPair& feedback,
Node* use_node) {
return InsertConversion(
node, simplified()->CheckedFloat64ToInt32(check, feedback), use_node);

View File

@ -5,7 +5,6 @@
#ifndef V8_COMPILER_REPRESENTATION_CHANGE_H_
#define V8_COMPILER_REPRESENTATION_CHANGE_H_
#include "src/compiler/feedback-source.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/simplified-operator.h"
@ -166,7 +165,7 @@ class UseInfo {
public:
UseInfo(MachineRepresentation representation, Truncation truncation,
TypeCheckKind type_check = TypeCheckKind::kNone,
const FeedbackSource& feedback = FeedbackSource())
const VectorSlotPair& feedback = VectorSlotPair())
: representation_(representation),
truncation_(truncation),
type_check_(type_check),
@ -177,7 +176,7 @@ class UseInfo {
static UseInfo TruncatingWord64() {
return UseInfo(MachineRepresentation::kWord64, Truncation::Word64());
}
static UseInfo CheckedBigIntTruncatingWord64(const FeedbackSource& feedback) {
static UseInfo CheckedBigIntTruncatingWord64(const VectorSlotPair& feedback) {
return UseInfo(MachineRepresentation::kWord64, Truncation::Word64(),
TypeCheckKind::kBigInt, feedback);
}
@ -220,59 +219,59 @@ class UseInfo {
// Possibly deoptimizing conversions.
static UseInfo CheckedHeapObjectAsTaggedPointer(
const FeedbackSource& feedback) {
const VectorSlotPair& feedback) {
return UseInfo(MachineRepresentation::kTaggedPointer, Truncation::Any(),
TypeCheckKind::kHeapObject, feedback);
}
static UseInfo CheckedBigIntAsTaggedPointer(const FeedbackSource& feedback) {
static UseInfo CheckedBigIntAsTaggedPointer(const VectorSlotPair& feedback) {
return UseInfo(MachineRepresentation::kTaggedPointer, Truncation::Any(),
TypeCheckKind::kBigInt, feedback);
}
static UseInfo CheckedSignedSmallAsTaggedSigned(
const FeedbackSource& feedback,
const VectorSlotPair& feedback,
IdentifyZeros identify_zeros = kDistinguishZeros) {
return UseInfo(MachineRepresentation::kTaggedSigned,
Truncation::Any(identify_zeros), TypeCheckKind::kSignedSmall,
feedback);
}
static UseInfo CheckedSignedSmallAsWord32(IdentifyZeros identify_zeros,
const FeedbackSource& feedback) {
const VectorSlotPair& feedback) {
return UseInfo(MachineRepresentation::kWord32,
Truncation::Any(identify_zeros), TypeCheckKind::kSignedSmall,
feedback);
}
static UseInfo CheckedSigned32AsWord32(IdentifyZeros identify_zeros,
const FeedbackSource& feedback) {
const VectorSlotPair& feedback) {
return UseInfo(MachineRepresentation::kWord32,
Truncation::Any(identify_zeros), TypeCheckKind::kSigned32,
feedback);
}
static UseInfo CheckedSigned64AsWord64(IdentifyZeros identify_zeros,
const FeedbackSource& feedback) {
const VectorSlotPair& feedback) {
return UseInfo(MachineRepresentation::kWord64,
Truncation::Any(identify_zeros), TypeCheckKind::kSigned64,
feedback);
}
static UseInfo CheckedNumberAsFloat64(IdentifyZeros identify_zeros,
const FeedbackSource& feedback) {
const VectorSlotPair& feedback) {
return UseInfo(MachineRepresentation::kFloat64,
Truncation::Any(identify_zeros), TypeCheckKind::kNumber,
feedback);
}
static UseInfo CheckedNumberAsWord32(const FeedbackSource& feedback) {
static UseInfo CheckedNumberAsWord32(const VectorSlotPair& feedback) {
return UseInfo(MachineRepresentation::kWord32, Truncation::Word32(),
TypeCheckKind::kNumber, feedback);
}
static UseInfo CheckedNumberOrOddballAsFloat64(
IdentifyZeros identify_zeros, const FeedbackSource& feedback) {
IdentifyZeros identify_zeros, const VectorSlotPair& feedback) {
return UseInfo(MachineRepresentation::kFloat64,
Truncation::Any(identify_zeros),
TypeCheckKind::kNumberOrOddball, feedback);
}
static UseInfo CheckedNumberOrOddballAsWord32(
const FeedbackSource& feedback) {
const VectorSlotPair& feedback) {
return UseInfo(MachineRepresentation::kWord32, Truncation::Word32(),
TypeCheckKind::kNumberOrOddball, feedback);
}
@ -298,13 +297,13 @@ class UseInfo {
? CheckForMinusZeroMode::kDontCheckForMinusZero
: CheckForMinusZeroMode::kCheckForMinusZero;
}
const FeedbackSource& feedback() const { return feedback_; }
const VectorSlotPair& feedback() const { return feedback_; }
private:
MachineRepresentation representation_;
Truncation truncation_;
TypeCheckKind type_check_;
FeedbackSource feedback_;
VectorSlotPair feedback_;
};
// Contains logic related to changing the representation of values for constants
@ -400,7 +399,7 @@ class V8_EXPORT_PRIVATE RepresentationChanger final {
Node* InsertChangeCompressedSignedToTaggedSigned(Node* node);
Node* InsertChangeCompressedToTagged(Node* node);
Node* InsertCheckedFloat64ToInt32(Node* node, CheckForMinusZeroMode check,
const FeedbackSource& feedback,
const VectorSlotPair& feedback,
Node* use_node);
Node* InsertConversion(Node* node, const Operator* op, Node* use_node);
Node* InsertTruncateInt64ToInt32(Node* node);

View File

@ -11,6 +11,7 @@
#include "src/compiler/bytecode-analysis.h"
#include "src/compiler/compilation-dependencies.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/vector-slot-pair.h"
#include "src/handles/handles-inl.h"
#include "src/ic/call-optimization.h"
#include "src/interpreter/bytecode-array-iterator.h"

View File

@ -92,7 +92,7 @@ MachineRepresentation MachineRepresentationFromArrayType(
}
UseInfo CheckedUseInfoAsWord32FromHint(
NumberOperationHint hint, const FeedbackSource& feedback = FeedbackSource(),
NumberOperationHint hint, const VectorSlotPair& feedback = VectorSlotPair(),
IdentifyZeros identify_zeros = kDistinguishZeros) {
switch (hint) {
case NumberOperationHint::kSignedSmall:
@ -109,7 +109,7 @@ UseInfo CheckedUseInfoAsWord32FromHint(
}
UseInfo CheckedUseInfoAsFloat64FromHint(
NumberOperationHint hint, const FeedbackSource& feedback,
NumberOperationHint hint, const VectorSlotPair& feedback,
IdentifyZeros identify_zeros = kDistinguishZeros) {
switch (hint) {
case NumberOperationHint::kSignedSmall:
@ -1092,7 +1092,7 @@ class RepresentationSelector {
if (lower()) DeferReplacement(node, node->InputAt(0));
} else {
VisitUnop(node,
UseInfo::CheckedHeapObjectAsTaggedPointer(FeedbackSource()),
UseInfo::CheckedHeapObjectAsTaggedPointer(VectorSlotPair()),
MachineRepresentation::kTaggedPointer);
}
}
@ -1442,13 +1442,13 @@ class RepresentationSelector {
!right_feedback_type.Maybe(Type::MinusZero())) {
left_identify_zeros = kIdentifyZeros;
}
UseInfo left_use = CheckedUseInfoAsWord32FromHint(hint, FeedbackSource(),
UseInfo left_use = CheckedUseInfoAsWord32FromHint(hint, VectorSlotPair(),
left_identify_zeros);
// For CheckedInt32Add and CheckedInt32Sub, we don't need to do
// a minus zero check for the right hand side, since we already
// know that the left hand side is a proper Signed32 value,
// potentially guarded by a check.
UseInfo right_use = CheckedUseInfoAsWord32FromHint(hint, FeedbackSource(),
UseInfo right_use = CheckedUseInfoAsWord32FromHint(hint, VectorSlotPair(),
kIdentifyZeros);
VisitBinop(node, left_use, right_use, MachineRepresentation::kWord32,
Type::Signed32());
@ -1481,7 +1481,7 @@ class RepresentationSelector {
// default case => Float64Add/Sub
VisitBinop(node,
UseInfo::CheckedNumberOrOddballAsFloat64(kDistinguishZeros,
FeedbackSource()),
VectorSlotPair()),
MachineRepresentation::kFloat64, Type::Number());
if (lower()) {
ChangeToPureOp(node, Float64Op(node));
@ -1544,9 +1544,9 @@ class RepresentationSelector {
// right hand side doesn't matter anyways, so in particular there's
// no observable difference between a 0 and a -0 then.
UseInfo const lhs_use = CheckedUseInfoAsWord32FromHint(
hint, FeedbackSource(), truncation.identify_zeros());
hint, VectorSlotPair(), truncation.identify_zeros());
UseInfo const rhs_use = CheckedUseInfoAsWord32FromHint(
hint, FeedbackSource(), kIdentifyZeros);
hint, VectorSlotPair(), kIdentifyZeros);
if (truncation.IsUsedAsWord32()) {
VisitBinop(node, lhs_use, rhs_use, MachineRepresentation::kWord32);
if (lower()) DeferReplacement(node, lowering->Int32Mod(node));
@ -1587,9 +1587,9 @@ class RepresentationSelector {
// right hand side doesn't matter anyways, so in particular there's
// no observable difference between a 0 and a -0 then.
UseInfo const lhs_use = UseInfo::CheckedNumberOrOddballAsFloat64(
truncation.identify_zeros(), FeedbackSource());
truncation.identify_zeros(), VectorSlotPair());
UseInfo const rhs_use = UseInfo::CheckedNumberOrOddballAsFloat64(
kIdentifyZeros, FeedbackSource());
kIdentifyZeros, VectorSlotPair());
VisitBinop(node, lhs_use, rhs_use, MachineRepresentation::kFloat64,
Type::Number());
if (lower()) ChangeToPureOp(node, Float64Op(node));
@ -1929,7 +1929,7 @@ class RepresentationSelector {
case NumberOperationHint::kSignedSmall:
if (propagate()) {
VisitBinop(node,
CheckedUseInfoAsWord32FromHint(hint, FeedbackSource(),
CheckedUseInfoAsWord32FromHint(hint, VectorSlotPair(),
kIdentifyZeros),
MachineRepresentation::kBit);
} else if (retype()) {
@ -1942,7 +1942,7 @@ class RepresentationSelector {
IsNodeRepresentationTagged(rhs)) {
VisitBinop(node,
UseInfo::CheckedSignedSmallAsTaggedSigned(
FeedbackSource(), kIdentifyZeros),
VectorSlotPair(), kIdentifyZeros),
MachineRepresentation::kBit);
ChangeToPureOp(
node, changer_->TaggedSignedOperatorFor(node->opcode()));
@ -1950,7 +1950,7 @@ class RepresentationSelector {
} else {
VisitBinop(node,
CheckedUseInfoAsWord32FromHint(
hint, FeedbackSource(), kIdentifyZeros),
hint, VectorSlotPair(), kIdentifyZeros),
MachineRepresentation::kBit);
ChangeToPureOp(node, Int32Op(node));
}
@ -1967,7 +1967,7 @@ class RepresentationSelector {
V8_FALLTHROUGH;
case NumberOperationHint::kNumber:
VisitBinop(node,
CheckedUseInfoAsFloat64FromHint(hint, FeedbackSource(),
CheckedUseInfoAsFloat64FromHint(hint, VectorSlotPair(),
kIdentifyZeros),
MachineRepresentation::kBit);
if (lower()) ChangeToPureOp(node, Float64Op(node));
@ -2052,7 +2052,7 @@ class RepresentationSelector {
// Checked float64 x float64 => float64
VisitBinop(node,
UseInfo::CheckedNumberOrOddballAsFloat64(kDistinguishZeros,
FeedbackSource()),
VectorSlotPair()),
MachineRepresentation::kFloat64, Type::Number());
if (lower()) ChangeToPureOp(node, Float64Op(node));
return;
@ -2148,7 +2148,7 @@ class RepresentationSelector {
// default case => Float64Div
VisitBinop(node,
UseInfo::CheckedNumberOrOddballAsFloat64(kDistinguishZeros,
FeedbackSource()),
VectorSlotPair()),
MachineRepresentation::kFloat64, Type::Number());
if (lower()) ChangeToPureOp(node, Float64Op(node));
return;
@ -2318,7 +2318,7 @@ class RepresentationSelector {
if (lower()) {
node->RemoveInput(1);
NodeProperties::ChangeOp(
node, simplified()->CheckedUint32ToInt32(FeedbackSource()));
node, simplified()->CheckedUint32ToInt32(VectorSlotPair()));
}
return;
}
@ -2705,14 +2705,14 @@ class RepresentationSelector {
case IrOpcode::kSpeculativeBigIntAdd: {
if (truncation.IsUsedAsWord64()) {
VisitBinop(node,
UseInfo::CheckedBigIntTruncatingWord64(FeedbackSource{}),
UseInfo::CheckedBigIntTruncatingWord64(VectorSlotPair{}),
MachineRepresentation::kWord64);
if (lower()) {
ChangeToPureOp(node, lowering->machine()->Int64Add());
}
} else {
VisitBinop(node,
UseInfo::CheckedBigIntAsTaggedPointer(FeedbackSource{}),
UseInfo::CheckedBigIntAsTaggedPointer(VectorSlotPair{}),
MachineRepresentation::kTaggedPointer);
if (lower()) {
NodeProperties::ChangeOp(node, lowering->simplified()->BigIntAdd());
@ -2723,7 +2723,7 @@ class RepresentationSelector {
case IrOpcode::kSpeculativeBigIntNegate: {
if (truncation.IsUsedAsWord64()) {
VisitUnop(node,
UseInfo::CheckedBigIntTruncatingWord64(FeedbackSource{}),
UseInfo::CheckedBigIntTruncatingWord64(VectorSlotPair{}),
MachineRepresentation::kWord64);
if (lower()) {
ChangeUnaryToPureBinaryOp(node, lowering->machine()->Int64Sub(), 0,
@ -2731,7 +2731,7 @@ class RepresentationSelector {
}
} else {
VisitUnop(node,
UseInfo::CheckedBigIntAsTaggedPointer(FeedbackSource{}),
UseInfo::CheckedBigIntAsTaggedPointer(VectorSlotPair{}),
MachineRepresentation::kTaggedPointer);
if (lower()) {
ChangeToPureOp(node, lowering->simplified()->BigIntNegate());
@ -2820,7 +2820,7 @@ class RepresentationSelector {
MachineRepresentation::kTaggedPointer);
} else {
VisitUnop(node,
UseInfo::CheckedHeapObjectAsTaggedPointer(FeedbackSource()),
UseInfo::CheckedHeapObjectAsTaggedPointer(VectorSlotPair()),
MachineRepresentation::kTaggedPointer);
}
if (lower()) DeferReplacement(node, node->InputAt(0));
@ -3415,12 +3415,12 @@ class RepresentationSelector {
}
case IrOpcode::kTransitionElementsKind: {
return VisitUnop(
node, UseInfo::CheckedHeapObjectAsTaggedPointer(FeedbackSource()),
node, UseInfo::CheckedHeapObjectAsTaggedPointer(VectorSlotPair()),
MachineRepresentation::kNone);
}
case IrOpcode::kCompareMaps:
return VisitUnop(
node, UseInfo::CheckedHeapObjectAsTaggedPointer(FeedbackSource()),
node, UseInfo::CheckedHeapObjectAsTaggedPointer(VectorSlotPair()),
MachineRepresentation::kBit);
case IrOpcode::kEnsureWritableFastElements:
return VisitBinop(node, UseInfo::AnyTagged(),

View File

@ -224,8 +224,7 @@ std::ostream& operator<<(std::ostream& os,
}
size_t hash_value(const CheckFloat64HoleParameters& params) {
FeedbackSource::Hash feedback_hash;
return base::hash_combine(params.mode(), feedback_hash(params.feedback()));
return base::hash_combine(params.mode(), params.feedback());
}
bool operator==(CheckFloat64HoleParameters const& lhs,
@ -275,8 +274,7 @@ bool operator==(CheckMapsParameters const& lhs,
}
size_t hash_value(CheckMapsParameters const& p) {
FeedbackSource::Hash feedback_hash;
return base::hash_combine(p.flags(), p.maps(), feedback_hash(p.feedback()));
return base::hash_combine(p.flags(), p.maps(), p.feedback());
}
std::ostream& operator<<(std::ostream& os, CheckMapsParameters const& p) {
@ -332,8 +330,7 @@ bool operator==(const GrowFastElementsParameters& lhs,
}
inline size_t hash_value(const GrowFastElementsParameters& params) {
FeedbackSource::Hash feedback_hash;
return base::hash_combine(params.mode(), feedback_hash(params.feedback()));
return base::hash_combine(params.mode(), params.feedback());
}
std::ostream& operator<<(std::ostream& os,
@ -578,8 +575,7 @@ bool operator==(NumberOperationParameters const& lhs,
}
size_t hash_value(NumberOperationParameters const& p) {
FeedbackSource::Hash feedback_hash;
return base::hash_combine(p.hint(), feedback_hash(p.feedback()));
return base::hash_combine(p.hint(), p.feedback());
}
std::ostream& operator<<(std::ostream& os, NumberOperationParameters const& p) {
@ -648,8 +644,7 @@ std::ostream& operator<<(std::ostream& os,
}
size_t hash_value(const CheckTaggedInputParameters& params) {
FeedbackSource::Hash feedback_hash;
return base::hash_combine(params.mode(), feedback_hash(params.feedback()));
return base::hash_combine(params.mode(), params.feedback());
}
bool operator==(CheckTaggedInputParameters const& lhs,
@ -675,8 +670,7 @@ std::ostream& operator<<(std::ostream& os,
}
size_t hash_value(const CheckMinusZeroParameters& params) {
FeedbackSource::Hash feedback_hash;
return base::hash_combine(params.mode(), feedback_hash(params.feedback()));
return base::hash_combine(params.mode(), params.feedback());
}
bool operator==(CheckMinusZeroParameters const& lhs,
@ -909,7 +903,7 @@ struct SimplifiedOperatorGlobalCache final {
: Operator1<CheckParameters>( \
IrOpcode::k##Name, Operator::kFoldable | Operator::kNoThrow, \
#Name, value_input_count, 1, 1, value_output_count, 1, 0, \
CheckParameters(FeedbackSource())) {} \
CheckParameters(VectorSlotPair())) {} \
}; \
Name##Operator k##Name;
CHECKED_WITH_FEEDBACK_OP_LIST(CHECKED_WITH_FEEDBACK)
@ -917,16 +911,16 @@ struct SimplifiedOperatorGlobalCache final {
#define CHECKED_BOUNDS(Name) \
struct Name##Operator final : public Operator1<CheckBoundsParameters> { \
Name##Operator(FeedbackSource feedback, CheckBoundsParameters::Mode mode) \
Name##Operator(VectorSlotPair feedback, CheckBoundsParameters::Mode mode) \
: Operator1<CheckBoundsParameters>( \
IrOpcode::k##Name, Operator::kFoldable | Operator::kNoThrow, \
#Name, 2, 1, 1, 1, 1, 0, \
CheckBoundsParameters(feedback, mode)) {} \
}; \
Name##Operator k##Name##Deopting = { \
FeedbackSource(), CheckBoundsParameters::kDeoptOnOutOfBounds}; \
VectorSlotPair(), CheckBoundsParameters::kDeoptOnOutOfBounds}; \
Name##Operator k##Name##Aborting = { \
FeedbackSource(), CheckBoundsParameters::kAbortOnOutOfBounds};
VectorSlotPair(), CheckBoundsParameters::kAbortOnOutOfBounds};
CHECKED_BOUNDS_OP_LIST(CHECKED_BOUNDS)
#undef CHECKED_BOUNDS
@ -936,7 +930,7 @@ struct SimplifiedOperatorGlobalCache final {
: Operator1<CheckIfParameters>(
IrOpcode::kCheckIf, Operator::kFoldable | Operator::kNoThrow,
"CheckIf", 1, 1, 1, 0, 1, 0,
CheckIfParameters(kDeoptimizeReason, FeedbackSource())) {}
CheckIfParameters(kDeoptimizeReason, VectorSlotPair())) {}
};
#define CHECK_IF(Name, message) \
CheckIfOperator<DeoptimizeReason::k##Name> kCheckIf##Name;
@ -1001,7 +995,7 @@ struct SimplifiedOperatorGlobalCache final {
IrOpcode::kCheckedFloat64ToInt32,
Operator::kFoldable | Operator::kNoThrow, "CheckedFloat64ToInt32",
1, 1, 1, 1, 1, 0,
CheckMinusZeroParameters(kMode, FeedbackSource())) {}
CheckMinusZeroParameters(kMode, VectorSlotPair())) {}
};
CheckedFloat64ToInt32Operator<CheckForMinusZeroMode::kCheckForMinusZero>
kCheckedFloat64ToInt32CheckForMinusZeroOperator;
@ -1016,7 +1010,7 @@ struct SimplifiedOperatorGlobalCache final {
IrOpcode::kCheckedFloat64ToInt64,
Operator::kFoldable | Operator::kNoThrow, "CheckedFloat64ToInt64",
1, 1, 1, 1, 1, 0,
CheckMinusZeroParameters(kMode, FeedbackSource())) {}
CheckMinusZeroParameters(kMode, VectorSlotPair())) {}
};
CheckedFloat64ToInt64Operator<CheckForMinusZeroMode::kCheckForMinusZero>
kCheckedFloat64ToInt64CheckForMinusZeroOperator;
@ -1031,7 +1025,7 @@ struct SimplifiedOperatorGlobalCache final {
IrOpcode::kCheckedTaggedToInt32,
Operator::kFoldable | Operator::kNoThrow, "CheckedTaggedToInt32",
1, 1, 1, 1, 1, 0,
CheckMinusZeroParameters(kMode, FeedbackSource())) {}
CheckMinusZeroParameters(kMode, VectorSlotPair())) {}
};
CheckedTaggedToInt32Operator<CheckForMinusZeroMode::kCheckForMinusZero>
kCheckedTaggedToInt32CheckForMinusZeroOperator;
@ -1046,7 +1040,7 @@ struct SimplifiedOperatorGlobalCache final {
IrOpcode::kCheckedTaggedToInt64,
Operator::kFoldable | Operator::kNoThrow, "CheckedTaggedToInt64",
1, 1, 1, 1, 1, 0,
CheckMinusZeroParameters(kMode, FeedbackSource())) {}
CheckMinusZeroParameters(kMode, VectorSlotPair())) {}
};
CheckedTaggedToInt64Operator<CheckForMinusZeroMode::kCheckForMinusZero>
kCheckedTaggedToInt64CheckForMinusZeroOperator;
@ -1061,7 +1055,7 @@ struct SimplifiedOperatorGlobalCache final {
IrOpcode::kCheckedTaggedToFloat64,
Operator::kFoldable | Operator::kNoThrow,
"CheckedTaggedToFloat64", 1, 1, 1, 1, 1, 0,
CheckTaggedInputParameters(kMode, FeedbackSource())) {}
CheckTaggedInputParameters(kMode, VectorSlotPair())) {}
};
CheckedTaggedToFloat64Operator<CheckTaggedInputMode::kNumber>
kCheckedTaggedToFloat64NumberOperator;
@ -1076,7 +1070,7 @@ struct SimplifiedOperatorGlobalCache final {
IrOpcode::kCheckedTruncateTaggedToWord32,
Operator::kFoldable | Operator::kNoThrow,
"CheckedTruncateTaggedToWord32", 1, 1, 1, 1, 1, 0,
CheckTaggedInputParameters(kMode, FeedbackSource())) {}
CheckTaggedInputParameters(kMode, VectorSlotPair())) {}
};
CheckedTruncateTaggedToWord32Operator<CheckTaggedInputMode::kNumber>
kCheckedTruncateTaggedToWord32NumberOperator;
@ -1108,7 +1102,7 @@ struct SimplifiedOperatorGlobalCache final {
IrOpcode::kCheckFloat64Hole,
Operator::kFoldable | Operator::kNoThrow, "CheckFloat64Hole", 1,
1, 1, 1, 1, 0,
CheckFloat64HoleParameters(kMode, FeedbackSource())) {}
CheckFloat64HoleParameters(kMode, VectorSlotPair())) {}
};
CheckFloat64HoleNaNOperator<CheckFloat64HoleMode::kAllowReturnHole>
kCheckFloat64HoleAllowReturnHoleOperator;
@ -1131,7 +1125,7 @@ struct SimplifiedOperatorGlobalCache final {
GrowFastElementsOperator()
: Operator1(IrOpcode::kMaybeGrowFastElements, Operator::kNoThrow,
"MaybeGrowFastElements", 4, 1, 1, 1, 1, 0,
GrowFastElementsParameters(kMode, FeedbackSource())) {}
GrowFastElementsParameters(kMode, VectorSlotPair())) {}
};
GrowFastElementsOperator<GrowFastElementsMode::kDoubleElements>
@ -1176,7 +1170,7 @@ struct SimplifiedOperatorGlobalCache final {
IrOpcode::kSpeculativeToNumber,
Operator::kFoldable | Operator::kNoThrow, "SpeculativeToNumber",
1, 1, 1, 1, 1, 0,
NumberOperationParameters(kHint, FeedbackSource())) {}
NumberOperationParameters(kHint, VectorSlotPair())) {}
};
SpeculativeToNumberOperator<NumberOperationHint::kSignedSmall>
kSpeculativeToNumberSignedSmallOperator;
@ -1210,7 +1204,7 @@ GET_FROM_CACHE(LoadFieldByIndex)
#define GET_FROM_CACHE_WITH_FEEDBACK(Name, value_input_count, \
value_output_count) \
const Operator* SimplifiedOperatorBuilder::Name( \
const FeedbackSource& feedback) { \
const VectorSlotPair& feedback) { \
if (!feedback.IsValid()) { \
return &cache_.k##Name; \
} \
@ -1224,7 +1218,7 @@ CHECKED_WITH_FEEDBACK_OP_LIST(GET_FROM_CACHE_WITH_FEEDBACK)
#define GET_FROM_CACHE_WITH_FEEDBACK(Name) \
const Operator* SimplifiedOperatorBuilder::Name( \
const FeedbackSource& feedback, CheckBoundsParameters::Mode mode) { \
const VectorSlotPair& feedback, CheckBoundsParameters::Mode mode) { \
if (!feedback.IsValid()) { \
switch (mode) { \
case CheckBoundsParameters::kDeoptOnOutOfBounds: \
@ -1273,7 +1267,7 @@ const Operator* SimplifiedOperatorBuilder::AssertType(Type type) {
}
const Operator* SimplifiedOperatorBuilder::CheckIf(
DeoptimizeReason reason, const FeedbackSource& feedback) {
DeoptimizeReason reason, const VectorSlotPair& feedback) {
if (!feedback.IsValid()) {
switch (reason) {
#define CHECK_IF(Name, message) \
@ -1311,7 +1305,7 @@ const Operator* SimplifiedOperatorBuilder::CheckedInt32Mul(
}
const Operator* SimplifiedOperatorBuilder::CheckedFloat64ToInt32(
CheckForMinusZeroMode mode, const FeedbackSource& feedback) {
CheckForMinusZeroMode mode, const VectorSlotPair& feedback) {
if (!feedback.IsValid()) {
switch (mode) {
case CheckForMinusZeroMode::kCheckForMinusZero:
@ -1327,7 +1321,7 @@ const Operator* SimplifiedOperatorBuilder::CheckedFloat64ToInt32(
}
const Operator* SimplifiedOperatorBuilder::CheckedFloat64ToInt64(
CheckForMinusZeroMode mode, const FeedbackSource& feedback) {
CheckForMinusZeroMode mode, const VectorSlotPair& feedback) {
if (!feedback.IsValid()) {
switch (mode) {
case CheckForMinusZeroMode::kCheckForMinusZero:
@ -1343,7 +1337,7 @@ const Operator* SimplifiedOperatorBuilder::CheckedFloat64ToInt64(
}
const Operator* SimplifiedOperatorBuilder::CheckedTaggedToInt32(
CheckForMinusZeroMode mode, const FeedbackSource& feedback) {
CheckForMinusZeroMode mode, const VectorSlotPair& feedback) {
if (!feedback.IsValid()) {
switch (mode) {
case CheckForMinusZeroMode::kCheckForMinusZero:
@ -1359,7 +1353,7 @@ const Operator* SimplifiedOperatorBuilder::CheckedTaggedToInt32(
}
const Operator* SimplifiedOperatorBuilder::CheckedTaggedToInt64(
CheckForMinusZeroMode mode, const FeedbackSource& feedback) {
CheckForMinusZeroMode mode, const VectorSlotPair& feedback) {
if (!feedback.IsValid()) {
switch (mode) {
case CheckForMinusZeroMode::kCheckForMinusZero:
@ -1375,7 +1369,7 @@ const Operator* SimplifiedOperatorBuilder::CheckedTaggedToInt64(
}
const Operator* SimplifiedOperatorBuilder::CheckedTaggedToFloat64(
CheckTaggedInputMode mode, const FeedbackSource& feedback) {
CheckTaggedInputMode mode, const VectorSlotPair& feedback) {
if (!feedback.IsValid()) {
switch (mode) {
case CheckTaggedInputMode::kNumber:
@ -1391,7 +1385,7 @@ const Operator* SimplifiedOperatorBuilder::CheckedTaggedToFloat64(
}
const Operator* SimplifiedOperatorBuilder::CheckedTruncateTaggedToWord32(
CheckTaggedInputMode mode, const FeedbackSource& feedback) {
CheckTaggedInputMode mode, const VectorSlotPair& feedback) {
if (!feedback.IsValid()) {
switch (mode) {
case CheckTaggedInputMode::kNumber:
@ -1408,7 +1402,7 @@ const Operator* SimplifiedOperatorBuilder::CheckedTruncateTaggedToWord32(
const Operator* SimplifiedOperatorBuilder::CheckMaps(
CheckMapsFlags flags, ZoneHandleSet<Map> maps,
const FeedbackSource& feedback) {
const VectorSlotPair& feedback) {
CheckMapsParameters const parameters(flags, maps, feedback);
return new (zone()) Operator1<CheckMapsParameters>( // --
IrOpcode::kCheckMaps, // opcode
@ -1453,7 +1447,7 @@ const Operator* SimplifiedOperatorBuilder::ConvertReceiver(
}
const Operator* SimplifiedOperatorBuilder::CheckFloat64Hole(
CheckFloat64HoleMode mode, FeedbackSource const& feedback) {
CheckFloat64HoleMode mode, VectorSlotPair const& feedback) {
if (!feedback.IsValid()) {
switch (mode) {
case CheckFloat64HoleMode::kAllowReturnHole:
@ -1485,7 +1479,7 @@ const Operator* SimplifiedOperatorBuilder::SpeculativeBigIntNegate(
}
const Operator* SimplifiedOperatorBuilder::SpeculativeToNumber(
NumberOperationHint hint, const FeedbackSource& feedback) {
NumberOperationHint hint, const VectorSlotPair& feedback) {
if (!feedback.IsValid()) {
switch (hint) {
case NumberOperationHint::kSignedSmall:
@ -1511,7 +1505,7 @@ const Operator* SimplifiedOperatorBuilder::EnsureWritableFastElements() {
}
const Operator* SimplifiedOperatorBuilder::MaybeGrowFastElements(
GrowFastElementsMode mode, const FeedbackSource& feedback) {
GrowFastElementsMode mode, const VectorSlotPair& feedback) {
if (!feedback.IsValid()) {
switch (mode) {
case GrowFastElementsMode::kDoubleElements:
@ -1587,10 +1581,7 @@ bool operator==(CheckParameters const& lhs, CheckParameters const& rhs) {
return lhs.feedback() == rhs.feedback();
}
size_t hash_value(CheckParameters const& p) {
FeedbackSource::Hash feedback_hash;
return feedback_hash(p.feedback());
}
size_t hash_value(CheckParameters const& p) { return hash_value(p.feedback()); }
std::ostream& operator<<(std::ostream& os, CheckParameters const& p) {
return os << p.feedback();
@ -1639,8 +1630,7 @@ bool operator==(CheckIfParameters const& lhs, CheckIfParameters const& rhs) {
}
size_t hash_value(CheckIfParameters const& p) {
FeedbackSource::Hash feedback_hash;
return base::hash_combine(p.reason(), feedback_hash(p.feedback()));
return base::hash_combine(p.reason(), p.feedback());
}
std::ostream& operator<<(std::ostream& os, CheckIfParameters const& p) {

View File

@ -10,9 +10,9 @@
#include "src/base/compiler-specific.h"
#include "src/codegen/machine-type.h"
#include "src/common/globals.h"
#include "src/compiler/feedback-source.h"
#include "src/compiler/operator.h"
#include "src/compiler/types.h"
#include "src/compiler/vector-slot-pair.h"
#include "src/compiler/write-barrier-kind.h"
#include "src/deoptimizer/deoptimize-reason.h"
#include "src/handles/handles.h"
@ -201,13 +201,13 @@ ConvertReceiverMode ConvertReceiverModeOf(Operator const* op)
// fails, then speculation on that CallIC slot will be disabled.
class CheckParameters final {
public:
explicit CheckParameters(const FeedbackSource& feedback)
explicit CheckParameters(const VectorSlotPair& feedback)
: feedback_(feedback) {}
FeedbackSource const& feedback() const { return feedback_; }
VectorSlotPair const& feedback() const { return feedback_; }
private:
FeedbackSource feedback_;
VectorSlotPair feedback_;
};
bool operator==(CheckParameters const&, CheckParameters const&);
@ -222,7 +222,7 @@ class CheckBoundsParameters final {
public:
enum Mode { kAbortOnOutOfBounds, kDeoptOnOutOfBounds };
CheckBoundsParameters(const FeedbackSource& feedback, Mode mode)
CheckBoundsParameters(const VectorSlotPair& feedback, Mode mode)
: check_parameters_(feedback), mode_(mode) {}
Mode mode() const { return mode_; }
@ -245,15 +245,15 @@ CheckBoundsParameters const& CheckBoundsParametersOf(Operator const*)
class CheckIfParameters final {
public:
explicit CheckIfParameters(DeoptimizeReason reason,
const FeedbackSource& feedback)
const VectorSlotPair& feedback)
: reason_(reason), feedback_(feedback) {}
FeedbackSource const& feedback() const { return feedback_; }
VectorSlotPair const& feedback() const { return feedback_; }
DeoptimizeReason reason() const { return reason_; }
private:
DeoptimizeReason reason_;
FeedbackSource feedback_;
VectorSlotPair feedback_;
};
bool operator==(CheckIfParameters const&, CheckIfParameters const&);
@ -277,15 +277,15 @@ std::ostream& operator<<(std::ostream&, CheckFloat64HoleMode);
class CheckFloat64HoleParameters {
public:
CheckFloat64HoleParameters(CheckFloat64HoleMode mode,
FeedbackSource const& feedback)
VectorSlotPair const& feedback)
: mode_(mode), feedback_(feedback) {}
CheckFloat64HoleMode mode() const { return mode_; }
FeedbackSource const& feedback() const { return feedback_; }
VectorSlotPair const& feedback() const { return feedback_; }
private:
CheckFloat64HoleMode mode_;
FeedbackSource feedback_;
VectorSlotPair feedback_;
};
CheckFloat64HoleParameters const& CheckFloat64HoleParametersOf(Operator const*)
@ -312,15 +312,15 @@ V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, CheckTaggedInputMode);
class CheckTaggedInputParameters {
public:
CheckTaggedInputParameters(CheckTaggedInputMode mode,
const FeedbackSource& feedback)
const VectorSlotPair& feedback)
: mode_(mode), feedback_(feedback) {}
CheckTaggedInputMode mode() const { return mode_; }
const FeedbackSource& feedback() const { return feedback_; }
const VectorSlotPair& feedback() const { return feedback_; }
private:
CheckTaggedInputMode mode_;
FeedbackSource feedback_;
VectorSlotPair feedback_;
};
const CheckTaggedInputParameters& CheckTaggedInputParametersOf(const Operator*)
@ -350,15 +350,15 @@ CheckForMinusZeroMode CheckMinusZeroModeOf(const Operator*)
class CheckMinusZeroParameters {
public:
CheckMinusZeroParameters(CheckForMinusZeroMode mode,
const FeedbackSource& feedback)
const VectorSlotPair& feedback)
: mode_(mode), feedback_(feedback) {}
CheckForMinusZeroMode mode() const { return mode_; }
const FeedbackSource& feedback() const { return feedback_; }
const VectorSlotPair& feedback() const { return feedback_; }
private:
CheckForMinusZeroMode mode_;
FeedbackSource feedback_;
VectorSlotPair feedback_;
};
V8_EXPORT_PRIVATE const CheckMinusZeroParameters& CheckMinusZeroParametersOf(
@ -389,17 +389,17 @@ std::ostream& operator<<(std::ostream&, CheckMapsFlags);
class CheckMapsParameters final {
public:
CheckMapsParameters(CheckMapsFlags flags, ZoneHandleSet<Map> const& maps,
const FeedbackSource& feedback)
const VectorSlotPair& feedback)
: flags_(flags), maps_(maps), feedback_(feedback) {}
CheckMapsFlags flags() const { return flags_; }
ZoneHandleSet<Map> const& maps() const { return maps_; }
FeedbackSource const& feedback() const { return feedback_; }
VectorSlotPair const& feedback() const { return feedback_; }
private:
CheckMapsFlags const flags_;
ZoneHandleSet<Map> const maps_;
FeedbackSource const feedback_;
VectorSlotPair const feedback_;
};
bool operator==(CheckMapsParameters const&, CheckMapsParameters const&);
@ -432,15 +432,15 @@ std::ostream& operator<<(std::ostream&, GrowFastElementsMode);
class GrowFastElementsParameters {
public:
GrowFastElementsParameters(GrowFastElementsMode mode,
const FeedbackSource& feedback)
const VectorSlotPair& feedback)
: mode_(mode), feedback_(feedback) {}
GrowFastElementsMode mode() const { return mode_; }
const FeedbackSource& feedback() const { return feedback_; }
const VectorSlotPair& feedback() const { return feedback_; }
private:
GrowFastElementsMode mode_;
FeedbackSource feedback_;
VectorSlotPair feedback_;
};
bool operator==(const GrowFastElementsParameters&,
@ -516,15 +516,15 @@ V8_EXPORT_PRIVATE NumberOperationHint NumberOperationHintOf(const Operator* op)
class NumberOperationParameters {
public:
NumberOperationParameters(NumberOperationHint hint,
const FeedbackSource& feedback)
const VectorSlotPair& feedback)
: hint_(hint), feedback_(feedback) {}
NumberOperationHint hint() const { return hint_; }
const FeedbackSource& feedback() const { return feedback_; }
const VectorSlotPair& feedback() const { return feedback_; }
private:
NumberOperationHint hint_;
FeedbackSource feedback_;
VectorSlotPair feedback_;
};
size_t hash_value(NumberOperationParameters const&);
@ -718,7 +718,7 @@ class V8_EXPORT_PRIVATE SimplifiedOperatorBuilder final
const Operator* FindOrderedHashMapEntryForInt32Key();
const Operator* SpeculativeToNumber(NumberOperationHint hint,
const FeedbackSource& feedback);
const VectorSlotPair& feedback);
const Operator* StringToNumber();
const Operator* PlainPrimitiveToNumber();
@ -756,67 +756,67 @@ class V8_EXPORT_PRIVATE SimplifiedOperatorBuilder final
const Operator* CompareMaps(ZoneHandleSet<Map>);
const Operator* MapGuard(ZoneHandleSet<Map> maps);
const Operator* CheckBounds(const FeedbackSource& feedback);
const Operator* CheckBounds(const VectorSlotPair& feedback);
const Operator* CheckEqualsInternalizedString();
const Operator* CheckEqualsSymbol();
const Operator* CheckFloat64Hole(CheckFloat64HoleMode, FeedbackSource const&);
const Operator* CheckFloat64Hole(CheckFloat64HoleMode, VectorSlotPair const&);
const Operator* CheckHeapObject();
const Operator* CheckIf(DeoptimizeReason deoptimize_reason,
const FeedbackSource& feedback = FeedbackSource());
const VectorSlotPair& feedback = VectorSlotPair());
const Operator* CheckInternalizedString();
const Operator* CheckMaps(CheckMapsFlags, ZoneHandleSet<Map>,
const FeedbackSource& = FeedbackSource());
const VectorSlotPair& = VectorSlotPair());
const Operator* CheckNotTaggedHole();
const Operator* CheckNumber(const FeedbackSource& feedback);
const Operator* CheckNumber(const VectorSlotPair& feedback);
const Operator* CheckReceiver();
const Operator* CheckReceiverOrNullOrUndefined();
const Operator* CheckSmi(const FeedbackSource& feedback);
const Operator* CheckString(const FeedbackSource& feedback);
const Operator* CheckSmi(const VectorSlotPair& feedback);
const Operator* CheckString(const VectorSlotPair& feedback);
const Operator* CheckSymbol();
const Operator* CheckedFloat64ToInt32(CheckForMinusZeroMode,
const FeedbackSource& feedback);
const VectorSlotPair& feedback);
const Operator* CheckedFloat64ToInt64(CheckForMinusZeroMode,
const FeedbackSource& feedback);
const VectorSlotPair& feedback);
const Operator* CheckedInt32Add();
const Operator* CheckedInt32Div();
const Operator* CheckedInt32Mod();
const Operator* CheckedInt32Mul(CheckForMinusZeroMode);
const Operator* CheckedInt32Sub();
const Operator* CheckedInt32ToCompressedSigned(
const FeedbackSource& feedback);
const Operator* CheckedInt32ToTaggedSigned(const FeedbackSource& feedback);
const Operator* CheckedInt64ToInt32(const FeedbackSource& feedback);
const Operator* CheckedInt64ToTaggedSigned(const FeedbackSource& feedback);
const Operator* CheckedTaggedSignedToInt32(const FeedbackSource& feedback);
const VectorSlotPair& feedback);
const Operator* CheckedInt32ToTaggedSigned(const VectorSlotPair& feedback);
const Operator* CheckedInt64ToInt32(const VectorSlotPair& feedback);
const Operator* CheckedInt64ToTaggedSigned(const VectorSlotPair& feedback);
const Operator* CheckedTaggedSignedToInt32(const VectorSlotPair& feedback);
const Operator* CheckedTaggedToFloat64(CheckTaggedInputMode,
const FeedbackSource& feedback);
const VectorSlotPair& feedback);
const Operator* CheckedTaggedToInt32(CheckForMinusZeroMode,
const FeedbackSource& feedback);
const VectorSlotPair& feedback);
const Operator* CheckedTaggedToInt64(CheckForMinusZeroMode,
const FeedbackSource& feedback);
const Operator* CheckedTaggedToTaggedPointer(const FeedbackSource& feedback);
const Operator* CheckedTaggedToTaggedSigned(const FeedbackSource& feedback);
const Operator* CheckBigInt(const FeedbackSource& feedback);
const VectorSlotPair& feedback);
const Operator* CheckedTaggedToTaggedPointer(const VectorSlotPair& feedback);
const Operator* CheckedTaggedToTaggedSigned(const VectorSlotPair& feedback);
const Operator* CheckBigInt(const VectorSlotPair& feedback);
const Operator* CheckedCompressedToTaggedPointer(
const FeedbackSource& feedback);
const VectorSlotPair& feedback);
const Operator* CheckedCompressedToTaggedSigned(
const FeedbackSource& feedback);
const VectorSlotPair& feedback);
const Operator* CheckedTaggedToCompressedPointer(
const FeedbackSource& feedback);
const VectorSlotPair& feedback);
const Operator* CheckedTaggedToCompressedSigned(
const FeedbackSource& feedback);
const VectorSlotPair& feedback);
const Operator* CheckedTruncateTaggedToWord32(CheckTaggedInputMode,
const FeedbackSource& feedback);
const VectorSlotPair& feedback);
const Operator* CheckedUint32Div();
const Operator* CheckedUint32Mod();
const Operator* CheckedUint32Bounds(const FeedbackSource& feedback,
const Operator* CheckedUint32Bounds(const VectorSlotPair& feedback,
CheckBoundsParameters::Mode mode);
const Operator* CheckedUint32ToInt32(const FeedbackSource& feedback);
const Operator* CheckedUint32ToTaggedSigned(const FeedbackSource& feedback);
const Operator* CheckedUint64Bounds(const FeedbackSource& feedback);
const Operator* CheckedUint64ToInt32(const FeedbackSource& feedback);
const Operator* CheckedUint64ToTaggedSigned(const FeedbackSource& feedback);
const Operator* CheckedUint32ToInt32(const VectorSlotPair& feedback);
const Operator* CheckedUint32ToTaggedSigned(const VectorSlotPair& feedback);
const Operator* CheckedUint64Bounds(const VectorSlotPair& feedback);
const Operator* CheckedUint64ToInt32(const VectorSlotPair& feedback);
const Operator* CheckedUint64ToTaggedSigned(const VectorSlotPair& feedback);
const Operator* ConvertReceiver(ConvertReceiverMode);
@ -865,7 +865,7 @@ class V8_EXPORT_PRIVATE SimplifiedOperatorBuilder final
// maybe-grow-fast-elements object, elements, index, length
const Operator* MaybeGrowFastElements(GrowFastElementsMode mode,
const FeedbackSource& feedback);
const VectorSlotPair& feedback);
// transition-elements-kind object, from-map, to-map
const Operator* TransitionElementsKind(ElementsTransition transition);

View File

@ -0,0 +1,41 @@
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/compiler/vector-slot-pair.h"
#include "src/objects/feedback-vector.h"
namespace v8 {
namespace internal {
VectorSlotPair::VectorSlotPair() = default;
int VectorSlotPair::index() const {
return vector_.is_null() ? -1 : FeedbackVector::GetIndex(slot_);
}
bool operator==(VectorSlotPair const& lhs, VectorSlotPair const& rhs) {
return lhs.slot() == rhs.slot() &&
lhs.vector().location() == rhs.vector().location() &&
lhs.ic_state() == rhs.ic_state();
}
bool operator!=(VectorSlotPair const& lhs, VectorSlotPair const& rhs) {
return !(lhs == rhs);
}
std::ostream& operator<<(std::ostream& os, const VectorSlotPair& p) {
if (p.IsValid()) {
return os << "VectorSlotPair(" << p.slot() << ", "
<< InlineCacheState2String(p.ic_state()) << ")";
}
return os << "VectorSlotPair(INVALID)";
}
size_t hash_value(VectorSlotPair const& p) {
return base::hash_combine(p.slot(), p.vector().location(), p.ic_state());
}
} // namespace internal
} // namespace v8

View File

@ -0,0 +1,51 @@
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMPILER_VECTOR_SLOT_PAIR_H_
#define V8_COMPILER_VECTOR_SLOT_PAIR_H_
#include "src/common/globals.h"
#include "src/handles/handles.h"
#include "src/utils/utils.h"
namespace v8 {
namespace internal {
class FeedbackVector;
// Defines a pair of {FeedbackVector} and {FeedbackSlot}, which
// is used to access the type feedback for a certain {Node}.
class V8_EXPORT_PRIVATE VectorSlotPair {
public:
VectorSlotPair();
VectorSlotPair(Handle<FeedbackVector> vector, FeedbackSlot slot,
InlineCacheState ic_state)
: vector_(vector), slot_(slot), ic_state_(ic_state) {}
bool IsValid() const { return !vector_.is_null() && !slot_.IsInvalid(); }
Handle<FeedbackVector> vector() const { return vector_; }
FeedbackSlot slot() const { return slot_; }
InlineCacheState ic_state() const { return ic_state_; }
int index() const;
private:
Handle<FeedbackVector> vector_;
FeedbackSlot slot_;
InlineCacheState ic_state_ = UNINITIALIZED;
};
bool operator==(VectorSlotPair const&, VectorSlotPair const&);
bool operator!=(VectorSlotPair const&, VectorSlotPair const&);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
VectorSlotPair const&);
size_t hash_value(VectorSlotPair const&);
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_VECTOR_SLOT_PAIR_H_

View File

@ -76,7 +76,7 @@ TEST(DeoptInMiddleOfBasicBlock) {
// Dummy node for FlagsContinuation::ForDeoptimize (which won't accept
// nullptr).
Node* node = Node::New(zone, 0, nullptr, 0, nullptr, false);
FeedbackSource feedback;
VectorSlotPair feedback;
FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
kEqual, DeoptimizeKind::kEager, DeoptimizeReason::kUnknown, feedback,
node);

View File

@ -401,11 +401,11 @@ TEST(Word64) {
CheckChange(
IrOpcode::kCheckedInt64ToInt32, MachineRepresentation::kWord64,
TypeCache::Get()->kSafeInteger, MachineRepresentation::kWord32,
UseInfo::CheckedSigned32AsWord32(kIdentifyZeros, FeedbackSource()));
UseInfo::CheckedSigned32AsWord32(kIdentifyZeros, VectorSlotPair()));
CheckChange(
IrOpcode::kCheckedUint64ToInt32, MachineRepresentation::kWord64,
TypeCache::Get()->kPositiveSafeInteger, MachineRepresentation::kWord32,
UseInfo::CheckedSigned32AsWord32(kIdentifyZeros, FeedbackSource()));
UseInfo::CheckedSigned32AsWord32(kIdentifyZeros, VectorSlotPair()));
CheckChange(IrOpcode::kChangeFloat64ToInt64, MachineRepresentation::kFloat64,
Type::Signed32(), MachineRepresentation::kWord64);
@ -420,7 +420,7 @@ TEST(Word64) {
CheckChange(
IrOpcode::kCheckedFloat64ToInt64, MachineRepresentation::kFloat64,
Type::Number(), MachineRepresentation::kWord64,
UseInfo::CheckedSigned64AsWord64(kIdentifyZeros, FeedbackSource()));
UseInfo::CheckedSigned64AsWord64(kIdentifyZeros, VectorSlotPair()));
CheckChange(IrOpcode::kChangeInt64ToFloat64, MachineRepresentation::kWord64,
Type::Signed32(), MachineRepresentation::kFloat64);
@ -449,7 +449,7 @@ TEST(Word64) {
IrOpcode::kChangeFloat32ToFloat64, IrOpcode::kCheckedFloat64ToInt64,
MachineRepresentation::kFloat32, Type::Number(),
MachineRepresentation::kWord64,
UseInfo::CheckedSigned64AsWord64(kIdentifyZeros, FeedbackSource()));
UseInfo::CheckedSigned64AsWord64(kIdentifyZeros, VectorSlotPair()));
CheckTwoChanges(IrOpcode::kChangeInt64ToFloat64,
IrOpcode::kTruncateFloat64ToFloat32,
@ -470,11 +470,11 @@ TEST(Word64) {
CheckChange(
IrOpcode::kCheckedTaggedToInt64, MachineRepresentation::kTagged,
Type::Number(), MachineRepresentation::kWord64,
UseInfo::CheckedSigned64AsWord64(kIdentifyZeros, FeedbackSource()));
UseInfo::CheckedSigned64AsWord64(kIdentifyZeros, VectorSlotPair()));
CheckChange(
IrOpcode::kCheckedTaggedToInt64, MachineRepresentation::kTaggedPointer,
Type::Number(), MachineRepresentation::kWord64,
UseInfo::CheckedSigned64AsWord64(kIdentifyZeros, FeedbackSource()));
UseInfo::CheckedSigned64AsWord64(kIdentifyZeros, VectorSlotPair()));
CheckTwoChanges(IrOpcode::kTruncateInt64ToInt32,
IrOpcode::kChangeInt31ToTaggedSigned,
@ -507,12 +507,12 @@ TEST(Word64) {
CheckChange(IrOpcode::kCheckedInt64ToTaggedSigned,
MachineRepresentation::kWord64, TypeCache::Get()->kSafeInteger,
MachineRepresentation::kTaggedSigned,
UseInfo::CheckedSignedSmallAsTaggedSigned(FeedbackSource()));
UseInfo::CheckedSignedSmallAsTaggedSigned(VectorSlotPair()));
CheckChange(IrOpcode::kCheckedUint64ToTaggedSigned,
MachineRepresentation::kWord64,
TypeCache::Get()->kPositiveSafeInteger,
MachineRepresentation::kTaggedSigned,
UseInfo::CheckedSignedSmallAsTaggedSigned(FeedbackSource()));
UseInfo::CheckedSignedSmallAsTaggedSigned(VectorSlotPair()));
CheckTwoChanges(
IrOpcode::kChangeInt64ToFloat64, IrOpcode::kChangeFloat64ToTaggedPointer,
@ -630,7 +630,7 @@ TEST(SignednessInWord32) {
CheckChange(IrOpcode::kCheckedTruncateTaggedToWord32,
MachineRepresentation::kTagged, Type::NonInternal(),
MachineRepresentation::kWord32,
UseInfo::CheckedNumberOrOddballAsWord32(FeedbackSource()));
UseInfo::CheckedNumberOrOddballAsWord32(VectorSlotPair()));
CheckTwoChanges(IrOpcode::kChangeInt32ToFloat64,
IrOpcode::kTruncateFloat64ToFloat32,
@ -644,7 +644,7 @@ TEST(SignednessInWord32) {
CheckChange(
IrOpcode::kCheckedUint32ToInt32, MachineRepresentation::kWord32,
Type::Unsigned32(),
UseInfo::CheckedSigned32AsWord32(kIdentifyZeros, FeedbackSource()));
UseInfo::CheckedSigned32AsWord32(kIdentifyZeros, VectorSlotPair()));
}
TEST(CompressedAndTagged) {
@ -698,19 +698,19 @@ static void TestMinusZeroCheck(IrOpcode::Value expected, Type from_type) {
CheckChange(
expected, MachineRepresentation::kFloat64, from_type,
UseInfo::CheckedSignedSmallAsWord32(kDistinguishZeros, FeedbackSource()));
UseInfo::CheckedSignedSmallAsWord32(kDistinguishZeros, VectorSlotPair()));
CheckChange(
expected, MachineRepresentation::kFloat64, from_type,
UseInfo::CheckedSignedSmallAsWord32(kIdentifyZeros, FeedbackSource()));
UseInfo::CheckedSignedSmallAsWord32(kIdentifyZeros, VectorSlotPair()));
CheckChange(
expected, MachineRepresentation::kFloat64, from_type,
UseInfo::CheckedSigned32AsWord32(kDistinguishZeros, FeedbackSource()));
UseInfo::CheckedSigned32AsWord32(kDistinguishZeros, VectorSlotPair()));
CheckChange(
expected, MachineRepresentation::kFloat64, from_type,
UseInfo::CheckedSigned32AsWord32(kDistinguishZeros, FeedbackSource()));
UseInfo::CheckedSigned32AsWord32(kDistinguishZeros, VectorSlotPair()));
}
TEST(MinusZeroCheck) {

View File

@ -6,7 +6,6 @@
#include "src/codegen/tick-counter.h"
#include "src/compiler/compilation-dependencies.h"
#include "src/compiler/feedback-source.h"
#include "src/compiler/js-call-reducer.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/simplified-operator.h"
@ -114,7 +113,7 @@ class JSCallReducerTest : public TypedGraphTest {
ClosureFeedbackCellArray::New(isolate(), shared);
Handle<FeedbackVector> vector =
FeedbackVector::New(isolate(), shared, closure_feedback_cell_array);
FeedbackSource feedback(vector, FeedbackSlot(0));
VectorSlotPair feedback(vector, FeedbackSlot(0), UNINITIALIZED);
return javascript()->Call(arity, CallFrequency(), feedback,
ConvertReceiverMode::kAny,
SpeculationMode::kAllowSpeculation);

View File

@ -375,7 +375,7 @@ TEST_F(JSTypedLoweringTest, JSStoreContext) {
TEST_F(JSTypedLoweringTest, JSLoadNamedStringLength) {
FeedbackSource feedback;
VectorSlotPair feedback;
Handle<Name> name = factory()->length_string();
Node* const receiver = Parameter(Type::String(), 0);
Node* const context = UndefinedConstant();

View File

@ -5,7 +5,6 @@
#include "src/compiler/redundancy-elimination.h"
#include "src/codegen/tick-counter.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/feedback-source.h"
#include "test/unittests/compiler/graph-reducer-unittest.h"
#include "test/unittests/compiler/graph-unittest.h"
#include "test/unittests/compiler/node-test-utils.h"
@ -41,24 +40,26 @@ class RedundancyEliminationTest : public GraphTest {
ClosureFeedbackCellArray::New(isolate(), shared);
Handle<FeedbackVector> feedback_vector =
FeedbackVector::New(isolate(), shared, closure_feedback_cell_array);
vector_slot_pairs_.push_back(FeedbackSource());
vector_slot_pairs_.push_back(FeedbackSource(feedback_vector, slot1));
vector_slot_pairs_.push_back(FeedbackSource(feedback_vector, slot2));
vector_slot_pairs_.push_back(VectorSlotPair());
vector_slot_pairs_.push_back(
VectorSlotPair(feedback_vector, slot1, UNINITIALIZED));
vector_slot_pairs_.push_back(
VectorSlotPair(feedback_vector, slot2, UNINITIALIZED));
}
~RedundancyEliminationTest() override = default;
protected:
Reduction Reduce(Node* node) { return reducer_.Reduce(node); }
std::vector<FeedbackSource> const& vector_slot_pairs() const {
std::vector<VectorSlotPair> const& vector_slot_pairs() const {
return vector_slot_pairs_;
}
SimplifiedOperatorBuilder* simplified() { return &simplified_; }
private:
NiceMock<MockAdvancedReducerEditor> editor_;
std::vector<FeedbackSource> vector_slot_pairs_;
FeedbackSource feedback2_;
std::vector<VectorSlotPair> vector_slot_pairs_;
VectorSlotPair feedback2_;
RedundancyElimination reducer_;
SimplifiedOperatorBuilder simplified_;
};
@ -87,8 +88,8 @@ const NumberOperationHint kNumberOperationHints[] = {
// CheckBounds
TEST_F(RedundancyEliminationTest, CheckBounds) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* index = Parameter(0);
Node* length = Parameter(1);
Node* effect = graph()->start();
@ -113,8 +114,8 @@ TEST_F(RedundancyEliminationTest, CheckBounds) {
// CheckNumber
TEST_F(RedundancyEliminationTest, CheckNumberSubsumedByCheckSmi) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -200,7 +201,7 @@ TEST_F(RedundancyEliminationTest,
TEST_F(RedundancyEliminationTest,
CheckStringSubsumedByCheckInternalizedString) {
TRACED_FOREACH(FeedbackSource, feedback, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -244,8 +245,8 @@ TEST_F(RedundancyEliminationTest, CheckSymbol) {
// CheckedFloat64ToInt32
TEST_F(RedundancyEliminationTest, CheckedFloat64ToInt32) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(CheckForMinusZeroMode, mode, kCheckForMinusZeroModes) {
Node* value = Parameter(0);
Node* effect = graph()->start();
@ -273,8 +274,8 @@ TEST_F(RedundancyEliminationTest, CheckedFloat64ToInt32) {
// CheckedFloat64ToInt64
TEST_F(RedundancyEliminationTest, CheckedFloat64ToInt64) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(CheckForMinusZeroMode, mode, kCheckForMinusZeroModes) {
Node* value = Parameter(0);
Node* effect = graph()->start();
@ -305,8 +306,8 @@ TEST_F(RedundancyEliminationTest, CheckedInt32ToCompressedSigned) {
if (!COMPRESS_POINTERS_BOOL) {
return;
}
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -332,8 +333,8 @@ TEST_F(RedundancyEliminationTest, CheckedInt32ToCompressedSigned) {
// CheckedInt32ToTaggedSigned
TEST_F(RedundancyEliminationTest, CheckedInt32ToTaggedSigned) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -359,8 +360,8 @@ TEST_F(RedundancyEliminationTest, CheckedInt32ToTaggedSigned) {
// CheckedInt64ToInt32
TEST_F(RedundancyEliminationTest, CheckedInt64ToInt32) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -384,8 +385,8 @@ TEST_F(RedundancyEliminationTest, CheckedInt64ToInt32) {
// CheckedInt64ToTaggedSigned
TEST_F(RedundancyEliminationTest, CheckedInt64ToTaggedSigned) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -411,8 +412,8 @@ TEST_F(RedundancyEliminationTest, CheckedInt64ToTaggedSigned) {
// CheckedTaggedSignedToInt32
TEST_F(RedundancyEliminationTest, CheckedTaggedSignedToInt32) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -438,8 +439,8 @@ TEST_F(RedundancyEliminationTest, CheckedTaggedSignedToInt32) {
// CheckedTaggedToFloat64
TEST_F(RedundancyEliminationTest, CheckedTaggedToFloat64) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(CheckTaggedInputMode, mode, kCheckTaggedInputModes) {
Node* value = Parameter(0);
Node* effect = graph()->start();
@ -465,8 +466,8 @@ TEST_F(RedundancyEliminationTest, CheckedTaggedToFloat64) {
TEST_F(RedundancyEliminationTest,
CheckedTaggedToFloat64SubsubmedByCheckedTaggedToFloat64) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -496,8 +497,8 @@ TEST_F(RedundancyEliminationTest,
// CheckedTaggedToInt32
TEST_F(RedundancyEliminationTest, CheckedTaggedToInt32) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(CheckForMinusZeroMode, mode, kCheckForMinusZeroModes) {
Node* value = Parameter(0);
Node* effect = graph()->start();
@ -523,8 +524,8 @@ TEST_F(RedundancyEliminationTest, CheckedTaggedToInt32) {
TEST_F(RedundancyEliminationTest,
CheckedTaggedToInt32SubsumedByCheckedTaggedSignedToInt32) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(CheckForMinusZeroMode, mode, kCheckForMinusZeroModes) {
Node* value = Parameter(0);
Node* effect = graph()->start();
@ -552,8 +553,8 @@ TEST_F(RedundancyEliminationTest,
// CheckedTaggedToInt64
TEST_F(RedundancyEliminationTest, CheckedTaggedToInt64) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(CheckForMinusZeroMode, mode, kCheckForMinusZeroModes) {
Node* value = Parameter(0);
Node* effect = graph()->start();
@ -581,8 +582,8 @@ TEST_F(RedundancyEliminationTest, CheckedTaggedToInt64) {
// CheckedTaggedToTaggedPointer
TEST_F(RedundancyEliminationTest, CheckedTaggedToTaggedPointer) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -608,8 +609,8 @@ TEST_F(RedundancyEliminationTest, CheckedTaggedToTaggedPointer) {
// CheckedTaggedToTaggedSigned
TEST_F(RedundancyEliminationTest, CheckedTaggedToTaggedSigned) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -635,8 +636,8 @@ TEST_F(RedundancyEliminationTest, CheckedTaggedToTaggedSigned) {
// CheckedCompressedToTaggedPointer
TEST_F(RedundancyEliminationTest, CheckedCompressedToTaggedPointer) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -662,8 +663,8 @@ TEST_F(RedundancyEliminationTest, CheckedCompressedToTaggedPointer) {
// CheckedCompressedToTaggedSigned
TEST_F(RedundancyEliminationTest, CheckedCompressedToTaggedSigned) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -689,8 +690,8 @@ TEST_F(RedundancyEliminationTest, CheckedCompressedToTaggedSigned) {
// CheckedTaggedToCompressedPointer
TEST_F(RedundancyEliminationTest, CheckedTaggedToCompressedPointer) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -716,8 +717,8 @@ TEST_F(RedundancyEliminationTest, CheckedTaggedToCompressedPointer) {
// CheckedTaggedToCompressedSigned
TEST_F(RedundancyEliminationTest, CheckedTaggedToCompressedSigned) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -743,8 +744,8 @@ TEST_F(RedundancyEliminationTest, CheckedTaggedToCompressedSigned) {
// CheckedTruncateTaggedToWord32
TEST_F(RedundancyEliminationTest, CheckedTruncateTaggedToWord32) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(CheckTaggedInputMode, mode, kCheckTaggedInputModes) {
Node* value = Parameter(0);
Node* effect = graph()->start();
@ -770,8 +771,8 @@ TEST_F(RedundancyEliminationTest, CheckedTruncateTaggedToWord32) {
TEST_F(RedundancyEliminationTest,
CheckedTruncateTaggedToWord32SubsumedByCheckedTruncateTaggedToWord32) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -801,8 +802,8 @@ TEST_F(RedundancyEliminationTest,
// CheckedUint32Bounds
TEST_F(RedundancyEliminationTest, CheckedUint32Bounds) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* index = Parameter(0);
Node* length = Parameter(1);
Node* effect = graph()->start();
@ -831,8 +832,8 @@ TEST_F(RedundancyEliminationTest, CheckedUint32Bounds) {
// CheckedUint32ToInt32
TEST_F(RedundancyEliminationTest, CheckedUint32ToInt32) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -858,8 +859,8 @@ TEST_F(RedundancyEliminationTest, CheckedUint32ToInt32) {
// CheckedUint32ToTaggedSigned
TEST_F(RedundancyEliminationTest, CheckedUint32ToTaggedSigned) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -885,8 +886,8 @@ TEST_F(RedundancyEliminationTest, CheckedUint32ToTaggedSigned) {
// CheckedUint64Bounds
TEST_F(RedundancyEliminationTest, CheckedUint64Bounds) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* index = Parameter(0);
Node* length = Parameter(1);
Node* effect = graph()->start();
@ -913,8 +914,8 @@ TEST_F(RedundancyEliminationTest, CheckedUint64Bounds) {
// CheckedUint64ToInt32
TEST_F(RedundancyEliminationTest, CheckedUint64ToInt32) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -940,8 +941,8 @@ TEST_F(RedundancyEliminationTest, CheckedUint64ToInt32) {
// CheckedUint64ToTaggedSigned
TEST_F(RedundancyEliminationTest, CheckedUint64ToTaggedSigned) {
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* value = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
@ -969,8 +970,8 @@ TEST_F(RedundancyEliminationTest, CheckedUint64ToTaggedSigned) {
TEST_F(RedundancyEliminationTest,
SpeculativeNumberEqualWithCheckBoundsBetterType) {
Typer typer(broker(), Typer::kNoFlags, graph(), tick_counter());
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* lhs = Parameter(Type::Any(), 0);
Node* rhs = Parameter(Type::Any(), 1);
Node* length = Parameter(Type::Unsigned31(), 2);
@ -1005,8 +1006,8 @@ TEST_F(RedundancyEliminationTest,
TEST_F(RedundancyEliminationTest,
SpeculativeNumberEqualWithCheckBoundsSameType) {
Typer typer(broker(), Typer::kNoFlags, graph(), tick_counter());
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* lhs = Parameter(Type::UnsignedSmall(), 0);
Node* rhs = Parameter(Type::UnsignedSmall(), 1);
Node* length = Parameter(Type::Unsigned31(), 2);
@ -1044,8 +1045,8 @@ TEST_F(RedundancyEliminationTest,
TEST_F(RedundancyEliminationTest,
SpeculativeNumberLessThanWithCheckBoundsBetterType) {
Typer typer(broker(), Typer::kNoFlags, graph(), tick_counter());
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* lhs = Parameter(Type::Any(), 0);
Node* rhs = Parameter(Type::Any(), 1);
Node* length = Parameter(Type::Unsigned31(), 2);
@ -1080,8 +1081,8 @@ TEST_F(RedundancyEliminationTest,
TEST_F(RedundancyEliminationTest,
SpeculativeNumberLessThanWithCheckBoundsSameType) {
Typer typer(broker(), Typer::kNoFlags, graph(), tick_counter());
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* lhs = Parameter(Type::UnsignedSmall(), 0);
Node* rhs = Parameter(Type::UnsignedSmall(), 1);
Node* length = Parameter(Type::Unsigned31(), 2);
@ -1119,8 +1120,8 @@ TEST_F(RedundancyEliminationTest,
TEST_F(RedundancyEliminationTest,
SpeculativeNumberLessThanOrEqualWithCheckBoundsBetterType) {
Typer typer(broker(), Typer::kNoFlags, graph(), tick_counter());
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* lhs = Parameter(Type::Any(), 0);
Node* rhs = Parameter(Type::Any(), 1);
Node* length = Parameter(Type::Unsigned31(), 2);
@ -1155,8 +1156,8 @@ TEST_F(RedundancyEliminationTest,
TEST_F(RedundancyEliminationTest,
SpeculativeNumberLessThanOrEqualWithCheckBoundsSameType) {
Typer typer(broker(), Typer::kNoFlags, graph(), tick_counter());
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
Node* lhs = Parameter(Type::UnsignedSmall(), 0);
Node* rhs = Parameter(Type::UnsignedSmall(), 1);
Node* length = Parameter(Type::Unsigned31(), 2);
@ -1194,7 +1195,7 @@ TEST_F(RedundancyEliminationTest,
TEST_F(RedundancyEliminationTest,
SpeculativeNumberAddWithCheckBoundsBetterType) {
Typer typer(broker(), Typer::kNoFlags, graph(), tick_counter());
TRACED_FOREACH(FeedbackSource, feedback, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback, vector_slot_pairs()) {
TRACED_FOREACH(NumberOperationHint, hint, kNumberOperationHints) {
Node* lhs = Parameter(Type::Any(), 0);
Node* rhs = Parameter(Type::Any(), 1);
@ -1220,7 +1221,7 @@ TEST_F(RedundancyEliminationTest,
TEST_F(RedundancyEliminationTest, SpeculativeNumberAddWithCheckBoundsSameType) {
Typer typer(broker(), Typer::kNoFlags, graph(), tick_counter());
TRACED_FOREACH(FeedbackSource, feedback, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback, vector_slot_pairs()) {
TRACED_FOREACH(NumberOperationHint, hint, kNumberOperationHints) {
Node* lhs = Parameter(Type::Range(42.0, 42.0, zone()), 0);
Node* rhs = Parameter(Type::Any(), 0);
@ -1250,7 +1251,7 @@ TEST_F(RedundancyEliminationTest, SpeculativeNumberAddWithCheckBoundsSameType) {
TEST_F(RedundancyEliminationTest,
SpeculativeNumberSubtractWithCheckBoundsBetterType) {
Typer typer(broker(), Typer::kNoFlags, graph(), tick_counter());
TRACED_FOREACH(FeedbackSource, feedback, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback, vector_slot_pairs()) {
TRACED_FOREACH(NumberOperationHint, hint, kNumberOperationHints) {
Node* lhs = Parameter(Type::Any(), 0);
Node* rhs = Parameter(Type::Any(), 1);
@ -1278,7 +1279,7 @@ TEST_F(RedundancyEliminationTest,
TEST_F(RedundancyEliminationTest,
SpeculativeNumberSubtractWithCheckBoundsSameType) {
Typer typer(broker(), Typer::kNoFlags, graph(), tick_counter());
TRACED_FOREACH(FeedbackSource, feedback, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback, vector_slot_pairs()) {
TRACED_FOREACH(NumberOperationHint, hint, kNumberOperationHints) {
Node* lhs = Parameter(Type::Range(42.0, 42.0, zone()), 0);
Node* rhs = Parameter(Type::Any(), 0);
@ -1309,7 +1310,7 @@ TEST_F(RedundancyEliminationTest,
TEST_F(RedundancyEliminationTest,
SpeculativeSafeIntegerAddWithCheckBoundsBetterType) {
Typer typer(broker(), Typer::kNoFlags, graph(), tick_counter());
TRACED_FOREACH(FeedbackSource, feedback, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback, vector_slot_pairs()) {
TRACED_FOREACH(NumberOperationHint, hint, kNumberOperationHints) {
Node* lhs = Parameter(Type::Any(), 0);
Node* rhs = Parameter(Type::Any(), 1);
@ -1337,7 +1338,7 @@ TEST_F(RedundancyEliminationTest,
TEST_F(RedundancyEliminationTest,
SpeculativeSafeIntegerAddWithCheckBoundsSameType) {
Typer typer(broker(), Typer::kNoFlags, graph(), tick_counter());
TRACED_FOREACH(FeedbackSource, feedback, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback, vector_slot_pairs()) {
TRACED_FOREACH(NumberOperationHint, hint, kNumberOperationHints) {
Node* lhs = Parameter(Type::Range(42.0, 42.0, zone()), 0);
Node* rhs = Parameter(Type::Any(), 0);
@ -1368,7 +1369,7 @@ TEST_F(RedundancyEliminationTest,
TEST_F(RedundancyEliminationTest,
SpeculativeSafeIntegerSubtractWithCheckBoundsBetterType) {
Typer typer(broker(), Typer::kNoFlags, graph(), tick_counter());
TRACED_FOREACH(FeedbackSource, feedback, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback, vector_slot_pairs()) {
TRACED_FOREACH(NumberOperationHint, hint, kNumberOperationHints) {
Node* lhs = Parameter(Type::Any(), 0);
Node* rhs = Parameter(Type::Any(), 1);
@ -1396,7 +1397,7 @@ TEST_F(RedundancyEliminationTest,
TEST_F(RedundancyEliminationTest,
SpeculativeSafeIntegerSubtractWithCheckBoundsSameType) {
Typer typer(broker(), Typer::kNoFlags, graph(), tick_counter());
TRACED_FOREACH(FeedbackSource, feedback, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback, vector_slot_pairs()) {
TRACED_FOREACH(NumberOperationHint, hint, kNumberOperationHints) {
Node* lhs = Parameter(Type::Range(42.0, 42.0, zone()), 0);
Node* rhs = Parameter(Type::Any(), 0);
@ -1427,8 +1428,8 @@ TEST_F(RedundancyEliminationTest,
TEST_F(RedundancyEliminationTest,
SpeculativeToNumberWithCheckBoundsBetterType) {
Typer typer(broker(), Typer::kNoFlags, graph(), tick_counter());
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(NumberOperationHint, hint, kNumberOperationHints) {
Node* index = Parameter(Type::Any(), 0);
Node* length = Parameter(Type::Unsigned31(), 1);
@ -1455,8 +1456,8 @@ TEST_F(RedundancyEliminationTest,
TEST_F(RedundancyEliminationTest, SpeculativeToNumberWithCheckBoundsSameType) {
Typer typer(broker(), Typer::kNoFlags, graph(), tick_counter());
TRACED_FOREACH(FeedbackSource, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(FeedbackSource, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback1, vector_slot_pairs()) {
TRACED_FOREACH(VectorSlotPair, feedback2, vector_slot_pairs()) {
TRACED_FOREACH(NumberOperationHint, hint, kNumberOperationHints) {
Node* index = Parameter(Type::Range(42.0, 42.0, zone()), 0);
Node* length = Parameter(Type::Unsigned31(), 1);

View File

@ -360,7 +360,7 @@ TEST_F(SimplifiedOperatorReducerTest, CheckedFloat64ToInt32WithConstant) {
TRACED_FOREACH(int32_t, n, kInt32Values) {
Reduction r = Reduce(graph()->NewNode(
simplified()->CheckedFloat64ToInt32(
CheckForMinusZeroMode::kDontCheckForMinusZero, FeedbackSource()),
CheckForMinusZeroMode::kDontCheckForMinusZero, VectorSlotPair()),
Float64Constant(n), effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsInt32Constant(n));
@ -418,7 +418,7 @@ TEST_F(SimplifiedOperatorReducerTest, CheckSmiWithChangeInt31ToTaggedSigned) {
Node* value =
graph()->NewNode(simplified()->ChangeInt31ToTaggedSigned(), param0);
Reduction reduction = Reduce(graph()->NewNode(
simplified()->CheckSmi(FeedbackSource()), value, effect, control));
simplified()->CheckSmi(VectorSlotPair()), value, effect, control));
ASSERT_TRUE(reduction.Changed());
EXPECT_EQ(value, reduction.replacement());
}
@ -428,7 +428,7 @@ TEST_F(SimplifiedOperatorReducerTest, CheckSmiWithNumberConstant) {
Node* control = graph()->start();
Node* value = NumberConstant(1.0);
Reduction reduction = Reduce(graph()->NewNode(
simplified()->CheckSmi(FeedbackSource()), value, effect, control));
simplified()->CheckSmi(VectorSlotPair()), value, effect, control));
ASSERT_TRUE(reduction.Changed());
EXPECT_EQ(value, reduction.replacement());
}
@ -438,9 +438,9 @@ TEST_F(SimplifiedOperatorReducerTest, CheckSmiWithCheckSmi) {
Node* effect = graph()->start();
Node* control = graph()->start();
Node* value = effect = graph()->NewNode(
simplified()->CheckSmi(FeedbackSource()), param0, effect, control);
simplified()->CheckSmi(VectorSlotPair()), param0, effect, control);
Reduction reduction = Reduce(graph()->NewNode(
simplified()->CheckSmi(FeedbackSource()), value, effect, control));
simplified()->CheckSmi(VectorSlotPair()), value, effect, control));
ASSERT_TRUE(reduction.Changed());
EXPECT_EQ(value, reduction.replacement());
}

View File

@ -463,7 +463,7 @@ TEST_MONOTONICITY(Add)
#undef TEST_MONOTONICITY
TEST_F(TyperTest, Monotonicity_InstanceOf) {
TestBinaryMonotonicity(javascript_.InstanceOf(FeedbackSource()));
TestBinaryMonotonicity(javascript_.InstanceOf(VectorSlotPair()));
}
// JS BINOPS without hint