5 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
6 #define V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
25 base::RandomNumberGenerator*
rng() {
return &
rng_; }
39 MakeMachineSignature(test->
zone(), return_type)),
45 MakeMachineSignature(test->
zone(), return_type, parameter0_type)),
51 MakeMachineSignature(test->
zone(), return_type, parameter0_type,
59 MakeMachineSignature(test->
zone(), return_type, parameter0_type,
60 parameter1_type, parameter2_type)),
64 return Build(InstructionSelector::Features(feature));
67 return Build(InstructionSelector::Features(feature1, feature2));
70 return Build(InstructionSelector::Features(),
mode);
72 Stream
Build(InstructionSelector::Features features,
80 return builder.
Build();
88 return builder.
Build();
98 return builder.
Build();
110 return builder.
Build();
119 size_t size()
const {
return instructions_.size(); }
121 EXPECT_LT(index,
size());
122 return instructions_[index];
126 return IsDouble(ToVreg(operand));
129 return doubles_.find(virtual_register) != doubles_.end();
133 return IsInteger(ToVreg(operand));
136 return !IsDouble(virtual_register) && !IsReference(virtual_register);
140 return IsReference(ToVreg(operand));
143 return references_.find(virtual_register) != references_.end();
147 return ToConstant(operand).ToFloat32();
151 return ToConstant(operand).ToInt32();
155 return ToConstant(operand).ToInt64();
159 if (operand->IsConstant())
return operand->
index();
165 EXPECT_LT(deoptimization_id, GetFrameStateDescriptorCount());
166 return deoptimization_entries_[deoptimization_id];
170 return static_cast<int>(deoptimization_entries_.size());
175 ConstantMap::const_iterator
i;
176 if (operand->IsConstant()) {
177 i = constants_.find(operand->
index());
178 EXPECT_FALSE(constants_.end() ==
i);
181 i = immediates_.find(operand->
index());
182 EXPECT_FALSE(immediates_.end() ==
i);
184 EXPECT_EQ(operand->
index(),
i->first);
188 friend class StreamBuilder;
200 base::RandomNumberGenerator
rng_;
204 template <
typename T>
207 public ::testing::WithParamInterface<T> {};
const Instruction * operator[](size_t index) const
bool IsReference(int virtual_register) const
Stream Build(StreamBuilderMode mode=kTargetInstructions)
StreamBuilder(InstructionSelectorTest *test, MachineType return_type, MachineType parameter0_type, MachineType parameter1_type, MachineType parameter2_type)
bool IsInteger(int virtual_register) const
MachineSignature * MakeMachineSignature(Zone *zone, MachineType return_type, MachineType parameter0_type)
std::map< int, Constant > ConstantMap
int GetFrameStateDescriptorCount()
int ToVreg(const InstructionOperand *operand) const
int32_t ToInt32(const InstructionOperand *operand) const
std::deque< FrameStateDescriptor * > deoptimization_entries_
MachineSignature * MakeMachineSignature(Zone *zone, MachineType return_type, MachineType parameter0_type, MachineType parameter1_type, MachineType parameter2_type)
MachineSignature * MakeMachineSignature(Zone *zone, MachineType return_type, MachineType parameter0_type, MachineType parameter1_type)
FrameStateDescriptor * GetFrameStateDescriptor(int deoptimization_id)
int64_t ToInt64(const InstructionOperand *operand) const
float ToFloat32(const InstructionOperand *operand) const
MachineSignature * MakeMachineSignature(Zone *zone, MachineType return_type)
std::set< int > references_
StreamBuilder(InstructionSelectorTest *test, MachineType return_type, MachineType parameter0_type, MachineType parameter1_type)
StreamBuilder(InstructionSelectorTest *test, MachineType return_type, MachineType parameter0_type)
InstructionSelectorTest * test_
Stream Build(InstructionSelector::Features features, StreamBuilderMode mode=kTargetInstructions)
Stream Build(CpuFeature feature)
StreamBuilder(InstructionSelectorTest *test, MachineType return_type)
Stream Build(CpuFeature feature1, CpuFeature feature2)
std::deque< Instruction * > instructions_
bool IsReference(const InstructionOperand *operand) const
bool IsDouble(const InstructionOperand *operand) const
Constant ToConstant(const InstructionOperand *operand) const
bool IsDouble(int virtual_register) const
bool IsInteger(const InstructionOperand *operand) const
@ kAllExceptNopInstructions
base::RandomNumberGenerator rng_
InstructionSelectorTest()
virtual ~InstructionSelectorTest()
base::RandomNumberGenerator * rng()
static const UnallocatedOperand * cast(const InstructionOperand *op)
int virtual_register() const
enable harmony numeric enable harmony object literal extensions Optimize object size
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long mode(MIPS only)") DEFINE_BOOL(enable_always_align_csp
Debugger support for the V8 JavaScript engine.