V8 Project
v8::internal::compiler Namespace Reference

Namespaces

 anonymous_namespace{common-operator-unittest.cc}
 
 anonymous_namespace{common-operator.cc}
 
 anonymous_namespace{graph-reducer-unittest.cc}
 
 anonymous_namespace{graph-unittest.cc}
 
 anonymous_namespace{instruction-selector-arm-unittest.cc}
 
 anonymous_namespace{instruction-selector-arm64-unittest.cc}
 
 anonymous_namespace{instruction-selector-ia32-unittest.cc}
 
 anonymous_namespace{instruction-selector-unittest.cc}
 
 anonymous_namespace{instruction-selector-x64-unittest.cc}
 
 anonymous_namespace{js-builtin-reducer-unittest.cc}
 
 anonymous_namespace{machine-operator-reducer-unittest.cc}
 
 anonymous_namespace{simplified-operator-reducer-unittest.cc}
 
 anonymous_namespace{simplified-operator-unittest.cc}
 
 anonymous_namespace{typer.cc}
 
 anonymous_namespace{value-numbering-reducer-unittest.cc}
 
 anonymous_namespace{value-numbering-reducer.cc}
 

Classes

class  FINAL
 
class  ArmOperandGenerator
 
struct  ArmLinkageHelperTraits
 
struct  Arm64LinkageHelperTraits
 
class  AstGraphBuilder
 
class  BASE_EMBEDDED
 
class  BasicBlockInstrumentor
 
class  ChangeLoweringTest
 
class  ChangeLoweringCommonTest
 
class  ChangeLowering32Test
 
class  ChangeLowering64Test
 
class  InstructionOperandConverter
 
struct  StaticParameterTraits< ExternalReference >
 
class  ControlBuilder
 
class  IfBuilder
 
class  LoopBuilder
 
class  SwitchBuilder
 
class  BlockBuilder
 
class  Frame
 
class  FrameOffset
 
class  NodeInputIterationTraits
 
class  NodeUseIterationTraits
 
class  GenericGraphVisit
 
class  GenericGraphBase
 
class  GenericGraph
 
class  GenericNode
 
class  GraphBuilder
 
class  StructuredGraphBuilder
 
class  GraphReducerTest
 
class  Reducer
 
class  GraphTest
 
class  Escaped
 
class  JSONGraphNodeWriter
 
class  JSONGraphEdgeWriter
 
class  GraphVisualizer
 
struct  AsDOT
 
struct  AsJSON
 
class  Graph
 
class  GraphDecorator
 
class  IA32OperandConverter
 
class  AddressingModeUnitTest
 
class  AddressingModeMatcher
 
struct  IA32LinkageHelperTraits
 
class  OperandGenerator
 
struct  CallBuffer
 
class  InstructionSelectorTest
 
class  InstructionSelectorTestWithParam
 
class  InstructionOperand
 
class  UnallocatedOperand
 
class  Instruction
 
class  GapInstruction
 
class  FrameStateDescriptor
 
class  JSBuiltinReducerTest
 
class  JSCallReduction
 
class  ContextSpecializationVisitor
 
class  JSContextSpecializer
 
class  JSGenericLowering
 
class  JSGraph
 
class  InlinerVisitor
 
class  Inlinee
 
class  CopyVisitor
 
class  JSCallFunctionAccessor
 
class  JSInliner
 
class  ContextAccess
 
struct  LoadNamedParameters
 
struct  CallParameters
 
struct  StoreNamedParameters
 
class  JSOperatorBuilder
 
struct  StaticParameterTraits< ContextAccess >
 
struct  StaticParameterTraits< Runtime::FunctionId >
 
class  JSBinopReduction
 
class  LinkageHelper
 
class  LinkageLocation
 
class  Linkage
 
class  MachineOperatorReducerTest
 
class  MachineOperatorReducerTestWithParam
 
struct  StaticParameterTraits< StoreRepresentation >
 
struct  StaticParameterTraits< LoadRepresentation >
 
struct  MachineOperatorBuilderImpl
 
class  Signature
 
class  NodeAuxData
 
class  NodeCache
 
struct  NodeMatcher
 
struct  ValueMatcher
 
class  ScaleFactorMatcher
 
class  IndexAndDisplacementMatcher
 
class  NodeProperties
 
class  NodeData
 
class  IrOpcode
 
class  OperatorProperties
 
class  Operator
 
class  SimpleOperator
 
struct  StaticParameterTraits
 
struct  StaticParameterTraits< int >
 
struct  StaticParameterTraits< double >
 
struct  StaticParameterTraits< Unique< Object > >
 
struct  StaticParameterTraits< Unique< Name > >
 
class  Operator1
 
class  PhaseStats
 
class  AstGraphBuilderWithPositions
 
class  Pipeline
 
class  RawMachineAssembler
 
class  LifetimePosition
 
class  UseInterval
 
class  UsePosition
 
class  LiveRange
 
class  RegisterAllocatorPhase
 
class  RepresentationChanger
 
class  BasicBlockData
 
class  Schedule
 
class  CFGBuilder
 
class  ScheduleEarlyNodeVisitor
 
class  PrepareUsesVisitor
 
class  ScheduleLateNodeVisitor
 
struct  SpecialRPOStackFrame
 
struct  BlockList
 
struct  LoopInfo
 
class  Scheduler
 
class  RepresentationSelector
 
class  SimplifiedLowering
 
class  SimplifiedOperatorReducerTest
 
class  SimplifiedOperatorReducerTestWithParam
 
class  SimplifiedPureOperatorTest
 
class  SimplifiedElementAccessOperatorTest
 
struct  StaticParameterTraits< FieldAccess >
 
struct  StaticParameterTraits< ElementAccess >
 
struct  FieldAccess
 
struct  ElementAccess
 
class  Typer
 
class  ValueNumberingReducerTest
 
class  Verifier
 
class  ScheduleVerifier
 
struct  Immediate64
 
struct  RegisterOrOperand
 
class  X64OperandConverter
 
struct  X64LinkageHelperTraits
 

Typedefs

typedef InstructionSelectorTestWithParam< DPI > InstructionSelectorDPITest
 
typedef InstructionSelectorTestWithParam< ODPI > InstructionSelectorODPITest
 
typedef InstructionSelectorTestWithParam< ShiftInstructionSelectorShiftTest
 
typedef InstructionSelectorTestWithParam< MemoryAccess > InstructionSelectorMemoryAccessTest
 
typedef LinkageHelper< ArmLinkageHelperTraitsLH
 
typedef InstructionSelectorTestWithParam< MachInst2 > InstructionSelectorLogicalTest
 
typedef InstructionSelectorTestWithParam< MachInst2 > InstructionSelectorAddSubTest
 
typedef InstructionSelectorTestWithParam< MachInst2 > InstructionSelectorDPFlagSetTest
 
typedef InstructionSelectorTestWithParam< MachInst2 > InstructionSelectorOvfAddSubTest
 
typedef InstructionSelectorTestWithParam< MachInst2 > InstructionSelectorMulDivTest
 
typedef InstructionSelectorTestWithParam< MulDPInst > InstructionSelectorIntDPWithIntMulTest
 
typedef InstructionSelectorTestWithParam< MachInst2 > InstructionSelectorFPArithTest
 
typedef InstructionSelectorTestWithParam< FPCmp > InstructionSelectorFPCmpTest
 
typedef InstructionSelectorTestWithParam< Conversion > InstructionSelectorConversionTest
 
typedef InstructionSelectorTestWithParam< MachInst2 > InstructionSelectorComparisonTest
 
typedef InstructionSelectorTestWithParam< MachInst2 > InstructionSelectorLogicalWithNotRHSTest
 
typedef ZoneList< MoveOperands >::iterator op_iterator
 
typedef int NodeId
 
typedef int32_t InstructionCode
 
typedef BitField< ArchOpcode, 0, 7 > ArchOpcodeField
 
typedef BitField< AddressingMode, 7, 5 > AddressingModeField
 
typedef BitField< FlagsMode, 12, 2 > FlagsModeField
 
typedef BitField< FlagsCondition, 14, 5 > FlagsConditionField
 
typedef BitField< int, 14, 18 > MiscField
 
typedef InstructionSelectorTestWithParam< MachineTypeInstructionSelectorPhiTest
 
typedef ZoneVector< InstructionOperand * > InstructionOperandVector
 
typedef ZoneDeque< Constant > ConstantDeque
 
typedef std::map< int, Constant, std::less< int >, zone_allocator< std::pair< int, Constant > > > ConstantMap
 
typedef ZoneDeque< Instruction * > InstructionDeque
 
typedef ZoneDeque< PointerMap * > PointerMapDeque
 
typedef ZoneVector< FrameStateDescriptor * > DeoptimizationVector
 
typedef Signature< LinkageLocationLocationSignature
 
typedef MachineOperatorReducerTestWithParam< UnaryOperator > MachineUnaryOperatorReducerTest
 
typedef MachineType LoadRepresentation
 
typedef uint16_t MachineTypeUnion
 
typedef Signature< MachineTypeMachineSignature
 
typedef NodeCache< int64_t > Int64NodeCache
 
typedef NodeCache< int32_t > Int32NodeCache
 
typedef NodeCache< void * > PtrNodeCache
 
typedef IntMatcher< int32_t, IrOpcode::kInt32Constant > Int32Matcher
 
typedef IntMatcher< uint32_t, IrOpcode::kInt32Constant > Uint32Matcher
 
typedef IntMatcher< int64_t, IrOpcode::kInt64Constant > Int64Matcher
 
typedef IntMatcher< uint64_t, IrOpcode::kInt64Constant > Uint64Matcher
 
typedef FloatMatcher< float, IrOpcode::kFloat32Constant > Float32Matcher
 
typedef FloatMatcher< double, IrOpcode::kFloat64Constant > Float64Matcher
 
typedef FloatMatcher< double, IrOpcode::kNumberConstant > NumberMatcher
 
typedef BinopMatcher< Int32Matcher, Int32MatcherInt32BinopMatcher
 
typedef BinopMatcher< Uint32Matcher, Uint32MatcherUint32BinopMatcher
 
typedef BinopMatcher< Int64Matcher, Int64MatcherInt64BinopMatcher
 
typedef BinopMatcher< Uint64Matcher, Uint64MatcherUint64BinopMatcher
 
typedef BinopMatcher< Float64Matcher, Float64MatcherFloat64BinopMatcher
 
typedef GenericGraphVisit::NullNodeVisitor< NodeData, Node > NullNodeVisitor
 
typedef std::set< Node *, std::less< Node * >, zone_allocator< Node * > > NodeSet
 
typedef NodeSet::iterator NodeSetIter
 
typedef NodeSet::reverse_iterator NodeSetRIter
 
typedef ZoneVector< Node * > NodeVector
 
typedef NodeVector::iterator NodeVectorIter
 
typedef NodeVector::const_iterator NodeVectorConstIter
 
typedef NodeVector::reverse_iterator NodeVectorRIter
 
typedef ZoneVector< NodeVectorNodeVectorVector
 
typedef NodeVectorVector::iterator NodeVectorVectorIter
 
typedef NodeVectorVector::reverse_iterator NodeVectorVectorRIter
 
typedef Node::Uses::iterator UseIter
 
typedef Node::Inputs::iterator InputIter
 
typedef GenericGraphVisit::NullNodeVisitor< BasicBlockData, BasicBlock > NullBasicBlockVisitor
 
typedef ZoneVector< BasicBlock * > BasicBlockVector
 
typedef BasicBlockVector::iterator BasicBlockVectorIter
 
typedef BasicBlockVector::reverse_iterator BasicBlockVectorRIter
 
typedef SimplifiedOperatorReducerTestWithParam< UnaryOperator > SimplifiedUnaryOperatorTest
 

Enumerations

enum  ImmediateMode {
  kArithmeticImm , kShift32Imm , kShift64Imm , kLogical32Imm ,
  kLogical64Imm , kLoadStoreImm8 , kLoadStoreImm16 , kLoadStoreImm32 ,
  kLoadStoreImm64 , kNoImmediate
}
 
enum  LhsKind { VARIABLE , NAMED_PROPERTY , KEYED_PROPERTY }
 
enum  OutputFrameStateCombine { kPushOutput , kIgnoreOutput }
 
enum  FrameStateType { JS_FRAME , ARGUMENTS_ADAPTOR }
 
enum  ArchOpcode { kLastArchOpcode = -1 ARCH_OPCODE_LIST(COUNT_ARCH_OPCODE) }
 
enum  AddressingMode { kLastAddressingMode = -1 ADDRESSING_MODE_LIST(COUNT_ADDRESSING_MODE) }
 
enum  FlagsMode { kFlags_none = 0 , kFlags_branch = 1 , kFlags_set = 2 }
 
enum  FlagsCondition {
  kEqual , kNotEqual , kSignedLessThan , kSignedGreaterThanOrEqual ,
  kSignedLessThanOrEqual , kSignedGreaterThan , kUnsignedLessThan , kUnsignedGreaterThanOrEqual ,
  kUnsignedLessThanOrEqual , kUnsignedGreaterThan , kUnorderedEqual , kUnorderedNotEqual ,
  kUnorderedLessThan , kUnorderedGreaterThanOrEqual , kUnorderedLessThanOrEqual , kUnorderedGreaterThan ,
  kOverflow , kNotOverflow
}
 
enum  WriteBarrierKind { kNoWriteBarrier , kFullWriteBarrier }
 
enum  MachineType {
  kRepBit = 1 << 0 , kRepWord8 = 1 << 1 , kRepWord16 = 1 << 2 , kRepWord32 = 1 << 3 ,
  kRepWord64 = 1 << 4 , kRepFloat32 = 1 << 5 , kRepFloat64 = 1 << 6 , kRepTagged = 1 << 7 ,
  kTypeBool = 1 << 8 , kTypeInt32 = 1 << 9 , kTypeUint32 = 1 << 10 , kTypeInt64 = 1 << 11 ,
  kTypeUint64 = 1 << 12 , kTypeNumber = 1 << 13 , kTypeAny = 1 << 14 , kMachNone = 0 ,
  kMachFloat32 = kRepFloat32 | kTypeNumber , kMachFloat64 = kRepFloat64 | kTypeNumber , kMachInt8 = kRepWord8 | kTypeInt32 , kMachUint8 = kRepWord8 | kTypeUint32 ,
  kMachInt16 = kRepWord16 | kTypeInt32 , kMachUint16 = kRepWord16 | kTypeUint32 , kMachInt32 = kRepWord32 | kTypeInt32 , kMachUint32 = kRepWord32 | kTypeUint32 ,
  kMachInt64 = kRepWord64 | kTypeInt64 , kMachUint64 = kRepWord64 | kTypeUint64 , kMachPtr = (kPointerSize == 4) ? kRepWord32 : kRepWord64 , kMachAnyTagged = kRepTagged | kTypeAny
}
 
enum  RegisterKind { UNALLOCATED_REGISTERS , GENERAL_REGISTERS , DOUBLE_REGISTERS }
 
enum  Phase { PROPAGATE , LOWER }
 
enum  BaseTaggedness { kUntaggedBase , kTaggedBase }
 
enum  Immediate64Type { kImm64Value , kImm64Handle , kImm64Reference }
 
enum  RegisterOrOperandType { kRegister , kDoubleRegister , kOperand }
 

Functions

 TEST_P (InstructionSelectorDPITest, Parameters)
 
 TEST_P (InstructionSelectorDPITest, Immediate)
 
 TEST_P (InstructionSelectorDPITest, ShiftByParameter)
 
 TEST_P (InstructionSelectorDPITest, ShiftByImmediate)
 
 TEST_P (InstructionSelectorDPITest, BranchWithParameters)
 
 TEST_P (InstructionSelectorDPITest, BranchWithImmediate)
 
 TEST_P (InstructionSelectorDPITest, BranchWithShiftByParameter)
 
 TEST_P (InstructionSelectorDPITest, BranchWithShiftByImmediate)
 
 TEST_P (InstructionSelectorDPITest, BranchIfZeroWithParameters)
 
 TEST_P (InstructionSelectorDPITest, BranchIfNotZeroWithParameters)
 
 TEST_P (InstructionSelectorDPITest, BranchIfZeroWithImmediate)
 
 TEST_P (InstructionSelectorDPITest, BranchIfNotZeroWithImmediate)
 
 INSTANTIATE_TEST_CASE_P (InstructionSelectorTest, InstructionSelectorDPITest, ::testing::ValuesIn(kDPIs))
 
 TEST_P (InstructionSelectorODPITest, OvfWithParameters)
 
 TEST_P (InstructionSelectorODPITest, OvfWithImmediate)
 
 TEST_P (InstructionSelectorODPITest, OvfWithShiftByParameter)
 
 TEST_P (InstructionSelectorODPITest, OvfWithShiftByImmediate)
 
 TEST_P (InstructionSelectorODPITest, ValWithParameters)
 
 TEST_P (InstructionSelectorODPITest, ValWithImmediate)
 
 TEST_P (InstructionSelectorODPITest, ValWithShiftByParameter)
 
 TEST_P (InstructionSelectorODPITest, ValWithShiftByImmediate)
 
 TEST_P (InstructionSelectorODPITest, BothWithParameters)
 
 TEST_P (InstructionSelectorODPITest, BothWithImmediate)
 
 TEST_P (InstructionSelectorODPITest, BothWithShiftByParameter)
 
 TEST_P (InstructionSelectorODPITest, BothWithShiftByImmediate)
 
 TEST_P (InstructionSelectorODPITest, BranchWithParameters)
 
 TEST_P (InstructionSelectorODPITest, BranchWithImmediate)
 
 TEST_P (InstructionSelectorODPITest, BranchIfZeroWithParameters)
 
 TEST_P (InstructionSelectorODPITest, BranchIfNotZeroWithParameters)
 
 INSTANTIATE_TEST_CASE_P (InstructionSelectorTest, InstructionSelectorODPITest, ::testing::ValuesIn(kODPIs))
 
 TEST_P (InstructionSelectorShiftTest, Parameters)
 
 TEST_P (InstructionSelectorShiftTest, Immediate)
 
 TEST_P (InstructionSelectorShiftTest, Word32EqualWithParameter)
 
 TEST_P (InstructionSelectorShiftTest, Word32EqualWithParameterAndImmediate)
 
 TEST_P (InstructionSelectorShiftTest, Word32EqualToZeroWithParameters)
 
 TEST_P (InstructionSelectorShiftTest, Word32EqualToZeroWithImmediate)
 
 TEST_P (InstructionSelectorShiftTest, Word32NotWithParameters)
 
 TEST_P (InstructionSelectorShiftTest, Word32NotWithImmediate)
 
 TEST_P (InstructionSelectorShiftTest, Word32AndWithWord32NotWithParameters)
 
 TEST_P (InstructionSelectorShiftTest, Word32AndWithWord32NotWithImmediate)
 
 INSTANTIATE_TEST_CASE_P (InstructionSelectorTest, InstructionSelectorShiftTest, ::testing::ValuesIn(kShifts))
 
 TEST_P (InstructionSelectorMemoryAccessTest, LoadWithParameters)
 
 TEST_P (InstructionSelectorMemoryAccessTest, LoadWithImmediateIndex)
 
 TEST_P (InstructionSelectorMemoryAccessTest, StoreWithParameters)
 
 TEST_P (InstructionSelectorMemoryAccessTest, StoreWithImmediateIndex)
 
 INSTANTIATE_TEST_CASE_P (InstructionSelectorTest, InstructionSelectorMemoryAccessTest, ::testing::ValuesIn(kMemoryAccesses))
 
 TEST_F (InstructionSelectorTest, ChangeFloat32ToFloat64WithParameter)
 
 TEST_F (InstructionSelectorTest, TruncateFloat64ToFloat32WithParameter)
 
 TEST_F (InstructionSelectorTest, Int32AddWithInt32Mul)
 
 TEST_F (InstructionSelectorTest, Int32DivWithParameters)
 
 TEST_F (InstructionSelectorTest, Int32DivWithParametersForSUDIV)
 
 TEST_F (InstructionSelectorTest, Int32ModWithParameters)
 
 TEST_F (InstructionSelectorTest, Int32ModWithParametersForSUDIV)
 
 TEST_F (InstructionSelectorTest, Int32ModWithParametersForSUDIVAndMLS)
 
 TEST_F (InstructionSelectorTest, Int32MulWithParameters)
 
 TEST_F (InstructionSelectorTest, Int32MulWithImmediate)
 
 TEST_F (InstructionSelectorTest, Int32SubWithInt32Mul)
 
 TEST_F (InstructionSelectorTest, Int32SubWithInt32MulForMLS)
 
 TEST_F (InstructionSelectorTest, Int32UDivWithParameters)
 
 TEST_F (InstructionSelectorTest, Int32UDivWithParametersForSUDIV)
 
 TEST_F (InstructionSelectorTest, Int32UModWithParameters)
 
 TEST_F (InstructionSelectorTest, Int32UModWithParametersForSUDIV)
 
 TEST_F (InstructionSelectorTest, Int32UModWithParametersForSUDIVAndMLS)
 
 TEST_F (InstructionSelectorTest, Word32AndWithUbfxImmediateForARMv7)
 
 TEST_F (InstructionSelectorTest, Word32AndWithBfcImmediateForARMv7)
 
 TEST_F (InstructionSelectorTest, Word32ShrWithWord32AndWithImmediateForARMv7)
 
 TEST_F (InstructionSelectorTest, Word32AndWithWord32Not)
 
 TEST_F (InstructionSelectorTest, Word32EqualWithParameters)
 
 TEST_F (InstructionSelectorTest, Word32EqualWithImmediate)
 
 TEST_F (InstructionSelectorTest, Word32EqualWithZero)
 
 TEST_F (InstructionSelectorTest, Word32NotWithParameter)
 
 TEST_F (InstructionSelectorTest, Word32AndWithWord32ShrWithImmediateForARMv7)
 
static void VisitRRRFloat64 (InstructionSelector *selector, ArchOpcode opcode, Node *node)
 
static bool TryMatchROR (InstructionSelector *selector, InstructionCode *opcode_return, Node *node, InstructionOperand **value_return, InstructionOperand **shift_return)
 
static bool TryMatchASR (InstructionSelector *selector, InstructionCode *opcode_return, Node *node, InstructionOperand **value_return, InstructionOperand **shift_return)
 
static bool TryMatchLSL (InstructionSelector *selector, InstructionCode *opcode_return, Node *node, InstructionOperand **value_return, InstructionOperand **shift_return)
 
static bool TryMatchLSR (InstructionSelector *selector, InstructionCode *opcode_return, Node *node, InstructionOperand **value_return, InstructionOperand **shift_return)
 
static bool TryMatchShift (InstructionSelector *selector, InstructionCode *opcode_return, Node *node, InstructionOperand **value_return, InstructionOperand **shift_return)
 
static bool TryMatchImmediateOrShift (InstructionSelector *selector, InstructionCode *opcode_return, Node *node, size_t *input_count_return, InstructionOperand **inputs)
 
static void VisitBinop (InstructionSelector *selector, Node *node, InstructionCode opcode, InstructionCode reverse_opcode, FlagsContinuation *cont)
 
static void VisitBinop (InstructionSelector *selector, Node *node, InstructionCode opcode, InstructionCode reverse_opcode)
 
static void EmitBic (InstructionSelector *selector, Node *node, Node *left, Node *right)
 
template<typename TryMatchShift >
static void VisitShift (InstructionSelector *selector, Node *node, TryMatchShift try_match_shift, FlagsContinuation *cont)
 
template<typename TryMatchShift >
static void VisitShift (InstructionSelector *selector, Node *node, TryMatchShift try_match_shift)
 
static void EmitDiv (InstructionSelector *selector, ArchOpcode div_opcode, ArchOpcode f64i32_opcode, ArchOpcode i32f64_opcode, InstructionOperand *result_operand, InstructionOperand *left_operand, InstructionOperand *right_operand)
 
static void VisitDiv (InstructionSelector *selector, Node *node, ArchOpcode div_opcode, ArchOpcode f64i32_opcode, ArchOpcode i32f64_opcode)
 
static void VisitMod (InstructionSelector *selector, Node *node, ArchOpcode div_opcode, ArchOpcode f64i32_opcode, ArchOpcode i32f64_opcode)
 
static void VisitWordCompare (InstructionSelector *selector, Node *node, InstructionCode opcode, FlagsContinuation *cont, bool commutative)
 
static int AlignedStackSlots (int stack_slots)
 
 TEST_P (InstructionSelectorLogicalTest, Parameter)
 
 TEST_P (InstructionSelectorLogicalTest, Immediate)
 
 INSTANTIATE_TEST_CASE_P (InstructionSelectorTest, InstructionSelectorLogicalTest, ::testing::ValuesIn(kLogicalInstructions))
 
 TEST_P (InstructionSelectorAddSubTest, ImmediateOnRight)
 
 TEST_P (InstructionSelectorAddSubTest, ImmediateOnLeft)
 
 INSTANTIATE_TEST_CASE_P (InstructionSelectorTest, InstructionSelectorAddSubTest, ::testing::ValuesIn(kAddSubInstructions))
 
 TEST_F (InstructionSelectorTest, SubZeroOnLeft)
 
 TEST_P (InstructionSelectorDPFlagSetTest, BranchWithParameters)
 
 INSTANTIATE_TEST_CASE_P (InstructionSelectorTest, InstructionSelectorDPFlagSetTest, ::testing::ValuesIn(kDPFlagSetInstructions))
 
 TEST_F (InstructionSelectorTest, AndBranchWithImmediateOnRight)
 
 TEST_F (InstructionSelectorTest, AddBranchWithImmediateOnRight)
 
 TEST_F (InstructionSelectorTest, SubBranchWithImmediateOnRight)
 
 TEST_F (InstructionSelectorTest, AndBranchWithImmediateOnLeft)
 
 TEST_F (InstructionSelectorTest, AddBranchWithImmediateOnLeft)
 
 TEST_P (InstructionSelectorOvfAddSubTest, OvfParameter)
 
 TEST_P (InstructionSelectorOvfAddSubTest, OvfImmediateOnRight)
 
 TEST_P (InstructionSelectorOvfAddSubTest, ValParameter)
 
 TEST_P (InstructionSelectorOvfAddSubTest, ValImmediateOnRight)
 
 TEST_P (InstructionSelectorOvfAddSubTest, BothParameter)
 
 TEST_P (InstructionSelectorOvfAddSubTest, BothImmediateOnRight)
 
 TEST_P (InstructionSelectorOvfAddSubTest, BranchWithImmediateOnRight)
 
 INSTANTIATE_TEST_CASE_P (InstructionSelectorTest, InstructionSelectorOvfAddSubTest, ::testing::ValuesIn(kOvfAddSubInstructions))
 
 TEST_F (InstructionSelectorTest, OvfFlagAddImmediateOnLeft)
 
 TEST_F (InstructionSelectorTest, OvfValAddImmediateOnLeft)
 
 TEST_F (InstructionSelectorTest, OvfBothAddImmediateOnLeft)
 
 TEST_F (InstructionSelectorTest, OvfBranchWithImmediateOnLeft)
 
 TEST_P (InstructionSelectorShiftTest, Parameter)
 
 INSTANTIATE_TEST_CASE_P (InstructionSelectorTest, InstructionSelectorShiftTest, ::testing::ValuesIn(kShiftInstructions))
 
 INSTANTIATE_TEST_CASE_P (InstructionSelectorTest, InstructionSelectorMulDivTest, ::testing::ValuesIn(kMulDivInstructions))
 
 TEST_P (InstructionSelectorIntDPWithIntMulTest, AddWithMul)
 
 TEST_P (InstructionSelectorIntDPWithIntMulTest, SubWithMul)
 
 TEST_P (InstructionSelectorIntDPWithIntMulTest, NegativeMul)
 
 INSTANTIATE_TEST_CASE_P (InstructionSelectorTest, InstructionSelectorIntDPWithIntMulTest, ::testing::ValuesIn(kMulDPInstructions))
 
 INSTANTIATE_TEST_CASE_P (InstructionSelectorTest, InstructionSelectorFPArithTest, ::testing::ValuesIn(kFPArithInstructions))
 
 TEST_P (InstructionSelectorFPCmpTest, Parameter)
 
 INSTANTIATE_TEST_CASE_P (InstructionSelectorTest, InstructionSelectorFPCmpTest, ::testing::ValuesIn(kFPCmpInstructions))
 
 TEST_P (InstructionSelectorConversionTest, Parameter)
 
 INSTANTIATE_TEST_CASE_P (InstructionSelectorTest, InstructionSelectorConversionTest, ::testing::ValuesIn(kConversionInstructions))
 
 TEST_P (InstructionSelectorComparisonTest, WithParameters)
 
 TEST_P (InstructionSelectorComparisonTest, WithImmediate)
 
 INSTANTIATE_TEST_CASE_P (InstructionSelectorTest, InstructionSelectorComparisonTest, ::testing::ValuesIn(kComparisonInstructions))
 
 TEST_F (InstructionSelectorTest, Word64EqualWithZero)
 
 INSTANTIATE_TEST_CASE_P (InstructionSelectorTest, InstructionSelectorLogicalWithNotRHSTest, ::testing::ValuesIn(kLogicalWithNotRHSs))
 
 TEST_F (InstructionSelectorTest, Word64NotWithParameter)
 
 TEST_F (InstructionSelectorTest, Word32XorMinusOneWithParameter)
 
 TEST_F (InstructionSelectorTest, Word64XorMinusOneWithParameter)
 
static void VisitRRR (InstructionSelector *selector, ArchOpcode opcode, Node *node)
 
static void VisitRRRFloat64 (InstructionSelector *selector, ArchOpcode opcode, Node *node)
 
static void VisitRRO (InstructionSelector *selector, ArchOpcode opcode, Node *node, ImmediateMode operand_mode)
 
template<typename Matcher >
static void VisitBinop (InstructionSelector *selector, Node *node, InstructionCode opcode, ImmediateMode operand_mode, FlagsContinuation *cont)
 
template<typename Matcher >
static void VisitBinop (InstructionSelector *selector, Node *node, ArchOpcode opcode, ImmediateMode operand_mode)
 
template<typename Matcher >
static void VisitLogical (InstructionSelector *selector, Node *node, Matcher *m, ArchOpcode opcode, bool left_can_cover, bool right_can_cover, ImmediateMode imm_mode)
 
static void VisitCompare (InstructionSelector *selector, InstructionCode opcode, InstructionOperand *left, InstructionOperand *right, FlagsContinuation *cont)
 
static void VisitWordCompare (InstructionSelector *selector, Node *node, InstructionCode opcode, FlagsContinuation *cont, bool commutative)
 
static LhsKind DetermineLhsKind (Expression *expr)
 
static Handle< SharedFunctionInfoSearchSharedFunctionInfo (Code *unoptimized_code, FunctionLiteral *expr)
 
static NodeVector::iterator FindInsertionPoint (NodeVector *nodes)
 
static const OperatorPointerConstant (CommonOperatorBuilder *common, void *ptr)
 
std::ostream & operator<< (std::ostream &os, const MachineType &type)
 
 TARGET_TEST_P (ChangeLoweringCommonTest, ChangeBitToBool)
 
 TARGET_TEST_P (ChangeLoweringCommonTest, ChangeBoolToBit)
 
 TARGET_TEST_P (ChangeLoweringCommonTest, ChangeFloat64ToTagged)
 
 TARGET_TEST_P (ChangeLoweringCommonTest, StringAdd)
 
 INSTANTIATE_TEST_CASE_P (ChangeLoweringTest, ChangeLoweringCommonTest, ::testing::Values(kRepWord32, kRepWord64))
 
 TARGET_TEST_F (ChangeLowering32Test, ChangeInt32ToTagged)
 
 TARGET_TEST_F (ChangeLowering32Test, ChangeTaggedToFloat64)
 
 TARGET_TEST_F (ChangeLowering32Test, ChangeTaggedToInt32)
 
 TARGET_TEST_F (ChangeLowering32Test, ChangeTaggedToUint32)
 
 TARGET_TEST_F (ChangeLowering32Test, ChangeUint32ToTagged)
 
 TARGET_TEST_F (ChangeLowering64Test, ChangeInt32ToTagged)
 
 TARGET_TEST_F (ChangeLowering64Test, ChangeTaggedToFloat64)
 
 TARGET_TEST_F (ChangeLowering64Test, ChangeTaggedToInt32)
 
 TARGET_TEST_F (ChangeLowering64Test, ChangeTaggedToUint32)
 
 TARGET_TEST_F (ChangeLowering64Test, ChangeUint32ToTagged)
 
static void FinishCode (MacroAssembler *masm)
 
 TEST_P (CommonSharedOperatorTest, InstancesAreGloballyShared)
 
 TEST_P (CommonSharedOperatorTest, NumberOfInputsAndOutputs)
 
 TEST_P (CommonSharedOperatorTest, OpcodeIsCorrect)
 
 TEST_P (CommonSharedOperatorTest, Properties)
 
 INSTANTIATE_TEST_CASE_P (CommonOperatorTest, CommonSharedOperatorTest, ::testing::ValuesIn(kSharedOperators))
 
 TEST_F (CommonOperatorTest, Float32Constant)
 
 TEST_F (CommonOperatorTest, ValueEffect)
 
 TEST_F (CommonOperatorTest, Finish)
 
static void VerifyMovesAreInjective (ZoneList< MoveOperands > *moves)
 
 TEST_F (GraphReducerTest, NodeIsDeadAfterReplace)
 
 TEST_F (GraphReducerTest, ReduceOnceForEveryReducer)
 
 TEST_F (GraphReducerTest, ReduceAgainAfterChanged)
 
static bool NodeIdIsLessThan (const Node *node, NodeId id)
 
Matcher< Node * > IsBranch (const Matcher< Node * > &value_matcher, const Matcher< Node * > &control_matcher)
 
Matcher< Node * > IsMerge (const Matcher< Node * > &control0_matcher, const Matcher< Node * > &control1_matcher)
 
Matcher< Node * > IsIfTrue (const Matcher< Node * > &control_matcher)
 
Matcher< Node * > IsIfFalse (const Matcher< Node * > &control_matcher)
 
Matcher< Node * > IsControlEffect (const Matcher< Node * > &control_matcher)
 
Matcher< Node * > IsValueEffect (const Matcher< Node * > &value_matcher)
 
Matcher< Node * > IsFinish (const Matcher< Node * > &value_matcher, const Matcher< Node * > &effect_matcher)
 
Matcher< Node * > IsExternalConstant (const Matcher< ExternalReference > &value_matcher)
 
Matcher< Node * > IsHeapConstant (const Matcher< Unique< HeapObject > > &value_matcher)
 
Matcher< Node * > IsInt32Constant (const Matcher< int32_t > &value_matcher)
 
Matcher< Node * > IsInt64Constant (const Matcher< int64_t > &value_matcher)
 
Matcher< Node * > IsFloat32Constant (const Matcher< float > &value_matcher)
 
Matcher< Node * > IsFloat64Constant (const Matcher< double > &value_matcher)
 
Matcher< Node * > IsNumberConstant (const Matcher< double > &value_matcher)
 
Matcher< Node * > IsPhi (const Matcher< MachineType > &type_matcher, const Matcher< Node * > &value0_matcher, const Matcher< Node * > &value1_matcher, const Matcher< Node * > &merge_matcher)
 
Matcher< Node * > IsProjection (const Matcher< size_t > &index_matcher, const Matcher< Node * > &base_matcher)
 
Matcher< Node * > IsCall (const Matcher< CallDescriptor * > &descriptor_matcher, const Matcher< Node * > &value0_matcher, const Matcher< Node * > &value1_matcher, const Matcher< Node * > &value2_matcher, const Matcher< Node * > &value3_matcher, const Matcher< Node * > &effect_matcher, const Matcher< Node * > &control_matcher)
 
Matcher< Node * > IsLoad (const Matcher< LoadRepresentation > &rep_matcher, const Matcher< Node * > &base_matcher, const Matcher< Node * > &index_matcher, const Matcher< Node * > &effect_matcher)
 
Matcher< Node * > IsStore (const Matcher< MachineType > &type_matcher, const Matcher< WriteBarrierKind > &write_barrier_matcher, const Matcher< Node * > &base_matcher, const Matcher< Node * > &index_matcher, const Matcher< Node * > &value_matcher, const Matcher< Node * > &effect_matcher, const Matcher< Node * > &control_matcher)
 
Matcher< Node * > IsNumberLessThan (const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
 
Matcher< Node * > IsNumberSubtract (const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
 
Matcher< Node * > IsWord32And (const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
 
Matcher< Node * > IsWord32Sar (const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
 
Matcher< Node * > IsWord32Shl (const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
 
Matcher< Node * > IsWord32Ror (const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
 
Matcher< Node * > IsWord32Equal (const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
 
Matcher< Node * > IsWord64And (const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
 
Matcher< Node * > IsWord64Shl (const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
 
Matcher< Node * > IsWord64Sar (const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
 
Matcher< Node * > IsWord64Equal (const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
 
Matcher< Node * > IsInt32AddWithOverflow (const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
 
Matcher< Node * > IsInt32Mul (const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
 
Matcher< Node * > IsUint32LessThanOrEqual (const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
 
Matcher< Node * > IsChangeFloat64ToInt32 (const Matcher< Node * > &input_matcher)
 
Matcher< Node * > IsChangeFloat64ToUint32 (const Matcher< Node * > &input_matcher)
 
Matcher< Node * > IsChangeInt32ToFloat64 (const Matcher< Node * > &input_matcher)
 
Matcher< Node * > IsChangeInt32ToInt64 (const Matcher< Node * > &input_matcher)
 
Matcher< Node * > IsChangeUint32ToFloat64 (const Matcher< Node * > &input_matcher)
 
Matcher< Node * > IsChangeUint32ToUint64 (const Matcher< Node * > &input_matcher)
 
Matcher< Node * > IsTruncateFloat64ToFloat32 (const Matcher< Node * > &input_matcher)
 
Matcher< Node * > IsTruncateFloat64ToInt32 (const Matcher< Node * > &input_matcher)
 
Matcher< Node * > IsTruncateInt64ToInt32 (const Matcher< Node * > &input_matcher)
 
Matcher< Node * > IsFloat64Sqrt (const Matcher< Node * > &input_matcher)
 
OStreamoperator<< (OStream &os, const AsJSON &ad)
 
static Node * GetControlCluster (Node *node)
 
static bool IsLikelyBackEdge (Node *from, int index, Node *to)
 
OStreamoperator<< (OStream &os, const AsDOT &ad)
 
static bool HasImmediateInput (Instruction *instr, int index)
 
 TEST_F (InstructionSelectorTest, Int32AddWithParameter)
 
 TEST_F (InstructionSelectorTest, Int32AddWithImmediate)
 
 TEST_F (InstructionSelectorTest, Int32SubWithParameter)
 
 TEST_F (InstructionSelectorTest, Int32SubWithImmediate)
 
 TEST_F (InstructionSelectorTest, BetterLeftOperandTestAddBinop)
 
 TEST_F (InstructionSelectorTest, BetterLeftOperandTestMulBinop)
 
 TEST_P (InstructionSelectorMemoryAccessTest, LoadWithImmediateBase)
 
 TEST_P (InstructionSelectorMemoryAccessTest, StoreWithImmediateBase)
 
 TEST_F (AddressingModeUnitTest, AddressingMode_MR)
 
 TEST_F (AddressingModeUnitTest, AddressingMode_MRI)
 
 TEST_F (AddressingModeUnitTest, AddressingMode_MR1)
 
 TEST_F (AddressingModeUnitTest, AddressingMode_MRN)
 
 TEST_F (AddressingModeUnitTest, AddressingMode_MR1I)
 
 TEST_F (AddressingModeUnitTest, AddressingMode_MRNI)
 
 TEST_F (AddressingModeUnitTest, AddressingMode_M1)
 
 TEST_F (AddressingModeUnitTest, AddressingMode_MN)
 
 TEST_F (AddressingModeUnitTest, AddressingMode_M1I)
 
 TEST_F (AddressingModeUnitTest, AddressingMode_MNI)
 
 TEST_F (AddressingModeUnitTest, AddressingMode_MI)
 
static void VisitBinop (InstructionSelector *selector, Node *node, InstructionCode opcode, FlagsContinuation *cont)
 
static void VisitBinop (InstructionSelector *selector, Node *node, InstructionCode opcode)
 
static void VisitShift (InstructionSelector *selector, Node *node, ArchOpcode opcode)
 
static void VisitDiv (InstructionSelector *selector, Node *node, ArchOpcode opcode)
 
static void VisitMod (InstructionSelector *selector, Node *node, ArchOpcode opcode)
 
static void VisitCompare (InstructionSelector *selector, InstructionCode opcode, InstructionOperand *left, InstructionOperand *right, FlagsContinuation *cont)
 
static void VisitWordCompare (InstructionSelector *selector, Node *node, InstructionCode opcode, FlagsContinuation *cont, bool commutative)
 
OStreamoperator<< (OStream &os, const ArchOpcode &ao)
 
OStreamoperator<< (OStream &os, const AddressingMode &am)
 
OStreamoperator<< (OStream &os, const FlagsMode &fm)
 
OStreamoperator<< (OStream &os, const FlagsCondition &fc)
 
 TARGET_TEST_F (InstructionSelectorTest, ReturnFloat32Constant)
 
 TARGET_TEST_F (InstructionSelectorTest, ReturnParameter)
 
 TARGET_TEST_F (InstructionSelectorTest, ReturnZero)
 
 TARGET_TEST_F (InstructionSelectorTest, TruncateFloat64ToInt32WithParameter)
 
 TARGET_TEST_F (InstructionSelectorTest, DoubleParameter)
 
 TARGET_TEST_F (InstructionSelectorTest, ReferenceParameter)
 
 TARGET_TEST_F (InstructionSelectorTest, Finish)
 
 TARGET_TEST_P (InstructionSelectorPhiTest, Doubleness)
 
 TARGET_TEST_P (InstructionSelectorPhiTest, Referenceness)
 
 INSTANTIATE_TEST_CASE_P (InstructionSelectorTest, InstructionSelectorPhiTest, ::testing::Values(kMachFloat64, kMachInt8, kMachUint8, kMachInt16, kMachUint16, kMachInt32, kMachUint32, kMachInt64, kMachUint64, kMachPtr, kMachAnyTagged))
 
 TARGET_TEST_F (InstructionSelectorTest, ValueEffect)
 
 TARGET_TEST_F (InstructionSelectorTest, CallJSFunctionWithDeopt)
 
 TARGET_TEST_F (InstructionSelectorTest, CallFunctionStubWithDeopt)
 
 TARGET_TEST_F (InstructionSelectorTest, CallFunctionStubDeoptRecursiveFrameState)
 
static void CheckNoPhis (const BasicBlock *block)
 
static InstructionOperandUseOrImmediate (OperandGenerator *g, Node *input)
 
OStreamoperator<< (OStream &os, const InstructionOperand &op)
 
OStreamoperator<< (OStream &os, const MoveOperands &mo)
 
OStreamoperator<< (OStream &os, const ParallelMove &pm)
 
OStreamoperator<< (OStream &os, const PointerMap &pm)
 
OStreamoperator<< (OStream &os, const Instruction &instr)
 
OStreamoperator<< (OStream &os, const Constant &constant)
 
OStreamoperator<< (OStream &os, const InstructionSequence &code)
 
 TEST_F (JSBuiltinReducerTest, MathAbs)
 
 TEST_F (JSBuiltinReducerTest, MathSqrt)
 
 TEST_F (JSBuiltinReducerTest, MathMax0)
 
 TEST_F (JSBuiltinReducerTest, MathMax1)
 
 TEST_F (JSBuiltinReducerTest, MathMax2)
 
 TEST_F (JSBuiltinReducerTest, MathImul)
 
 TEST_F (JSBuiltinReducerTest, MathFround)
 
static Reduction ReplaceWithPureReduction (Node *node, Reduction reduction)
 
static CallDescriptor::Flags FlagsForNode (Node *node)
 
static void Parse (Handle< JSFunction > function, CompilationInfoWithZone *info)
 
static void RelaxEffects (Node *node)
 
static Reduction ReplaceWithReduction (Node *node, Reduction reduction)
 
OStreamoperator<< (OStream &os, const CallDescriptor::Kind &k)
 
OStreamoperator<< (OStream &os, const CallDescriptor &d)
 
 TEST_P (MachineUnaryOperatorReducerTest, Parameter)
 
 INSTANTIATE_TEST_CASE_P (MachineOperatorReducerTest, MachineUnaryOperatorReducerTest, ::testing::ValuesIn(kUnaryOperators))
 
 TEST_F (MachineOperatorReducerTest, ChangeFloat64ToFloat32WithConstant)
 
 TEST_F (MachineOperatorReducerTest, ChangeFloat64ToInt32WithChangeInt32ToFloat64)
 
 TEST_F (MachineOperatorReducerTest, ChangeFloat64ToInt32WithConstant)
 
 TEST_F (MachineOperatorReducerTest, ChangeFloat64ToUint32WithChangeUint32ToFloat64)
 
 TEST_F (MachineOperatorReducerTest, ChangeFloat64ToUint32WithConstant)
 
 TEST_F (MachineOperatorReducerTest, ChangeInt32ToFloat64WithConstant)
 
 TEST_F (MachineOperatorReducerTest, ChangeInt32ToInt64WithConstant)
 
 TEST_F (MachineOperatorReducerTest, ChangeUint32ToFloat64WithConstant)
 
 TEST_F (MachineOperatorReducerTest, ChangeUint32ToUint64WithConstant)
 
 TEST_F (MachineOperatorReducerTest, TruncateFloat64ToFloat32WithChangeFloat32ToFloat64)
 
 TEST_F (MachineOperatorReducerTest, TruncateFloat64ToFloat32WithConstant)
 
 TEST_F (MachineOperatorReducerTest, TruncateFloat64ToInt32WithChangeInt32ToFloat64)
 
 TEST_F (MachineOperatorReducerTest, TruncateFloat64ToInt32WithConstant)
 
 TEST_F (MachineOperatorReducerTest, TruncateInt64ToInt32WithChangeInt32ToInt64)
 
 TEST_F (MachineOperatorReducerTest, TruncateInt64ToInt32WithConstant)
 
 TEST_F (MachineOperatorReducerTest, ReduceToWord32RorWithParameters)
 
 TEST_F (MachineOperatorReducerTest, ReduceToWord32RorWithConstant)
 
 TEST_F (MachineOperatorReducerTest, Word32RorWithZeroShift)
 
 TEST_F (MachineOperatorReducerTest, Word32RorWithConstants)
 
 TEST_F (MachineOperatorReducerTest, Word32ShlWithZeroShift)
 
 TEST_F (MachineOperatorReducerTest, Word32ShlWithWord32Sar)
 
 TEST_F (MachineOperatorReducerTest, Word32ShlWithWord32Shr)
 
 TEST_F (MachineOperatorReducerTest, Int32AddWithOverflowWithZero)
 
 TEST_F (MachineOperatorReducerTest, Int32AddWithOverflowWithConstant)
 
 TEST_F (MachineOperatorReducerTest, Int32SubWithOverflowWithZero)
 
 TEST_F (MachineOperatorReducerTest, Int32SubWithOverflowWithConstant)
 
 TEST (MachineOperatorTest, PseudoOperatorsWhenWordSizeIs32Bit)
 
 TEST (MachineOperatorTest, PseudoOperatorsWhenWordSizeIs64Bit)
 
OStreamoperator<< (OStream &os, const WriteBarrierKind &write_barrier_kind)
 
OStreamoperator<< (OStream &os, const StoreRepresentation &rep)
 
bool operator== (const StoreRepresentation &rep1, const StoreRepresentation &rep2)
 
bool operator!= (const StoreRepresentation &rep1, const StoreRepresentation &rep2)
 
OStreamoperator<< (OStream &os, const MachineType &type)
 
MachineType TypeOf (MachineType machine_type)
 
MachineType RepresentationOf (MachineType machine_type)
 
int ElementSizeOf (MachineType machine_type)
 
template<typename Key >
int32_t NodeCacheHash (Key key)
 
template<>
int32_t NodeCacheHash (int32_t key)
 
template<>
int32_t NodeCacheHash (int64_t key)
 
template<>
int32_t NodeCacheHash (double key)
 
template<>
int32_t NodeCacheHash (void *key)
 
OStreamoperator<< (OStream &os, const Operator &op)
 
OStreamoperator<< (OStream &os, const Node &n)
 
template<typename T >
static const TOpParameter (const Node *node)
 
template<typename T >
static const TOpParameter (const Operator *op)
 
static bool VerifyGraphs ()
 
static void TraceSchedule (Schedule *schedule)
 
static LifetimePosition Min (LifetimePosition a, LifetimePosition b)
 
static LifetimePosition Max (LifetimePosition a, LifetimePosition b)
 
static int UnhandledSortHelper (LiveRange *const *a, LiveRange *const *b)
 
 STATIC_ASSERT (DoubleRegister::kMaxNumAllocatableRegisters >=Register::kMaxNumAllocatableRegisters)
 
OStreamoperator<< (OStream &os, const BasicBlockData::Control &c)
 
OStreamoperator<< (OStream &os, const Schedule &s)
 
static void Trace (const char *msg,...)
 
static int Push (SpecialRPOStackFrame *stack, int depth, BasicBlock *child, int unvisited)
 
static LoopInfoComputeLoopInfo (Zone *zone, SpecialRPOStackFrame *queue, int num_loops, int num_blocks, ZoneList< std::pair< BasicBlock *, int > > *backedges)
 
static WriteBarrierKind ComputeWriteBarrierKind (BaseTaggedness base_is_tagged, MachineType representation, Type *type)
 
 TEST_P (SimplifiedUnaryOperatorTest, Parameter)
 
 INSTANTIATE_TEST_CASE_P (SimplifiedOperatorReducerTest, SimplifiedUnaryOperatorTest, ::testing::ValuesIn(kUnaryOperators))
 
 TEST_F (SimplifiedOperatorReducerTest, BooleanNotWithBooleanNot)
 
 TEST_F (SimplifiedOperatorReducerTest, BooleanNotWithFalseConstant)
 
 TEST_F (SimplifiedOperatorReducerTest, BooleanNotWithTrueConstant)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeBitToBoolWithChangeBoolToBit)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeBitToBoolWithZeroConstant)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeBitToBoolWithOneConstant)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeBoolToBitWithFalseConstant)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeBoolToBitWithTrueConstant)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeBoolToBitWithChangeBitToBool)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeFloat64ToTaggedWithConstant)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeInt32ToTaggedWithConstant)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeTaggedToFloat64WithChangeFloat64ToTagged)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeTaggedToFloat64WithChangeInt32ToTagged)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeTaggedToFloat64WithChangeUint32ToTagged)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeTaggedToFloat64WithConstant)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeTaggedToFloat64WithNaNConstant1)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeTaggedToFloat64WithNaNConstant2)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeTaggedToInt32WithChangeFloat64ToTagged)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeTaggedToInt32WithChangeInt32ToTagged)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeTaggedToInt32WithConstant)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeTaggedToInt32WithNaNConstant1)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeTaggedToInt32WithNaNConstant2)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeTaggedToUint32WithChangeFloat64ToTagged)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeTaggedToUint32WithChangeUint32ToTagged)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeTaggedToUint32WithConstant)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeTaggedToUint32WithNaNConstant1)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeTaggedToUint32WithNaNConstant2)
 
 TEST_F (SimplifiedOperatorReducerTest, ChangeUint32ToTagged)
 
std::ostream & operator<< (std::ostream &os, const ElementAccess &access)
 
 TEST_P (SimplifiedPureOperatorTest, InstancesAreGloballyShared)
 
 TEST_P (SimplifiedPureOperatorTest, NumberOfInputsAndOutputs)
 
 TEST_P (SimplifiedPureOperatorTest, OpcodeIsCorrect)
 
 TEST_P (SimplifiedPureOperatorTest, Properties)
 
 INSTANTIATE_TEST_CASE_P (SimplifiedOperatorTest, SimplifiedPureOperatorTest, ::testing::ValuesIn(kPureOperators))
 
 TEST_P (SimplifiedElementAccessOperatorTest, LoadElement)
 
 TEST_P (SimplifiedElementAccessOperatorTest, StoreElement)
 
 INSTANTIATE_TEST_CASE_P (SimplifiedOperatorTest, SimplifiedElementAccessOperatorTest, ::testing::ValuesIn(kElementAccesses))
 
OStreamoperator<< (OStream &os, BaseTaggedness base_taggedness)
 
bool operator== (ElementAccess const &lhs, ElementAccess const &rhs)
 
bool operator!= (ElementAccess const &lhs, ElementAccess const &rhs)
 
OStreamoperator<< (OStream &os, ElementAccess const &access)
 
const FieldAccessFieldAccessOf (const Operator *op)
 
const ElementAccessElementAccessOf (const Operator *op)
 
bool operator== (const SourcePosition &lhs, const SourcePosition &rhs)
 
bool operator!= (const SourcePosition &lhs, const SourcePosition &rhs)
 
 TEST_F (ValueNumberingReducerTest, AllInputsAreChecked)
 
 TEST_F (ValueNumberingReducerTest, DeadNodesAreNeverReturned)
 
 TEST_F (ValueNumberingReducerTest, OperatorEqualityNotIdentity)
 
 TEST_F (ValueNumberingReducerTest, SubsequentReductionsYieldTheSameNode)
 
 TEST_F (ValueNumberingReducerTest, WontReplaceNodeWithItself)
 
static bool IsDefUseChainLinkPresent (Node *def, Node *use)
 
static bool IsUseDefChainLinkPresent (Node *def, Node *use)
 
static bool HasDominatingDef (Schedule *schedule, Node *node, BasicBlock *container, BasicBlock *use_block, int use_pos)
 
static void CheckInputsDominate (Schedule *schedule, BasicBlock *block, Node *node, int use_pos)
 
static bool HasImmediateInput (Instruction *instr, int index)
 
 TEST_F (InstructionSelectorTest, ChangeInt32ToInt64WithParameter)
 
 TEST_F (InstructionSelectorTest, ChangeUint32ToUint64WithParameter)
 
 TEST_F (InstructionSelectorTest, TruncateInt64ToInt32WithParameter)
 
static void VisitBinop (InstructionSelector *selector, Node *node, InstructionCode opcode, FlagsContinuation *cont)
 
static void VisitBinop (InstructionSelector *selector, Node *node, InstructionCode opcode)
 
static void VisitWord32Shift (InstructionSelector *selector, Node *node, ArchOpcode opcode)
 
static void VisitWord64Shift (InstructionSelector *selector, Node *node, ArchOpcode opcode)
 
static void VisitMul (InstructionSelector *selector, Node *node, ArchOpcode opcode)
 
static void VisitDiv (InstructionSelector *selector, Node *node, ArchOpcode opcode)
 
static void VisitMod (InstructionSelector *selector, Node *node, ArchOpcode opcode)
 
static void VisitCompare (InstructionSelector *selector, InstructionCode opcode, InstructionOperand *left, InstructionOperand *right, FlagsContinuation *cont)
 
static void VisitWordCompare (InstructionSelector *selector, Node *node, InstructionCode opcode, FlagsContinuation *cont, bool commutative)
 

Variables

static const MulDPInst kMulDPInstructions []
 
static const MemoryAccess kMemoryAccesses []
 
static const MachInst2 kComparisonInstructions []
 
static const MachInst2 kLogicalWithNotRHSs []
 
static base::LazyInstance< CommonOperatorBuilderImpl >::type kImpl
 
const InstructionCode kGapInstruction = -1
 
const InstructionCode kBlockStartInstruction = -2
 
const InstructionCode kSourcePositionInstruction = -3
 
static base::LazyInstance< MachineOperatorBuilderImpl >::type kImpl
 
const MachineTypeUnion kRepMask
 
const MachineTypeUnion kTypeMask
 
static const int kBlockOnStack = -2
 
static const int kBlockVisited1 = -3
 
static const int kBlockVisited2 = -4
 
static const int kBlockUnvisited1 = -1
 
static const int kBlockUnvisited2 = kBlockVisited1
 
static base::LazyInstance< SimplifiedOperatorBuilderImpl >::type kImpl
 
static const int kNonHeapObjectHeaderSize = kHeapObjectTag
 
const bool kWin64 = false
 

Typedef Documentation

◆ AddressingModeField

◆ ArchOpcodeField

◆ BasicBlockVector

Definition at line 149 of file schedule.h.

◆ BasicBlockVectorIter

typedef BasicBlockVector::iterator v8::internal::compiler::BasicBlockVectorIter

Definition at line 150 of file schedule.h.

◆ BasicBlockVectorRIter

typedef BasicBlockVector::reverse_iterator v8::internal::compiler::BasicBlockVectorRIter

Definition at line 151 of file schedule.h.

◆ ConstantDeque

Definition at line 800 of file instruction.h.

◆ ConstantMap

typedef std::map<int, Constant, std::less<int>, zone_allocator<std::pair<int, Constant> > > v8::internal::compiler::ConstantMap

Definition at line 802 of file instruction.h.

◆ DeoptimizationVector

◆ FlagsConditionField

◆ FlagsModeField

◆ Float32Matcher

typedef FloatMatcher<float, IrOpcode::kFloat32Constant> v8::internal::compiler::Float32Matcher

Definition at line 93 of file node-matchers.h.

◆ Float64BinopMatcher

◆ Float64Matcher

typedef FloatMatcher<double, IrOpcode::kFloat64Constant> v8::internal::compiler::Float64Matcher

Definition at line 94 of file node-matchers.h.

◆ InputIter

typedef Node::Inputs::iterator v8::internal::compiler::InputIter

Definition at line 82 of file node.h.

◆ InstructionCode

Definition at line 103 of file instruction-codes.h.

◆ InstructionDeque

◆ InstructionOperandVector

◆ InstructionSelectorAddSubTest

◆ InstructionSelectorComparisonTest

◆ InstructionSelectorConversionTest

◆ InstructionSelectorDPFlagSetTest

◆ InstructionSelectorDPITest

◆ InstructionSelectorFPArithTest

◆ InstructionSelectorFPCmpTest

◆ InstructionSelectorIntDPWithIntMulTest

◆ InstructionSelectorLogicalTest

◆ InstructionSelectorLogicalWithNotRHSTest

◆ InstructionSelectorMemoryAccessTest

◆ InstructionSelectorMulDivTest

◆ InstructionSelectorODPITest

◆ InstructionSelectorOvfAddSubTest

◆ InstructionSelectorPhiTest

◆ InstructionSelectorShiftTest

◆ Int32BinopMatcher

Definition at line 136 of file node-matchers.h.

◆ Int32Matcher

typedef IntMatcher<int32_t, IrOpcode::kInt32Constant> v8::internal::compiler::Int32Matcher

Definition at line 79 of file node-matchers.h.

◆ Int32NodeCache

Definition at line 47 of file node-cache.h.

◆ Int64BinopMatcher

Definition at line 138 of file node-matchers.h.

◆ Int64Matcher

typedef IntMatcher<int64_t, IrOpcode::kInt64Constant> v8::internal::compiler::Int64Matcher

Definition at line 81 of file node-matchers.h.

◆ Int64NodeCache

Definition at line 46 of file node-cache.h.

◆ LH

◆ LoadRepresentation

◆ LocationSignature

◆ MachineSignature

◆ MachineTypeUnion

Definition at line 59 of file machine-type.h.

◆ MachineUnaryOperatorReducerTest

◆ MiscField

Definition at line 113 of file instruction-codes.h.

◆ NodeId

Definition at line 18 of file generic-node.h.

◆ NodeSet

typedef std::set<Node*, std::less<Node*>, zone_allocator<Node*> > v8::internal::compiler::NodeSet

Definition at line 68 of file node.h.

◆ NodeSetIter

typedef NodeSet::iterator v8::internal::compiler::NodeSetIter

Definition at line 69 of file node.h.

◆ NodeSetRIter

typedef NodeSet::reverse_iterator v8::internal::compiler::NodeSetRIter

Definition at line 70 of file node.h.

◆ NodeVector

Definition at line 72 of file node.h.

◆ NodeVectorConstIter

typedef NodeVector::const_iterator v8::internal::compiler::NodeVectorConstIter

Definition at line 74 of file node.h.

◆ NodeVectorIter

typedef NodeVector::iterator v8::internal::compiler::NodeVectorIter

Definition at line 73 of file node.h.

◆ NodeVectorRIter

typedef NodeVector::reverse_iterator v8::internal::compiler::NodeVectorRIter

Definition at line 75 of file node.h.

◆ NodeVectorVector

◆ NodeVectorVectorIter

typedef NodeVectorVector::iterator v8::internal::compiler::NodeVectorVectorIter

Definition at line 78 of file node.h.

◆ NodeVectorVectorRIter

typedef NodeVectorVector::reverse_iterator v8::internal::compiler::NodeVectorVectorRIter

Definition at line 79 of file node.h.

◆ NullBasicBlockVisitor

◆ NullNodeVisitor

◆ NumberMatcher

typedef FloatMatcher<double, IrOpcode::kNumberConstant> v8::internal::compiler::NumberMatcher

Definition at line 95 of file node-matchers.h.

◆ op_iterator

typedef ZoneList<MoveOperands>::iterator v8::internal::compiler::op_iterator

Definition at line 15 of file gap-resolver.cc.

◆ PointerMapDeque

Definition at line 805 of file instruction.h.

◆ PtrNodeCache

Definition at line 48 of file node-cache.h.

◆ SimplifiedUnaryOperatorTest

◆ Uint32BinopMatcher

◆ Uint32Matcher

typedef IntMatcher<uint32_t, IrOpcode::kInt32Constant> v8::internal::compiler::Uint32Matcher

Definition at line 80 of file node-matchers.h.

◆ Uint64BinopMatcher

◆ Uint64Matcher

typedef IntMatcher<uint64_t, IrOpcode::kInt64Constant> v8::internal::compiler::Uint64Matcher

Definition at line 82 of file node-matchers.h.

◆ UseIter

typedef Node::Uses::iterator v8::internal::compiler::UseIter

Definition at line 81 of file node.h.

Enumeration Type Documentation

◆ AddressingMode

Enumerator
kLastAddressingMode 

Definition at line 59 of file instruction-codes.h.

59  {
60 #define DECLARE_ADDRESSING_MODE(Name) kMode_##Name,
62 #undef DECLARE_ADDRESSING_MODE
63 #define COUNT_ADDRESSING_MODE(Name) +1
65 #undef COUNT_ADDRESSING_MODE
66 };
#define COUNT_ADDRESSING_MODE(Name)
#define DECLARE_ADDRESSING_MODE(Name)
#define ADDRESSING_MODE_LIST(V)

◆ ArchOpcode

Enumerator
kLastArchOpcode 

Definition at line 40 of file instruction-codes.h.

40  {
41 #define DECLARE_ARCH_OPCODE(Name) k##Name,
43 #undef DECLARE_ARCH_OPCODE
44 #define COUNT_ARCH_OPCODE(Name) +1
46 #undef COUNT_ARCH_OPCODE
47 };
#define COUNT_ARCH_OPCODE(Name)
#define ARCH_OPCODE_LIST(V)
#define DECLARE_ARCH_OPCODE(Name)

◆ BaseTaggedness

Enumerator
kUntaggedBase 
kTaggedBase 

Definition at line 29 of file simplified-operator.h.

◆ FlagsCondition

Enumerator
kEqual 
kNotEqual 
kSignedLessThan 
kSignedGreaterThanOrEqual 
kSignedLessThanOrEqual 
kSignedGreaterThan 
kUnsignedLessThan 
kUnsignedGreaterThanOrEqual 
kUnsignedLessThanOrEqual 
kUnsignedGreaterThan 
kUnorderedEqual 
kUnorderedNotEqual 
kUnorderedLessThan 
kUnorderedGreaterThanOrEqual 
kUnorderedLessThanOrEqual 
kUnorderedGreaterThan 
kOverflow 
kNotOverflow 

Definition at line 76 of file instruction-codes.h.

76  {
77  kEqual,
78  kNotEqual,
93  kOverflow,
95 };

◆ FlagsMode

Enumerator
kFlags_none 
kFlags_branch 
kFlags_set 

Definition at line 71 of file instruction-codes.h.

◆ FrameStateType

Enumerator
JS_FRAME 
ARGUMENTS_ADAPTOR 

Definition at line 36 of file common-operator.h.

36  {
37  JS_FRAME, // Represents an unoptimized JavaScriptFrame.
38  ARGUMENTS_ADAPTOR // Represents an ArgumentsAdaptorFrame.
39 };

◆ Immediate64Type

Enumerator
kImm64Value 
kImm64Handle 
kImm64Reference 

Definition at line 23 of file code-generator-x64.cc.

◆ ImmediateMode

Enumerator
kArithmeticImm 
kShift32Imm 
kShift64Imm 
kLogical32Imm 
kLogical64Imm 
kLoadStoreImm8 
kLoadStoreImm16 
kLoadStoreImm32 
kLoadStoreImm64 
kNoImmediate 

Definition at line 12 of file instruction-selector-arm64.cc.

◆ LhsKind

Enumerator
VARIABLE 
NAMED_PROPERTY 
KEYED_PROPERTY 

Definition at line 117 of file ast-graph-builder.cc.

◆ MachineType

Enumerator
kRepBit 
kRepWord8 
kRepWord16 
kRepWord32 
kRepWord64 
kRepFloat32 
kRepFloat64 
kRepTagged 
kTypeBool 
kTypeInt32 
kTypeUint32 
kTypeInt64 
kTypeUint64 
kTypeNumber 
kTypeAny 
kMachNone 
kMachFloat32 
kMachFloat64 
kMachInt8 
kMachUint8 
kMachInt16 
kMachUint16 
kMachInt32 
kMachUint32 
kMachInt64 
kMachUint64 
kMachPtr 
kMachAnyTagged 

Definition at line 21 of file machine-type.h.

21  {
22  // Representations.
23  kRepBit = 1 << 0,
24  kRepWord8 = 1 << 1,
25  kRepWord16 = 1 << 2,
26  kRepWord32 = 1 << 3,
27  kRepWord64 = 1 << 4,
28  kRepFloat32 = 1 << 5,
29  kRepFloat64 = 1 << 6,
30  kRepTagged = 1 << 7,
31 
32  // Types.
33  kTypeBool = 1 << 8,
34  kTypeInt32 = 1 << 9,
35  kTypeUint32 = 1 << 10,
36  kTypeInt64 = 1 << 11,
37  kTypeUint64 = 1 << 12,
38  kTypeNumber = 1 << 13,
39  kTypeAny = 1 << 14,
40 
41  // Machine types.
42  kMachNone = 0,
55 };
const int kPointerSize
Definition: globals.h:129

◆ OutputFrameStateCombine

Enumerator
kPushOutput 
kIgnoreOutput 

Definition at line 29 of file common-operator.h.

29  {
30  kPushOutput, // Push the output on the expression stack.
31  kIgnoreOutput // Use the frame state as-is.
32 };

◆ Phase

Enumerator
PROPAGATE 
LOWER 

Definition at line 31 of file simplified-lowering.cc.

31  {
32  // 1.) PROPAGATE: Traverse the graph from the end, pushing usage information
33  // backwards from uses to definitions, around cycles in phis, according
34  // to local rules for each operator.
35  // During this phase, the usage information for a node determines the best
36  // possible lowering for each operator so far, and that in turn determines
37  // the output representation.
38  // Therefore, to be correct, this phase must iterate to a fixpoint before
39  // the next phase can begin.
40  PROPAGATE,
41 
42  // 2.) LOWER: perform lowering for all {Simplified} nodes by replacing some
43  // operators for some nodes, expanding some nodes to multiple nodes, or
44  // removing some (redundant) nodes.
45  // During this phase, use the {RepresentationChanger} to insert
46  // representation changes between uses that demand a particular
47  // representation and nodes that produce a different representation.
48  LOWER
49 };

◆ RegisterKind

Enumerator
UNALLOCATED_REGISTERS 
GENERAL_REGISTERS 
DOUBLE_REGISTERS 

Definition at line 27 of file register-allocator.h.

◆ RegisterOrOperandType

◆ WriteBarrierKind

Enumerator
kNoWriteBarrier 
kFullWriteBarrier 

Definition at line 20 of file machine-operator.h.

Function Documentation

◆ AlignedStackSlots()

static int v8::internal::compiler::AlignedStackSlots ( int  stack_slots)
static

Definition at line 678 of file code-generator-arm64.cc.

678  {
679  if (stack_slots & 1) stack_slots++;
680  return stack_slots;
681 }

◆ CheckInputsDominate()

static void v8::internal::compiler::CheckInputsDominate ( Schedule schedule,
BasicBlock *  block,
Node *  node,
int  use_pos 
)
static

Definition at line 274 of file verifier.cc.

275  {
276  for (int j = OperatorProperties::GetValueInputCount(node->op()) - 1; j >= 0;
277  j--) {
278  BasicBlock* use_block = block;
279  if (node->opcode() == IrOpcode::kPhi) {
280  use_block = use_block->PredecessorAt(j);
281  use_pos = static_cast<int>(use_block->nodes_.size()) - 1;
282  }
283  Node* input = node->InputAt(j);
284  if (!HasDominatingDef(schedule, node->InputAt(j), block, use_block,
285  use_pos)) {
286  V8_Fatal(__FILE__, __LINE__,
287  "Node #%d:%s in B%d is not dominated by input@%d #%d:%s",
288  node->id(), node->op()->mnemonic(), block->id(), j, input->id(),
289  input->op()->mnemonic());
290  }
291  }
292 }
void V8_Fatal(const char *file, int line, const char *format,...)
Definition: logging.cc:75
static bool HasDominatingDef(Schedule *schedule, Node *node, BasicBlock *container, BasicBlock *use_block, int use_pos)
Definition: verifier.cc:256

References v8::internal::compiler::OperatorProperties::GetValueInputCount(), HasDominatingDef(), and V8_Fatal().

Referenced by v8::internal::compiler::ScheduleVerifier::Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckNoPhis()

static void v8::internal::compiler::CheckNoPhis ( const BasicBlock *  block)
inlinestatic

Definition at line 393 of file instruction-selector.cc.

393  {
394 #ifdef DEBUG
395  // Branch targets should not have phis.
396  for (BasicBlock::const_iterator i = block->begin(); i != block->end(); ++i) {
397  const Node* node = *i;
398  CHECK_NE(IrOpcode::kPhi, node->opcode());
399  }
400 #endif
401 }
#define CHECK_NE(unexpected, value)
Definition: logging.h:173

References CHECK_NE.

◆ ComputeLoopInfo()

static LoopInfo* v8::internal::compiler::ComputeLoopInfo ( Zone zone,
SpecialRPOStackFrame queue,
int  num_loops,
int  num_blocks,
ZoneList< std::pair< BasicBlock *, int > > *  backedges 
)
static

Definition at line 786 of file scheduler.cc.

788  {
789  LoopInfo* loops = zone->NewArray<LoopInfo>(num_loops);
790  memset(loops, 0, num_loops * sizeof(LoopInfo));
791 
792  // Compute loop membership starting from backedges.
793  // O(max(loop_depth) * max(|loop|)
794  for (int i = 0; i < backedges->length(); i++) {
795  BasicBlock* member = backedges->at(i).first;
796  BasicBlock* header = member->SuccessorAt(backedges->at(i).second);
797  int loop_num = header->loop_end_;
798  if (loops[loop_num].header == NULL) {
799  loops[loop_num].header = header;
800  loops[loop_num].members = new (zone) BitVector(num_blocks, zone);
801  }
802 
803  int queue_length = 0;
804  if (member != header) {
805  // As long as the header doesn't have a backedge to itself,
806  // Push the member onto the queue and process its predecessors.
807  if (!loops[loop_num].members->Contains(member->id())) {
808  loops[loop_num].members->Add(member->id());
809  }
810  queue[queue_length++].block = member;
811  }
812 
813  // Propagate loop membership backwards. All predecessors of M up to the
814  // loop header H are members of the loop too. O(|blocks between M and H|).
815  while (queue_length > 0) {
816  BasicBlock* block = queue[--queue_length].block;
817  for (int i = 0; i < block->PredecessorCount(); i++) {
818  BasicBlock* pred = block->PredecessorAt(i);
819  if (pred != header) {
820  if (!loops[loop_num].members->Contains(pred->id())) {
821  loops[loop_num].members->Add(pred->id());
822  queue[queue_length++].block = pred;
823  }
824  }
825  }
826  }
827  }
828  return loops;
829 }
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 enable alignment of csp to bytes on platforms which prefer the register to always be NULL

References v8::internal::BitVector::Add(), v8::internal::compiler::SpecialRPOStackFrame::block, v8::internal::compiler::LoopInfo::header, v8::internal::compiler::LoopInfo::members, v8::internal::Zone::NewArray(), and NULL.

Referenced by v8::internal::compiler::Scheduler::ComputeSpecialRPO().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ComputeWriteBarrierKind()

static WriteBarrierKind v8::internal::compiler::ComputeWriteBarrierKind ( BaseTaggedness  base_is_tagged,
MachineType  representation,
Type type 
)
static

Definition at line 823 of file simplified-lowering.cc.

825  {
826  // TODO(turbofan): skip write barriers for Smis, etc.
827  if (base_is_tagged == kTaggedBase &&
828  RepresentationOf(representation) == kRepTagged) {
829  // Write barriers are only for writes into heap objects (i.e. tagged base).
830  return kFullWriteBarrier;
831  }
832  return kNoWriteBarrier;
833 }
MachineType RepresentationOf(MachineType machine_type)
Definition: machine-type.h:76

References kFullWriteBarrier, kNoWriteBarrier, kRepTagged, kTaggedBase, and RepresentationOf().

Referenced by v8::internal::compiler::SimplifiedLowering::DoStoreElement(), and v8::internal::compiler::SimplifiedLowering::DoStoreField().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DetermineLhsKind()

static LhsKind v8::internal::compiler::DetermineLhsKind ( Expression expr)
static

Definition at line 121 of file ast-graph-builder.cc.

121  {
122  Property* property = expr->AsProperty();
123  DCHECK(expr->IsValidReferenceExpression());
124  LhsKind lhs_kind =
125  (property == NULL) ? VARIABLE : (property->key()->IsPropertyName())
127  : KEYED_PROPERTY;
128  return lhs_kind;
129 }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, v8::internal::Expression::IsValidReferenceExpression(), KEYED_PROPERTY, NAMED_PROPERTY, NULL, and VARIABLE.

Referenced by v8::internal::compiler::AstGraphBuilder::VisitForInAssignment().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ElementAccessOf()

const ElementAccess & v8::internal::compiler::ElementAccessOf ( const Operator op)

Definition at line 56 of file simplified-operator.cc.

56  {
57  DCHECK_NOT_NULL(op);
58  DCHECK(op->opcode() == IrOpcode::kLoadElement ||
59  op->opcode() == IrOpcode::kStoreElement);
60  return OpParameter<ElementAccess>(op);
61 }
#define DCHECK_NOT_NULL(p)
Definition: logging.h:213

References DCHECK, DCHECK_NOT_NULL, and v8::internal::compiler::Operator::opcode().

Referenced by v8::internal::compiler::SimplifiedLowering::DoLoadElement(), v8::internal::compiler::SimplifiedLowering::DoStoreElement(), TEST_P(), and v8::internal::compiler::RepresentationSelector::VisitNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ElementSizeOf()

int v8::internal::compiler::ElementSizeOf ( MachineType  machine_type)
inline

Definition at line 83 of file machine-type.h.

83  {
84  switch (RepresentationOf(machine_type)) {
85  case kRepBit:
86  case kRepWord8:
87  return 1;
88  case kRepWord16:
89  return 2;
90  case kRepWord32:
91  case kRepFloat32:
92  return 4;
93  case kRepWord64:
94  case kRepFloat64:
95  return 8;
96  case kRepTagged:
97  return kPointerSize;
98  default:
99  UNREACHABLE();
100  return kPointerSize;
101  }
102 }
#define UNREACHABLE()
Definition: logging.h:30

References v8::internal::kPointerSize, kRepBit, kRepFloat32, kRepFloat64, kRepTagged, kRepWord16, kRepWord32, kRepWord64, kRepWord8, RepresentationOf(), and UNREACHABLE.

Referenced by v8::internal::compiler::SimplifiedLowering::ComputeIndex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EmitBic()

static void v8::internal::compiler::EmitBic ( InstructionSelector *  selector,
Node *  node,
Node *  left,
Node *  right 
)
inlinestatic

Definition at line 382 of file instruction-selector-arm.cc.

383  {
384  ArmOperandGenerator g(selector);
385  InstructionCode opcode = kArmBic;
386  InstructionOperand* value_operand;
387  InstructionOperand* shift_operand;
388  if (TryMatchShift(selector, &opcode, right, &value_operand, &shift_operand)) {
389  selector->Emit(opcode, g.DefineAsRegister(node), g.UseRegister(left),
390  value_operand, shift_operand);
391  return;
392  }
393  selector->Emit(opcode | AddressingModeField::encode(kMode_Operand2_R),
394  g.DefineAsRegister(node), g.UseRegister(left),
395  g.UseRegister(right));
396 }
static bool TryMatchShift(InstructionSelector *selector, InstructionCode *opcode_return, Node *node, InstructionOperand **value_return, InstructionOperand **shift_return)

References v8::internal::compiler::OperandGenerator::DefineAsRegister(), v8::internal::BitFieldBase< T, shift, size, uint32_t >::encode(), TryMatchShift(), and v8::internal::compiler::OperandGenerator::UseRegister().

+ Here is the call graph for this function:

◆ EmitDiv()

static void v8::internal::compiler::EmitDiv ( InstructionSelector *  selector,
ArchOpcode  div_opcode,
ArchOpcode  f64i32_opcode,
ArchOpcode  i32f64_opcode,
InstructionOperand result_operand,
InstructionOperand left_operand,
InstructionOperand right_operand 
)
static

Definition at line 614 of file instruction-selector-arm.cc.

618  {
619  ArmOperandGenerator g(selector);
620  if (selector->IsSupported(SUDIV)) {
621  selector->Emit(div_opcode, result_operand, left_operand, right_operand);
622  return;
623  }
624  InstructionOperand* left_double_operand = g.TempDoubleRegister();
625  InstructionOperand* right_double_operand = g.TempDoubleRegister();
626  InstructionOperand* result_double_operand = g.TempDoubleRegister();
627  selector->Emit(f64i32_opcode, left_double_operand, left_operand);
628  selector->Emit(f64i32_opcode, right_double_operand, right_operand);
629  selector->Emit(kArmVdivF64, result_double_operand, left_double_operand,
630  right_double_operand);
631  selector->Emit(i32f64_opcode, result_operand, result_double_operand);
632 }

References v8::internal::SUDIV, and v8::internal::compiler::OperandGenerator::TempDoubleRegister().

Referenced by VisitDiv(), and VisitMod().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FieldAccessOf()

const FieldAccess & v8::internal::compiler::FieldAccessOf ( const Operator op)

Definition at line 48 of file simplified-operator.cc.

48  {
49  DCHECK_NOT_NULL(op);
50  DCHECK(op->opcode() == IrOpcode::kLoadField ||
51  op->opcode() == IrOpcode::kStoreField);
52  return OpParameter<FieldAccess>(op);
53 }

References DCHECK, DCHECK_NOT_NULL, and v8::internal::compiler::Operator::opcode().

Referenced by v8::internal::compiler::SimplifiedLowering::DoLoadField(), v8::internal::compiler::SimplifiedLowering::DoStoreField(), and v8::internal::compiler::RepresentationSelector::VisitNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FindInsertionPoint()

static NodeVector::iterator v8::internal::compiler::FindInsertionPoint ( NodeVector nodes)
static

Definition at line 18 of file basic-block-instrumentor.cc.

18  {
19  NodeVector::iterator i = nodes->begin();
20  for (; i != nodes->end(); ++i) {
21  const Operator* op = (*i)->op();
22  if (OperatorProperties::IsBasicBlockBegin(op)) continue;
23  switch (op->opcode()) {
24  case IrOpcode::kParameter:
25  case IrOpcode::kPhi:
26  case IrOpcode::kEffectPhi:
27  continue;
28  }
29  break;
30  }
31  return i;
32 }

References v8::internal::compiler::OperatorProperties::IsBasicBlockBegin(), and v8::internal::compiler::Operator::opcode().

Referenced by v8::internal::compiler::BasicBlockInstrumentor::Instrument().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FinishCode()

static void v8::internal::compiler::FinishCode ( MacroAssembler masm)
inlinestatic

Definition at line 122 of file code-generator-impl.h.

122  {
123 #if V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_ARM
124  masm->CheckConstPool(true, false);
125 #endif
126 }

References v8::internal::Assembler::CheckConstPool().

+ Here is the call graph for this function:

◆ FlagsForNode()

static CallDescriptor::Flags v8::internal::compiler::FlagsForNode ( Node *  node)
static

Definition at line 134 of file js-generic-lowering.cc.

134  {
135  CallDescriptor::Flags result = CallDescriptor::kNoFlags;
136  if (OperatorProperties::HasFrameStateInput(node->op())) {
137  result |= CallDescriptor::kNeedsFrameState;
138  }
139  return result;
140 }

References v8::internal::compiler::OperatorProperties::HasFrameStateInput().

Referenced by v8::internal::compiler::JSGenericLowering::ReplaceWithCompareIC(), and v8::internal::compiler::JSGenericLowering::ReplaceWithStubCall().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetControlCluster()

static Node* v8::internal::compiler::GetControlCluster ( Node *  node)
static

Definition at line 184 of file graph-visualizer.cc.

184  {
185  if (OperatorProperties::IsBasicBlockBegin(node->op())) {
186  return node;
187  } else if (OperatorProperties::GetControlInputCount(node->op()) == 1) {
188  Node* control = NodeProperties::GetControlInput(node, 0);
189  return OperatorProperties::IsBasicBlockBegin(control->op()) ? control
190  : NULL;
191  } else {
192  return NULL;
193  }
194 }

References v8::internal::compiler::NodeProperties::GetControlInput(), v8::internal::compiler::OperatorProperties::GetControlInputCount(), v8::internal::compiler::OperatorProperties::IsBasicBlockBegin(), and NULL.

Referenced by v8::internal::compiler::GraphVisualizer::AnnotateNode(), v8::internal::compiler::GraphVisualizer::Pre(), and v8::internal::compiler::GraphVisualizer::PrintEdge().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasDominatingDef()

static bool v8::internal::compiler::HasDominatingDef ( Schedule schedule,
Node *  node,
BasicBlock *  container,
BasicBlock *  use_block,
int  use_pos 
)
static

Definition at line 256 of file verifier.cc.

258  {
259  BasicBlock* block = use_block;
260  while (true) {
261  while (use_pos >= 0) {
262  if (block->nodes_[use_pos] == node) return true;
263  use_pos--;
264  }
265  block = block->dominator_;
266  if (block == NULL) break;
267  use_pos = static_cast<int>(block->nodes_.size()) - 1;
268  if (node == block->control_input_) return true;
269  }
270  return false;
271 }

References NULL.

Referenced by CheckInputsDominate().

+ Here is the caller graph for this function:

◆ HasImmediateInput() [1/2]

static bool v8::internal::compiler::HasImmediateInput ( Instruction instr,
int  index 
)
static

Definition at line 165 of file code-generator-ia32.cc.

165  {
166  return instr->InputAt(index)->IsImmediate();
167 }

References v8::internal::compiler::Instruction::InputAt().

+ Here is the call graph for this function:

◆ HasImmediateInput() [2/2]

static bool v8::internal::compiler::HasImmediateInput ( Instruction instr,
int  index 
)
static

Definition at line 230 of file code-generator-x64.cc.

230  {
231  return instr->InputAt(index)->IsImmediate();
232 }

References v8::internal::compiler::Instruction::InputAt().

+ Here is the call graph for this function:

◆ INSTANTIATE_TEST_CASE_P() [1/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( ChangeLoweringTest  ,
ChangeLoweringCommonTest  ,
::testing::Values(kRepWord32, kRepWord64  
)

◆ INSTANTIATE_TEST_CASE_P() [2/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( CommonOperatorTest  ,
CommonSharedOperatorTest  ,
::testing::ValuesIn(kSharedOperators)   
)

◆ INSTANTIATE_TEST_CASE_P() [3/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( InstructionSelectorTest  ,
InstructionSelectorAddSubTest  ,
::testing::ValuesIn(kAddSubInstructions)   
)

◆ INSTANTIATE_TEST_CASE_P() [4/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( InstructionSelectorTest  ,
InstructionSelectorComparisonTest  ,
::testing::ValuesIn(kComparisonInstructions  
)

◆ INSTANTIATE_TEST_CASE_P() [5/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( InstructionSelectorTest  ,
InstructionSelectorConversionTest  ,
::testing::ValuesIn(kConversionInstructions)   
)

◆ INSTANTIATE_TEST_CASE_P() [6/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( InstructionSelectorTest  ,
InstructionSelectorDPFlagSetTest  ,
::testing::ValuesIn(kDPFlagSetInstructions)   
)

◆ INSTANTIATE_TEST_CASE_P() [7/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( InstructionSelectorTest  ,
InstructionSelectorDPITest  ,
::testing::ValuesIn(kDPIs)   
)

◆ INSTANTIATE_TEST_CASE_P() [8/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( InstructionSelectorTest  ,
InstructionSelectorFPArithTest  ,
::testing::ValuesIn(kFPArithInstructions)   
)

◆ INSTANTIATE_TEST_CASE_P() [9/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( InstructionSelectorTest  ,
InstructionSelectorFPCmpTest  ,
::testing::ValuesIn(kFPCmpInstructions)   
)

◆ INSTANTIATE_TEST_CASE_P() [10/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( InstructionSelectorTest  ,
InstructionSelectorIntDPWithIntMulTest  ,
::testing::ValuesIn(kMulDPInstructions  
)

◆ INSTANTIATE_TEST_CASE_P() [11/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( InstructionSelectorTest  ,
InstructionSelectorLogicalTest  ,
::testing::ValuesIn(kLogicalInstructions)   
)

◆ INSTANTIATE_TEST_CASE_P() [12/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( InstructionSelectorTest  ,
InstructionSelectorLogicalWithNotRHSTest  ,
::testing::ValuesIn(kLogicalWithNotRHSs  
)

◆ INSTANTIATE_TEST_CASE_P() [13/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( InstructionSelectorTest  ,
InstructionSelectorMemoryAccessTest  ,
::testing::ValuesIn(kMemoryAccesses  
)

◆ INSTANTIATE_TEST_CASE_P() [14/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( InstructionSelectorTest  ,
InstructionSelectorMulDivTest  ,
::testing::ValuesIn(kMulDivInstructions)   
)

◆ INSTANTIATE_TEST_CASE_P() [15/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( InstructionSelectorTest  ,
InstructionSelectorODPITest  ,
::testing::ValuesIn(kODPIs)   
)

◆ INSTANTIATE_TEST_CASE_P() [16/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( InstructionSelectorTest  ,
InstructionSelectorOvfAddSubTest  ,
::testing::ValuesIn(kOvfAddSubInstructions)   
)

◆ INSTANTIATE_TEST_CASE_P() [17/23]

◆ INSTANTIATE_TEST_CASE_P() [18/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( InstructionSelectorTest  ,
InstructionSelectorShiftTest  ,
::testing::ValuesIn(kShiftInstructions)   
)

◆ INSTANTIATE_TEST_CASE_P() [19/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( InstructionSelectorTest  ,
InstructionSelectorShiftTest  ,
::testing::ValuesIn(kShifts)   
)

◆ INSTANTIATE_TEST_CASE_P() [20/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( MachineOperatorReducerTest  ,
MachineUnaryOperatorReducerTest  ,
::testing::ValuesIn(kUnaryOperators)   
)

◆ INSTANTIATE_TEST_CASE_P() [21/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( SimplifiedOperatorReducerTest  ,
SimplifiedUnaryOperatorTest  ,
::testing::ValuesIn(kUnaryOperators)   
)

◆ INSTANTIATE_TEST_CASE_P() [22/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( SimplifiedOperatorTest  ,
SimplifiedElementAccessOperatorTest  ,
::testing::ValuesIn(kElementAccesses)   
)

◆ INSTANTIATE_TEST_CASE_P() [23/23]

v8::internal::compiler::INSTANTIATE_TEST_CASE_P ( SimplifiedOperatorTest  ,
SimplifiedPureOperatorTest  ,
::testing::ValuesIn(kPureOperators)   
)

◆ IsBranch()

Matcher< Node * > v8::internal::compiler::IsBranch ( const Matcher< Node * > &  value_matcher,
const Matcher< Node * > &  control_matcher 
)

Definition at line 606 of file graph-unittest.cc.

607  {
608  return MakeMatcher(new IsBranchMatcher(value_matcher, control_matcher));
609 }

Referenced by v8::internal::compiler::FINAL< kOperandKind, kNumCachedOperands >::false_block(), TARGET_TEST_F(), TARGET_TEST_P(), TEST_F(), and v8::internal::compiler::FINAL< kOperandKind, kNumCachedOperands >::true_block().

+ Here is the caller graph for this function:

◆ IsCall()

Matcher< Node * > v8::internal::compiler::IsCall ( const Matcher< CallDescriptor * > &  descriptor_matcher,
const Matcher< Node * > &  value0_matcher,
const Matcher< Node * > &  value1_matcher,
const Matcher< Node * > &  value2_matcher,
const Matcher< Node * > &  value3_matcher,
const Matcher< Node * > &  effect_matcher,
const Matcher< Node * > &  control_matcher 
)

Definition at line 705 of file graph-unittest.cc.

711  {
712  return MakeMatcher(new IsCallMatcher(
713  descriptor_matcher, value0_matcher, value1_matcher, value2_matcher,
714  value3_matcher, effect_matcher, control_matcher));
715 }

Referenced by v8::internal::compiler::ChangeLoweringTest::IsAllocateHeapNumber().

+ Here is the caller graph for this function:

◆ IsChangeFloat64ToInt32()

Matcher<Node*> v8::internal::compiler::IsChangeFloat64ToInt32 ( const Matcher< Node * > &  input_matcher)

Referenced by TARGET_TEST_F(), and TEST_F().

+ Here is the caller graph for this function:

◆ IsChangeFloat64ToUint32()

Matcher<Node*> v8::internal::compiler::IsChangeFloat64ToUint32 ( const Matcher< Node * > &  input_matcher)

Referenced by TARGET_TEST_F(), and TEST_F().

+ Here is the caller graph for this function:

◆ IsChangeInt32ToFloat64()

Matcher<Node*> v8::internal::compiler::IsChangeInt32ToFloat64 ( const Matcher< Node * > &  input_matcher)

Referenced by TARGET_TEST_F(), and TEST_F().

+ Here is the caller graph for this function:

◆ IsChangeInt32ToInt64()

Matcher<Node*> v8::internal::compiler::IsChangeInt32ToInt64 ( const Matcher< Node * > &  input_matcher)

Referenced by TARGET_TEST_F().

+ Here is the caller graph for this function:

◆ IsChangeUint32ToFloat64()

Matcher<Node*> v8::internal::compiler::IsChangeUint32ToFloat64 ( const Matcher< Node * > &  input_matcher)

Referenced by TARGET_TEST_F(), and TEST_F().

+ Here is the caller graph for this function:

◆ IsChangeUint32ToUint64()

Matcher<Node*> v8::internal::compiler::IsChangeUint32ToUint64 ( const Matcher< Node * > &  input_matcher)

Referenced by TARGET_TEST_F().

+ Here is the caller graph for this function:

◆ IsControlEffect()

Matcher< Node * > v8::internal::compiler::IsControlEffect ( const Matcher< Node * > &  control_matcher)

Definition at line 629 of file graph-unittest.cc.

629  {
630  return MakeMatcher(
631  new IsControl1Matcher(IrOpcode::kControlEffect, control_matcher));
632 }

Referenced by TARGET_TEST_F().

+ Here is the caller graph for this function:

◆ IsDefUseChainLinkPresent()

static bool v8::internal::compiler::IsDefUseChainLinkPresent ( Node *  def,
Node *  use 
)
static

Definition at line 28 of file verifier.cc.

28  {
29  Node::Uses uses = def->uses();
30  for (Node::Uses::iterator it = uses.begin(); it != uses.end(); ++it) {
31  if (*it == use) return true;
32  }
33  return false;
34 }
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 enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to use(in kBytes)") DEFINE_INT(max_stack_trace_source_length

References use().

Referenced by v8::internal::compiler::Verifier::Visitor::Pre().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsExternalConstant()

Matcher< Node * > v8::internal::compiler::IsExternalConstant ( const Matcher< ExternalReference > &  value_matcher)

Definition at line 646 of file graph-unittest.cc.

647  {
648  return MakeMatcher(new IsConstantMatcher<ExternalReference>(
649  IrOpcode::kExternalConstant, value_matcher));
650 }

Referenced by v8::internal::compiler::ChangeLoweringTest::IsAllocateHeapNumber().

+ Here is the caller graph for this function:

◆ IsFinish()

Matcher< Node * > v8::internal::compiler::IsFinish ( const Matcher< Node * > &  value_matcher,
const Matcher< Node * > &  effect_matcher 
)

Definition at line 640 of file graph-unittest.cc.

641  {
642  return MakeMatcher(new IsFinishMatcher(value_matcher, effect_matcher));
643 }

Referenced by TARGET_TEST_F(), and TARGET_TEST_P().

+ Here is the caller graph for this function:

◆ IsFloat32Constant()

Matcher< Node * > v8::internal::compiler::IsFloat32Constant ( const Matcher< float > &  value_matcher)

Definition at line 672 of file graph-unittest.cc.

672  {
673  return MakeMatcher(
674  new IsConstantMatcher<float>(IrOpcode::kFloat32Constant, value_matcher));
675 }

Referenced by TEST_F().

+ Here is the caller graph for this function:

◆ IsFloat64Constant()

Matcher< Node * > v8::internal::compiler::IsFloat64Constant ( const Matcher< double > &  value_matcher)

Definition at line 678 of file graph-unittest.cc.

678  {
679  return MakeMatcher(
680  new IsConstantMatcher<double>(IrOpcode::kFloat64Constant, value_matcher));
681 }

Referenced by TEST_F().

+ Here is the caller graph for this function:

◆ IsFloat64Sqrt()

Matcher<Node*> v8::internal::compiler::IsFloat64Sqrt ( const Matcher< Node * > &  input_matcher)

Referenced by TEST_F().

+ Here is the caller graph for this function:

◆ IsHeapConstant()

Matcher< Node * > v8::internal::compiler::IsHeapConstant ( const Matcher< Unique< HeapObject > > &  value_matcher)

Definition at line 653 of file graph-unittest.cc.

654  {
655  return MakeMatcher(new IsConstantMatcher<Unique<HeapObject> >(
656  IrOpcode::kHeapConstant, value_matcher));
657 }

Referenced by v8::internal::compiler::ChangeLoweringTest::IsAllocateHeapNumber(), v8::internal::compiler::GraphTest::IsFalseConstant(), and v8::internal::compiler::GraphTest::IsTrueConstant().

+ Here is the caller graph for this function:

◆ IsIfFalse()

Matcher< Node * > v8::internal::compiler::IsIfFalse ( const Matcher< Node * > &  control_matcher)

Definition at line 623 of file graph-unittest.cc.

623  {
624  return MakeMatcher(
625  new IsControl1Matcher(IrOpcode::kIfFalse, control_matcher));
626 }

Referenced by TARGET_TEST_F(), TARGET_TEST_P(), and TEST_F().

+ Here is the caller graph for this function:

◆ IsIfTrue()

Matcher< Node * > v8::internal::compiler::IsIfTrue ( const Matcher< Node * > &  control_matcher)

Definition at line 618 of file graph-unittest.cc.

618  {
619  return MakeMatcher(new IsControl1Matcher(IrOpcode::kIfTrue, control_matcher));
620 }

Referenced by TARGET_TEST_F(), TARGET_TEST_P(), and TEST_F().

+ Here is the caller graph for this function:

◆ IsInt32AddWithOverflow()

Matcher<Node*> v8::internal::compiler::IsInt32AddWithOverflow ( const Matcher< Node * > &  lhs_matcher,
const Matcher< Node * > &  rhs_matcher 
)

Referenced by TARGET_TEST_F().

+ Here is the caller graph for this function:

◆ IsInt32Constant()

Matcher< Node * > v8::internal::compiler::IsInt32Constant ( const Matcher< int32_t > &  value_matcher)

Definition at line 660 of file graph-unittest.cc.

660  {
661  return MakeMatcher(
662  new IsConstantMatcher<int32_t>(IrOpcode::kInt32Constant, value_matcher));
663 }

Referenced by v8::internal::compiler::ChangeLoweringTest::IsAllocateHeapNumber(), TARGET_TEST_F(), TARGET_TEST_P(), and TEST_F().

+ Here is the caller graph for this function:

◆ IsInt32Mul()

Matcher<Node*> v8::internal::compiler::IsInt32Mul ( const Matcher< Node * > &  lhs_matcher,
const Matcher< Node * > &  rhs_matcher 
)

Referenced by TEST_F().

+ Here is the caller graph for this function:

◆ IsInt64Constant()

Matcher< Node * > v8::internal::compiler::IsInt64Constant ( const Matcher< int64_t > &  value_matcher)

Definition at line 666 of file graph-unittest.cc.

666  {
667  return MakeMatcher(
668  new IsConstantMatcher<int64_t>(IrOpcode::kInt64Constant, value_matcher));
669 }

Referenced by TEST_F().

+ Here is the caller graph for this function:

◆ IsLikelyBackEdge()

static bool v8::internal::compiler::IsLikelyBackEdge ( Node *  from,
int  index,
Node *  to 
)
static

Definition at line 225 of file graph-visualizer.cc.

225  {
226  if (from->opcode() == IrOpcode::kPhi ||
227  from->opcode() == IrOpcode::kEffectPhi) {
228  Node* control = NodeProperties::GetControlInput(from, 0);
229  return control->opcode() != IrOpcode::kMerge && control != to && index != 0;
230  } else if (from->opcode() == IrOpcode::kLoop) {
231  return index != 0;
232  } else {
233  return false;
234  }
235 }
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 enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes to(mksnapshot only)") DEFINE_STRING(raw_context_file

References v8::internal::compiler::NodeProperties::GetControlInput(), and to().

Referenced by v8::internal::compiler::GraphVisualizer::PrintEdge().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsLoad()

Matcher< Node * > v8::internal::compiler::IsLoad ( const Matcher< LoadRepresentation > &  rep_matcher,
const Matcher< Node * > &  base_matcher,
const Matcher< Node * > &  index_matcher,
const Matcher< Node * > &  effect_matcher 
)

Definition at line 718 of file graph-unittest.cc.

721  {
722  return MakeMatcher(new IsLoadMatcher(rep_matcher, base_matcher, index_matcher,
723  effect_matcher));
724 }

Referenced by v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::CanAccessAsMonomorphic(), v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::CanAccessMonomorphic(), v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::LoadResult(), and TARGET_TEST_F().

+ Here is the caller graph for this function:

◆ IsMerge()

Matcher< Node * > v8::internal::compiler::IsMerge ( const Matcher< Node * > &  control0_matcher,
const Matcher< Node * > &  control1_matcher 
)

Definition at line 612 of file graph-unittest.cc.

613  {
614  return MakeMatcher(new IsMergeMatcher(control0_matcher, control1_matcher));
615 }

Referenced by TARGET_TEST_F(), TARGET_TEST_P(), and TEST_F().

+ Here is the caller graph for this function:

◆ IsNumberConstant()

Matcher< Node * > v8::internal::compiler::IsNumberConstant ( const Matcher< double > &  value_matcher)

Definition at line 684 of file graph-unittest.cc.

684  {
685  return MakeMatcher(
686  new IsConstantMatcher<double>(IrOpcode::kNumberConstant, value_matcher));
687 }

Referenced by v8::internal::compiler::ChangeLoweringTest::IsAllocateHeapNumber(), and TEST_F().

+ Here is the caller graph for this function:

◆ IsNumberLessThan()

Matcher<Node*> v8::internal::compiler::IsNumberLessThan ( const Matcher< Node * > &  lhs_matcher,
const Matcher< Node * > &  rhs_matcher 
)

Referenced by TEST_F().

+ Here is the caller graph for this function:

◆ IsNumberSubtract()

Matcher<Node*> v8::internal::compiler::IsNumberSubtract ( const Matcher< Node * > &  lhs_matcher,
const Matcher< Node * > &  rhs_matcher 
)

Referenced by TEST_F().

+ Here is the caller graph for this function:

◆ IsPhi()

Matcher< Node * > v8::internal::compiler::IsPhi ( const Matcher< MachineType > &  type_matcher,
const Matcher< Node * > &  value0_matcher,
const Matcher< Node * > &  value1_matcher,
const Matcher< Node * > &  merge_matcher 
)

Definition at line 690 of file graph-unittest.cc.

693  {
694  return MakeMatcher(new IsPhiMatcher(type_matcher, value0_matcher,
695  value1_matcher, merge_matcher));
696 }

Referenced by TARGET_TEST_F(), TARGET_TEST_P(), and TEST_F().

+ Here is the caller graph for this function:

◆ IsProjection()

Matcher< Node * > v8::internal::compiler::IsProjection ( const Matcher< size_t > &  index_matcher,
const Matcher< Node * > &  base_matcher 
)

Definition at line 699 of file graph-unittest.cc.

700  {
701  return MakeMatcher(new IsProjectionMatcher(index_matcher, base_matcher));
702 }

Referenced by TARGET_TEST_F().

+ Here is the caller graph for this function:

◆ IsStore()

Matcher< Node * > v8::internal::compiler::IsStore ( const Matcher< MachineType > &  type_matcher,
const Matcher< WriteBarrierKind > &  write_barrier_matcher,
const Matcher< Node * > &  base_matcher,
const Matcher< Node * > &  index_matcher,
const Matcher< Node * > &  value_matcher,
const Matcher< Node * > &  effect_matcher,
const Matcher< Node * > &  control_matcher 
)

Definition at line 727 of file graph-unittest.cc.

733  {
734  return MakeMatcher(new IsStoreMatcher(
735  type_matcher, write_barrier_matcher, base_matcher, index_matcher,
736  value_matcher, effect_matcher, control_matcher));
737 }

Referenced by TARGET_TEST_F(), and TARGET_TEST_P().

+ Here is the caller graph for this function:

◆ IsTruncateFloat64ToFloat32()

Matcher<Node*> v8::internal::compiler::IsTruncateFloat64ToFloat32 ( const Matcher< Node * > &  input_matcher)

Referenced by TEST_F().

+ Here is the caller graph for this function:

◆ IsTruncateFloat64ToInt32()

Matcher<Node*> v8::internal::compiler::IsTruncateFloat64ToInt32 ( const Matcher< Node * > &  input_matcher)

◆ IsTruncateInt64ToInt32()

Matcher<Node*> v8::internal::compiler::IsTruncateInt64ToInt32 ( const Matcher< Node * > &  input_matcher)

Referenced by TARGET_TEST_F().

+ Here is the caller graph for this function:

◆ IsUint32LessThanOrEqual()

Matcher<Node*> v8::internal::compiler::IsUint32LessThanOrEqual ( const Matcher< Node * > &  lhs_matcher,
const Matcher< Node * > &  rhs_matcher 
)

Referenced by TARGET_TEST_F().

+ Here is the caller graph for this function:

◆ IsUseDefChainLinkPresent()

static bool v8::internal::compiler::IsUseDefChainLinkPresent ( Node *  def,
Node *  use 
)
static

Definition at line 37 of file verifier.cc.

37  {
38  Node::Inputs inputs = use->inputs();
39  for (Node::Inputs::iterator it = inputs.begin(); it != inputs.end(); ++it) {
40  if (*it == def) return true;
41  }
42  return false;
43 }

References use().

Referenced by v8::internal::compiler::Verifier::Visitor::Pre().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsValueEffect()

Matcher< Node * > v8::internal::compiler::IsValueEffect ( const Matcher< Node * > &  value_matcher)

Definition at line 635 of file graph-unittest.cc.

635  {
636  return MakeMatcher(new IsUnopMatcher(IrOpcode::kValueEffect, value_matcher));
637 }

Referenced by TARGET_TEST_P().

+ Here is the caller graph for this function:

◆ IsWord32And()

Matcher<Node*> v8::internal::compiler::IsWord32And ( const Matcher< Node * > &  lhs_matcher,
const Matcher< Node * > &  rhs_matcher 
)

Referenced by TARGET_TEST_F(), and TEST_F().

+ Here is the caller graph for this function:

◆ IsWord32Equal()

Matcher<Node*> v8::internal::compiler::IsWord32Equal ( const Matcher< Node * > &  lhs_matcher,
const Matcher< Node * > &  rhs_matcher 
)

Referenced by v8::internal::compiler::ChangeLoweringTest::IsWordEqual().

+ Here is the caller graph for this function:

◆ IsWord32Ror()

Matcher<Node*> v8::internal::compiler::IsWord32Ror ( const Matcher< Node * > &  lhs_matcher,
const Matcher< Node * > &  rhs_matcher 
)

Referenced by TEST_F().

+ Here is the caller graph for this function:

◆ IsWord32Sar()

Matcher<Node*> v8::internal::compiler::IsWord32Sar ( const Matcher< Node * > &  lhs_matcher,
const Matcher< Node * > &  rhs_matcher 
)

Referenced by TARGET_TEST_F().

+ Here is the caller graph for this function:

◆ IsWord32Shl()

Matcher<Node*> v8::internal::compiler::IsWord32Shl ( const Matcher< Node * > &  lhs_matcher,
const Matcher< Node * > &  rhs_matcher 
)

Referenced by TARGET_TEST_F().

+ Here is the caller graph for this function:

◆ IsWord64And()

Matcher<Node*> v8::internal::compiler::IsWord64And ( const Matcher< Node * > &  lhs_matcher,
const Matcher< Node * > &  rhs_matcher 
)

Referenced by TARGET_TEST_F().

+ Here is the caller graph for this function:

◆ IsWord64Equal()

Matcher<Node*> v8::internal::compiler::IsWord64Equal ( const Matcher< Node * > &  lhs_matcher,
const Matcher< Node * > &  rhs_matcher 
)

Referenced by v8::internal::compiler::ChangeLoweringTest::IsWordEqual().

+ Here is the caller graph for this function:

◆ IsWord64Sar()

Matcher<Node*> v8::internal::compiler::IsWord64Sar ( const Matcher< Node * > &  lhs_matcher,
const Matcher< Node * > &  rhs_matcher 
)

Referenced by TARGET_TEST_F().

+ Here is the caller graph for this function:

◆ IsWord64Shl()

Matcher<Node*> v8::internal::compiler::IsWord64Shl ( const Matcher< Node * > &  lhs_matcher,
const Matcher< Node * > &  rhs_matcher 
)

Referenced by TARGET_TEST_F().

+ Here is the caller graph for this function:

◆ Max()

static LifetimePosition v8::internal::compiler::Max ( LifetimePosition  a,
LifetimePosition  b 
)
inlinestatic

Definition at line 20 of file register-allocator.cc.

20  {
21  return a.Value() > b.Value() ? a : b;
22 }

References v8::internal::compiler::LifetimePosition::Value().

Referenced by v8::internal::compiler::LiveRange::AddUseInterval(), v8::ResourceConstraints::ConfigureDefaults(), v8::EmbedderDataFor(), and v8::internal::TypeImpl< Config >::Max().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Min()

static LifetimePosition v8::internal::compiler::Min ( LifetimePosition  a,
LifetimePosition  b 
)
inlinestatic

Definition at line 15 of file register-allocator.cc.

15  {
16  return a.Value() < b.Value() ? a : b;
17 }

References v8::internal::compiler::LifetimePosition::Value().

Referenced by v8::internal::compiler::LiveRange::AddUseInterval(), v8::ResourceConstraints::ConfigureDefaults(), v8::internal::TypeImpl< Config >::Min(), and v8::internal::compiler::LiveRange::SetSpillStartIndex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NodeCacheHash() [1/5]

template<>
int32_t v8::internal::compiler::NodeCacheHash ( double  key)
inline

Definition at line 33 of file node-cache.cc.

33  {
34  return ComputeLongHash(bit_cast<int64_t>(key));
35 }
uint32_t ComputeLongHash(uint64_t key)
Definition: utils.h:262

References v8::internal::ComputeLongHash().

+ Here is the call graph for this function:

◆ NodeCacheHash() [2/5]

template<>
int32_t v8::internal::compiler::NodeCacheHash ( int32_t  key)
inline

Definition at line 21 of file node-cache.cc.

21  {
22  return ComputeIntegerHash(key, 0);
23 }
uint32_t ComputeIntegerHash(uint32_t key, uint32_t seed)
Definition: utils.h:249

References v8::internal::ComputeIntegerHash().

+ Here is the call graph for this function:

◆ NodeCacheHash() [3/5]

template<>
int32_t v8::internal::compiler::NodeCacheHash ( int64_t  key)
inline

Definition at line 27 of file node-cache.cc.

27  {
28  return ComputeLongHash(key);
29 }

References v8::internal::ComputeLongHash().

+ Here is the call graph for this function:

◆ NodeCacheHash() [4/5]

template<typename Key >
int32_t v8::internal::compiler::NodeCacheHash ( Key  key)

Definition at line 15 of file node-cache.cc.

15  {
16  UNIMPLEMENTED();
17  return 0;
18 }
#define UNIMPLEMENTED()
Definition: logging.h:28

References UNIMPLEMENTED.

Referenced by v8::internal::compiler::NodeCache< Key >::Find(), and v8::internal::compiler::NodeCache< Key >::Resize().

+ Here is the caller graph for this function:

◆ NodeCacheHash() [5/5]

template<>
int32_t v8::internal::compiler::NodeCacheHash ( void *  key)
inline

Definition at line 39 of file node-cache.cc.

39  {
40  return ComputePointerHash(key);
41 }
uint32_t ComputePointerHash(void *ptr)
Definition: utils.h:274

References v8::internal::ComputePointerHash().

+ Here is the call graph for this function:

◆ NodeIdIsLessThan()

static bool v8::internal::compiler::NodeIdIsLessThan ( const Node *  node,
NodeId  id 
)
static

Definition at line 19 of file graph-reducer.cc.

19  {
20  return node->id() < id;
21 }

◆ operator!=() [1/3]

bool v8::internal::compiler::operator!= ( const SourcePosition &  lhs,
const SourcePosition &  rhs 
)
inline

Definition at line 41 of file source-position.h.

41  {
42  return !(lhs == rhs);
43 }

◆ operator!=() [2/3]

bool v8::internal::compiler::operator!= ( const StoreRepresentation &  rep1,
const StoreRepresentation &  rep2 
)
inline

Definition at line 50 of file machine-operator.h.

51  {
52  return !(rep1 == rep2);
53 }

◆ operator!=() [3/3]

bool v8::internal::compiler::operator!= ( ElementAccess const &  lhs,
ElementAccess const &  rhs 
)

Definition at line 35 of file simplified-operator.cc.

35  {
36  return !(lhs == rhs);
37 }

◆ operator<<() [1/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
BaseTaggedness  base_taggedness 
)

Definition at line 16 of file simplified-operator.cc.

16  {
17  switch (base_taggedness) {
18  case kUntaggedBase:
19  return os << "untagged base";
20  case kTaggedBase:
21  return os << "tagged base";
22  }
23  UNREACHABLE();
24  return os;
25 }

References kTaggedBase, kUntaggedBase, and UNREACHABLE.

◆ operator<<() [2/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const AddressingMode am 
)

Definition at line 180 of file instruction.cc.

180  {
181  switch (am) {
182  case kMode_None:
183  return os;
184 #define CASE(Name) \
185  case kMode_##Name: \
186  return os << #Name;
188 #undef CASE
189  }
190  UNREACHABLE();
191  return os;
192 }
#define TARGET_ADDRESSING_MODE_LIST(V)
#define CASE(Name)

References CASE, TARGET_ADDRESSING_MODE_LIST, and UNREACHABLE.

◆ operator<<() [3/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const ArchOpcode ao 
)

Definition at line 167 of file instruction.cc.

167  {
168  switch (ao) {
169 #define CASE(Name) \
170  case k##Name: \
171  return os << #Name;
173 #undef CASE
174  }
175  UNREACHABLE();
176  return os;
177 }

References ARCH_OPCODE_LIST, CASE, and UNREACHABLE.

◆ operator<<() [4/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const AsDOT ad 
)

Definition at line 380 of file graph-visualizer.cc.

380  {
381  Zone tmp_zone(ad.graph.zone()->isolate());
382  GraphVisualizer(os, &tmp_zone, &ad.graph).Print();
383  return os;
384 }

References v8::internal::compiler::AsDOT::graph, v8::internal::Zone::isolate(), v8::internal::compiler::GraphVisualizer::Print(), and v8::internal::compiler::GenericGraphBase::zone().

+ Here is the call graph for this function:

◆ operator<<() [5/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const AsJSON ad 
)

Definition at line 149 of file graph-visualizer.cc.

149  {
150  Zone tmp_zone(ad.graph.zone()->isolate());
151  os << "{\"nodes\":[";
152  JSONGraphNodeWriter(os, &tmp_zone, &ad.graph).Print();
153  os << "],\"edges\":[";
154  JSONGraphEdgeWriter(os, &tmp_zone, &ad.graph).Print();
155  os << "]}";
156  return os;
157 }

References v8::internal::compiler::AsJSON::graph, v8::internal::Zone::isolate(), v8::internal::compiler::JSONGraphNodeWriter::Print(), v8::internal::compiler::JSONGraphEdgeWriter::Print(), and v8::internal::compiler::GenericGraphBase::zone().

+ Here is the call graph for this function:

◆ operator<<() [6/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const BasicBlockData::Control c 
)

Definition at line 15 of file schedule.cc.

15  {
16  switch (c) {
17  case BasicBlockData::kNone:
18  return os << "none";
19  case BasicBlockData::kGoto:
20  return os << "goto";
21  case BasicBlockData::kBranch:
22  return os << "branch";
23  case BasicBlockData::kReturn:
24  return os << "return";
25  case BasicBlockData::kThrow:
26  return os << "throw";
27  }
28  UNREACHABLE();
29  return os;
30 }

References v8::internal::compiler::BasicBlockData::kBranch, v8::internal::compiler::BasicBlockData::kGoto, v8::internal::compiler::BasicBlockData::kNone, v8::internal::compiler::BasicBlockData::kReturn, v8::internal::compiler::BasicBlockData::kThrow, and UNREACHABLE.

◆ operator<<() [7/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const CallDescriptor &  d 
)

Definition at line 34 of file linkage.cc.

34  {
35  // TODO(svenpanne) Output properties etc. and be less cryptic.
36  return os << d.kind() << ":" << d.debug_name() << ":r" << d.ReturnCount()
37  << "j" << d.JSParameterCount() << "i" << d.InputCount() << "f"
38  << d.FrameStateCount();
39 }

◆ operator<<() [8/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const CallDescriptor::Kind &  k 
)

Definition at line 18 of file linkage.cc.

18  {
19  switch (k) {
20  case CallDescriptor::kCallCodeObject:
21  os << "Code";
22  break;
23  case CallDescriptor::kCallJSFunction:
24  os << "JS";
25  break;
26  case CallDescriptor::kCallAddress:
27  os << "Addr";
28  break;
29  }
30  return os;
31 }

◆ operator<<() [9/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const Constant &  constant 
)

Definition at line 297 of file instruction.cc.

297  {
298  switch (constant.type()) {
299  case Constant::kInt32:
300  return os << constant.ToInt32();
301  case Constant::kInt64:
302  return os << constant.ToInt64() << "l";
303  case Constant::kFloat32:
304  return os << constant.ToFloat32() << "f";
305  case Constant::kFloat64:
306  return os << constant.ToFloat64();
307  case Constant::kExternalReference:
308  return os << constant.ToExternalReference().address();
309  case Constant::kHeapObject:
310  return os << Brief(*constant.ToHeapObject());
311  }
312  UNREACHABLE();
313  return os;
314 }

References UNREACHABLE.

◆ operator<<() [10/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const FlagsCondition fc 
)

Definition at line 209 of file instruction.cc.

209  {
210  switch (fc) {
211  case kEqual:
212  return os << "equal";
213  case kNotEqual:
214  return os << "not equal";
215  case kSignedLessThan:
216  return os << "signed less than";
218  return os << "signed greater than or equal";
220  return os << "signed less than or equal";
221  case kSignedGreaterThan:
222  return os << "signed greater than";
223  case kUnsignedLessThan:
224  return os << "unsigned less than";
226  return os << "unsigned greater than or equal";
228  return os << "unsigned less than or equal";
230  return os << "unsigned greater than";
231  case kUnorderedEqual:
232  return os << "unordered equal";
233  case kUnorderedNotEqual:
234  return os << "unordered not equal";
235  case kUnorderedLessThan:
236  return os << "unordered less than";
238  return os << "unordered greater than or equal";
240  return os << "unordered less than or equal";
242  return os << "unordered greater than";
243  case kOverflow:
244  return os << "overflow";
245  case kNotOverflow:
246  return os << "not overflow";
247  }
248  UNREACHABLE();
249  return os;
250 }

References kEqual, kNotEqual, kNotOverflow, kOverflow, kSignedGreaterThan, kSignedGreaterThanOrEqual, kSignedLessThan, kSignedLessThanOrEqual, kUnorderedEqual, kUnorderedGreaterThan, kUnorderedGreaterThanOrEqual, kUnorderedLessThan, kUnorderedLessThanOrEqual, kUnorderedNotEqual, kUnsignedGreaterThan, kUnsignedGreaterThanOrEqual, kUnsignedLessThan, kUnsignedLessThanOrEqual, and UNREACHABLE.

◆ operator<<() [11/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const FlagsMode fm 
)

Definition at line 195 of file instruction.cc.

195  {
196  switch (fm) {
197  case kFlags_none:
198  return os;
199  case kFlags_branch:
200  return os << "branch";
201  case kFlags_set:
202  return os << "set";
203  }
204  UNREACHABLE();
205  return os;
206 }

References kFlags_branch, kFlags_none, kFlags_set, and UNREACHABLE.

◆ operator<<() [12/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const Instruction instr 
)

Definition at line 253 of file instruction.cc.

253  {
254  if (instr.OutputCount() > 1) os << "(";
255  for (size_t i = 0; i < instr.OutputCount(); i++) {
256  if (i > 0) os << ", ";
257  os << *instr.OutputAt(i);
258  }
259 
260  if (instr.OutputCount() > 1) os << ") = ";
261  if (instr.OutputCount() == 1) os << " = ";
262 
263  if (instr.IsGapMoves()) {
264  const GapInstruction* gap = GapInstruction::cast(&instr);
265  os << (instr.IsBlockStart() ? " block-start" : "gap ");
266  for (int i = GapInstruction::FIRST_INNER_POSITION;
267  i <= GapInstruction::LAST_INNER_POSITION; i++) {
268  os << "(";
269  if (gap->parallel_moves_[i] != NULL) os << *gap->parallel_moves_[i];
270  os << ") ";
271  }
272  } else if (instr.IsSourcePosition()) {
273  const SourcePositionInstruction* pos =
274  SourcePositionInstruction::cast(&instr);
275  os << "position (" << pos->source_position().raw() << ")";
276  } else {
277  os << ArchOpcodeField::decode(instr.opcode());
278  AddressingMode am = AddressingModeField::decode(instr.opcode());
279  if (am != kMode_None) {
280  os << " : " << AddressingModeField::decode(instr.opcode());
281  }
282  FlagsMode fm = FlagsModeField::decode(instr.opcode());
283  if (fm != kFlags_none) {
284  os << " && " << fm << " if "
285  << FlagsConditionField::decode(instr.opcode());
286  }
287  }
288  if (instr.InputCount() > 0) {
289  for (size_t i = 0; i < instr.InputCount(); i++) {
290  os << " " << *instr.InputAt(i);
291  }
292  }
293  return os << "\n";
294 }

◆ operator<<() [13/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const InstructionOperand op 
)

Definition at line 13 of file instruction.cc.

13  {
14  switch (op.kind()) {
15  case InstructionOperand::INVALID:
16  return os << "(0)";
17  case InstructionOperand::UNALLOCATED: {
18  const UnallocatedOperand* unalloc = UnallocatedOperand::cast(&op);
19  os << "v" << unalloc->virtual_register();
20  if (unalloc->basic_policy() == UnallocatedOperand::FIXED_SLOT) {
21  return os << "(=" << unalloc->fixed_slot_index() << "S)";
22  }
23  switch (unalloc->extended_policy()) {
25  return os;
26  case UnallocatedOperand::FIXED_REGISTER:
27  return os << "(=" << Register::AllocationIndexToString(
28  unalloc->fixed_register_index()) << ")";
29  case UnallocatedOperand::FIXED_DOUBLE_REGISTER:
30  return os << "(=" << DoubleRegister::AllocationIndexToString(
31  unalloc->fixed_register_index()) << ")";
32  case UnallocatedOperand::MUST_HAVE_REGISTER:
33  return os << "(R)";
34  case UnallocatedOperand::SAME_AS_FIRST_INPUT:
35  return os << "(1)";
36  case UnallocatedOperand::ANY:
37  return os << "(-)";
38  }
39  }
41  return os << "[constant:" << op.index() << "]";
42  case InstructionOperand::IMMEDIATE:
43  return os << "[immediate:" << op.index() << "]";
44  case InstructionOperand::STACK_SLOT:
45  return os << "[stack:" << op.index() << "]";
46  case InstructionOperand::DOUBLE_STACK_SLOT:
47  return os << "[double_stack:" << op.index() << "]";
49  return os << "[" << Register::AllocationIndexToString(op.index())
50  << "|R]";
51  case InstructionOperand::DOUBLE_REGISTER:
52  return os << "[" << DoubleRegister::AllocationIndexToString(op.index())
53  << "|R]";
54  }
55  UNREACHABLE();
56  return os;
57 }
#define REGISTER(N, C)
@ NONE

References v8::internal::Register::AllocationIndexToString(), v8::internal::DwVfpRegister::AllocationIndexToString(), v8::internal::compiler::UnallocatedOperand::ANY, v8::internal::compiler::UnallocatedOperand::basic_policy(), v8::internal::compiler::UnallocatedOperand::cast(), v8::internal::compiler::InstructionOperand::CONSTANT, v8::internal::compiler::InstructionOperand::DOUBLE_REGISTER, v8::internal::compiler::InstructionOperand::DOUBLE_STACK_SLOT, v8::internal::compiler::UnallocatedOperand::extended_policy(), v8::internal::compiler::UnallocatedOperand::FIXED_DOUBLE_REGISTER, v8::internal::compiler::UnallocatedOperand::FIXED_REGISTER, v8::internal::compiler::UnallocatedOperand::fixed_register_index(), v8::internal::compiler::UnallocatedOperand::FIXED_SLOT, v8::internal::compiler::UnallocatedOperand::fixed_slot_index(), v8::internal::compiler::InstructionOperand::IMMEDIATE, v8::internal::compiler::InstructionOperand::index(), v8::internal::compiler::InstructionOperand::INVALID, v8::internal::compiler::InstructionOperand::kind(), v8::internal::compiler::UnallocatedOperand::MUST_HAVE_REGISTER, v8::internal::compiler::UnallocatedOperand::NONE, v8::internal::compiler::InstructionOperand::REGISTER, v8::internal::compiler::UnallocatedOperand::SAME_AS_FIRST_INPUT, v8::internal::compiler::InstructionOperand::STACK_SLOT, v8::internal::compiler::InstructionOperand::UNALLOCATED, UNREACHABLE, and v8::internal::compiler::UnallocatedOperand::virtual_register().

+ Here is the call graph for this function:

◆ operator<<() [14/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const InstructionSequence code 
)

Definition at line 417 of file instruction.cc.

417  {
418  for (size_t i = 0; i < code.immediates_.size(); ++i) {
419  Constant constant = code.immediates_[i];
420  os << "IMM#" << i << ": " << constant << "\n";
421  }
422  int i = 0;
423  for (ConstantMap::const_iterator it = code.constants_.begin();
424  it != code.constants_.end(); ++i, ++it) {
425  os << "CST#" << i << ": v" << it->first << " = " << it->second << "\n";
426  }
427  for (int i = 0; i < code.BasicBlockCount(); i++) {
428  BasicBlock* block = code.BlockAt(i);
429 
430  int bid = block->id();
431  os << "RPO#" << block->rpo_number_ << ": B" << bid;
432  CHECK(block->rpo_number_ == i);
433  if (block->IsLoopHeader()) {
434  os << " loop blocks: [" << block->rpo_number_ << ", " << block->loop_end_
435  << ")";
436  }
437  os << " instructions: [" << block->code_start_ << ", " << block->code_end_
438  << ")\n predecessors:";
439 
440  BasicBlock::Predecessors predecessors = block->predecessors();
441  for (BasicBlock::Predecessors::iterator iter = predecessors.begin();
442  iter != predecessors.end(); ++iter) {
443  os << " B" << (*iter)->id();
444  }
445  os << "\n";
446 
447  for (BasicBlock::const_iterator j = block->begin(); j != block->end();
448  ++j) {
449  Node* phi = *j;
450  if (phi->opcode() != IrOpcode::kPhi) continue;
451  os << " phi: v" << phi->id() << " =";
452  Node::Inputs inputs = phi->inputs();
453  for (Node::Inputs::iterator iter(inputs.begin()); iter != inputs.end();
454  ++iter) {
455  os << " v" << (*iter)->id();
456  }
457  os << "\n";
458  }
459 
460  ScopedVector<char> buf(32);
461  for (int j = block->first_instruction_index();
462  j <= block->last_instruction_index(); j++) {
463  // TODO(svenpanne) Add some basic formatting to our streams.
464  SNPrintF(buf, "%5d", j);
465  os << " " << buf.start() << ": " << *code.InstructionAt(j);
466  }
467 
468  os << " " << block->control_;
469 
470  if (block->control_input_ != NULL) {
471  os << " v" << block->control_input_->id();
472  }
473 
474  BasicBlock::Successors successors = block->successors();
475  for (BasicBlock::Successors::iterator iter = successors.begin();
476  iter != successors.end(); ++iter) {
477  os << " B" << (*iter)->id();
478  }
479  os << "\n";
480  }
481  return os;
482 }
#define CHECK(condition)
Definition: logging.h:36
int SNPrintF(Vector< char > str, const char *format,...)
Definition: utils.cc:105

◆ operator<<() [15/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const MachineType type 
)

Definition at line 20 of file machine-type.cc.

20  {
21  bool before = false;
22  PRINT(kRepBit);
30 
37  PRINT(kTypeAny);
38  return os;
39 }
#define PRINT(bit)
Definition: machine-type.cc:12

References kRepBit, kRepFloat32, kRepFloat64, kRepTagged, kRepWord16, kRepWord32, kRepWord64, kRepWord8, kTypeAny, kTypeBool, kTypeInt32, kTypeInt64, kTypeNumber, kTypeUint32, kTypeUint64, and PRINT.

◆ operator<<() [16/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const MoveOperands &  mo 
)

Definition at line 98 of file instruction.cc.

98  {
99  os << *mo.destination();
100  if (!mo.source()->Equals(mo.destination())) os << " = " << *mo.source();
101  return os << ";";
102 }

◆ operator<<() [17/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const Node &  n 
)

Definition at line 48 of file node.cc.

48  {
49  os << n.id() << ": " << *n.op();
50  if (n.op()->InputCount() != 0) {
51  os << "(";
52  for (int i = 0; i < n.op()->InputCount(); ++i) {
53  if (i != 0) os << ", ";
54  os << n.InputAt(i)->id();
55  }
56  os << ")";
57  }
58  return os;
59 }

◆ operator<<() [18/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const Operator op 
)

Definition at line 45 of file node.cc.

45 { return op.PrintTo(os); }

◆ operator<<() [19/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const ParallelMove &  pm 
)

Definition at line 113 of file instruction.cc.

113  {
114  bool first = true;
115  for (ZoneList<MoveOperands>::iterator move = pm.move_operands()->begin();
116  move != pm.move_operands()->end(); ++move) {
117  if (move->IsEliminated()) continue;
118  if (!first) os << " ";
119  first = false;
120  os << *move;
121  }
122  return os;
123 }

References v8::internal::List< T, AllocationPolicy >::begin().

+ Here is the call graph for this function:

◆ operator<<() [20/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const PointerMap &  pm 
)

Definition at line 155 of file instruction.cc.

155  {
156  os << "{";
157  for (ZoneList<InstructionOperand*>::iterator op =
158  pm.pointer_operands_.begin();
159  op != pm.pointer_operands_.end(); ++op) {
160  if (op != pm.pointer_operands_.begin()) os << ";";
161  os << *op;
162  }
163  return os << "}";
164 }

◆ operator<<() [21/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const Schedule s 
)

Definition at line 33 of file schedule.cc.

33  {
34  // TODO(svenpanne) Const-correct the RPO stuff/iterators.
35  BasicBlockVector* rpo = const_cast<Schedule*>(&s)->rpo_order();
36  for (BasicBlockVectorIter i = rpo->begin(); i != rpo->end(); ++i) {
37  BasicBlock* block = *i;
38  os << "--- BLOCK B" << block->id();
39  if (block->PredecessorCount() != 0) os << " <- ";
40  BasicBlock::Predecessors predecessors = block->predecessors();
41  bool comma = false;
42  for (BasicBlock::Predecessors::iterator j = predecessors.begin();
43  j != predecessors.end(); ++j) {
44  if (comma) os << ", ";
45  comma = true;
46  os << "B" << (*j)->id();
47  }
48  os << " ---\n";
49  for (BasicBlock::const_iterator j = block->begin(); j != block->end();
50  ++j) {
51  Node* node = *j;
52  os << " " << *node;
53  if (!NodeProperties::IsControl(node)) {
54  Bounds bounds = NodeProperties::GetBounds(node);
55  os << " : ";
56  bounds.lower->PrintTo(os);
57  if (!bounds.upper->Is(bounds.lower)) {
58  os << "..";
59  bounds.upper->PrintTo(os);
60  }
61  }
62  os << "\n";
63  }
64  BasicBlock::Control control = block->control_;
65  if (control != BasicBlock::kNone) {
66  os << " ";
67  if (block->control_input_ != NULL) {
68  os << *block->control_input_;
69  } else {
70  os << "Goto";
71  }
72  os << " -> ";
73  BasicBlock::Successors successors = block->successors();
74  comma = false;
75  for (BasicBlock::Successors::iterator j = successors.begin();
76  j != successors.end(); ++j) {
77  if (comma) os << ", ";
78  comma = true;
79  os << "B" << (*j)->id();
80  }
81  os << "\n";
82  }
83  }
84  return os;
85 }
ZoneVector< BasicBlock * > BasicBlockVector
Definition: schedule.h:149
BasicBlockVector::iterator BasicBlockVectorIter
Definition: schedule.h:150
BoundsImpl< ZoneTypeConfig > Bounds
Definition: types.h:1047

References v8::internal::compiler::NodeProperties::GetBounds(), v8::internal::compiler::NodeProperties::IsControl(), v8::internal::BoundsImpl< Config >::lower, NULL, and v8::internal::BoundsImpl< Config >::upper.

+ Here is the call graph for this function:

◆ operator<<() [22/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const StoreRepresentation &  rep 
)

Definition at line 27 of file machine-operator.cc.

27  {
28  return os << "(" << rep.machine_type() << " : " << rep.write_barrier_kind()
29  << ")";
30 }

◆ operator<<() [23/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
const WriteBarrierKind write_barrier_kind 
)

Definition at line 15 of file machine-operator.cc.

15  {
16  switch (write_barrier_kind) {
17  case kNoWriteBarrier:
18  return os << "NoWriteBarrier";
19  case kFullWriteBarrier:
20  return os << "FullWriteBarrier";
21  }
22  UNREACHABLE();
23  return os;
24 }

References kFullWriteBarrier, kNoWriteBarrier, and UNREACHABLE.

◆ operator<<() [24/26]

OStream & v8::internal::compiler::operator<< ( OStream os,
ElementAccess const &  access 
)

Definition at line 40 of file simplified-operator.cc.

40  {
41  os << "[" << access.base_is_tagged << ", " << access.header_size << ", ";
42  access.type->PrintTo(os);
43  os << ", " << access.machine_type << "]";
44  return os;
45 }

References v8::internal::compiler::ElementAccess::base_is_tagged, v8::internal::compiler::ElementAccess::header_size, v8::internal::compiler::ElementAccess::machine_type, v8::internal::TypeImpl< Config >::PrintTo(), and v8::internal::compiler::ElementAccess::type.

+ Here is the call graph for this function:

◆ operator<<() [25/26]

std::ostream& v8::internal::compiler::operator<< ( std::ostream &  os,
const ElementAccess access 
)
inline

Definition at line 15 of file simplified-operator-unittest.cc.

15  {
16  OStringStream ost;
17  ost << access;
18  return os << ost.c_str();
19 }

References v8::internal::OStringStream::c_str().

+ Here is the call graph for this function:

◆ operator<<() [26/26]

std::ostream& v8::internal::compiler::operator<< ( std::ostream &  os,
const MachineType type 
)
inline

Definition at line 24 of file change-lowering-unittest.cc.

24  {
25  OStringStream ost;
26  ost << type;
27  return os << ost.c_str();
28 }

References v8::internal::OStringStream::c_str().

+ Here is the call graph for this function:

◆ operator==() [1/3]

bool v8::internal::compiler::operator== ( const SourcePosition &  lhs,
const SourcePosition &  rhs 
)
inline

Definition at line 37 of file source-position.h.

37  {
38  return lhs.raw() == rhs.raw();
39 }

◆ operator==() [2/3]

bool v8::internal::compiler::operator== ( const StoreRepresentation &  rep1,
const StoreRepresentation &  rep2 
)
inline

Definition at line 44 of file machine-operator.h.

45  {
46  return rep1.machine_type() == rep2.machine_type() &&
47  rep1.write_barrier_kind() == rep2.write_barrier_kind();
48 }

◆ operator==() [3/3]

bool v8::internal::compiler::operator== ( ElementAccess const &  lhs,
ElementAccess const &  rhs 
)

Definition at line 28 of file simplified-operator.cc.

28  {
29  return lhs.base_is_tagged == rhs.base_is_tagged &&
30  lhs.header_size == rhs.header_size && lhs.type == rhs.type &&
31  lhs.machine_type == rhs.machine_type;
32 }

References v8::internal::compiler::ElementAccess::base_is_tagged, v8::internal::compiler::ElementAccess::header_size, v8::internal::compiler::ElementAccess::machine_type, and v8::internal::compiler::ElementAccess::type.

◆ OpParameter() [1/2]

template<typename T >
static const T& v8::internal::compiler::OpParameter ( const Node *  node)
inlinestatic

Definition at line 86 of file node.h.

86  {
87  return OpParameter<T>(node->op());
88 }

Referenced by v8::internal::compiler::OperandGenerator::ToConstant().

+ Here is the caller graph for this function:

◆ OpParameter() [2/2]

template<typename T >
static const T& v8::internal::compiler::OpParameter ( const Operator op)
inlinestatic

Definition at line 254 of file operator.h.

254  {
255  return reinterpret_cast<const Operator1<T>*>(op)->parameter();
256 }

◆ Parse()

static void v8::internal::compiler::Parse ( Handle< JSFunction function,
CompilationInfoWithZone info 
)
static

Definition at line 56 of file js-inlining.cc.

56  {
57  CHECK(Parser::Parse(info));
58  CHECK(Rewriter::Rewrite(info));
59  CHECK(Scope::Analyze(info));
60  CHECK(Compiler::EnsureDeoptimizationSupport(info));
61 }
static void Parse(Handle< JSFunction > function, CompilationInfoWithZone *info)
Definition: js-inlining.cc:56

References v8::internal::Scope::Analyze(), CHECK, v8::internal::Compiler::EnsureDeoptimizationSupport(), v8::internal::Parser::Parse(), and v8::internal::Rewriter::Rewrite().

Referenced by v8::JSON::Parse(), v8::internal::RUNTIME_FUNCTION(), and v8::internal::compiler::JSInliner::TryInlineCall().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PointerConstant()

static const Operator* v8::internal::compiler::PointerConstant ( CommonOperatorBuilder *  common,
void *  ptr 
)
static

Definition at line 36 of file basic-block-instrumentor.cc.

37  {
38  return kPointerSize == 8
39  ? common->Int64Constant(reinterpret_cast<intptr_t>(ptr))
40  : common->Int32Constant(
41  static_cast<int32_t>(reinterpret_cast<intptr_t>(ptr)));
42 }
int int32_t
Definition: unicode.cc:24

References v8::internal::kPointerSize.

Referenced by v8::internal::compiler::BasicBlockInstrumentor::Instrument().

+ Here is the caller graph for this function:

◆ Push()

static int v8::internal::compiler::Push ( SpecialRPOStackFrame stack,
int  depth,
BasicBlock *  child,
int  unvisited 
)
static

Definition at line 773 of file scheduler.cc.

774  {
775  if (child->rpo_number_ == unvisited) {
776  stack[depth].block = child;
777  stack[depth].index = 0;
778  child->rpo_number_ = kBlockOnStack;
779  return depth + 1;
780  }
781  return depth;
782 }
static const int kBlockOnStack
Definition: scheduler.cc:728

References v8::internal::compiler::SpecialRPOStackFrame::block, v8::internal::compiler::SpecialRPOStackFrame::index, and kBlockOnStack.

Referenced by v8::internal::FullCodeGenerator::AllocateModules(), v8::internal::HGraphBuilder::BuildAllocateArrayFromLength(), v8::internal::CodeStubGraphBuilder< Stub >::BuildCodeInitializedStub(), v8::internal::CodeStubGraphBuilder< Stub >::BuildCodeStub(), v8::internal::HGraphBuilder::BuildKeyedIndexCheck(), v8::internal::HGraphBuilder::BuildNumberToString(), v8::internal::HGraphBuilder::BuildStringAdd(), v8::internal::HGraphBuilder::BuildUncheckedDictionaryElementLoad(), v8::internal::HGraphBuilder::BuildUncheckedStringAdd(), v8::internal::compiler::Scheduler::ComputeSpecialRPO(), v8::internal::LCodeGen::DeoptimizeBranch(), v8::internal::LCodeGen::DeoptimizeIf(), v8::internal::LCodeGen::DoDeferredAllocate(), v8::internal::LCodeGen::DoDeferredLoadMutableDouble(), v8::internal::PostorderProcessor::PerformNonBacktrackingStep(), v8::internal::FullCodeGenerator::StackValueContext::Plug(), v8::internal::PostorderProcessor::SetupSuccessors(), and v8::internal::FullCodeGenerator::VisitLogicalExpression().

+ Here is the caller graph for this function:

◆ RelaxEffects()

static void v8::internal::compiler::RelaxEffects ( Node *  node)
static

Definition at line 27 of file js-typed-lowering.cc.

27  {
28  NodeProperties::ReplaceWithValue(node, node, NULL);
29 }

References NULL, and v8::internal::compiler::NodeProperties::ReplaceWithValue().

Referenced by v8::internal::compiler::JSBinopReduction::ChangeToPureOperator().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReplaceWithPureReduction()

static Reduction v8::internal::compiler::ReplaceWithPureReduction ( Node *  node,
Reduction  reduction 
)
static

Definition at line 18 of file js-builtin-reducer.cc.

18  {
19  if (reduction.Changed()) {
20  NodeProperties::ReplaceWithValue(node, reduction.replacement());
21  return reduction;
22  }
23  return Reducer::NoChange();
24 }

References v8::internal::compiler::Reducer::NoChange(), and v8::internal::compiler::NodeProperties::ReplaceWithValue().

+ Here is the call graph for this function:

◆ ReplaceWithReduction()

static Reduction v8::internal::compiler::ReplaceWithReduction ( Node *  node,
Reduction  reduction 
)
static

Definition at line 623 of file js-typed-lowering.cc.

623  {
624  if (reduction.Changed()) {
625  NodeProperties::ReplaceWithValue(node, reduction.replacement());
626  return reduction;
627  }
628  return Reducer::NoChange();
629 }

References v8::internal::compiler::Reducer::NoChange(), and v8::internal::compiler::NodeProperties::ReplaceWithValue().

+ Here is the call graph for this function:

◆ RepresentationOf()

MachineType v8::internal::compiler::RepresentationOf ( MachineType  machine_type)
inline

Definition at line 76 of file machine-type.h.

76  {
77  int result = machine_type & kRepMask;
79  return static_cast<MachineType>(result);
80 }
bool IsPowerOfTwo32(uint32_t value)
Definition: bits.h:77
const MachineTypeUnion kRepMask
Definition: machine-type.h:62

References CHECK, v8::base::bits::IsPowerOfTwo32(), and kRepMask.

Referenced by ComputeWriteBarrierKind(), ElementSizeOf(), and v8::internal::compiler::OperandGenerator::ToUnallocatedOperand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SearchSharedFunctionInfo()

static Handle<SharedFunctionInfo> v8::internal::compiler::SearchSharedFunctionInfo ( Code unoptimized_code,
FunctionLiteral *  expr 
)
static

Definition at line 134 of file ast-graph-builder.cc.

135  {
136  int start_position = expr->start_position();
137  for (RelocIterator it(unoptimized_code); !it.done(); it.next()) {
138  RelocInfo* rinfo = it.rinfo();
139  if (rinfo->rmode() != RelocInfo::EMBEDDED_OBJECT) continue;
140  Object* obj = rinfo->target_object();
141  if (obj->IsSharedFunctionInfo()) {
142  SharedFunctionInfo* shared = SharedFunctionInfo::cast(obj);
143  if (shared->start_position() == start_position) {
144  return Handle<SharedFunctionInfo>(shared);
145  }
146  }
147  }
148  return Handle<SharedFunctionInfo>();
149 }
kSerializedDataOffset Object
Definition: objects-inl.h:5322

References v8::internal::RelocIterator::done(), v8::internal::RelocInfo::EMBEDDED_OBJECT, v8::internal::RelocInfo::rmode(), and v8::internal::SharedFunctionInfo::start_position().

+ Here is the call graph for this function:

◆ STATIC_ASSERT()

Referenced by v8::internal::compiler::ChangeLoweringTest::HeapNumberValueOffset(), v8::internal::compiler::SimplifiedLowering::IsTagged(), v8::internal::compiler::IA32OperandConverter::ScaleFor(), v8::internal::compiler::X64OperandConverter::ScaleFor(), and TARGET_TEST_F().

+ Here is the caller graph for this function:

◆ TARGET_TEST_F() [1/21]

v8::internal::compiler::TARGET_TEST_F ( ChangeLowering32Test  ,
ChangeInt32ToTagged   
)

Definition at line 196 of file change-lowering-unittest.cc.

196  {
197  Node* val = Parameter(0);
198  Node* node = graph()->NewNode(simplified()->ChangeInt32ToTagged(), val);
199  Reduction reduction = Reduce(node);
200  ASSERT_TRUE(reduction.Changed());
201 
202  Node* phi = reduction.replacement();
203  Capture<Node*> add, branch, heap_number, if_true;
204  EXPECT_THAT(
205  phi,
207  IsFinish(
208  AllOf(CaptureEq(&heap_number),
209  IsAllocateHeapNumber(_, CaptureEq(&if_true))),
210  IsStore(kMachFloat64, kNoWriteBarrier, CaptureEq(&heap_number),
211  IsInt32Constant(HeapNumberValueOffset()),
212  IsChangeInt32ToFloat64(val), CaptureEq(&heap_number),
213  CaptureEq(&if_true))),
214  IsProjection(
215  0, AllOf(CaptureEq(&add), IsInt32AddWithOverflow(val, val))),
216  IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
217  IsIfFalse(AllOf(CaptureEq(&branch),
218  IsBranch(IsProjection(1, CaptureEq(&add)),
219  graph()->start()))))));
220 }
#define _
Matcher< Node * > IsMerge(const Matcher< Node * > &control0_matcher, const Matcher< Node * > &control1_matcher)
Matcher< Node * > IsIfFalse(const Matcher< Node * > &control_matcher)
Matcher< Node * > IsBranch(const Matcher< Node * > &value_matcher, const Matcher< Node * > &control_matcher)
Matcher< Node * > IsIfTrue(const Matcher< Node * > &control_matcher)
Matcher< Node * > IsFinish(const Matcher< Node * > &value_matcher, const Matcher< Node * > &effect_matcher)
Matcher< Node * > IsChangeInt32ToFloat64(const Matcher< Node * > &input_matcher)
Matcher< Node * > IsInt32Constant(const Matcher< int32_t > &value_matcher)
Matcher< Node * > IsPhi(const Matcher< MachineType > &type_matcher, const Matcher< Node * > &value0_matcher, const Matcher< Node * > &value1_matcher, const Matcher< Node * > &merge_matcher)
Matcher< Node * > IsStore(const Matcher< MachineType > &type_matcher, const Matcher< WriteBarrierKind > &write_barrier_matcher, const Matcher< Node * > &base_matcher, const Matcher< Node * > &index_matcher, const Matcher< Node * > &value_matcher, const Matcher< Node * > &effect_matcher, const Matcher< Node * > &control_matcher)
Matcher< Node * > IsProjection(const Matcher< size_t > &index_matcher, const Matcher< Node * > &base_matcher)
Matcher< Node * > IsInt32AddWithOverflow(const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)

References _, IsBranch(), IsChangeInt32ToFloat64(), IsFinish(), IsIfFalse(), IsIfTrue(), IsInt32AddWithOverflow(), IsInt32Constant(), IsMerge(), IsPhi(), IsProjection(), IsStore(), kMachAnyTagged, kMachFloat64, and kNoWriteBarrier.

+ Here is the call graph for this function:

◆ TARGET_TEST_F() [2/21]

v8::internal::compiler::TARGET_TEST_F ( ChangeLowering32Test  ,
ChangeTaggedToFloat64   
)

Definition at line 223 of file change-lowering-unittest.cc.

223  {
224  STATIC_ASSERT(kSmiTag == 0);
226 
227  Node* val = Parameter(0);
228  Node* node = graph()->NewNode(simplified()->ChangeTaggedToFloat64(), val);
229  Reduction reduction = Reduce(node);
230  ASSERT_TRUE(reduction.Changed());
231 
232  Node* phi = reduction.replacement();
233  Capture<Node*> branch, if_true;
234  EXPECT_THAT(
235  phi,
236  IsPhi(
237  kMachFloat64,
238  IsLoad(kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
239  IsControlEffect(CaptureEq(&if_true))),
241  IsWord32Sar(val, IsInt32Constant(SmiShiftAmount()))),
242  IsMerge(
243  AllOf(CaptureEq(&if_true),
244  IsIfTrue(AllOf(
245  CaptureEq(&branch),
247  graph()->start())))),
248  IsIfFalse(CaptureEq(&branch)))));
249 }
#define STATIC_ASSERT(test)
Definition: macros.h:311
Matcher< Node * > IsControlEffect(const Matcher< Node * > &control_matcher)
Matcher< Node * > IsWord32And(const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
Matcher< Node * > IsLoad(const Matcher< LoadRepresentation > &rep_matcher, const Matcher< Node * > &base_matcher, const Matcher< Node * > &index_matcher, const Matcher< Node * > &effect_matcher)
Matcher< Node * > IsWord32Sar(const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
const int kSmiTagSize
Definition: v8.h:5743
const intptr_t kSmiTagMask
Definition: v8.h:5744
const int kSmiTag
Definition: v8.h:5742

References IsBranch(), IsChangeInt32ToFloat64(), IsControlEffect(), IsIfFalse(), IsIfTrue(), IsInt32Constant(), IsLoad(), IsMerge(), IsPhi(), IsWord32And(), IsWord32Sar(), kMachFloat64, v8::internal::kSmiTag, v8::internal::kSmiTagMask, v8::internal::kSmiTagSize, and STATIC_ASSERT().

+ Here is the call graph for this function:

◆ TARGET_TEST_F() [3/21]

v8::internal::compiler::TARGET_TEST_F ( ChangeLowering32Test  ,
ChangeTaggedToInt32   
)

Definition at line 252 of file change-lowering-unittest.cc.

252  {
253  STATIC_ASSERT(kSmiTag == 0);
255 
256  Node* val = Parameter(0);
257  Node* node = graph()->NewNode(simplified()->ChangeTaggedToInt32(), val);
258  Reduction reduction = Reduce(node);
259  ASSERT_TRUE(reduction.Changed());
260 
261  Node* phi = reduction.replacement();
262  Capture<Node*> branch, if_true;
263  EXPECT_THAT(
264  phi,
267  kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
268  IsControlEffect(CaptureEq(&if_true)))),
269  IsWord32Sar(val, IsInt32Constant(SmiShiftAmount())),
270  IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
271  IsIfFalse(AllOf(
272  CaptureEq(&branch),
274  graph()->start()))))));
275 }
Matcher< Node * > IsChangeFloat64ToInt32(const Matcher< Node * > &input_matcher)

References IsBranch(), IsChangeFloat64ToInt32(), IsControlEffect(), IsIfFalse(), IsIfTrue(), IsInt32Constant(), IsLoad(), IsMerge(), IsPhi(), IsWord32And(), IsWord32Sar(), kMachFloat64, kMachInt32, v8::internal::kSmiTag, v8::internal::kSmiTagMask, v8::internal::kSmiTagSize, and STATIC_ASSERT().

+ Here is the call graph for this function:

◆ TARGET_TEST_F() [4/21]

v8::internal::compiler::TARGET_TEST_F ( ChangeLowering32Test  ,
ChangeTaggedToUint32   
)

Definition at line 278 of file change-lowering-unittest.cc.

278  {
279  STATIC_ASSERT(kSmiTag == 0);
281 
282  Node* val = Parameter(0);
283  Node* node = graph()->NewNode(simplified()->ChangeTaggedToUint32(), val);
284  Reduction reduction = Reduce(node);
285  ASSERT_TRUE(reduction.Changed());
286 
287  Node* phi = reduction.replacement();
288  Capture<Node*> branch, if_true;
289  EXPECT_THAT(
290  phi,
293  kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
294  IsControlEffect(CaptureEq(&if_true)))),
295  IsWord32Sar(val, IsInt32Constant(SmiShiftAmount())),
296  IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
297  IsIfFalse(AllOf(
298  CaptureEq(&branch),
300  graph()->start()))))));
301 }
Matcher< Node * > IsChangeFloat64ToUint32(const Matcher< Node * > &input_matcher)

References IsBranch(), IsChangeFloat64ToUint32(), IsControlEffect(), IsIfFalse(), IsIfTrue(), IsInt32Constant(), IsLoad(), IsMerge(), IsPhi(), IsWord32And(), IsWord32Sar(), kMachFloat64, kMachUint32, v8::internal::kSmiTag, v8::internal::kSmiTagMask, v8::internal::kSmiTagSize, and STATIC_ASSERT().

+ Here is the call graph for this function:

◆ TARGET_TEST_F() [5/21]

v8::internal::compiler::TARGET_TEST_F ( ChangeLowering32Test  ,
ChangeUint32ToTagged   
)

Definition at line 304 of file change-lowering-unittest.cc.

304  {
305  STATIC_ASSERT(kSmiTag == 0);
307 
308  Node* val = Parameter(0);
309  Node* node = graph()->NewNode(simplified()->ChangeUint32ToTagged(), val);
310  Reduction reduction = Reduce(node);
311  ASSERT_TRUE(reduction.Changed());
312 
313  Node* phi = reduction.replacement();
314  Capture<Node*> branch, heap_number, if_false;
315  EXPECT_THAT(
316  phi,
317  IsPhi(
318  kMachAnyTagged, IsWord32Shl(val, IsInt32Constant(SmiShiftAmount())),
319  IsFinish(
320  AllOf(CaptureEq(&heap_number),
321  IsAllocateHeapNumber(_, CaptureEq(&if_false))),
322  IsStore(kMachFloat64, kNoWriteBarrier, CaptureEq(&heap_number),
323  IsInt32Constant(HeapNumberValueOffset()),
324  IsChangeUint32ToFloat64(val), CaptureEq(&heap_number),
325  CaptureEq(&if_false))),
326  IsMerge(
327  IsIfTrue(AllOf(CaptureEq(&branch),
329  val, IsInt32Constant(SmiMaxValue())),
330  graph()->start()))),
331  AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch))))));
332 }
Matcher< Node * > IsChangeUint32ToFloat64(const Matcher< Node * > &input_matcher)
Matcher< Node * > IsUint32LessThanOrEqual(const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
Matcher< Node * > IsWord32Shl(const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)

References _, IsBranch(), IsChangeUint32ToFloat64(), IsFinish(), IsIfFalse(), IsIfTrue(), IsInt32Constant(), IsMerge(), IsPhi(), IsStore(), IsUint32LessThanOrEqual(), IsWord32Shl(), kMachAnyTagged, kMachFloat64, kNoWriteBarrier, v8::internal::kSmiTag, v8::internal::kSmiTagSize, and STATIC_ASSERT().

+ Here is the call graph for this function:

◆ TARGET_TEST_F() [6/21]

v8::internal::compiler::TARGET_TEST_F ( ChangeLowering64Test  ,
ChangeInt32ToTagged   
)

Definition at line 348 of file change-lowering-unittest.cc.

348  {
349  Node* val = Parameter(0);
350  Node* node = graph()->NewNode(simplified()->ChangeInt32ToTagged(), val);
351  Reduction reduction = Reduce(node);
352  ASSERT_TRUE(reduction.Changed());
353 
354  EXPECT_THAT(reduction.replacement(),
356  IsInt32Constant(SmiShiftAmount())));
357 }
Matcher< Node * > IsChangeInt32ToInt64(const Matcher< Node * > &input_matcher)
Matcher< Node * > IsWord64Shl(const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)

References IsChangeInt32ToInt64(), IsInt32Constant(), and IsWord64Shl().

+ Here is the call graph for this function:

◆ TARGET_TEST_F() [7/21]

v8::internal::compiler::TARGET_TEST_F ( ChangeLowering64Test  ,
ChangeTaggedToFloat64   
)

Definition at line 360 of file change-lowering-unittest.cc.

360  {
361  STATIC_ASSERT(kSmiTag == 0);
363 
364  Node* val = Parameter(0);
365  Node* node = graph()->NewNode(simplified()->ChangeTaggedToFloat64(), val);
366  Reduction reduction = Reduce(node);
367  ASSERT_TRUE(reduction.Changed());
368 
369  Node* phi = reduction.replacement();
370  Capture<Node*> branch, if_true;
371  EXPECT_THAT(
372  phi,
373  IsPhi(
374  kMachFloat64,
375  IsLoad(kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
376  IsControlEffect(CaptureEq(&if_true))),
378  IsWord64Sar(val, IsInt32Constant(SmiShiftAmount())))),
379  IsMerge(
380  AllOf(CaptureEq(&if_true),
381  IsIfTrue(AllOf(
382  CaptureEq(&branch),
384  graph()->start())))),
385  IsIfFalse(CaptureEq(&branch)))));
386 }
Matcher< Node * > IsTruncateInt64ToInt32(const Matcher< Node * > &input_matcher)
Matcher< Node * > IsWord64Sar(const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
Matcher< Node * > IsWord64And(const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)

References IsBranch(), IsChangeInt32ToFloat64(), IsControlEffect(), IsIfFalse(), IsIfTrue(), IsInt32Constant(), IsLoad(), IsMerge(), IsPhi(), IsTruncateInt64ToInt32(), IsWord64And(), IsWord64Sar(), kMachFloat64, v8::internal::kSmiTag, v8::internal::kSmiTagMask, v8::internal::kSmiTagSize, and STATIC_ASSERT().

+ Here is the call graph for this function:

◆ TARGET_TEST_F() [8/21]

v8::internal::compiler::TARGET_TEST_F ( ChangeLowering64Test  ,
ChangeTaggedToInt32   
)

Definition at line 389 of file change-lowering-unittest.cc.

389  {
390  STATIC_ASSERT(kSmiTag == 0);
392 
393  Node* val = Parameter(0);
394  Node* node = graph()->NewNode(simplified()->ChangeTaggedToInt32(), val);
395  Reduction reduction = Reduce(node);
396  ASSERT_TRUE(reduction.Changed());
397 
398  Node* phi = reduction.replacement();
399  Capture<Node*> branch, if_true;
400  EXPECT_THAT(
401  phi,
404  kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
405  IsControlEffect(CaptureEq(&if_true)))),
407  IsWord64Sar(val, IsInt32Constant(SmiShiftAmount()))),
408  IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
409  IsIfFalse(AllOf(
410  CaptureEq(&branch),
412  graph()->start()))))));
413 }

References IsBranch(), IsChangeFloat64ToInt32(), IsControlEffect(), IsIfFalse(), IsIfTrue(), IsInt32Constant(), IsLoad(), IsMerge(), IsPhi(), IsTruncateInt64ToInt32(), IsWord64And(), IsWord64Sar(), kMachFloat64, kMachInt32, v8::internal::kSmiTag, v8::internal::kSmiTagMask, v8::internal::kSmiTagSize, and STATIC_ASSERT().

+ Here is the call graph for this function:

◆ TARGET_TEST_F() [9/21]

v8::internal::compiler::TARGET_TEST_F ( ChangeLowering64Test  ,
ChangeTaggedToUint32   
)

Definition at line 416 of file change-lowering-unittest.cc.

416  {
417  STATIC_ASSERT(kSmiTag == 0);
419 
420  Node* val = Parameter(0);
421  Node* node = graph()->NewNode(simplified()->ChangeTaggedToUint32(), val);
422  Reduction reduction = Reduce(node);
423  ASSERT_TRUE(reduction.Changed());
424 
425  Node* phi = reduction.replacement();
426  Capture<Node*> branch, if_true;
427  EXPECT_THAT(
428  phi,
431  kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
432  IsControlEffect(CaptureEq(&if_true)))),
434  IsWord64Sar(val, IsInt32Constant(SmiShiftAmount()))),
435  IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
436  IsIfFalse(AllOf(
437  CaptureEq(&branch),
439  graph()->start()))))));
440 }

References IsBranch(), IsChangeFloat64ToUint32(), IsControlEffect(), IsIfFalse(), IsIfTrue(), IsInt32Constant(), IsLoad(), IsMerge(), IsPhi(), IsTruncateInt64ToInt32(), IsWord64And(), IsWord64Sar(), kMachFloat64, kMachUint32, v8::internal::kSmiTag, v8::internal::kSmiTagMask, v8::internal::kSmiTagSize, and STATIC_ASSERT().

+ Here is the call graph for this function:

◆ TARGET_TEST_F() [10/21]

v8::internal::compiler::TARGET_TEST_F ( ChangeLowering64Test  ,
ChangeUint32ToTagged   
)

Definition at line 443 of file change-lowering-unittest.cc.

443  {
444  STATIC_ASSERT(kSmiTag == 0);
446 
447  Node* val = Parameter(0);
448  Node* node = graph()->NewNode(simplified()->ChangeUint32ToTagged(), val);
449  Reduction reduction = Reduce(node);
450  ASSERT_TRUE(reduction.Changed());
451 
452  Node* phi = reduction.replacement();
453  Capture<Node*> branch, heap_number, if_false;
454  EXPECT_THAT(
455  phi,
456  IsPhi(
458  IsInt32Constant(SmiShiftAmount())),
459  IsFinish(
460  AllOf(CaptureEq(&heap_number),
461  IsAllocateHeapNumber(_, CaptureEq(&if_false))),
462  IsStore(kMachFloat64, kNoWriteBarrier, CaptureEq(&heap_number),
463  IsInt32Constant(HeapNumberValueOffset()),
464  IsChangeUint32ToFloat64(val), CaptureEq(&heap_number),
465  CaptureEq(&if_false))),
466  IsMerge(
467  IsIfTrue(AllOf(CaptureEq(&branch),
469  val, IsInt32Constant(SmiMaxValue())),
470  graph()->start()))),
471  AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch))))));
472 }
Matcher< Node * > IsChangeUint32ToUint64(const Matcher< Node * > &input_matcher)

References _, IsBranch(), IsChangeUint32ToFloat64(), IsChangeUint32ToUint64(), IsFinish(), IsIfFalse(), IsIfTrue(), IsInt32Constant(), IsMerge(), IsPhi(), IsStore(), IsUint32LessThanOrEqual(), IsWord64Shl(), kMachAnyTagged, kMachFloat64, kNoWriteBarrier, v8::internal::kSmiTag, v8::internal::kSmiTagSize, and STATIC_ASSERT().

+ Here is the call graph for this function:

◆ TARGET_TEST_F() [11/21]

v8::internal::compiler::TARGET_TEST_F ( InstructionSelectorTest  ,
CallFunctionStubDeoptRecursiveFrameState   
)

Definition at line 421 of file instruction-selector-unittest.cc.

422  {
423  StreamBuilder m(this, kMachAnyTagged, kMachAnyTagged, kMachAnyTagged,
425 
426  BailoutId bailout_id_before(42);
427  BailoutId bailout_id_parent(62);
428 
429  // Some arguments for the call node.
430  Node* function_node = m.Parameter(0);
431  Node* receiver = m.Parameter(1);
432  Node* context = m.Int32Constant(66);
433 
434  // Build frame state for the state before the call.
435  Node* parameters = m.NewNode(m.common()->StateValues(1), m.Int32Constant(63));
436  Node* locals = m.NewNode(m.common()->StateValues(1), m.Int32Constant(64));
437  Node* stack = m.NewNode(m.common()->StateValues(1), m.Int32Constant(65));
438  Node* frame_state_parent = m.NewNode(
439  m.common()->FrameState(JS_FRAME, bailout_id_parent, kIgnoreOutput),
440  parameters, locals, stack, context, m.UndefinedConstant());
441 
442  Node* context2 = m.Int32Constant(46);
443  Node* parameters2 =
444  m.NewNode(m.common()->StateValues(1), m.Int32Constant(43));
445  Node* locals2 = m.NewNode(m.common()->StateValues(1), m.Int32Constant(44));
446  Node* stack2 = m.NewNode(m.common()->StateValues(1), m.Int32Constant(45));
447  Node* frame_state_before = m.NewNode(
448  m.common()->FrameState(JS_FRAME, bailout_id_before, kPushOutput),
449  parameters2, locals2, stack2, context2, frame_state_parent);
450 
451  // Build the call.
452  Node* call = m.CallFunctionStub0(function_node, receiver, context2,
453  frame_state_before, CALL_AS_METHOD);
454 
455  m.Return(call);
456 
457  Stream s = m.Build(kAllExceptNopInstructions);
458 
459  // Skip until kArchCallJSFunction.
460  size_t index = 0;
461  for (; index < s.size() && s[index]->arch_opcode() != kArchCallCodeObject;
462  index++) {
463  }
464  // Now we should have three instructions: call, return.
465  EXPECT_EQ(index + 2, s.size());
466 
467  // Check the call instruction
468  const Instruction* call_instr = s[index++];
469  EXPECT_EQ(kArchCallCodeObject, call_instr->arch_opcode());
470  size_t num_operands =
471  1 + // Code object.
472  1 + // Frame state deopt id
473  4 + // One input for each value in frame state + context.
474  4 + // One input for each value in the parent frame state + context.
475  1 + // Function.
476  1; // Context.
477  EXPECT_EQ(num_operands, call_instr->InputCount());
478  // Code object.
479  EXPECT_TRUE(call_instr->InputAt(0)->IsImmediate());
480 
481  // Deoptimization id.
482  int32_t deopt_id_before = s.ToInt32(call_instr->InputAt(1));
483  FrameStateDescriptor* desc_before =
484  s.GetFrameStateDescriptor(deopt_id_before);
485  EXPECT_EQ(bailout_id_before, desc_before->bailout_id());
486  EXPECT_EQ(1u, desc_before->parameters_count());
487  EXPECT_EQ(1u, desc_before->locals_count());
488  EXPECT_EQ(1u, desc_before->stack_count());
489  EXPECT_EQ(63, s.ToInt32(call_instr->InputAt(2)));
490  // Context:
491  EXPECT_EQ(66, s.ToInt32(call_instr->InputAt(3)));
492  EXPECT_EQ(64, s.ToInt32(call_instr->InputAt(4)));
493  EXPECT_EQ(65, s.ToInt32(call_instr->InputAt(5)));
494  // Values from parent environment should follow.
495  EXPECT_EQ(43, s.ToInt32(call_instr->InputAt(6)));
496  EXPECT_EQ(46, s.ToInt32(call_instr->InputAt(7)));
497  EXPECT_EQ(44, s.ToInt32(call_instr->InputAt(8)));
498  EXPECT_EQ(45, s.ToInt32(call_instr->InputAt(9)));
499 
500  // Function.
501  EXPECT_EQ(function_node->id(), s.ToVreg(call_instr->InputAt(10)));
502  // Context.
503  EXPECT_EQ(context2->id(), s.ToVreg(call_instr->InputAt(11)));
504  // Continuation.
505 
506  EXPECT_EQ(kArchRet, s[index++]->arch_opcode());
507  EXPECT_EQ(index, s.size());
508 }
@ CALL_AS_METHOD
Definition: globals.h:470

References v8::internal::compiler::Instruction::arch_opcode(), v8::internal::compiler::FrameStateDescriptor::bailout_id(), v8::internal::CALL_AS_METHOD, v8::internal::compiler::Instruction::InputAt(), v8::internal::compiler::Instruction::InputCount(), JS_FRAME, kIgnoreOutput, kMachAnyTagged, kPushOutput, v8::internal::compiler::FrameStateDescriptor::locals_count(), v8::internal::compiler::FrameStateDescriptor::parameters_count(), and v8::internal::compiler::FrameStateDescriptor::stack_count().

+ Here is the call graph for this function:

◆ TARGET_TEST_F() [12/21]

v8::internal::compiler::TARGET_TEST_F ( InstructionSelectorTest  ,
CallFunctionStubWithDeopt   
)

Definition at line 345 of file instruction-selector-unittest.cc.

345  {
346  StreamBuilder m(this, kMachAnyTagged, kMachAnyTagged, kMachAnyTagged,
348 
349  BailoutId bailout_id_before(42);
350 
351  // Some arguments for the call node.
352  Node* function_node = m.Parameter(0);
353  Node* receiver = m.Parameter(1);
354  Node* context = m.Int32Constant(1); // Context is ignored.
355 
356  // Build frame state for the state before the call.
357  Node* parameters = m.NewNode(m.common()->StateValues(1), m.Int32Constant(43));
358  Node* locals = m.NewNode(m.common()->StateValues(1), m.Int32Constant(44));
359  Node* stack = m.NewNode(m.common()->StateValues(1), m.Int32Constant(45));
360 
361  Node* context_sentinel = m.Int32Constant(0);
362  Node* frame_state_before = m.NewNode(
363  m.common()->FrameState(JS_FRAME, bailout_id_before, kPushOutput),
364  parameters, locals, stack, context_sentinel, m.UndefinedConstant());
365 
366  // Build the call.
367  Node* call = m.CallFunctionStub0(function_node, receiver, context,
368  frame_state_before, CALL_AS_METHOD);
369 
370  m.Return(call);
371 
372  Stream s = m.Build(kAllExceptNopInstructions);
373 
374  // Skip until kArchCallJSFunction.
375  size_t index = 0;
376  for (; index < s.size() && s[index]->arch_opcode() != kArchCallCodeObject;
377  index++) {
378  }
379  // Now we should have two instructions: call, return.
380  ASSERT_EQ(index + 2, s.size());
381 
382  // Check the call instruction
383  const Instruction* call_instr = s[index++];
384  EXPECT_EQ(kArchCallCodeObject, call_instr->arch_opcode());
385  size_t num_operands =
386  1 + // Code object.
387  1 +
388  4 + // Frame state deopt id + one input for each value in frame state.
389  1 + // Function.
390  1; // Context.
391  ASSERT_EQ(num_operands, call_instr->InputCount());
392 
393  // Code object.
394  EXPECT_TRUE(call_instr->InputAt(0)->IsImmediate());
395 
396  // Deoptimization id.
397  int32_t deopt_id_before = s.ToInt32(call_instr->InputAt(1));
398  FrameStateDescriptor* desc_before =
399  s.GetFrameStateDescriptor(deopt_id_before);
400  EXPECT_EQ(bailout_id_before, desc_before->bailout_id());
401  EXPECT_EQ(kPushOutput, desc_before->state_combine());
402  EXPECT_EQ(1u, desc_before->parameters_count());
403  EXPECT_EQ(1u, desc_before->locals_count());
404  EXPECT_EQ(1u, desc_before->stack_count());
405  EXPECT_EQ(43, s.ToInt32(call_instr->InputAt(2)));
406  EXPECT_EQ(0, s.ToInt32(call_instr->InputAt(3)));
407  EXPECT_EQ(44, s.ToInt32(call_instr->InputAt(4)));
408  EXPECT_EQ(45, s.ToInt32(call_instr->InputAt(5)));
409 
410  // Function.
411  EXPECT_EQ(function_node->id(), s.ToVreg(call_instr->InputAt(6)));
412  // Context.
413  EXPECT_EQ(context->id(), s.ToVreg(call_instr->InputAt(7)));
414 
415  EXPECT_EQ(kArchRet, s[index++]->arch_opcode());
416 
417  EXPECT_EQ(index, s.size());
418 }

References v8::internal::compiler::Instruction::arch_opcode(), v8::internal::compiler::FrameStateDescriptor::bailout_id(), v8::internal::CALL_AS_METHOD, v8::internal::compiler::Instruction::InputAt(), v8::internal::compiler::Instruction::InputCount(), JS_FRAME, kMachAnyTagged, kPushOutput, v8::internal::compiler::FrameStateDescriptor::locals_count(), v8::internal::compiler::FrameStateDescriptor::parameters_count(), v8::internal::compiler::FrameStateDescriptor::stack_count(), and v8::internal::compiler::FrameStateDescriptor::state_combine().

+ Here is the call graph for this function:

◆ TARGET_TEST_F() [13/21]

v8::internal::compiler::TARGET_TEST_F ( InstructionSelectorTest  ,
CallJSFunctionWithDeopt   
)

Definition at line 307 of file instruction-selector-unittest.cc.

307  {
308  StreamBuilder m(this, kMachAnyTagged, kMachAnyTagged, kMachAnyTagged,
310 
311  BailoutId bailout_id(42);
312 
313  Node* function_node = m.Parameter(0);
314  Node* receiver = m.Parameter(1);
315  Node* context = m.Parameter(2);
316 
317  Node* parameters = m.NewNode(m.common()->StateValues(1), m.Int32Constant(1));
318  Node* locals = m.NewNode(m.common()->StateValues(0));
319  Node* stack = m.NewNode(m.common()->StateValues(0));
320  Node* context_dummy = m.Int32Constant(0);
321 
322  Node* state_node = m.NewNode(
323  m.common()->FrameState(JS_FRAME, bailout_id, kPushOutput), parameters,
324  locals, stack, context_dummy, m.UndefinedConstant());
325  Node* call = m.CallJS0(function_node, receiver, context, state_node);
326  m.Return(call);
327 
328  Stream s = m.Build(kAllExceptNopInstructions);
329 
330  // Skip until kArchCallJSFunction.
331  size_t index = 0;
332  for (; index < s.size() && s[index]->arch_opcode() != kArchCallJSFunction;
333  index++) {
334  }
335  // Now we should have two instructions: call and return.
336  ASSERT_EQ(index + 2, s.size());
337 
338  EXPECT_EQ(kArchCallJSFunction, s[index++]->arch_opcode());
339  EXPECT_EQ(kArchRet, s[index++]->arch_opcode());
340 
341  // TODO(jarin) Check deoptimization table.
342 }

References JS_FRAME, kMachAnyTagged, and kPushOutput.

◆ TARGET_TEST_F() [14/21]

v8::internal::compiler::TARGET_TEST_F ( InstructionSelectorTest  ,
DoubleParameter   
)

Definition at line 177 of file instruction-selector-unittest.cc.

177  {
178  StreamBuilder m(this, kMachFloat64, kMachFloat64);
179  Node* param = m.Parameter(0);
180  m.Return(param);
181  Stream s = m.Build(kAllInstructions);
182  EXPECT_TRUE(s.IsDouble(param->id()));
183 }

References kMachFloat64.

◆ TARGET_TEST_F() [15/21]

v8::internal::compiler::TARGET_TEST_F ( InstructionSelectorTest  ,
Finish   
)

Definition at line 199 of file instruction-selector-unittest.cc.

199  {
200  StreamBuilder m(this, kMachAnyTagged, kMachAnyTagged);
201  Node* param = m.Parameter(0);
202  Node* finish = m.NewNode(m.common()->Finish(1), param, m.graph()->start());
203  m.Return(finish);
204  Stream s = m.Build(kAllInstructions);
205  ASSERT_EQ(3U, s.size());
206  EXPECT_EQ(kArchNop, s[0]->arch_opcode());
207  ASSERT_EQ(1U, s[0]->OutputCount());
208  ASSERT_TRUE(s[0]->Output()->IsUnallocated());
209  EXPECT_EQ(param->id(), s.ToVreg(s[0]->Output()));
210  EXPECT_EQ(kArchNop, s[1]->arch_opcode());
211  ASSERT_EQ(1U, s[1]->InputCount());
212  ASSERT_TRUE(s[1]->InputAt(0)->IsUnallocated());
213  EXPECT_EQ(param->id(), s.ToVreg(s[1]->InputAt(0)));
214  ASSERT_EQ(1U, s[1]->OutputCount());
215  ASSERT_TRUE(s[1]->Output()->IsUnallocated());
216  EXPECT_TRUE(UnallocatedOperand::cast(s[1]->Output())->HasSameAsInputPolicy());
217  EXPECT_EQ(finish->id(), s.ToVreg(s[1]->Output()));
218  EXPECT_TRUE(s.IsReference(finish->id()));
219 }

References v8::internal::compiler::UnallocatedOperand::cast(), and kMachAnyTagged.

+ Here is the call graph for this function:

◆ TARGET_TEST_F() [16/21]

v8::internal::compiler::TARGET_TEST_F ( InstructionSelectorTest  ,
ReferenceParameter   
)

Definition at line 186 of file instruction-selector-unittest.cc.

186  {
187  StreamBuilder m(this, kMachAnyTagged, kMachAnyTagged);
188  Node* param = m.Parameter(0);
189  m.Return(param);
190  Stream s = m.Build(kAllInstructions);
191  EXPECT_TRUE(s.IsReference(param->id()));
192 }

References kMachAnyTagged.

◆ TARGET_TEST_F() [17/21]

v8::internal::compiler::TARGET_TEST_F ( InstructionSelectorTest  ,
ReturnFloat32Constant   
)

Definition at line 116 of file instruction-selector-unittest.cc.

116  {
117  const float kValue = 4.2f;
118  StreamBuilder m(this, kMachFloat32);
119  m.Return(m.Float32Constant(kValue));
120  Stream s = m.Build(kAllInstructions);
121  ASSERT_EQ(2U, s.size());
122  EXPECT_EQ(kArchNop, s[0]->arch_opcode());
123  ASSERT_EQ(InstructionOperand::CONSTANT, s[0]->OutputAt(0)->kind());
124  EXPECT_FLOAT_EQ(kValue, s.ToFloat32(s[0]->OutputAt(0)));
125  EXPECT_EQ(kArchRet, s[1]->arch_opcode());
126  EXPECT_EQ(1U, s[1]->InputCount());
127 }

References v8::internal::compiler::InstructionOperand::CONSTANT, and kMachFloat32.

◆ TARGET_TEST_F() [18/21]

v8::internal::compiler::TARGET_TEST_F ( InstructionSelectorTest  ,
ReturnParameter   
)

Definition at line 130 of file instruction-selector-unittest.cc.

130  {
131  StreamBuilder m(this, kMachInt32, kMachInt32);
132  m.Return(m.Parameter(0));
133  Stream s = m.Build(kAllInstructions);
134  ASSERT_EQ(2U, s.size());
135  EXPECT_EQ(kArchNop, s[0]->arch_opcode());
136  ASSERT_EQ(1U, s[0]->OutputCount());
137  EXPECT_EQ(kArchRet, s[1]->arch_opcode());
138  EXPECT_EQ(1U, s[1]->InputCount());
139 }

References kMachInt32.

◆ TARGET_TEST_F() [19/21]

v8::internal::compiler::TARGET_TEST_F ( InstructionSelectorTest  ,
ReturnZero   
)

Definition at line 142 of file instruction-selector-unittest.cc.

142  {
143  StreamBuilder m(this, kMachInt32);
144  m.Return(m.Int32Constant(0));
145  Stream s = m.Build(kAllInstructions);
146  ASSERT_EQ(2U, s.size());
147  EXPECT_EQ(kArchNop, s[0]->arch_opcode());
148  ASSERT_EQ(1U, s[0]->OutputCount());
149  EXPECT_EQ(InstructionOperand::CONSTANT, s[0]->OutputAt(0)->kind());
150  EXPECT_EQ(0, s.ToInt32(s[0]->OutputAt(0)));
151  EXPECT_EQ(kArchRet, s[1]->arch_opcode());
152  EXPECT_EQ(1U, s[1]->InputCount());
153 }

References v8::internal::compiler::InstructionOperand::CONSTANT, and kMachInt32.

◆ TARGET_TEST_F() [20/21]

v8::internal::compiler::TARGET_TEST_F ( InstructionSelectorTest  ,
TruncateFloat64ToInt32WithParameter   
)

Definition at line 160 of file instruction-selector-unittest.cc.

160  {
161  StreamBuilder m(this, kMachInt32, kMachFloat64);
162  m.Return(m.TruncateFloat64ToInt32(m.Parameter(0)));
163  Stream s = m.Build(kAllInstructions);
164  ASSERT_EQ(3U, s.size());
165  EXPECT_EQ(kArchNop, s[0]->arch_opcode());
166  EXPECT_EQ(kArchTruncateDoubleToI, s[1]->arch_opcode());
167  EXPECT_EQ(1U, s[1]->InputCount());
168  EXPECT_EQ(1U, s[1]->OutputCount());
169  EXPECT_EQ(kArchRet, s[2]->arch_opcode());
170 }

References kMachFloat64, and kMachInt32.

◆ TARGET_TEST_F() [21/21]

v8::internal::compiler::TARGET_TEST_F ( InstructionSelectorTest  ,
ValueEffect   
)

Definition at line 281 of file instruction-selector-unittest.cc.

281  {
282  StreamBuilder m1(this, kMachInt32, kMachPtr);
283  Node* p1 = m1.Parameter(0);
284  m1.Return(m1.Load(kMachInt32, p1, m1.Int32Constant(0)));
285  Stream s1 = m1.Build(kAllInstructions);
286  StreamBuilder m2(this, kMachInt32, kMachPtr);
287  Node* p2 = m2.Parameter(0);
288  m2.Return(m2.NewNode(m2.machine()->Load(kMachInt32), p2, m2.Int32Constant(0),
289  m2.NewNode(m2.common()->ValueEffect(1), p2)));
290  Stream s2 = m2.Build(kAllInstructions);
291  EXPECT_LE(3U, s1.size());
292  ASSERT_EQ(s1.size(), s2.size());
293  TRACED_FORRANGE(size_t, i, 0, s1.size() - 1) {
294  const Instruction* i1 = s1[i];
295  const Instruction* i2 = s2[i];
296  EXPECT_EQ(i1->arch_opcode(), i2->arch_opcode());
297  EXPECT_EQ(i1->InputCount(), i2->InputCount());
298  EXPECT_EQ(i1->OutputCount(), i2->OutputCount());
299  }
300 }
const SwVfpRegister s1
const SwVfpRegister s2

References v8::internal::compiler::Instruction::arch_opcode(), v8::internal::compiler::Instruction::InputCount(), kMachInt32, kMachPtr, v8::internal::compiler::Instruction::OutputCount(), v8::internal::p1, v8::internal::p2, v8::internal::s1, and v8::internal::s2.

+ Here is the call graph for this function:

◆ TARGET_TEST_P() [1/6]

v8::internal::compiler::TARGET_TEST_P ( ChangeLoweringCommonTest  ,
ChangeBitToBool   
)

Definition at line 125 of file change-lowering-unittest.cc.

125  {
126  Node* val = Parameter(0);
127  Node* node = graph()->NewNode(simplified()->ChangeBitToBool(), val);
128  Reduction reduction = Reduce(node);
129  ASSERT_TRUE(reduction.Changed());
130 
131  Node* phi = reduction.replacement();
132  Capture<Node*> branch;
133  EXPECT_THAT(phi,
134  IsPhi(static_cast<MachineType>(kTypeBool | kRepTagged),
135  IsTrueConstant(), IsFalseConstant(),
136  IsMerge(IsIfTrue(AllOf(CaptureEq(&branch),
137  IsBranch(val, graph()->start()))),
138  IsIfFalse(CaptureEq(&branch)))));
139 }

References IsBranch(), IsIfFalse(), IsIfTrue(), IsMerge(), IsPhi(), kRepTagged, and kTypeBool.

+ Here is the call graph for this function:

◆ TARGET_TEST_P() [2/6]

v8::internal::compiler::TARGET_TEST_P ( ChangeLoweringCommonTest  ,
ChangeBoolToBit   
)

Definition at line 142 of file change-lowering-unittest.cc.

142  {
143  Node* val = Parameter(0);
144  Node* node = graph()->NewNode(simplified()->ChangeBoolToBit(), val);
145  Reduction reduction = Reduce(node);
146  ASSERT_TRUE(reduction.Changed());
147 
148  EXPECT_THAT(reduction.replacement(), IsWordEqual(val, IsTrueConstant()));
149 }

◆ TARGET_TEST_P() [3/6]

v8::internal::compiler::TARGET_TEST_P ( ChangeLoweringCommonTest  ,
ChangeFloat64ToTagged   
)

Definition at line 152 of file change-lowering-unittest.cc.

152  {
153  Node* val = Parameter(0);
154  Node* node = graph()->NewNode(simplified()->ChangeFloat64ToTagged(), val);
155  Reduction reduction = Reduce(node);
156  ASSERT_TRUE(reduction.Changed());
157 
158  Node* finish = reduction.replacement();
159  Capture<Node*> heap_number;
160  EXPECT_THAT(
161  finish,
162  IsFinish(
163  AllOf(CaptureEq(&heap_number),
164  IsAllocateHeapNumber(IsValueEffect(val), graph()->start())),
165  IsStore(kMachFloat64, kNoWriteBarrier, CaptureEq(&heap_number),
166  IsInt32Constant(HeapNumberValueOffset()), val,
167  CaptureEq(&heap_number), graph()->start())));
168 }
Matcher< Node * > IsValueEffect(const Matcher< Node * > &value_matcher)

References IsFinish(), IsInt32Constant(), IsStore(), IsValueEffect(), kMachFloat64, and kNoWriteBarrier.

+ Here is the call graph for this function:

◆ TARGET_TEST_P() [4/6]

v8::internal::compiler::TARGET_TEST_P ( ChangeLoweringCommonTest  ,
StringAdd   
)

Definition at line 171 of file change-lowering-unittest.cc.

171  {
172  Node* node =
173  graph()->NewNode(simplified()->StringAdd(), Parameter(0), Parameter(1));
174  Reduction reduction = Reduce(node);
175  EXPECT_FALSE(reduction.Changed());
176 }

◆ TARGET_TEST_P() [5/6]

v8::internal::compiler::TARGET_TEST_P ( InstructionSelectorPhiTest  ,
Doubleness   
)

Definition at line 230 of file instruction-selector-unittest.cc.

230  {
231  const MachineType type = GetParam();
232  StreamBuilder m(this, type, type, type);
233  Node* param0 = m.Parameter(0);
234  Node* param1 = m.Parameter(1);
235  MLabel a, b, c;
236  m.Branch(m.Int32Constant(0), &a, &b);
237  m.Bind(&a);
238  m.Goto(&c);
239  m.Bind(&b);
240  m.Goto(&c);
241  m.Bind(&c);
242  Node* phi = m.Phi(type, param0, param1);
243  m.Return(phi);
244  Stream s = m.Build(kAllInstructions);
245  EXPECT_EQ(s.IsDouble(phi->id()), s.IsDouble(param0->id()));
246  EXPECT_EQ(s.IsDouble(phi->id()), s.IsDouble(param1->id()));
247 }

◆ TARGET_TEST_P() [6/6]

v8::internal::compiler::TARGET_TEST_P ( InstructionSelectorPhiTest  ,
Referenceness   
)

Definition at line 250 of file instruction-selector-unittest.cc.

250  {
251  const MachineType type = GetParam();
252  StreamBuilder m(this, type, type, type);
253  Node* param0 = m.Parameter(0);
254  Node* param1 = m.Parameter(1);
255  MLabel a, b, c;
256  m.Branch(m.Int32Constant(1), &a, &b);
257  m.Bind(&a);
258  m.Goto(&c);
259  m.Bind(&b);
260  m.Goto(&c);
261  m.Bind(&c);
262  Node* phi = m.Phi(type, param0, param1);
263  m.Return(phi);
264  Stream s = m.Build(kAllInstructions);
265  EXPECT_EQ(s.IsReference(phi->id()), s.IsReference(param0->id()));
266  EXPECT_EQ(s.IsReference(phi->id()), s.IsReference(param1->id()));
267 }

◆ TEST() [1/2]

v8::internal::compiler::TEST ( MachineOperatorTest  ,
PseudoOperatorsWhenWordSizeIs32Bit   
)

Definition at line 280 of file machine-operator-unittest.cc.

280  {
281  MachineOperatorBuilder machine(kRepWord32);
282  EXPECT_EQ(machine.Word32And(), machine.WordAnd());
283  EXPECT_EQ(machine.Word32Or(), machine.WordOr());
284  EXPECT_EQ(machine.Word32Xor(), machine.WordXor());
285  EXPECT_EQ(machine.Word32Shl(), machine.WordShl());
286  EXPECT_EQ(machine.Word32Shr(), machine.WordShr());
287  EXPECT_EQ(machine.Word32Sar(), machine.WordSar());
288  EXPECT_EQ(machine.Word32Ror(), machine.WordRor());
289  EXPECT_EQ(machine.Word32Equal(), machine.WordEqual());
290  EXPECT_EQ(machine.Int32Add(), machine.IntAdd());
291  EXPECT_EQ(machine.Int32Sub(), machine.IntSub());
292  EXPECT_EQ(machine.Int32Mul(), machine.IntMul());
293  EXPECT_EQ(machine.Int32Div(), machine.IntDiv());
294  EXPECT_EQ(machine.Int32UDiv(), machine.IntUDiv());
295  EXPECT_EQ(machine.Int32Mod(), machine.IntMod());
296  EXPECT_EQ(machine.Int32UMod(), machine.IntUMod());
297  EXPECT_EQ(machine.Int32LessThan(), machine.IntLessThan());
298  EXPECT_EQ(machine.Int32LessThanOrEqual(), machine.IntLessThanOrEqual());
299 }

References kRepWord32.

◆ TEST() [2/2]

v8::internal::compiler::TEST ( MachineOperatorTest  ,
PseudoOperatorsWhenWordSizeIs64Bit   
)

Definition at line 302 of file machine-operator-unittest.cc.

302  {
303  MachineOperatorBuilder machine(kRepWord64);
304  EXPECT_EQ(machine.Word64And(), machine.WordAnd());
305  EXPECT_EQ(machine.Word64Or(), machine.WordOr());
306  EXPECT_EQ(machine.Word64Xor(), machine.WordXor());
307  EXPECT_EQ(machine.Word64Shl(), machine.WordShl());
308  EXPECT_EQ(machine.Word64Shr(), machine.WordShr());
309  EXPECT_EQ(machine.Word64Sar(), machine.WordSar());
310  EXPECT_EQ(machine.Word64Ror(), machine.WordRor());
311  EXPECT_EQ(machine.Word64Equal(), machine.WordEqual());
312  EXPECT_EQ(machine.Int64Add(), machine.IntAdd());
313  EXPECT_EQ(machine.Int64Sub(), machine.IntSub());
314  EXPECT_EQ(machine.Int64Mul(), machine.IntMul());
315  EXPECT_EQ(machine.Int64Div(), machine.IntDiv());
316  EXPECT_EQ(machine.Int64UDiv(), machine.IntUDiv());
317  EXPECT_EQ(machine.Int64Mod(), machine.IntMod());
318  EXPECT_EQ(machine.Int64UMod(), machine.IntUMod());
319  EXPECT_EQ(machine.Int64LessThan(), machine.IntLessThan());
320  EXPECT_EQ(machine.Int64LessThanOrEqual(), machine.IntLessThanOrEqual());
321 }

References kRepWord64.

◆ TEST_F() [1/132]

v8::internal::compiler::TEST_F ( AddressingModeUnitTest  ,
AddressingMode_M1   
)

Definition at line 378 of file instruction-selector-ia32-unittest.cc.

378  {
379  Node* base = null_ptr;
380  Node* index = index_reg;
381  Run(base, index, kMode_MR);
382 }

◆ TEST_F() [2/132]

v8::internal::compiler::TEST_F ( AddressingModeUnitTest  ,
AddressingMode_M1I   
)

Definition at line 396 of file instruction-selector-ia32-unittest.cc.

396  {
397  Node* base = null_ptr;
398  Node* index = m->Int32Add(index_reg, non_zero);
399  Run(base, index, kMode_MRI);
400 }

◆ TEST_F() [3/132]

v8::internal::compiler::TEST_F ( AddressingModeUnitTest  ,
AddressingMode_MI   
)

Definition at line 414 of file instruction-selector-ia32-unittest.cc.

414  {
415  Node* bases[] = {null_ptr, non_zero};
416  Node* indices[] = {zero, non_zero};
417  for (size_t i = 0; i < arraysize(bases); ++i) {
418  for (size_t j = 0; j < arraysize(indices); ++j) {
419  Reset();
420  Node* base = bases[i];
421  Node* index = indices[j];
422  Run(base, index, kMode_MI);
423  }
424  }
425 }
#define arraysize(array)
Definition: macros.h:86

References arraysize, and v8::internal::zero.

◆ TEST_F() [4/132]

v8::internal::compiler::TEST_F ( AddressingModeUnitTest  ,
AddressingMode_MN   
)

Definition at line 385 of file instruction-selector-ia32-unittest.cc.

385  {
386  AddressingMode expected[] = {kMode_MR, kMode_M2, kMode_M4, kMode_M8};
387  for (size_t i = 0; i < arraysize(scales); ++i) {
388  Reset();
389  Node* base = null_ptr;
390  Node* index = m->Int32Mul(index_reg, scales[i]);
391  Run(base, index, expected[i]);
392  }
393 }

References arraysize.

◆ TEST_F() [5/132]

v8::internal::compiler::TEST_F ( AddressingModeUnitTest  ,
AddressingMode_MNI   
)

Definition at line 403 of file instruction-selector-ia32-unittest.cc.

403  {
404  AddressingMode expected[] = {kMode_MRI, kMode_M2I, kMode_M4I, kMode_M8I};
405  for (size_t i = 0; i < arraysize(scales); ++i) {
406  Reset();
407  Node* base = null_ptr;
408  Node* index = m->Int32Add(m->Int32Mul(index_reg, scales[i]), non_zero);
409  Run(base, index, expected[i]);
410  }
411 }

References arraysize.

◆ TEST_F() [6/132]

v8::internal::compiler::TEST_F ( AddressingModeUnitTest  ,
AddressingMode_MR   
)

Definition at line 328 of file instruction-selector-ia32-unittest.cc.

328  {
329  Node* base = base_reg;
330  Node* index = zero;
331  Run(base, index, kMode_MR);
332 }

References v8::internal::zero.

◆ TEST_F() [7/132]

v8::internal::compiler::TEST_F ( AddressingModeUnitTest  ,
AddressingMode_MR1   
)

Definition at line 342 of file instruction-selector-ia32-unittest.cc.

342  {
343  Node* base = base_reg;
344  Node* index = index_reg;
345  Run(base, index, kMode_MR1);
346 }

◆ TEST_F() [8/132]

v8::internal::compiler::TEST_F ( AddressingModeUnitTest  ,
AddressingMode_MR1I   
)

Definition at line 360 of file instruction-selector-ia32-unittest.cc.

360  {
361  Node* base = base_reg;
362  Node* index = m->Int32Add(index_reg, non_zero);
363  Run(base, index, kMode_MR1I);
364 }

◆ TEST_F() [9/132]

v8::internal::compiler::TEST_F ( AddressingModeUnitTest  ,
AddressingMode_MRI   
)

Definition at line 335 of file instruction-selector-ia32-unittest.cc.

335  {
336  Node* base = base_reg;
337  Node* index = non_zero;
338  Run(base, index, kMode_MRI);
339 }

◆ TEST_F() [10/132]

v8::internal::compiler::TEST_F ( AddressingModeUnitTest  ,
AddressingMode_MRN   
)

Definition at line 349 of file instruction-selector-ia32-unittest.cc.

349  {
350  AddressingMode expected[] = {kMode_MR1, kMode_MR2, kMode_MR4, kMode_MR8};
351  for (size_t i = 0; i < arraysize(scales); ++i) {
352  Reset();
353  Node* base = base_reg;
354  Node* index = m->Int32Mul(index_reg, scales[i]);
355  Run(base, index, expected[i]);
356  }
357 }

References arraysize.

◆ TEST_F() [11/132]

v8::internal::compiler::TEST_F ( AddressingModeUnitTest  ,
AddressingMode_MRNI   
)

Definition at line 367 of file instruction-selector-ia32-unittest.cc.

367  {
368  AddressingMode expected[] = {kMode_MR1I, kMode_MR2I, kMode_MR4I, kMode_MR8I};
369  for (size_t i = 0; i < arraysize(scales); ++i) {
370  Reset();
371  Node* base = base_reg;
372  Node* index = m->Int32Add(m->Int32Mul(index_reg, scales[i]), non_zero);
373  Run(base, index, expected[i]);
374  }
375 }

References arraysize.

◆ TEST_F() [12/132]

v8::internal::compiler::TEST_F ( CommonOperatorTest  ,
Finish   
)

Definition at line 169 of file common-operator-unittest.cc.

169  {
170  TRACED_FOREACH(int, arguments, kArguments) {
171  const Operator* op = common()->Finish(arguments);
172  EXPECT_EQ(1, OperatorProperties::GetValueInputCount(op));
173  EXPECT_EQ(arguments, OperatorProperties::GetEffectInputCount(op));
174  EXPECT_EQ(arguments + 1, OperatorProperties::GetTotalInputCount(op));
175  EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op));
176  EXPECT_EQ(0, OperatorProperties::GetEffectOutputCount(op));
177  EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op));
178  }
179 }

References v8::internal::compiler::OperatorProperties::GetControlOutputCount(), v8::internal::compiler::OperatorProperties::GetEffectInputCount(), v8::internal::compiler::OperatorProperties::GetEffectOutputCount(), v8::internal::compiler::OperatorProperties::GetTotalInputCount(), v8::internal::compiler::OperatorProperties::GetValueInputCount(), v8::internal::compiler::OperatorProperties::GetValueOutputCount(), and v8::internal::compiler::anonymous_namespace{common-operator-unittest.cc}::kArguments.

+ Here is the call graph for this function:

◆ TEST_F() [13/132]

v8::internal::compiler::TEST_F ( CommonOperatorTest  ,
Float32Constant   
)

Definition at line 144 of file common-operator-unittest.cc.

144  {
145  TRACED_FOREACH(float, value, kFloat32Values) {
146  const Operator* op = common()->Float32Constant(value);
147  EXPECT_FLOAT_EQ(value, OpParameter<float>(op));
148  EXPECT_EQ(0, OperatorProperties::GetValueInputCount(op));
149  EXPECT_EQ(0, OperatorProperties::GetTotalInputCount(op));
150  EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op));
151  EXPECT_EQ(0, OperatorProperties::GetEffectOutputCount(op));
152  EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op));
153  }
154 }

References v8::internal::compiler::OperatorProperties::GetControlOutputCount(), v8::internal::compiler::OperatorProperties::GetEffectOutputCount(), v8::internal::compiler::OperatorProperties::GetTotalInputCount(), v8::internal::compiler::OperatorProperties::GetValueInputCount(), v8::internal::compiler::OperatorProperties::GetValueOutputCount(), and v8::internal::compiler::anonymous_namespace{common-operator-unittest.cc}::kFloat32Values.

+ Here is the call graph for this function:

◆ TEST_F() [14/132]

v8::internal::compiler::TEST_F ( CommonOperatorTest  ,
ValueEffect   
)

Definition at line 157 of file common-operator-unittest.cc.

157  {
158  TRACED_FOREACH(int, arguments, kArguments) {
159  const Operator* op = common()->ValueEffect(arguments);
160  EXPECT_EQ(arguments, OperatorProperties::GetValueInputCount(op));
161  EXPECT_EQ(arguments, OperatorProperties::GetTotalInputCount(op));
162  EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op));
163  EXPECT_EQ(1, OperatorProperties::GetEffectOutputCount(op));
164  EXPECT_EQ(0, OperatorProperties::GetValueOutputCount(op));
165  }
166 }

References v8::internal::compiler::OperatorProperties::GetControlOutputCount(), v8::internal::compiler::OperatorProperties::GetEffectOutputCount(), v8::internal::compiler::OperatorProperties::GetTotalInputCount(), v8::internal::compiler::OperatorProperties::GetValueInputCount(), v8::internal::compiler::OperatorProperties::GetValueOutputCount(), and v8::internal::compiler::anonymous_namespace{common-operator-unittest.cc}::kArguments.

+ Here is the call graph for this function:

◆ TEST_F() [15/132]

v8::internal::compiler::TEST_F ( GraphReducerTest  ,
NodeIsDeadAfterReplace   
)

Definition at line 77 of file graph-reducer-unittest.cc.

77  {
78  StrictMock<MockReducer> r;
79  Node* node0 = graph()->NewNode(&OP0);
80  Node* node1 = graph()->NewNode(&OP1, node0);
81  Node* node2 = graph()->NewNode(&OP1, node0);
82  EXPECT_CALL(r, Reduce(node1)).WillOnce(Return(Reducer::Replace(node2)));
83  ReduceNode(node1, &r);
84  EXPECT_FALSE(node0->IsDead());
85  EXPECT_TRUE(node1->IsDead());
86  EXPECT_FALSE(node2->IsDead());
87 }
#define OP1(name, ptype, pname, properties, inputs, outputs)
Definition: js-operator.h:75
SimpleOperator OP0(0, Operator::kNoWrite, 0, 1, "op0")

References v8::internal::compiler::anonymous_namespace{graph-reducer-unittest.cc}::OP0, OP1, and v8::internal::compiler::Reducer::Replace().

+ Here is the call graph for this function:

◆ TEST_F() [16/132]

v8::internal::compiler::TEST_F ( GraphReducerTest  ,
ReduceAgainAfterChanged   
)

Definition at line 99 of file graph-reducer-unittest.cc.

99  {
100  Sequence s1, s2, s3;
101  StrictMock<MockReducer> r1, r2, r3;
102  Node* node0 = graph()->NewNode(&OP0);
103  EXPECT_CALL(r1, Reduce(node0));
104  EXPECT_CALL(r2, Reduce(node0));
105  EXPECT_CALL(r3, Reduce(node0)).InSequence(s1, s2, s3).WillOnce(
106  Return(Reducer::Changed(node0)));
107  EXPECT_CALL(r1, Reduce(node0)).InSequence(s1);
108  EXPECT_CALL(r2, Reduce(node0)).InSequence(s2);
109  EXPECT_CALL(r3, Reduce(node0)).InSequence(s3);
110  ReduceNode(node0, &r1, &r2, &r3);
111 }
const Register r2
const Register r3
const SwVfpRegister s3
const Register r1

References v8::internal::compiler::Reducer::Changed(), v8::internal::compiler::anonymous_namespace{graph-reducer-unittest.cc}::OP0, v8::internal::r1, v8::internal::r2, v8::internal::r3, v8::internal::s1, v8::internal::s2, and v8::internal::s3.

+ Here is the call graph for this function:

◆ TEST_F() [17/132]

v8::internal::compiler::TEST_F ( GraphReducerTest  ,
ReduceOnceForEveryReducer   
)

Definition at line 90 of file graph-reducer-unittest.cc.

90  {
91  StrictMock<MockReducer> r1, r2;
92  Node* node0 = graph()->NewNode(&OP0);
93  EXPECT_CALL(r1, Reduce(node0));
94  EXPECT_CALL(r2, Reduce(node0));
95  ReduceNode(node0, &r1, &r2);
96 }

References v8::internal::compiler::anonymous_namespace{graph-reducer-unittest.cc}::OP0, v8::internal::r1, and v8::internal::r2.

◆ TEST_F() [18/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
AddBranchWithImmediateOnLeft   
)

Definition at line 485 of file instruction-selector-arm64-unittest.cc.

485  {
486  TRACED_FOREACH(int32_t, imm, kAddSubImmediates) {
487  StreamBuilder m(this, kMachInt32, kMachInt32);
488  MLabel a, b;
489  m.Branch(m.Int32Add(m.Int32Constant(imm), m.Parameter(0)), &a, &b);
490  m.Bind(&a);
491  m.Return(m.Int32Constant(1));
492  m.Bind(&b);
493  m.Return(m.Int32Constant(0));
494  Stream s = m.Build();
495  ASSERT_EQ(1U, s.size());
496  EXPECT_EQ(kArm64Cmn32, s[0]->arch_opcode());
497  ASSERT_LE(1U, s[0]->InputCount());
498  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
499  EXPECT_EQ(kNotEqual, s[0]->flags_condition());
500  }
501 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::kAddSubImmediates, kFlags_branch, kMachInt32, and kNotEqual.

◆ TEST_F() [19/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
AddBranchWithImmediateOnRight   
)

Definition at line 430 of file instruction-selector-arm64-unittest.cc.

430  {
431  TRACED_FOREACH(int32_t, imm, kAddSubImmediates) {
432  StreamBuilder m(this, kMachInt32, kMachInt32);
433  MLabel a, b;
434  m.Branch(m.Int32Add(m.Parameter(0), m.Int32Constant(imm)), &a, &b);
435  m.Bind(&a);
436  m.Return(m.Int32Constant(1));
437  m.Bind(&b);
438  m.Return(m.Int32Constant(0));
439  Stream s = m.Build();
440  ASSERT_EQ(1U, s.size());
441  EXPECT_EQ(kArm64Cmn32, s[0]->arch_opcode());
442  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
443  EXPECT_EQ(kNotEqual, s[0]->flags_condition());
444  }
445 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::kAddSubImmediates, kFlags_branch, kMachInt32, and kNotEqual.

◆ TEST_F() [20/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
AndBranchWithImmediateOnLeft   
)

Definition at line 466 of file instruction-selector-arm64-unittest.cc.

466  {
467  TRACED_FOREACH(int32_t, imm, kLogicalImmediates) {
468  StreamBuilder m(this, kMachInt32, kMachInt32);
469  MLabel a, b;
470  m.Branch(m.Word32And(m.Int32Constant(imm), m.Parameter(0)), &a, &b);
471  m.Bind(&a);
472  m.Return(m.Int32Constant(1));
473  m.Bind(&b);
474  m.Return(m.Int32Constant(0));
475  Stream s = m.Build();
476  ASSERT_EQ(1U, s.size());
477  EXPECT_EQ(kArm64Tst32, s[0]->arch_opcode());
478  ASSERT_LE(1U, s[0]->InputCount());
479  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
480  EXPECT_EQ(kNotEqual, s[0]->flags_condition());
481  }
482 }

References kFlags_branch, v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::kLogicalImmediates, kMachInt32, and kNotEqual.

◆ TEST_F() [21/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
AndBranchWithImmediateOnRight   
)

Definition at line 412 of file instruction-selector-arm64-unittest.cc.

412  {
413  TRACED_FOREACH(int32_t, imm, kLogicalImmediates) {
414  StreamBuilder m(this, kMachInt32, kMachInt32);
415  MLabel a, b;
416  m.Branch(m.Word32And(m.Parameter(0), m.Int32Constant(imm)), &a, &b);
417  m.Bind(&a);
418  m.Return(m.Int32Constant(1));
419  m.Bind(&b);
420  m.Return(m.Int32Constant(0));
421  Stream s = m.Build();
422  ASSERT_EQ(1U, s.size());
423  EXPECT_EQ(kArm64Tst32, s[0]->arch_opcode());
424  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
425  EXPECT_EQ(kNotEqual, s[0]->flags_condition());
426  }
427 }

References kFlags_branch, v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::kLogicalImmediates, kMachInt32, and kNotEqual.

◆ TEST_F() [22/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
BetterLeftOperandTestAddBinop   
)

Definition at line 106 of file instruction-selector-ia32-unittest.cc.

106  {
107  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
108  Node* param1 = m.Parameter(0);
109  Node* param2 = m.Parameter(1);
110  Node* add = m.Int32Add(param1, param2);
111  m.Return(m.Int32Add(add, param1));
112  Stream s = m.Build();
113  ASSERT_EQ(2U, s.size());
114  EXPECT_EQ(kIA32Add, s[0]->arch_opcode());
115  ASSERT_EQ(2U, s[0]->InputCount());
116  ASSERT_TRUE(s[0]->InputAt(0)->IsUnallocated());
117  EXPECT_EQ(param2->id(), s.ToVreg(s[0]->InputAt(0)));
118 }

References kMachInt32.

◆ TEST_F() [23/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
BetterLeftOperandTestMulBinop   
)

Definition at line 121 of file instruction-selector-ia32-unittest.cc.

121  {
122  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
123  Node* param1 = m.Parameter(0);
124  Node* param2 = m.Parameter(1);
125  Node* mul = m.Int32Mul(param1, param2);
126  m.Return(m.Int32Mul(mul, param1));
127  Stream s = m.Build();
128  ASSERT_EQ(2U, s.size());
129  EXPECT_EQ(kIA32Imul, s[0]->arch_opcode());
130  ASSERT_EQ(2U, s[0]->InputCount());
131  ASSERT_TRUE(s[0]->InputAt(0)->IsUnallocated());
132  EXPECT_EQ(param2->id(), s.ToVreg(s[0]->InputAt(0)));
133 }

References kMachInt32.

◆ TEST_F() [24/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
ChangeFloat32ToFloat64WithParameter   
)

Definition at line 1345 of file instruction-selector-arm-unittest.cc.

1345  {
1346  StreamBuilder m(this, kMachFloat64, kMachFloat32);
1347  m.Return(m.ChangeFloat32ToFloat64(m.Parameter(0)));
1348  Stream s = m.Build();
1349  ASSERT_EQ(1U, s.size());
1350  EXPECT_EQ(kArmVcvtF64F32, s[0]->arch_opcode());
1351  EXPECT_EQ(1U, s[0]->InputCount());
1352  EXPECT_EQ(1U, s[0]->OutputCount());
1353 }

References kMachFloat32, and kMachFloat64.

◆ TEST_F() [25/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
ChangeInt32ToInt64WithParameter   
)

Definition at line 26 of file instruction-selector-x64-unittest.cc.

26  {
27  StreamBuilder m(this, kMachInt64, kMachInt32);
28  m.Return(m.ChangeInt32ToInt64(m.Parameter(0)));
29  Stream s = m.Build();
30  ASSERT_EQ(1U, s.size());
31  EXPECT_EQ(kX64Movsxlq, s[0]->arch_opcode());
32 }

References kMachInt32, and kMachInt64.

◆ TEST_F() [26/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
ChangeUint32ToUint64WithParameter   
)

Definition at line 35 of file instruction-selector-x64-unittest.cc.

35  {
36  StreamBuilder m(this, kMachUint64, kMachUint32);
37  m.Return(m.ChangeUint32ToUint64(m.Parameter(0)));
38  Stream s = m.Build();
39  ASSERT_EQ(1U, s.size());
40  EXPECT_EQ(kX64Movl, s[0]->arch_opcode());
41 }

References kMachUint32, and kMachUint64.

◆ TEST_F() [27/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32AddWithImmediate   
)

Definition at line 30 of file instruction-selector-ia32-unittest.cc.

30  {
31  TRACED_FOREACH(int32_t, imm, kImmediates) {
32  {
33  StreamBuilder m(this, kMachInt32, kMachInt32);
34  m.Return(m.Int32Add(m.Parameter(0), m.Int32Constant(imm)));
35  Stream s = m.Build();
36  ASSERT_EQ(1U, s.size());
37  EXPECT_EQ(kIA32Add, s[0]->arch_opcode());
38  ASSERT_EQ(2U, s[0]->InputCount());
39  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
40  }
41  {
42  StreamBuilder m(this, kMachInt32, kMachInt32);
43  m.Return(m.Int32Add(m.Int32Constant(imm), m.Parameter(0)));
44  Stream s = m.Build();
45  ASSERT_EQ(1U, s.size());
46  EXPECT_EQ(kIA32Add, s[0]->arch_opcode());
47  ASSERT_EQ(2U, s[0]->InputCount());
48  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
49  }
50  }
51 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-ia32-unittest.cc}::kImmediates, and kMachInt32.

◆ TEST_F() [28/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32AddWithInt32Mul   
)

Definition at line 1371 of file instruction-selector-arm-unittest.cc.

1371  {
1372  {
1373  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
1374  m.Return(
1375  m.Int32Add(m.Parameter(0), m.Int32Mul(m.Parameter(1), m.Parameter(2))));
1376  Stream s = m.Build();
1377  ASSERT_EQ(1U, s.size());
1378  EXPECT_EQ(kArmMla, s[0]->arch_opcode());
1379  EXPECT_EQ(3U, s[0]->InputCount());
1380  EXPECT_EQ(1U, s[0]->OutputCount());
1381  }
1382  {
1383  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
1384  m.Return(
1385  m.Int32Add(m.Int32Mul(m.Parameter(1), m.Parameter(2)), m.Parameter(0)));
1386  Stream s = m.Build();
1387  ASSERT_EQ(1U, s.size());
1388  EXPECT_EQ(kArmMla, s[0]->arch_opcode());
1389  EXPECT_EQ(3U, s[0]->InputCount());
1390  EXPECT_EQ(1U, s[0]->OutputCount());
1391  }
1392 }

References kMachInt32.

◆ TEST_F() [29/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32AddWithParameter   
)

Definition at line 21 of file instruction-selector-ia32-unittest.cc.

21  {
22  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
23  m.Return(m.Int32Add(m.Parameter(0), m.Parameter(1)));
24  Stream s = m.Build();
25  ASSERT_EQ(1U, s.size());
26  EXPECT_EQ(kIA32Add, s[0]->arch_opcode());
27 }

References kMachInt32.

◆ TEST_F() [30/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32DivWithParameters   
)

Definition at line 1395 of file instruction-selector-arm-unittest.cc.

1395  {
1396  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1397  m.Return(m.Int32Div(m.Parameter(0), m.Parameter(1)));
1398  Stream s = m.Build();
1399  ASSERT_EQ(4U, s.size());
1400  EXPECT_EQ(kArmVcvtF64S32, s[0]->arch_opcode());
1401  ASSERT_EQ(1U, s[0]->OutputCount());
1402  EXPECT_EQ(kArmVcvtF64S32, s[1]->arch_opcode());
1403  ASSERT_EQ(1U, s[1]->OutputCount());
1404  EXPECT_EQ(kArmVdivF64, s[2]->arch_opcode());
1405  ASSERT_EQ(2U, s[2]->InputCount());
1406  ASSERT_EQ(1U, s[2]->OutputCount());
1407  EXPECT_EQ(s.ToVreg(s[0]->Output()), s.ToVreg(s[2]->InputAt(0)));
1408  EXPECT_EQ(s.ToVreg(s[1]->Output()), s.ToVreg(s[2]->InputAt(1)));
1409  EXPECT_EQ(kArmVcvtS32F64, s[3]->arch_opcode());
1410  ASSERT_EQ(1U, s[3]->InputCount());
1411  EXPECT_EQ(s.ToVreg(s[2]->Output()), s.ToVreg(s[3]->InputAt(0)));
1412 }

References kMachInt32.

◆ TEST_F() [31/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32DivWithParametersForSUDIV   
)

Definition at line 1415 of file instruction-selector-arm-unittest.cc.

1415  {
1416  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1417  m.Return(m.Int32Div(m.Parameter(0), m.Parameter(1)));
1418  Stream s = m.Build(SUDIV);
1419  ASSERT_EQ(1U, s.size());
1420  EXPECT_EQ(kArmSdiv, s[0]->arch_opcode());
1421 }

References kMachInt32, and v8::internal::SUDIV.

◆ TEST_F() [32/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32ModWithParameters   
)

Definition at line 1424 of file instruction-selector-arm-unittest.cc.

1424  {
1425  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1426  m.Return(m.Int32Mod(m.Parameter(0), m.Parameter(1)));
1427  Stream s = m.Build();
1428  ASSERT_EQ(6U, s.size());
1429  EXPECT_EQ(kArmVcvtF64S32, s[0]->arch_opcode());
1430  ASSERT_EQ(1U, s[0]->OutputCount());
1431  EXPECT_EQ(kArmVcvtF64S32, s[1]->arch_opcode());
1432  ASSERT_EQ(1U, s[1]->OutputCount());
1433  EXPECT_EQ(kArmVdivF64, s[2]->arch_opcode());
1434  ASSERT_EQ(2U, s[2]->InputCount());
1435  ASSERT_EQ(1U, s[2]->OutputCount());
1436  EXPECT_EQ(s.ToVreg(s[0]->Output()), s.ToVreg(s[2]->InputAt(0)));
1437  EXPECT_EQ(s.ToVreg(s[1]->Output()), s.ToVreg(s[2]->InputAt(1)));
1438  EXPECT_EQ(kArmVcvtS32F64, s[3]->arch_opcode());
1439  ASSERT_EQ(1U, s[3]->InputCount());
1440  EXPECT_EQ(s.ToVreg(s[2]->Output()), s.ToVreg(s[3]->InputAt(0)));
1441  EXPECT_EQ(kArmMul, s[4]->arch_opcode());
1442  ASSERT_EQ(1U, s[4]->OutputCount());
1443  ASSERT_EQ(2U, s[4]->InputCount());
1444  EXPECT_EQ(s.ToVreg(s[3]->Output()), s.ToVreg(s[4]->InputAt(0)));
1445  EXPECT_EQ(s.ToVreg(s[1]->InputAt(0)), s.ToVreg(s[4]->InputAt(1)));
1446  EXPECT_EQ(kArmSub, s[5]->arch_opcode());
1447  ASSERT_EQ(1U, s[5]->OutputCount());
1448  ASSERT_EQ(2U, s[5]->InputCount());
1449  EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[5]->InputAt(0)));
1450  EXPECT_EQ(s.ToVreg(s[4]->Output()), s.ToVreg(s[5]->InputAt(1)));
1451 }

References kMachInt32.

◆ TEST_F() [33/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32ModWithParametersForSUDIV   
)

Definition at line 1454 of file instruction-selector-arm-unittest.cc.

1454  {
1455  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1456  m.Return(m.Int32Mod(m.Parameter(0), m.Parameter(1)));
1457  Stream s = m.Build(SUDIV);
1458  ASSERT_EQ(3U, s.size());
1459  EXPECT_EQ(kArmSdiv, s[0]->arch_opcode());
1460  ASSERT_EQ(1U, s[0]->OutputCount());
1461  ASSERT_EQ(2U, s[0]->InputCount());
1462  EXPECT_EQ(kArmMul, s[1]->arch_opcode());
1463  ASSERT_EQ(1U, s[1]->OutputCount());
1464  ASSERT_EQ(2U, s[1]->InputCount());
1465  EXPECT_EQ(s.ToVreg(s[0]->Output()), s.ToVreg(s[1]->InputAt(0)));
1466  EXPECT_EQ(s.ToVreg(s[0]->InputAt(1)), s.ToVreg(s[1]->InputAt(1)));
1467  EXPECT_EQ(kArmSub, s[2]->arch_opcode());
1468  ASSERT_EQ(1U, s[2]->OutputCount());
1469  ASSERT_EQ(2U, s[2]->InputCount());
1470  EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[2]->InputAt(0)));
1471  EXPECT_EQ(s.ToVreg(s[1]->Output()), s.ToVreg(s[2]->InputAt(1)));
1472 }

References kMachInt32, and v8::internal::SUDIV.

◆ TEST_F() [34/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32ModWithParametersForSUDIVAndMLS   
)

Definition at line 1475 of file instruction-selector-arm-unittest.cc.

1475  {
1476  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1477  m.Return(m.Int32Mod(m.Parameter(0), m.Parameter(1)));
1478  Stream s = m.Build(MLS, SUDIV);
1479  ASSERT_EQ(2U, s.size());
1480  EXPECT_EQ(kArmSdiv, s[0]->arch_opcode());
1481  ASSERT_EQ(1U, s[0]->OutputCount());
1482  ASSERT_EQ(2U, s[0]->InputCount());
1483  EXPECT_EQ(kArmMls, s[1]->arch_opcode());
1484  ASSERT_EQ(1U, s[1]->OutputCount());
1485  ASSERT_EQ(3U, s[1]->InputCount());
1486  EXPECT_EQ(s.ToVreg(s[0]->Output()), s.ToVreg(s[1]->InputAt(0)));
1487  EXPECT_EQ(s.ToVreg(s[0]->InputAt(1)), s.ToVreg(s[1]->InputAt(1)));
1488  EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[1]->InputAt(2)));
1489 }

References kMachInt32, v8::internal::MLS, and v8::internal::SUDIV.

◆ TEST_F() [35/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32MulWithImmediate   
)

Definition at line 1503 of file instruction-selector-arm-unittest.cc.

1503  {
1504  // x * (2^k + 1) -> x + (x >> k)
1505  TRACED_FORRANGE(int32_t, k, 1, 30) {
1506  StreamBuilder m(this, kMachInt32, kMachInt32);
1507  m.Return(m.Int32Mul(m.Parameter(0), m.Int32Constant((1 << k) + 1)));
1508  Stream s = m.Build();
1509  ASSERT_EQ(1U, s.size());
1510  EXPECT_EQ(kArmAdd, s[0]->arch_opcode());
1511  EXPECT_EQ(kMode_Operand2_R_LSL_I, s[0]->addressing_mode());
1512  ASSERT_EQ(3U, s[0]->InputCount());
1513  EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[0]->InputAt(1)));
1514  EXPECT_EQ(k, s.ToInt32(s[0]->InputAt(2)));
1515  EXPECT_EQ(1U, s[0]->OutputCount());
1516  }
1517  // x * (2^k - 1) -> -x + (x >> k)
1518  TRACED_FORRANGE(int32_t, k, 3, 30) {
1519  StreamBuilder m(this, kMachInt32, kMachInt32);
1520  m.Return(m.Int32Mul(m.Parameter(0), m.Int32Constant((1 << k) - 1)));
1521  Stream s = m.Build();
1522  ASSERT_EQ(1U, s.size());
1523  EXPECT_EQ(kArmRsb, s[0]->arch_opcode());
1524  EXPECT_EQ(kMode_Operand2_R_LSL_I, s[0]->addressing_mode());
1525  ASSERT_EQ(3U, s[0]->InputCount());
1526  EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[0]->InputAt(1)));
1527  EXPECT_EQ(k, s.ToInt32(s[0]->InputAt(2)));
1528  EXPECT_EQ(1U, s[0]->OutputCount());
1529  }
1530  // (2^k + 1) * x -> x + (x >> k)
1531  TRACED_FORRANGE(int32_t, k, 1, 30) {
1532  StreamBuilder m(this, kMachInt32, kMachInt32);
1533  m.Return(m.Int32Mul(m.Int32Constant((1 << k) + 1), m.Parameter(0)));
1534  Stream s = m.Build();
1535  ASSERT_EQ(1U, s.size());
1536  EXPECT_EQ(kArmAdd, s[0]->arch_opcode());
1537  EXPECT_EQ(kMode_Operand2_R_LSL_I, s[0]->addressing_mode());
1538  ASSERT_EQ(3U, s[0]->InputCount());
1539  EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[0]->InputAt(1)));
1540  EXPECT_EQ(k, s.ToInt32(s[0]->InputAt(2)));
1541  EXPECT_EQ(1U, s[0]->OutputCount());
1542  }
1543  // x * (2^k - 1) -> -x + (x >> k)
1544  TRACED_FORRANGE(int32_t, k, 3, 30) {
1545  StreamBuilder m(this, kMachInt32, kMachInt32);
1546  m.Return(m.Int32Mul(m.Int32Constant((1 << k) - 1), m.Parameter(0)));
1547  Stream s = m.Build();
1548  ASSERT_EQ(1U, s.size());
1549  EXPECT_EQ(kArmRsb, s[0]->arch_opcode());
1550  EXPECT_EQ(kMode_Operand2_R_LSL_I, s[0]->addressing_mode());
1551  ASSERT_EQ(3U, s[0]->InputCount());
1552  EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[0]->InputAt(1)));
1553  EXPECT_EQ(k, s.ToInt32(s[0]->InputAt(2)));
1554  EXPECT_EQ(1U, s[0]->OutputCount());
1555  }
1556 }

References kMachInt32.

◆ TEST_F() [36/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32MulWithParameters   
)

Definition at line 1492 of file instruction-selector-arm-unittest.cc.

1492  {
1493  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1494  m.Return(m.Int32Mul(m.Parameter(0), m.Parameter(1)));
1495  Stream s = m.Build();
1496  ASSERT_EQ(1U, s.size());
1497  EXPECT_EQ(kArmMul, s[0]->arch_opcode());
1498  EXPECT_EQ(2U, s[0]->InputCount());
1499  EXPECT_EQ(1U, s[0]->OutputCount());
1500 }

References kMachInt32.

◆ TEST_F() [37/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32SubWithImmediate   
)

Definition at line 64 of file instruction-selector-ia32-unittest.cc.

64  {
65  TRACED_FOREACH(int32_t, imm, kImmediates) {
66  StreamBuilder m(this, kMachInt32, kMachInt32);
67  m.Return(m.Int32Sub(m.Parameter(0), m.Int32Constant(imm)));
68  Stream s = m.Build();
69  ASSERT_EQ(1U, s.size());
70  EXPECT_EQ(kIA32Sub, s[0]->arch_opcode());
71  ASSERT_EQ(2U, s[0]->InputCount());
72  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
73  }
74 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-ia32-unittest.cc}::kImmediates, and kMachInt32.

◆ TEST_F() [38/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32SubWithInt32Mul   
)

Definition at line 1559 of file instruction-selector-arm-unittest.cc.

1559  {
1560  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
1561  m.Return(
1562  m.Int32Sub(m.Parameter(0), m.Int32Mul(m.Parameter(1), m.Parameter(2))));
1563  Stream s = m.Build();
1564  ASSERT_EQ(2U, s.size());
1565  EXPECT_EQ(kArmMul, s[0]->arch_opcode());
1566  ASSERT_EQ(1U, s[0]->OutputCount());
1567  EXPECT_EQ(kArmSub, s[1]->arch_opcode());
1568  ASSERT_EQ(2U, s[1]->InputCount());
1569  EXPECT_EQ(s.ToVreg(s[0]->Output()), s.ToVreg(s[1]->InputAt(1)));
1570 }

References kMachInt32.

◆ TEST_F() [39/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32SubWithInt32MulForMLS   
)

Definition at line 1573 of file instruction-selector-arm-unittest.cc.

1573  {
1574  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
1575  m.Return(
1576  m.Int32Sub(m.Parameter(0), m.Int32Mul(m.Parameter(1), m.Parameter(2))));
1577  Stream s = m.Build(MLS);
1578  ASSERT_EQ(1U, s.size());
1579  EXPECT_EQ(kArmMls, s[0]->arch_opcode());
1580  EXPECT_EQ(1U, s[0]->OutputCount());
1581  EXPECT_EQ(3U, s[0]->InputCount());
1582 }

References kMachInt32, and v8::internal::MLS.

◆ TEST_F() [40/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32SubWithParameter   
)

Definition at line 54 of file instruction-selector-ia32-unittest.cc.

54  {
55  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
56  m.Return(m.Int32Sub(m.Parameter(0), m.Parameter(1)));
57  Stream s = m.Build();
58  ASSERT_EQ(1U, s.size());
59  EXPECT_EQ(kIA32Sub, s[0]->arch_opcode());
60  EXPECT_EQ(1U, s[0]->OutputCount());
61 }

References kMachInt32.

◆ TEST_F() [41/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32UDivWithParameters   
)

Definition at line 1585 of file instruction-selector-arm-unittest.cc.

1585  {
1586  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1587  m.Return(m.Int32UDiv(m.Parameter(0), m.Parameter(1)));
1588  Stream s = m.Build();
1589  ASSERT_EQ(4U, s.size());
1590  EXPECT_EQ(kArmVcvtF64U32, s[0]->arch_opcode());
1591  ASSERT_EQ(1U, s[0]->OutputCount());
1592  EXPECT_EQ(kArmVcvtF64U32, s[1]->arch_opcode());
1593  ASSERT_EQ(1U, s[1]->OutputCount());
1594  EXPECT_EQ(kArmVdivF64, s[2]->arch_opcode());
1595  ASSERT_EQ(2U, s[2]->InputCount());
1596  ASSERT_EQ(1U, s[2]->OutputCount());
1597  EXPECT_EQ(s.ToVreg(s[0]->Output()), s.ToVreg(s[2]->InputAt(0)));
1598  EXPECT_EQ(s.ToVreg(s[1]->Output()), s.ToVreg(s[2]->InputAt(1)));
1599  EXPECT_EQ(kArmVcvtU32F64, s[3]->arch_opcode());
1600  ASSERT_EQ(1U, s[3]->InputCount());
1601  EXPECT_EQ(s.ToVreg(s[2]->Output()), s.ToVreg(s[3]->InputAt(0)));
1602 }

References kMachInt32.

◆ TEST_F() [42/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32UDivWithParametersForSUDIV   
)

Definition at line 1605 of file instruction-selector-arm-unittest.cc.

1605  {
1606  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1607  m.Return(m.Int32UDiv(m.Parameter(0), m.Parameter(1)));
1608  Stream s = m.Build(SUDIV);
1609  ASSERT_EQ(1U, s.size());
1610  EXPECT_EQ(kArmUdiv, s[0]->arch_opcode());
1611 }

References kMachInt32, and v8::internal::SUDIV.

◆ TEST_F() [43/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32UModWithParameters   
)

Definition at line 1614 of file instruction-selector-arm-unittest.cc.

1614  {
1615  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1616  m.Return(m.Int32UMod(m.Parameter(0), m.Parameter(1)));
1617  Stream s = m.Build();
1618  ASSERT_EQ(6U, s.size());
1619  EXPECT_EQ(kArmVcvtF64U32, s[0]->arch_opcode());
1620  ASSERT_EQ(1U, s[0]->OutputCount());
1621  EXPECT_EQ(kArmVcvtF64U32, s[1]->arch_opcode());
1622  ASSERT_EQ(1U, s[1]->OutputCount());
1623  EXPECT_EQ(kArmVdivF64, s[2]->arch_opcode());
1624  ASSERT_EQ(2U, s[2]->InputCount());
1625  ASSERT_EQ(1U, s[2]->OutputCount());
1626  EXPECT_EQ(s.ToVreg(s[0]->Output()), s.ToVreg(s[2]->InputAt(0)));
1627  EXPECT_EQ(s.ToVreg(s[1]->Output()), s.ToVreg(s[2]->InputAt(1)));
1628  EXPECT_EQ(kArmVcvtU32F64, s[3]->arch_opcode());
1629  ASSERT_EQ(1U, s[3]->InputCount());
1630  EXPECT_EQ(s.ToVreg(s[2]->Output()), s.ToVreg(s[3]->InputAt(0)));
1631  EXPECT_EQ(kArmMul, s[4]->arch_opcode());
1632  ASSERT_EQ(1U, s[4]->OutputCount());
1633  ASSERT_EQ(2U, s[4]->InputCount());
1634  EXPECT_EQ(s.ToVreg(s[3]->Output()), s.ToVreg(s[4]->InputAt(0)));
1635  EXPECT_EQ(s.ToVreg(s[1]->InputAt(0)), s.ToVreg(s[4]->InputAt(1)));
1636  EXPECT_EQ(kArmSub, s[5]->arch_opcode());
1637  ASSERT_EQ(1U, s[5]->OutputCount());
1638  ASSERT_EQ(2U, s[5]->InputCount());
1639  EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[5]->InputAt(0)));
1640  EXPECT_EQ(s.ToVreg(s[4]->Output()), s.ToVreg(s[5]->InputAt(1)));
1641 }

References kMachInt32.

◆ TEST_F() [44/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32UModWithParametersForSUDIV   
)

Definition at line 1644 of file instruction-selector-arm-unittest.cc.

1644  {
1645  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1646  m.Return(m.Int32UMod(m.Parameter(0), m.Parameter(1)));
1647  Stream s = m.Build(SUDIV);
1648  ASSERT_EQ(3U, s.size());
1649  EXPECT_EQ(kArmUdiv, s[0]->arch_opcode());
1650  ASSERT_EQ(1U, s[0]->OutputCount());
1651  ASSERT_EQ(2U, s[0]->InputCount());
1652  EXPECT_EQ(kArmMul, s[1]->arch_opcode());
1653  ASSERT_EQ(1U, s[1]->OutputCount());
1654  ASSERT_EQ(2U, s[1]->InputCount());
1655  EXPECT_EQ(s.ToVreg(s[0]->Output()), s.ToVreg(s[1]->InputAt(0)));
1656  EXPECT_EQ(s.ToVreg(s[0]->InputAt(1)), s.ToVreg(s[1]->InputAt(1)));
1657  EXPECT_EQ(kArmSub, s[2]->arch_opcode());
1658  ASSERT_EQ(1U, s[2]->OutputCount());
1659  ASSERT_EQ(2U, s[2]->InputCount());
1660  EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[2]->InputAt(0)));
1661  EXPECT_EQ(s.ToVreg(s[1]->Output()), s.ToVreg(s[2]->InputAt(1)));
1662 }

References kMachInt32, and v8::internal::SUDIV.

◆ TEST_F() [45/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Int32UModWithParametersForSUDIVAndMLS   
)

Definition at line 1665 of file instruction-selector-arm-unittest.cc.

1665  {
1666  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1667  m.Return(m.Int32UMod(m.Parameter(0), m.Parameter(1)));
1668  Stream s = m.Build(MLS, SUDIV);
1669  ASSERT_EQ(2U, s.size());
1670  EXPECT_EQ(kArmUdiv, s[0]->arch_opcode());
1671  ASSERT_EQ(1U, s[0]->OutputCount());
1672  ASSERT_EQ(2U, s[0]->InputCount());
1673  EXPECT_EQ(kArmMls, s[1]->arch_opcode());
1674  ASSERT_EQ(1U, s[1]->OutputCount());
1675  ASSERT_EQ(3U, s[1]->InputCount());
1676  EXPECT_EQ(s.ToVreg(s[0]->Output()), s.ToVreg(s[1]->InputAt(0)));
1677  EXPECT_EQ(s.ToVreg(s[0]->InputAt(1)), s.ToVreg(s[1]->InputAt(1)));
1678  EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[1]->InputAt(2)));
1679 }

References kMachInt32, v8::internal::MLS, and v8::internal::SUDIV.

◆ TEST_F() [46/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
OvfBothAddImmediateOnLeft   
)

Definition at line 699 of file instruction-selector-arm64-unittest.cc.

699  {
700  TRACED_FOREACH(int32_t, imm, kAddSubImmediates) {
701  StreamBuilder m(this, kMachInt32, kMachInt32);
702  Node* n = m.Int32AddWithOverflow(m.Int32Constant(imm), m.Parameter(0));
703  m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
704  Stream s = m.Build();
705 
706  ASSERT_LE(1U, s.size());
707  EXPECT_EQ(kArm64Add32, s[0]->arch_opcode());
708  ASSERT_EQ(2U, s[0]->InputCount());
709  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
710  EXPECT_EQ(2U, s[0]->OutputCount());
711  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
712  EXPECT_EQ(kOverflow, s[0]->flags_condition());
713  }
714 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::kAddSubImmediates, kFlags_set, kMachInt32, and kOverflow.

◆ TEST_F() [47/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
OvfBranchWithImmediateOnLeft   
)

Definition at line 717 of file instruction-selector-arm64-unittest.cc.

717  {
718  TRACED_FOREACH(int32_t, imm, kAddSubImmediates) {
719  StreamBuilder m(this, kMachInt32, kMachInt32);
720  MLabel a, b;
721  Node* n = m.Int32AddWithOverflow(m.Int32Constant(imm), m.Parameter(0));
722  m.Branch(m.Projection(1, n), &a, &b);
723  m.Bind(&a);
724  m.Return(m.Int32Constant(0));
725  m.Bind(&b);
726  m.Return(m.Projection(0, n));
727  Stream s = m.Build();
728 
729  ASSERT_EQ(1U, s.size());
730  EXPECT_EQ(kArm64Add32, s[0]->arch_opcode());
731  ASSERT_EQ(4U, s[0]->InputCount());
732  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
733  EXPECT_EQ(1U, s[0]->OutputCount());
734  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
735  EXPECT_EQ(kOverflow, s[0]->flags_condition());
736  }
737 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::kAddSubImmediates, kFlags_branch, kMachInt32, and kOverflow.

◆ TEST_F() [48/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
OvfFlagAddImmediateOnLeft   
)

Definition at line 664 of file instruction-selector-arm64-unittest.cc.

664  {
665  TRACED_FOREACH(int32_t, imm, kAddSubImmediates) {
666  StreamBuilder m(this, kMachInt32, kMachInt32);
667  m.Return(m.Projection(
668  1, m.Int32AddWithOverflow(m.Int32Constant(imm), m.Parameter(0))));
669  Stream s = m.Build();
670 
671  ASSERT_EQ(1U, s.size());
672  EXPECT_EQ(kArm64Add32, s[0]->arch_opcode());
673  EXPECT_EQ(2U, s[0]->InputCount());
674  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
675  EXPECT_LE(1U, s[0]->OutputCount());
676  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
677  EXPECT_EQ(kOverflow, s[0]->flags_condition());
678  }
679 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::kAddSubImmediates, kFlags_set, kMachInt32, and kOverflow.

◆ TEST_F() [49/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
OvfValAddImmediateOnLeft   
)

Definition at line 682 of file instruction-selector-arm64-unittest.cc.

682  {
683  TRACED_FOREACH(int32_t, imm, kAddSubImmediates) {
684  StreamBuilder m(this, kMachInt32, kMachInt32);
685  m.Return(m.Projection(
686  0, m.Int32AddWithOverflow(m.Int32Constant(imm), m.Parameter(0))));
687  Stream s = m.Build();
688 
689  ASSERT_EQ(1U, s.size());
690  EXPECT_EQ(kArm64Add32, s[0]->arch_opcode());
691  ASSERT_EQ(2U, s[0]->InputCount());
692  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
693  EXPECT_LE(1U, s[0]->OutputCount());
694  EXPECT_EQ(kFlags_none, s[0]->flags_mode());
695  }
696 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::kAddSubImmediates, kFlags_none, and kMachInt32.

◆ TEST_F() [50/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
SubBranchWithImmediateOnRight   
)

Definition at line 448 of file instruction-selector-arm64-unittest.cc.

448  {
449  TRACED_FOREACH(int32_t, imm, kAddSubImmediates) {
450  StreamBuilder m(this, kMachInt32, kMachInt32);
451  MLabel a, b;
452  m.Branch(m.Int32Sub(m.Parameter(0), m.Int32Constant(imm)), &a, &b);
453  m.Bind(&a);
454  m.Return(m.Int32Constant(1));
455  m.Bind(&b);
456  m.Return(m.Int32Constant(0));
457  Stream s = m.Build();
458  ASSERT_EQ(1U, s.size());
459  EXPECT_EQ(kArm64Cmp32, s[0]->arch_opcode());
460  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
461  EXPECT_EQ(kNotEqual, s[0]->flags_condition());
462  }
463 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::kAddSubImmediates, kFlags_branch, kMachInt32, and kNotEqual.

◆ TEST_F() [51/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
SubZeroOnLeft   
)

Definition at line 354 of file instruction-selector-arm64-unittest.cc.

354  {
355  // Subtraction with zero on the left maps to Neg.
356  {
357  // 32-bit subtract.
358  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
359  m.Return(m.Int32Sub(m.Int32Constant(0), m.Parameter(0)));
360  Stream s = m.Build();
361 
362  ASSERT_EQ(1U, s.size());
363  EXPECT_EQ(kArm64Neg32, s[0]->arch_opcode());
364  EXPECT_EQ(1U, s[0]->InputCount());
365  EXPECT_EQ(1U, s[0]->OutputCount());
366  }
367  {
368  // 64-bit subtract.
369  StreamBuilder m(this, kMachInt64, kMachInt64, kMachInt64);
370  m.Return(m.Int64Sub(m.Int64Constant(0), m.Parameter(0)));
371  Stream s = m.Build();
372 
373  ASSERT_EQ(1U, s.size());
374  EXPECT_EQ(kArm64Neg, s[0]->arch_opcode());
375  EXPECT_EQ(1U, s[0]->InputCount());
376  EXPECT_EQ(1U, s[0]->OutputCount());
377  }
378 }

References kMachInt32, and kMachInt64.

◆ TEST_F() [52/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
TruncateFloat64ToFloat32WithParameter   
)

Definition at line 1356 of file instruction-selector-arm-unittest.cc.

1356  {
1357  StreamBuilder m(this, kMachFloat32, kMachFloat64);
1358  m.Return(m.TruncateFloat64ToFloat32(m.Parameter(0)));
1359  Stream s = m.Build();
1360  ASSERT_EQ(1U, s.size());
1361  EXPECT_EQ(kArmVcvtF32F64, s[0]->arch_opcode());
1362  EXPECT_EQ(1U, s[0]->InputCount());
1363  EXPECT_EQ(1U, s[0]->OutputCount());
1364 }

References kMachFloat32, and kMachFloat64.

◆ TEST_F() [53/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
TruncateInt64ToInt32WithParameter   
)

Definition at line 55 of file instruction-selector-x64-unittest.cc.

55  {
56  StreamBuilder m(this, kMachInt32, kMachInt64);
57  m.Return(m.TruncateInt64ToInt32(m.Parameter(0)));
58  Stream s = m.Build();
59  ASSERT_EQ(1U, s.size());
60  EXPECT_EQ(kX64Movl, s[0]->arch_opcode());
61 }

References kMachInt32, and kMachInt64.

◆ TEST_F() [54/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Word32AndWithBfcImmediateForARMv7   
)

Definition at line 1708 of file instruction-selector-arm-unittest.cc.

1708  {
1709  TRACED_FORRANGE(int32_t, lsb, 0, 31) {
1710  TRACED_FORRANGE(int32_t, width, 1, (32 - lsb) - 1) {
1711  StreamBuilder m(this, kMachInt32, kMachInt32);
1712  m.Return(m.Word32And(
1713  m.Parameter(0),
1714  m.Int32Constant(~((0xffffffffu >> (32 - width)) << lsb))));
1715  Stream s = m.Build(ARMv7);
1716  ASSERT_EQ(1U, s.size());
1717  EXPECT_EQ(kArmBfc, s[0]->arch_opcode());
1718  ASSERT_EQ(1U, s[0]->OutputCount());
1719  EXPECT_TRUE(
1720  UnallocatedOperand::cast(s[0]->Output())->HasSameAsInputPolicy());
1721  ASSERT_EQ(3U, s[0]->InputCount());
1722  EXPECT_EQ(lsb, s.ToInt32(s[0]->InputAt(1)));
1723  EXPECT_EQ(width, s.ToInt32(s[0]->InputAt(2)));
1724  }
1725  }
1726  TRACED_FORRANGE(int32_t, lsb, 0, 31) {
1727  TRACED_FORRANGE(int32_t, width, 1, (32 - lsb) - 1) {
1728  StreamBuilder m(this, kMachInt32, kMachInt32);
1729  m.Return(
1730  m.Word32And(m.Int32Constant(~((0xffffffffu >> (32 - width)) << lsb)),
1731  m.Parameter(0)));
1732  Stream s = m.Build(ARMv7);
1733  ASSERT_EQ(1U, s.size());
1734  EXPECT_EQ(kArmBfc, s[0]->arch_opcode());
1735  ASSERT_EQ(1U, s[0]->OutputCount());
1736  EXPECT_TRUE(
1737  UnallocatedOperand::cast(s[0]->Output())->HasSameAsInputPolicy());
1738  ASSERT_EQ(3U, s[0]->InputCount());
1739  EXPECT_EQ(lsb, s.ToInt32(s[0]->InputAt(1)));
1740  EXPECT_EQ(width, s.ToInt32(s[0]->InputAt(2)));
1741  }
1742  }
1743 }
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 ARMv7(ARM only)") DEFINE_BOOL(enable_32dregs

References v8::internal::ARMv7, v8::internal::compiler::UnallocatedOperand::cast(), and kMachInt32.

+ Here is the call graph for this function:

◆ TEST_F() [55/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Word32AndWithUbfxImmediateForARMv7   
)

Definition at line 1682 of file instruction-selector-arm-unittest.cc.

1682  {
1683  TRACED_FORRANGE(int32_t, width, 1, 32) {
1684  StreamBuilder m(this, kMachInt32, kMachInt32);
1685  m.Return(m.Word32And(m.Parameter(0),
1686  m.Int32Constant(0xffffffffu >> (32 - width))));
1687  Stream s = m.Build(ARMv7);
1688  ASSERT_EQ(1U, s.size());
1689  EXPECT_EQ(kArmUbfx, s[0]->arch_opcode());
1690  ASSERT_EQ(3U, s[0]->InputCount());
1691  EXPECT_EQ(0, s.ToInt32(s[0]->InputAt(1)));
1692  EXPECT_EQ(width, s.ToInt32(s[0]->InputAt(2)));
1693  }
1694  TRACED_FORRANGE(int32_t, width, 1, 32) {
1695  StreamBuilder m(this, kMachInt32, kMachInt32);
1696  m.Return(m.Word32And(m.Int32Constant(0xffffffffu >> (32 - width)),
1697  m.Parameter(0)));
1698  Stream s = m.Build(ARMv7);
1699  ASSERT_EQ(1U, s.size());
1700  EXPECT_EQ(kArmUbfx, s[0]->arch_opcode());
1701  ASSERT_EQ(3U, s[0]->InputCount());
1702  EXPECT_EQ(0, s.ToInt32(s[0]->InputAt(1)));
1703  EXPECT_EQ(width, s.ToInt32(s[0]->InputAt(2)));
1704  }
1705 }

References v8::internal::ARMv7, and kMachInt32.

◆ TEST_F() [56/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Word32AndWithWord32Not   
)

Definition at line 1784 of file instruction-selector-arm-unittest.cc.

1784  {
1785  {
1786  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1787  m.Return(m.Word32And(m.Parameter(0), m.Word32Not(m.Parameter(1))));
1788  Stream s = m.Build();
1789  ASSERT_EQ(1U, s.size());
1790  EXPECT_EQ(kArmBic, s[0]->arch_opcode());
1791  EXPECT_EQ(kMode_Operand2_R, s[0]->addressing_mode());
1792  EXPECT_EQ(2U, s[0]->InputCount());
1793  EXPECT_EQ(1U, s[0]->OutputCount());
1794  }
1795  {
1796  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1797  m.Return(m.Word32And(m.Word32Not(m.Parameter(0)), m.Parameter(1)));
1798  Stream s = m.Build();
1799  ASSERT_EQ(1U, s.size());
1800  EXPECT_EQ(kArmBic, s[0]->arch_opcode());
1801  EXPECT_EQ(kMode_Operand2_R, s[0]->addressing_mode());
1802  EXPECT_EQ(2U, s[0]->InputCount());
1803  EXPECT_EQ(1U, s[0]->OutputCount());
1804  }
1805 }

References kMachInt32.

◆ TEST_F() [57/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Word32AndWithWord32ShrWithImmediateForARMv7   
)

Definition at line 1896 of file instruction-selector-arm-unittest.cc.

1896  {
1897  TRACED_FORRANGE(int32_t, lsb, 0, 31) {
1898  TRACED_FORRANGE(int32_t, width, 1, 32 - lsb) {
1899  StreamBuilder m(this, kMachInt32, kMachInt32);
1900  m.Return(m.Word32And(m.Word32Shr(m.Parameter(0), m.Int32Constant(lsb)),
1901  m.Int32Constant(0xffffffffu >> (32 - width))));
1902  Stream s = m.Build(ARMv7);
1903  ASSERT_EQ(1U, s.size());
1904  EXPECT_EQ(kArmUbfx, s[0]->arch_opcode());
1905  ASSERT_EQ(3U, s[0]->InputCount());
1906  EXPECT_EQ(lsb, s.ToInt32(s[0]->InputAt(1)));
1907  EXPECT_EQ(width, s.ToInt32(s[0]->InputAt(2)));
1908  }
1909  }
1910  TRACED_FORRANGE(int32_t, lsb, 0, 31) {
1911  TRACED_FORRANGE(int32_t, width, 1, 32 - lsb) {
1912  StreamBuilder m(this, kMachInt32, kMachInt32);
1913  m.Return(m.Word32And(m.Int32Constant(0xffffffffu >> (32 - width)),
1914  m.Word32Shr(m.Parameter(0), m.Int32Constant(lsb))));
1915  Stream s = m.Build(ARMv7);
1916  ASSERT_EQ(1U, s.size());
1917  EXPECT_EQ(kArmUbfx, s[0]->arch_opcode());
1918  ASSERT_EQ(3U, s[0]->InputCount());
1919  EXPECT_EQ(lsb, s.ToInt32(s[0]->InputAt(1)));
1920  EXPECT_EQ(width, s.ToInt32(s[0]->InputAt(2)));
1921  }
1922  }
1923 }

References v8::internal::ARMv7, and kMachInt32.

◆ TEST_F() [58/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Word32EqualWithImmediate   
)

Definition at line 1822 of file instruction-selector-arm-unittest.cc.

1822  {
1823  TRACED_FOREACH(int32_t, imm, kImmediates) {
1824  if (imm == 0) continue;
1825  StreamBuilder m(this, kMachInt32, kMachInt32);
1826  m.Return(m.Word32Equal(m.Parameter(0), m.Int32Constant(imm)));
1827  Stream s = m.Build();
1828  ASSERT_EQ(1U, s.size());
1829  EXPECT_EQ(kArmCmp, s[0]->arch_opcode());
1830  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
1831  ASSERT_EQ(2U, s[0]->InputCount());
1832  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
1833  EXPECT_EQ(1U, s[0]->OutputCount());
1834  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
1835  EXPECT_EQ(kEqual, s[0]->flags_condition());
1836  }
1837  TRACED_FOREACH(int32_t, imm, kImmediates) {
1838  if (imm == 0) continue;
1839  StreamBuilder m(this, kMachInt32, kMachInt32);
1840  m.Return(m.Word32Equal(m.Int32Constant(imm), m.Parameter(0)));
1841  Stream s = m.Build();
1842  ASSERT_EQ(1U, s.size());
1843  EXPECT_EQ(kArmCmp, s[0]->arch_opcode());
1844  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
1845  ASSERT_EQ(2U, s[0]->InputCount());
1846  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
1847  EXPECT_EQ(1U, s[0]->OutputCount());
1848  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
1849  EXPECT_EQ(kEqual, s[0]->flags_condition());
1850  }
1851 }

References kEqual, kFlags_set, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kImmediates, and kMachInt32.

◆ TEST_F() [59/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Word32EqualWithParameters   
)

Definition at line 1808 of file instruction-selector-arm-unittest.cc.

1808  {
1809  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1810  m.Return(m.Word32Equal(m.Parameter(0), m.Parameter(1)));
1811  Stream s = m.Build();
1812  ASSERT_EQ(1U, s.size());
1813  EXPECT_EQ(kArmCmp, s[0]->arch_opcode());
1814  EXPECT_EQ(kMode_Operand2_R, s[0]->addressing_mode());
1815  EXPECT_EQ(2U, s[0]->InputCount());
1816  EXPECT_EQ(1U, s[0]->OutputCount());
1817  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
1818  EXPECT_EQ(kEqual, s[0]->flags_condition());
1819 }

References kEqual, kFlags_set, and kMachInt32.

◆ TEST_F() [60/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Word32EqualWithZero   
)

Definition at line 1854 of file instruction-selector-arm-unittest.cc.

1854  {
1855  {
1856  StreamBuilder m(this, kMachInt32, kMachInt32);
1857  m.Return(m.Word32Equal(m.Parameter(0), m.Int32Constant(0)));
1858  Stream s = m.Build();
1859  ASSERT_EQ(1U, s.size());
1860  EXPECT_EQ(kArmTst, s[0]->arch_opcode());
1861  EXPECT_EQ(kMode_Operand2_R, s[0]->addressing_mode());
1862  ASSERT_EQ(2U, s[0]->InputCount());
1863  EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[0]->InputAt(1)));
1864  EXPECT_EQ(1U, s[0]->OutputCount());
1865  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
1866  EXPECT_EQ(kEqual, s[0]->flags_condition());
1867  }
1868  {
1869  StreamBuilder m(this, kMachInt32, kMachInt32);
1870  m.Return(m.Word32Equal(m.Int32Constant(0), m.Parameter(0)));
1871  Stream s = m.Build();
1872  ASSERT_EQ(1U, s.size());
1873  EXPECT_EQ(kArmTst, s[0]->arch_opcode());
1874  EXPECT_EQ(kMode_Operand2_R, s[0]->addressing_mode());
1875  ASSERT_EQ(2U, s[0]->InputCount());
1876  EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[0]->InputAt(1)));
1877  EXPECT_EQ(1U, s[0]->OutputCount());
1878  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
1879  EXPECT_EQ(kEqual, s[0]->flags_condition());
1880  }
1881 }

References kEqual, kFlags_set, and kMachInt32.

◆ TEST_F() [61/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Word32NotWithParameter   
)

Definition at line 1884 of file instruction-selector-arm-unittest.cc.

1884  {
1885  StreamBuilder m(this, kMachInt32, kMachInt32);
1886  m.Return(m.Word32Not(m.Parameter(0)));
1887  Stream s = m.Build();
1888  ASSERT_EQ(1U, s.size());
1889  EXPECT_EQ(kArmMvn, s[0]->arch_opcode());
1890  EXPECT_EQ(kMode_Operand2_R, s[0]->addressing_mode());
1891  EXPECT_EQ(1U, s[0]->InputCount());
1892  EXPECT_EQ(1U, s[0]->OutputCount());
1893 }

References kMachInt32.

◆ TEST_F() [62/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Word32ShrWithWord32AndWithImmediateForARMv7   
)

Definition at line 1746 of file instruction-selector-arm-unittest.cc.

1746  {
1747  TRACED_FORRANGE(int32_t, lsb, 0, 31) {
1748  TRACED_FORRANGE(int32_t, width, 1, 32 - lsb) {
1749  uint32_t max = 1 << lsb;
1750  if (max > static_cast<uint32_t>(kMaxInt)) max -= 1;
1751  uint32_t jnk = rng()->NextInt(max);
1752  uint32_t msk = ((0xffffffffu >> (32 - width)) << lsb) | jnk;
1753  StreamBuilder m(this, kMachInt32, kMachInt32);
1754  m.Return(m.Word32Shr(m.Word32And(m.Parameter(0), m.Int32Constant(msk)),
1755  m.Int32Constant(lsb)));
1756  Stream s = m.Build(ARMv7);
1757  ASSERT_EQ(1U, s.size());
1758  EXPECT_EQ(kArmUbfx, s[0]->arch_opcode());
1759  ASSERT_EQ(3U, s[0]->InputCount());
1760  EXPECT_EQ(lsb, s.ToInt32(s[0]->InputAt(1)));
1761  EXPECT_EQ(width, s.ToInt32(s[0]->InputAt(2)));
1762  }
1763  }
1764  TRACED_FORRANGE(int32_t, lsb, 0, 31) {
1765  TRACED_FORRANGE(int32_t, width, 1, 32 - lsb) {
1766  uint32_t max = 1 << lsb;
1767  if (max > static_cast<uint32_t>(kMaxInt)) max -= 1;
1768  uint32_t jnk = rng()->NextInt(max);
1769  uint32_t msk = ((0xffffffffu >> (32 - width)) << lsb) | jnk;
1770  StreamBuilder m(this, kMachInt32, kMachInt32);
1771  m.Return(m.Word32Shr(m.Word32And(m.Int32Constant(msk), m.Parameter(0)),
1772  m.Int32Constant(lsb)));
1773  Stream s = m.Build(ARMv7);
1774  ASSERT_EQ(1U, s.size());
1775  EXPECT_EQ(kArmUbfx, s[0]->arch_opcode());
1776  ASSERT_EQ(3U, s[0]->InputCount());
1777  EXPECT_EQ(lsb, s.ToInt32(s[0]->InputAt(1)));
1778  EXPECT_EQ(width, s.ToInt32(s[0]->InputAt(2)));
1779  }
1780  }
1781 }
const int kMaxInt
Definition: globals.h:109

References v8::internal::ARMv7, kMachInt32, and v8::internal::kMaxInt.

◆ TEST_F() [63/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Word32XorMinusOneWithParameter   
)

Definition at line 1352 of file instruction-selector-arm64-unittest.cc.

1352  {
1353  {
1354  StreamBuilder m(this, kMachInt32, kMachInt32);
1355  m.Return(m.Word32Xor(m.Parameter(0), m.Int32Constant(-1)));
1356  Stream s = m.Build();
1357  ASSERT_EQ(1U, s.size());
1358  EXPECT_EQ(kArm64Not32, s[0]->arch_opcode());
1359  EXPECT_EQ(1U, s[0]->InputCount());
1360  EXPECT_EQ(1U, s[0]->OutputCount());
1361  }
1362  {
1363  StreamBuilder m(this, kMachInt32, kMachInt32);
1364  m.Return(m.Word32Xor(m.Int32Constant(-1), m.Parameter(0)));
1365  Stream s = m.Build();
1366  ASSERT_EQ(1U, s.size());
1367  EXPECT_EQ(kArm64Not32, s[0]->arch_opcode());
1368  EXPECT_EQ(1U, s[0]->InputCount());
1369  EXPECT_EQ(1U, s[0]->OutputCount());
1370  }
1371 }

References kMachInt32.

◆ TEST_F() [64/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Word64EqualWithZero   
)

Definition at line 1208 of file instruction-selector-arm64-unittest.cc.

1208  {
1209  {
1210  StreamBuilder m(this, kMachInt64, kMachInt64);
1211  m.Return(m.Word64Equal(m.Parameter(0), m.Int64Constant(0)));
1212  Stream s = m.Build();
1213  ASSERT_EQ(1U, s.size());
1214  EXPECT_EQ(kArm64Tst, s[0]->arch_opcode());
1215  ASSERT_EQ(2U, s[0]->InputCount());
1216  EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[0]->InputAt(1)));
1217  EXPECT_EQ(1U, s[0]->OutputCount());
1218  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
1219  EXPECT_EQ(kEqual, s[0]->flags_condition());
1220  }
1221  {
1222  StreamBuilder m(this, kMachInt64, kMachInt64);
1223  m.Return(m.Word64Equal(m.Int64Constant(0), m.Parameter(0)));
1224  Stream s = m.Build();
1225  ASSERT_EQ(1U, s.size());
1226  EXPECT_EQ(kArm64Tst, s[0]->arch_opcode());
1227  ASSERT_EQ(2U, s[0]->InputCount());
1228  EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[0]->InputAt(1)));
1229  EXPECT_EQ(1U, s[0]->OutputCount());
1230  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
1231  EXPECT_EQ(kEqual, s[0]->flags_condition());
1232  }
1233 }

References kEqual, kFlags_set, and kMachInt64.

◆ TEST_F() [65/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Word64NotWithParameter   
)

Definition at line 1341 of file instruction-selector-arm64-unittest.cc.

1341  {
1342  StreamBuilder m(this, kMachInt64, kMachInt64);
1343  m.Return(m.Word64Not(m.Parameter(0)));
1344  Stream s = m.Build();
1345  ASSERT_EQ(1U, s.size());
1346  EXPECT_EQ(kArm64Not, s[0]->arch_opcode());
1347  EXPECT_EQ(1U, s[0]->InputCount());
1348  EXPECT_EQ(1U, s[0]->OutputCount());
1349 }

References kMachInt64.

◆ TEST_F() [66/132]

v8::internal::compiler::TEST_F ( InstructionSelectorTest  ,
Word64XorMinusOneWithParameter   
)

Definition at line 1374 of file instruction-selector-arm64-unittest.cc.

1374  {
1375  {
1376  StreamBuilder m(this, kMachInt64, kMachInt64);
1377  m.Return(m.Word64Xor(m.Parameter(0), m.Int64Constant(-1)));
1378  Stream s = m.Build();
1379  ASSERT_EQ(1U, s.size());
1380  EXPECT_EQ(kArm64Not, s[0]->arch_opcode());
1381  EXPECT_EQ(1U, s[0]->InputCount());
1382  EXPECT_EQ(1U, s[0]->OutputCount());
1383  }
1384  {
1385  StreamBuilder m(this, kMachInt64, kMachInt64);
1386  m.Return(m.Word64Xor(m.Int64Constant(-1), m.Parameter(0)));
1387  Stream s = m.Build();
1388  ASSERT_EQ(1U, s.size());
1389  EXPECT_EQ(kArm64Not, s[0]->arch_opcode());
1390  EXPECT_EQ(1U, s[0]->InputCount());
1391  EXPECT_EQ(1U, s[0]->OutputCount());
1392  }
1393 }

References kMachInt64.

◆ TEST_F() [67/132]

v8::internal::compiler::TEST_F ( JSBuiltinReducerTest  ,
MathAbs   
)

Definition at line 66 of file js-builtin-reducer-unittest.cc.

66  {
67  Handle<JSFunction> f(isolate()->context()->math_abs_fun());
68 
69  TRACED_FOREACH(Type*, t0, kNumberTypes) {
70  Node* p0 = Parameter(t0, 0);
71  Node* fun = HeapConstant(Unique<HeapObject>::CreateUninitialized(f));
72  Node* call = graph()->NewNode(javascript()->Call(3, NO_CALL_FUNCTION_FLAGS),
73  fun, UndefinedConstant(), p0);
74  Reduction r = Reduce(call);
75 
76  if (t0->Is(Type::Unsigned32())) {
77  ASSERT_TRUE(r.Changed());
78  EXPECT_THAT(r.replacement(), p0);
79  } else {
80  Capture<Node*> branch;
81  ASSERT_TRUE(r.Changed());
82  EXPECT_THAT(
83  r.replacement(),
85  IsMerge(IsIfTrue(CaptureEq(&branch)),
86  IsIfFalse(AllOf(
87  CaptureEq(&branch),
89  graph()->start()))))));
90  }
91  }
92 }
Matcher< Node * > IsNumberLessThan(const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
Matcher< Node * > IsNumberConstant(const Matcher< double > &value_matcher)
Matcher< Node * > IsNumberSubtract(const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
TypeImpl< ZoneTypeConfig > Type
@ NO_CALL_FUNCTION_FLAGS
Definition: globals.h:469

References IsBranch(), IsIfFalse(), IsIfTrue(), IsMerge(), IsNumberConstant(), IsNumberLessThan(), IsNumberSubtract(), IsPhi(), kMachNone, v8::internal::compiler::anonymous_namespace{js-builtin-reducer-unittest.cc}::kNumberTypes, v8::internal::NO_CALL_FUNCTION_FLAGS, and v8::internal::p0.

+ Here is the call graph for this function:

◆ TEST_F() [68/132]

v8::internal::compiler::TEST_F ( JSBuiltinReducerTest  ,
MathFround   
)

Definition at line 213 of file js-builtin-reducer-unittest.cc.

213  {
214  Handle<Object> m =
215  JSObject::GetProperty(isolate()->global_object(),
216  isolate()->factory()->NewStringFromAsciiChecked(
217  "Math")).ToHandleChecked();
218  Handle<JSFunction> f = Handle<JSFunction>::cast(
219  JSObject::GetProperty(m, isolate()->factory()->NewStringFromAsciiChecked(
220  "fround")).ToHandleChecked());
221 
222  TRACED_FOREACH(Type*, t0, kNumberTypes) {
223  Node* p0 = Parameter(t0, 0);
224  Node* fun = HeapConstant(Unique<HeapObject>::CreateUninitialized(f));
225  Node* call = graph()->NewNode(javascript()->Call(3, NO_CALL_FUNCTION_FLAGS),
226  fun, UndefinedConstant(), p0);
227  Reduction r = Reduce(call);
228 
229  ASSERT_TRUE(r.Changed());
230  EXPECT_THAT(r.replacement(), IsTruncateFloat64ToFloat32(p0));
231  }
232 }
Matcher< Node * > IsTruncateFloat64ToFloat32(const Matcher< Node * > &input_matcher)

References v8::internal::Handle< T >::cast(), v8::internal::Object::GetProperty(), IsTruncateFloat64ToFloat32(), v8::internal::compiler::anonymous_namespace{js-builtin-reducer-unittest.cc}::kNumberTypes, v8::internal::NO_CALL_FUNCTION_FLAGS, and v8::internal::p0.

+ Here is the call graph for this function:

◆ TEST_F() [69/132]

v8::internal::compiler::TEST_F ( JSBuiltinReducerTest  ,
MathImul   
)

Definition at line 184 of file js-builtin-reducer-unittest.cc.

184  {
185  Handle<JSFunction> f(isolate()->context()->math_imul_fun());
186 
187  TRACED_FOREACH(Type*, t0, kNumberTypes) {
188  TRACED_FOREACH(Type*, t1, kNumberTypes) {
189  Node* p0 = Parameter(t0, 0);
190  Node* p1 = Parameter(t1, 1);
191  Node* fun = HeapConstant(Unique<HeapObject>::CreateUninitialized(f));
192  Node* call =
193  graph()->NewNode(javascript()->Call(4, NO_CALL_FUNCTION_FLAGS), fun,
194  UndefinedConstant(), p0, p1);
195  Reduction r = Reduce(call);
196 
197  if (t0->Is(Type::Integral32()) && t1->Is(Type::Integral32())) {
198  ASSERT_TRUE(r.Changed());
199  EXPECT_THAT(r.replacement(), IsInt32Mul(p0, p1));
200  } else {
201  ASSERT_FALSE(r.Changed());
202  EXPECT_EQ(IrOpcode::kJSCallFunction, call->opcode());
203  }
204  }
205  }
206 }
Matcher< Node * > IsInt32Mul(const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)

References IsInt32Mul(), v8::internal::compiler::anonymous_namespace{js-builtin-reducer-unittest.cc}::kNumberTypes, v8::internal::NO_CALL_FUNCTION_FLAGS, v8::internal::p0, and v8::internal::p1.

+ Here is the call graph for this function:

◆ TEST_F() [70/132]

v8::internal::compiler::TEST_F ( JSBuiltinReducerTest  ,
MathMax0   
)

Definition at line 119 of file js-builtin-reducer-unittest.cc.

119  {
120  Handle<JSFunction> f(isolate()->context()->math_max_fun());
121 
122  Node* fun = HeapConstant(Unique<HeapObject>::CreateUninitialized(f));
123  Node* call = graph()->NewNode(javascript()->Call(2, NO_CALL_FUNCTION_FLAGS),
124  fun, UndefinedConstant());
125  Reduction r = Reduce(call);
126 
127  ASSERT_TRUE(r.Changed());
128  EXPECT_THAT(r.replacement(), IsNumberConstant(-V8_INFINITY));
129 }
#define V8_INFINITY
Definition: globals.h:25

References IsNumberConstant(), v8::internal::NO_CALL_FUNCTION_FLAGS, and V8_INFINITY.

+ Here is the call graph for this function:

◆ TEST_F() [71/132]

v8::internal::compiler::TEST_F ( JSBuiltinReducerTest  ,
MathMax1   
)

Definition at line 132 of file js-builtin-reducer-unittest.cc.

132  {
133  Handle<JSFunction> f(isolate()->context()->math_max_fun());
134 
135  TRACED_FOREACH(Type*, t0, kNumberTypes) {
136  Node* p0 = Parameter(t0, 0);
137  Node* fun = HeapConstant(Unique<HeapObject>::CreateUninitialized(f));
138  Node* call = graph()->NewNode(javascript()->Call(3, NO_CALL_FUNCTION_FLAGS),
139  fun, UndefinedConstant(), p0);
140  Reduction r = Reduce(call);
141 
142  ASSERT_TRUE(r.Changed());
143  EXPECT_THAT(r.replacement(), p0);
144  }
145 }

References v8::internal::compiler::anonymous_namespace{js-builtin-reducer-unittest.cc}::kNumberTypes, v8::internal::NO_CALL_FUNCTION_FLAGS, and v8::internal::p0.

◆ TEST_F() [72/132]

v8::internal::compiler::TEST_F ( JSBuiltinReducerTest  ,
MathMax2   
)

Definition at line 148 of file js-builtin-reducer-unittest.cc.

148  {
149  Handle<JSFunction> f(isolate()->context()->math_max_fun());
150 
151  TRACED_FOREACH(Type*, t0, kNumberTypes) {
152  TRACED_FOREACH(Type*, t1, kNumberTypes) {
153  Node* p0 = Parameter(t0, 0);
154  Node* p1 = Parameter(t1, 1);
155  Node* fun = HeapConstant(Unique<HeapObject>::CreateUninitialized(f));
156  Node* call =
157  graph()->NewNode(javascript()->Call(4, NO_CALL_FUNCTION_FLAGS), fun,
158  UndefinedConstant(), p0, p1);
159  Reduction r = Reduce(call);
160 
161  if (t0->Is(Type::Integral32()) && t1->Is(Type::Integral32())) {
162  Capture<Node*> branch;
163  ASSERT_TRUE(r.Changed());
164  EXPECT_THAT(
165  r.replacement(),
166  IsPhi(kMachNone, p1, p0,
167  IsMerge(IsIfTrue(CaptureEq(&branch)),
168  IsIfFalse(AllOf(CaptureEq(&branch),
170  graph()->start()))))));
171  } else {
172  ASSERT_FALSE(r.Changed());
173  EXPECT_EQ(IrOpcode::kJSCallFunction, call->opcode());
174  }
175  }
176  }
177 }

References IsBranch(), IsIfFalse(), IsIfTrue(), IsMerge(), IsNumberLessThan(), IsPhi(), kMachNone, v8::internal::compiler::anonymous_namespace{js-builtin-reducer-unittest.cc}::kNumberTypes, v8::internal::NO_CALL_FUNCTION_FLAGS, v8::internal::p0, and v8::internal::p1.

+ Here is the call graph for this function:

◆ TEST_F() [73/132]

v8::internal::compiler::TEST_F ( JSBuiltinReducerTest  ,
MathSqrt   
)

Definition at line 99 of file js-builtin-reducer-unittest.cc.

99  {
100  Handle<JSFunction> f(isolate()->context()->math_sqrt_fun());
101 
102  TRACED_FOREACH(Type*, t0, kNumberTypes) {
103  Node* p0 = Parameter(t0, 0);
104  Node* fun = HeapConstant(Unique<HeapObject>::CreateUninitialized(f));
105  Node* call = graph()->NewNode(javascript()->Call(3, NO_CALL_FUNCTION_FLAGS),
106  fun, UndefinedConstant(), p0);
107  Reduction r = Reduce(call);
108 
109  ASSERT_TRUE(r.Changed());
110  EXPECT_THAT(r.replacement(), IsFloat64Sqrt(p0));
111  }
112 }
Matcher< Node * > IsFloat64Sqrt(const Matcher< Node * > &input_matcher)

References IsFloat64Sqrt(), v8::internal::compiler::anonymous_namespace{js-builtin-reducer-unittest.cc}::kNumberTypes, v8::internal::NO_CALL_FUNCTION_FLAGS, and v8::internal::p0.

+ Here is the call graph for this function:

◆ TEST_F() [74/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
ChangeFloat64ToFloat32WithConstant   
)

Definition at line 249 of file machine-operator-reducer-unittest.cc.

249  {
250  TRACED_FOREACH(float, x, kFloat32Values) {
251  Reduction reduction = Reduce(graph()->NewNode(
252  machine()->ChangeFloat32ToFloat64(), Float32Constant(x)));
253  ASSERT_TRUE(reduction.Changed());
254  EXPECT_THAT(reduction.replacement(), IsFloat64Constant(x));
255  }
256 }
Matcher< Node * > IsFloat64Constant(const Matcher< double > &value_matcher)

References IsFloat64Constant(), and v8::internal::compiler::anonymous_namespace{machine-operator-reducer-unittest.cc}::kFloat32Values.

+ Here is the call graph for this function:

◆ TEST_F() [75/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
ChangeFloat64ToInt32WithChangeInt32ToFloat64   
)

Definition at line 263 of file machine-operator-reducer-unittest.cc.

264  {
265  Node* value = Parameter(0);
266  Reduction reduction = Reduce(graph()->NewNode(
267  machine()->ChangeFloat64ToInt32(),
268  graph()->NewNode(machine()->ChangeInt32ToFloat64(), value)));
269  ASSERT_TRUE(reduction.Changed());
270  EXPECT_EQ(value, reduction.replacement());
271 }

◆ TEST_F() [76/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
ChangeFloat64ToInt32WithConstant   
)

Definition at line 274 of file machine-operator-reducer-unittest.cc.

274  {
275  TRACED_FOREACH(int32_t, x, kInt32Values) {
276  Reduction reduction = Reduce(graph()->NewNode(
277  machine()->ChangeFloat64ToInt32(), Float64Constant(FastI2D(x))));
278  ASSERT_TRUE(reduction.Changed());
279  EXPECT_THAT(reduction.replacement(), IsInt32Constant(x));
280  }
281 }
double FastI2D(int x)
Definition: conversions.h:64

References v8::internal::FastI2D(), IsInt32Constant(), and v8::internal::compiler::anonymous_namespace{machine-operator-reducer-unittest.cc}::kInt32Values.

+ Here is the call graph for this function:

◆ TEST_F() [77/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
ChangeFloat64ToUint32WithChangeUint32ToFloat64   
)

Definition at line 288 of file machine-operator-reducer-unittest.cc.

289  {
290  Node* value = Parameter(0);
291  Reduction reduction = Reduce(graph()->NewNode(
292  machine()->ChangeFloat64ToUint32(),
293  graph()->NewNode(machine()->ChangeUint32ToFloat64(), value)));
294  ASSERT_TRUE(reduction.Changed());
295  EXPECT_EQ(value, reduction.replacement());
296 }

◆ TEST_F() [78/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
ChangeFloat64ToUint32WithConstant   
)

Definition at line 299 of file machine-operator-reducer-unittest.cc.

299  {
300  TRACED_FOREACH(uint32_t, x, kUint32Values) {
301  Reduction reduction = Reduce(graph()->NewNode(
302  machine()->ChangeFloat64ToUint32(), Float64Constant(FastUI2D(x))));
303  ASSERT_TRUE(reduction.Changed());
304  EXPECT_THAT(reduction.replacement(), IsInt32Constant(bit_cast<int32_t>(x)));
305  }
306 }
double FastUI2D(unsigned x)
Definition: conversions.h:72

References v8::internal::FastUI2D(), IsInt32Constant(), and v8::internal::compiler::anonymous_namespace{machine-operator-reducer-unittest.cc}::kUint32Values.

+ Here is the call graph for this function:

◆ TEST_F() [79/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
ChangeInt32ToFloat64WithConstant   
)

Definition at line 313 of file machine-operator-reducer-unittest.cc.

313  {
314  TRACED_FOREACH(int32_t, x, kInt32Values) {
315  Reduction reduction = Reduce(
316  graph()->NewNode(machine()->ChangeInt32ToFloat64(), Int32Constant(x)));
317  ASSERT_TRUE(reduction.Changed());
318  EXPECT_THAT(reduction.replacement(), IsFloat64Constant(FastI2D(x)));
319  }
320 }

References v8::internal::FastI2D(), IsFloat64Constant(), and v8::internal::compiler::anonymous_namespace{machine-operator-reducer-unittest.cc}::kInt32Values.

+ Here is the call graph for this function:

◆ TEST_F() [80/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
ChangeInt32ToInt64WithConstant   
)

Definition at line 327 of file machine-operator-reducer-unittest.cc.

327  {
328  TRACED_FOREACH(int32_t, x, kInt32Values) {
329  Reduction reduction = Reduce(
330  graph()->NewNode(machine()->ChangeInt32ToInt64(), Int32Constant(x)));
331  ASSERT_TRUE(reduction.Changed());
332  EXPECT_THAT(reduction.replacement(), IsInt64Constant(x));
333  }
334 }
Matcher< Node * > IsInt64Constant(const Matcher< int64_t > &value_matcher)

References IsInt64Constant(), and v8::internal::compiler::anonymous_namespace{machine-operator-reducer-unittest.cc}::kInt32Values.

+ Here is the call graph for this function:

◆ TEST_F() [81/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
ChangeUint32ToFloat64WithConstant   
)

Definition at line 341 of file machine-operator-reducer-unittest.cc.

341  {
342  TRACED_FOREACH(uint32_t, x, kUint32Values) {
343  Reduction reduction =
344  Reduce(graph()->NewNode(machine()->ChangeUint32ToFloat64(),
345  Int32Constant(bit_cast<int32_t>(x))));
346  ASSERT_TRUE(reduction.Changed());
347  EXPECT_THAT(reduction.replacement(), IsFloat64Constant(FastUI2D(x)));
348  }
349 }

References v8::internal::FastUI2D(), IsFloat64Constant(), and v8::internal::compiler::anonymous_namespace{machine-operator-reducer-unittest.cc}::kUint32Values.

+ Here is the call graph for this function:

◆ TEST_F() [82/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
ChangeUint32ToUint64WithConstant   
)

Definition at line 356 of file machine-operator-reducer-unittest.cc.

356  {
357  TRACED_FOREACH(uint32_t, x, kUint32Values) {
358  Reduction reduction =
359  Reduce(graph()->NewNode(machine()->ChangeUint32ToUint64(),
360  Int32Constant(bit_cast<int32_t>(x))));
361  ASSERT_TRUE(reduction.Changed());
362  EXPECT_THAT(reduction.replacement(),
363  IsInt64Constant(bit_cast<int64_t>(static_cast<uint64_t>(x))));
364  }
365 }

References IsInt64Constant(), and v8::internal::compiler::anonymous_namespace{machine-operator-reducer-unittest.cc}::kUint32Values.

+ Here is the call graph for this function:

◆ TEST_F() [83/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
Int32AddWithOverflowWithConstant   
)

Definition at line 599 of file machine-operator-reducer-unittest.cc.

599  {
600  TRACED_FOREACH(int32_t, x, kInt32Values) {
601  TRACED_FOREACH(int32_t, y, kInt32Values) {
602  int32_t z;
603  Node* add = graph()->NewNode(machine()->Int32AddWithOverflow(),
604  Int32Constant(x), Int32Constant(y));
605 
606  Reduction r = Reduce(graph()->NewNode(common()->Projection(1), add));
607  ASSERT_TRUE(r.Changed());
608  EXPECT_THAT(r.replacement(),
610 
611  r = Reduce(graph()->NewNode(common()->Projection(0), add));
612  ASSERT_TRUE(r.Changed());
613  EXPECT_THAT(r.replacement(), IsInt32Constant(z));
614  }
615  }
616 }
bool SignedAddOverflow32(int32_t lhs, int32_t rhs, int32_t *val)
Definition: bits.h:122

References IsInt32Constant(), v8::internal::compiler::anonymous_namespace{machine-operator-reducer-unittest.cc}::kInt32Values, v8::base::bits::SignedAddOverflow32(), and v8::base::internal::y.

+ Here is the call graph for this function:

◆ TEST_F() [84/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
Int32AddWithOverflowWithZero   
)

Definition at line 570 of file machine-operator-reducer-unittest.cc.

570  {
571  Node* p0 = Parameter(0);
572  {
573  Node* add = graph()->NewNode(machine()->Int32AddWithOverflow(),
574  Int32Constant(0), p0);
575 
576  Reduction r = Reduce(graph()->NewNode(common()->Projection(1), add));
577  ASSERT_TRUE(r.Changed());
578  EXPECT_THAT(r.replacement(), IsInt32Constant(0));
579 
580  r = Reduce(graph()->NewNode(common()->Projection(0), add));
581  ASSERT_TRUE(r.Changed());
582  EXPECT_EQ(p0, r.replacement());
583  }
584  {
585  Node* add = graph()->NewNode(machine()->Int32AddWithOverflow(), p0,
586  Int32Constant(0));
587 
588  Reduction r = Reduce(graph()->NewNode(common()->Projection(1), add));
589  ASSERT_TRUE(r.Changed());
590  EXPECT_THAT(r.replacement(), IsInt32Constant(0));
591 
592  r = Reduce(graph()->NewNode(common()->Projection(0), add));
593  ASSERT_TRUE(r.Changed());
594  EXPECT_EQ(p0, r.replacement());
595  }
596 }

References IsInt32Constant(), and v8::internal::p0.

+ Here is the call graph for this function:

◆ TEST_F() [85/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
Int32SubWithOverflowWithConstant   
)

Definition at line 638 of file machine-operator-reducer-unittest.cc.

638  {
639  TRACED_FOREACH(int32_t, x, kInt32Values) {
640  TRACED_FOREACH(int32_t, y, kInt32Values) {
641  int32_t z;
642  Node* add = graph()->NewNode(machine()->Int32SubWithOverflow(),
643  Int32Constant(x), Int32Constant(y));
644 
645  Reduction r = Reduce(graph()->NewNode(common()->Projection(1), add));
646  ASSERT_TRUE(r.Changed());
647  EXPECT_THAT(r.replacement(),
649 
650  r = Reduce(graph()->NewNode(common()->Projection(0), add));
651  ASSERT_TRUE(r.Changed());
652  EXPECT_THAT(r.replacement(), IsInt32Constant(z));
653  }
654  }
655 }
bool SignedSubOverflow32(int32_t lhs, int32_t rhs, int32_t *val)
Definition: bits.h:136

References IsInt32Constant(), v8::internal::compiler::anonymous_namespace{machine-operator-reducer-unittest.cc}::kInt32Values, v8::base::bits::SignedSubOverflow32(), and v8::base::internal::y.

+ Here is the call graph for this function:

◆ TEST_F() [86/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
Int32SubWithOverflowWithZero   
)

Definition at line 623 of file machine-operator-reducer-unittest.cc.

623  {
624  Node* p0 = Parameter(0);
625  Node* add =
626  graph()->NewNode(machine()->Int32SubWithOverflow(), p0, Int32Constant(0));
627 
628  Reduction r = Reduce(graph()->NewNode(common()->Projection(1), add));
629  ASSERT_TRUE(r.Changed());
630  EXPECT_THAT(r.replacement(), IsInt32Constant(0));
631 
632  r = Reduce(graph()->NewNode(common()->Projection(0), add));
633  ASSERT_TRUE(r.Changed());
634  EXPECT_EQ(p0, r.replacement());
635 }

References IsInt32Constant(), and v8::internal::p0.

+ Here is the call graph for this function:

◆ TEST_F() [87/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
ReduceToWord32RorWithConstant   
)

Definition at line 472 of file machine-operator-reducer-unittest.cc.

472  {
473  Node* value = Parameter(0);
474  TRACED_FORRANGE(int32_t, k, 0, 31) {
475  Node* shl =
476  graph()->NewNode(machine()->Word32Shl(), value, Int32Constant(k));
477  Node* shr =
478  graph()->NewNode(machine()->Word32Shr(), value, Int32Constant(32 - k));
479 
480  // (x << K) | (x >> ((32 - K) - y)) => x ror K
481  Node* node1 = graph()->NewNode(machine()->Word32Or(), shl, shr);
482  Reduction reduction1 = Reduce(node1);
483  EXPECT_TRUE(reduction1.Changed());
484  EXPECT_EQ(reduction1.replacement(), node1);
485  EXPECT_THAT(reduction1.replacement(),
486  IsWord32Ror(value, IsInt32Constant(k)));
487 
488  // (x >> (32 - K)) | (x << K) => x ror K
489  Node* node2 = graph()->NewNode(machine()->Word32Or(), shr, shl);
490  Reduction reduction2 = Reduce(node2);
491  EXPECT_TRUE(reduction2.Changed());
492  EXPECT_EQ(reduction2.replacement(), node2);
493  EXPECT_THAT(reduction2.replacement(),
494  IsWord32Ror(value, IsInt32Constant(k)));
495  }
496 }
Matcher< Node * > IsWord32Ror(const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)

References IsInt32Constant(), and IsWord32Ror().

+ Here is the call graph for this function:

◆ TEST_F() [88/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
ReduceToWord32RorWithParameters   
)

Definition at line 448 of file machine-operator-reducer-unittest.cc.

448  {
449  Node* value = Parameter(0);
450  Node* shift = Parameter(1);
451  Node* shl = graph()->NewNode(machine()->Word32Shl(), value, shift);
452  Node* shr = graph()->NewNode(
453  machine()->Word32Shr(), value,
454  graph()->NewNode(machine()->Int32Sub(), Int32Constant(32), shift));
455 
456  // (x << y) | (x >> (32 - y)) => x ror y
457  Node* node1 = graph()->NewNode(machine()->Word32Or(), shl, shr);
458  Reduction reduction1 = Reduce(node1);
459  EXPECT_TRUE(reduction1.Changed());
460  EXPECT_EQ(reduction1.replacement(), node1);
461  EXPECT_THAT(reduction1.replacement(), IsWord32Ror(value, shift));
462 
463  // (x >> (32 - y)) | (x << y) => x ror y
464  Node* node2 = graph()->NewNode(machine()->Word32Or(), shr, shl);
465  Reduction reduction2 = Reduce(node2);
466  EXPECT_TRUE(reduction2.Changed());
467  EXPECT_EQ(reduction2.replacement(), node2);
468  EXPECT_THAT(reduction2.replacement(), IsWord32Ror(value, shift));
469 }
enable harmony numeric enable harmony object literal extensions Optimize object Array shift

References IsWord32Ror(), and shift.

+ Here is the call graph for this function:

◆ TEST_F() [89/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
TruncateFloat64ToFloat32WithChangeFloat32ToFloat64   
)

Definition at line 372 of file machine-operator-reducer-unittest.cc.

373  {
374  Node* value = Parameter(0);
375  Reduction reduction = Reduce(graph()->NewNode(
376  machine()->TruncateFloat64ToFloat32(),
377  graph()->NewNode(machine()->ChangeFloat32ToFloat64(), value)));
378  ASSERT_TRUE(reduction.Changed());
379  EXPECT_EQ(value, reduction.replacement());
380 }

◆ TEST_F() [90/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
TruncateFloat64ToFloat32WithConstant   
)

Definition at line 383 of file machine-operator-reducer-unittest.cc.

383  {
384  TRACED_FOREACH(double, x, kFloat64Values) {
385  Reduction reduction = Reduce(graph()->NewNode(
386  machine()->TruncateFloat64ToFloat32(), Float64Constant(x)));
387  ASSERT_TRUE(reduction.Changed());
388  EXPECT_THAT(reduction.replacement(), IsFloat32Constant(DoubleToFloat32(x)));
389  }
390 }
Matcher< Node * > IsFloat32Constant(const Matcher< float > &value_matcher)
float DoubleToFloat32(double x)

References v8::internal::DoubleToFloat32(), IsFloat32Constant(), and v8::internal::compiler::anonymous_namespace{machine-operator-reducer-unittest.cc}::kFloat64Values.

+ Here is the call graph for this function:

◆ TEST_F() [91/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
TruncateFloat64ToInt32WithChangeInt32ToFloat64   
)

Definition at line 397 of file machine-operator-reducer-unittest.cc.

398  {
399  Node* value = Parameter(0);
400  Reduction reduction = Reduce(graph()->NewNode(
401  machine()->TruncateFloat64ToInt32(),
402  graph()->NewNode(machine()->ChangeInt32ToFloat64(), value)));
403  ASSERT_TRUE(reduction.Changed());
404  EXPECT_EQ(value, reduction.replacement());
405 }

◆ TEST_F() [92/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
TruncateFloat64ToInt32WithConstant   
)

Definition at line 408 of file machine-operator-reducer-unittest.cc.

408  {
409  TRACED_FOREACH(double, x, kFloat64Values) {
410  Reduction reduction = Reduce(graph()->NewNode(
411  machine()->TruncateFloat64ToInt32(), Float64Constant(x)));
412  ASSERT_TRUE(reduction.Changed());
413  EXPECT_THAT(reduction.replacement(), IsInt32Constant(DoubleToInt32(x)));
414  }
415 }
int32_t DoubleToInt32(double x)

References v8::internal::DoubleToInt32(), IsInt32Constant(), and v8::internal::compiler::anonymous_namespace{machine-operator-reducer-unittest.cc}::kFloat64Values.

+ Here is the call graph for this function:

◆ TEST_F() [93/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
TruncateInt64ToInt32WithChangeInt32ToInt64   
)

Definition at line 422 of file machine-operator-reducer-unittest.cc.

422  {
423  Node* value = Parameter(0);
424  Reduction reduction = Reduce(graph()->NewNode(
425  machine()->TruncateInt64ToInt32(),
426  graph()->NewNode(machine()->ChangeInt32ToInt64(), value)));
427  ASSERT_TRUE(reduction.Changed());
428  EXPECT_EQ(value, reduction.replacement());
429 }

◆ TEST_F() [94/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
TruncateInt64ToInt32WithConstant   
)

Definition at line 432 of file machine-operator-reducer-unittest.cc.

432  {
433  TRACED_FOREACH(int64_t, x, kInt64Values) {
434  Reduction reduction = Reduce(
435  graph()->NewNode(machine()->TruncateInt64ToInt32(), Int64Constant(x)));
436  ASSERT_TRUE(reduction.Changed());
437  EXPECT_THAT(reduction.replacement(),
438  IsInt32Constant(bit_cast<int32_t>(
439  static_cast<uint32_t>(bit_cast<uint64_t>(x)))));
440  }
441 }

References IsInt32Constant(), and v8::internal::compiler::anonymous_namespace{machine-operator-reducer-unittest.cc}::kInt64Values.

+ Here is the call graph for this function:

◆ TEST_F() [95/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
Word32RorWithConstants   
)

Definition at line 509 of file machine-operator-reducer-unittest.cc.

509  {
510  TRACED_FOREACH(int32_t, x, kUint32Values) {
511  TRACED_FORRANGE(int32_t, y, 0, 31) {
512  Node* node = graph()->NewNode(machine()->Word32Ror(), Int32Constant(x),
513  Int32Constant(y));
514  Reduction reduction = Reduce(node);
515  EXPECT_TRUE(reduction.Changed());
516  EXPECT_THAT(reduction.replacement(),
518  }
519  }
520 }
uint32_t RotateRight32(uint32_t value, uint32_t shift)
Definition: bits.h:107

References IsInt32Constant(), v8::internal::compiler::anonymous_namespace{machine-operator-reducer-unittest.cc}::kUint32Values, v8::base::bits::RotateRight32(), and v8::base::internal::y.

+ Here is the call graph for this function:

◆ TEST_F() [96/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
Word32RorWithZeroShift   
)

Definition at line 499 of file machine-operator-reducer-unittest.cc.

499  {
500  Node* value = Parameter(0);
501  Node* node =
502  graph()->NewNode(machine()->Word32Ror(), value, Int32Constant(0));
503  Reduction reduction = Reduce(node);
504  EXPECT_TRUE(reduction.Changed());
505  EXPECT_EQ(reduction.replacement(), value);
506 }

◆ TEST_F() [97/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
Word32ShlWithWord32Sar   
)

Definition at line 536 of file machine-operator-reducer-unittest.cc.

536  {
537  Node* p0 = Parameter(0);
538  TRACED_FORRANGE(int32_t, x, 1, 31) {
539  Node* node = graph()->NewNode(
540  machine()->Word32Shl(),
541  graph()->NewNode(machine()->Word32Sar(), p0, Int32Constant(x)),
542  Int32Constant(x));
543  Reduction r = Reduce(node);
544  ASSERT_TRUE(r.Changed());
545  int32_t m = bit_cast<int32_t>(~((1U << x) - 1U));
546  EXPECT_THAT(r.replacement(), IsWord32And(p0, IsInt32Constant(m)));
547  }
548 }

References IsInt32Constant(), IsWord32And(), and v8::internal::p0.

+ Here is the call graph for this function:

◆ TEST_F() [98/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
Word32ShlWithWord32Shr   
)

Definition at line 551 of file machine-operator-reducer-unittest.cc.

551  {
552  Node* p0 = Parameter(0);
553  TRACED_FORRANGE(int32_t, x, 1, 31) {
554  Node* node = graph()->NewNode(
555  machine()->Word32Shl(),
556  graph()->NewNode(machine()->Word32Shr(), p0, Int32Constant(x)),
557  Int32Constant(x));
558  Reduction r = Reduce(node);
559  ASSERT_TRUE(r.Changed());
560  int32_t m = bit_cast<int32_t>(~((1U << x) - 1U));
561  EXPECT_THAT(r.replacement(), IsWord32And(p0, IsInt32Constant(m)));
562  }
563 }

References IsInt32Constant(), IsWord32And(), and v8::internal::p0.

+ Here is the call graph for this function:

◆ TEST_F() [99/132]

v8::internal::compiler::TEST_F ( MachineOperatorReducerTest  ,
Word32ShlWithZeroShift   
)

Definition at line 527 of file machine-operator-reducer-unittest.cc.

527  {
528  Node* p0 = Parameter(0);
529  Node* node = graph()->NewNode(machine()->Word32Shl(), p0, Int32Constant(0));
530  Reduction r = Reduce(node);
531  ASSERT_TRUE(r.Changed());
532  EXPECT_EQ(p0, r.replacement());
533 }

References v8::internal::p0.

◆ TEST_F() [100/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
BooleanNotWithBooleanNot   
)

Definition at line 179 of file simplified-operator-reducer-unittest.cc.

179  {
180  Node* param0 = Parameter(0);
181  Reduction reduction = Reduce(
182  graph()->NewNode(simplified()->BooleanNot(),
183  graph()->NewNode(simplified()->BooleanNot(), param0)));
184  ASSERT_TRUE(reduction.Changed());
185  EXPECT_EQ(param0, reduction.replacement());
186 }

◆ TEST_F() [101/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
BooleanNotWithFalseConstant   
)

Definition at line 189 of file simplified-operator-reducer-unittest.cc.

189  {
190  Reduction reduction0 =
191  Reduce(graph()->NewNode(simplified()->BooleanNot(), FalseConstant()));
192  ASSERT_TRUE(reduction0.Changed());
193  EXPECT_THAT(reduction0.replacement(), IsTrueConstant());
194 }

◆ TEST_F() [102/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
BooleanNotWithTrueConstant   
)

Definition at line 197 of file simplified-operator-reducer-unittest.cc.

197  {
198  Reduction reduction1 =
199  Reduce(graph()->NewNode(simplified()->BooleanNot(), TrueConstant()));
200  ASSERT_TRUE(reduction1.Changed());
201  EXPECT_THAT(reduction1.replacement(), IsFalseConstant());
202 }

◆ TEST_F() [103/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeBitToBoolWithChangeBoolToBit   
)

Definition at line 209 of file simplified-operator-reducer-unittest.cc.

209  {
210  Node* param0 = Parameter(0);
211  Reduction reduction = Reduce(graph()->NewNode(
212  simplified()->ChangeBitToBool(),
213  graph()->NewNode(simplified()->ChangeBoolToBit(), param0)));
214  ASSERT_TRUE(reduction.Changed());
215  EXPECT_EQ(param0, reduction.replacement());
216 }

◆ TEST_F() [104/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeBitToBoolWithOneConstant   
)

Definition at line 227 of file simplified-operator-reducer-unittest.cc.

227  {
228  Reduction reduction = Reduce(
229  graph()->NewNode(simplified()->ChangeBitToBool(), Int32Constant(1)));
230  ASSERT_TRUE(reduction.Changed());
231  EXPECT_THAT(reduction.replacement(), IsTrueConstant());
232 }

◆ TEST_F() [105/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeBitToBoolWithZeroConstant   
)

Definition at line 219 of file simplified-operator-reducer-unittest.cc.

219  {
220  Reduction reduction = Reduce(
221  graph()->NewNode(simplified()->ChangeBitToBool(), Int32Constant(0)));
222  ASSERT_TRUE(reduction.Changed());
223  EXPECT_THAT(reduction.replacement(), IsFalseConstant());
224 }

◆ TEST_F() [106/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeBoolToBitWithChangeBitToBool   
)

Definition at line 255 of file simplified-operator-reducer-unittest.cc.

255  {
256  Node* param0 = Parameter(0);
257  Reduction reduction = Reduce(graph()->NewNode(
258  simplified()->ChangeBoolToBit(),
259  graph()->NewNode(simplified()->ChangeBitToBool(), param0)));
260  ASSERT_TRUE(reduction.Changed());
261  EXPECT_EQ(param0, reduction.replacement());
262 }

◆ TEST_F() [107/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeBoolToBitWithFalseConstant   
)

Definition at line 239 of file simplified-operator-reducer-unittest.cc.

239  {
240  Reduction reduction = Reduce(
241  graph()->NewNode(simplified()->ChangeBoolToBit(), FalseConstant()));
242  ASSERT_TRUE(reduction.Changed());
243  EXPECT_THAT(reduction.replacement(), IsInt32Constant(0));
244 }

References IsInt32Constant().

+ Here is the call graph for this function:

◆ TEST_F() [108/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeBoolToBitWithTrueConstant   
)

Definition at line 247 of file simplified-operator-reducer-unittest.cc.

247  {
248  Reduction reduction =
249  Reduce(graph()->NewNode(simplified()->ChangeBoolToBit(), TrueConstant()));
250  ASSERT_TRUE(reduction.Changed());
251  EXPECT_THAT(reduction.replacement(), IsInt32Constant(1));
252 }

References IsInt32Constant().

+ Here is the call graph for this function:

◆ TEST_F() [109/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeFloat64ToTaggedWithConstant   
)

Definition at line 269 of file simplified-operator-reducer-unittest.cc.

269  {
270  TRACED_FOREACH(double, n, kFloat64Values) {
271  Reduction reduction = Reduce(graph()->NewNode(
272  simplified()->ChangeFloat64ToTagged(), Float64Constant(n)));
273  ASSERT_TRUE(reduction.Changed());
274  EXPECT_THAT(reduction.replacement(), IsNumberConstant(n));
275  }
276 }

References IsNumberConstant(), and v8::internal::compiler::anonymous_namespace{simplified-operator-reducer-unittest.cc}::kFloat64Values.

+ Here is the call graph for this function:

◆ TEST_F() [110/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeInt32ToTaggedWithConstant   
)

Definition at line 283 of file simplified-operator-reducer-unittest.cc.

283  {
284  TRACED_FOREACH(int32_t, n, kInt32Values) {
285  Reduction reduction = Reduce(graph()->NewNode(
286  simplified()->ChangeInt32ToTagged(), Int32Constant(n)));
287  ASSERT_TRUE(reduction.Changed());
288  EXPECT_THAT(reduction.replacement(), IsNumberConstant(FastI2D(n)));
289  }
290 }

References v8::internal::FastI2D(), IsNumberConstant(), and v8::internal::compiler::anonymous_namespace{simplified-operator-reducer-unittest.cc}::kInt32Values.

+ Here is the call graph for this function:

◆ TEST_F() [111/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeTaggedToFloat64WithChangeFloat64ToTagged   
)

Definition at line 297 of file simplified-operator-reducer-unittest.cc.

298  {
299  Node* param0 = Parameter(0);
300  Reduction reduction = Reduce(graph()->NewNode(
301  simplified()->ChangeTaggedToFloat64(),
302  graph()->NewNode(simplified()->ChangeFloat64ToTagged(), param0)));
303  ASSERT_TRUE(reduction.Changed());
304  EXPECT_EQ(param0, reduction.replacement());
305 }

◆ TEST_F() [112/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeTaggedToFloat64WithChangeInt32ToTagged   
)

Definition at line 308 of file simplified-operator-reducer-unittest.cc.

309  {
310  Node* param0 = Parameter(0);
311  Reduction reduction = Reduce(graph()->NewNode(
312  simplified()->ChangeTaggedToFloat64(),
313  graph()->NewNode(simplified()->ChangeInt32ToTagged(), param0)));
314  ASSERT_TRUE(reduction.Changed());
315  EXPECT_THAT(reduction.replacement(), IsChangeInt32ToFloat64(param0));
316 }

References IsChangeInt32ToFloat64().

+ Here is the call graph for this function:

◆ TEST_F() [113/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeTaggedToFloat64WithChangeUint32ToTagged   
)

Definition at line 319 of file simplified-operator-reducer-unittest.cc.

320  {
321  Node* param0 = Parameter(0);
322  Reduction reduction = Reduce(graph()->NewNode(
323  simplified()->ChangeTaggedToFloat64(),
324  graph()->NewNode(simplified()->ChangeUint32ToTagged(), param0)));
325  ASSERT_TRUE(reduction.Changed());
326  EXPECT_THAT(reduction.replacement(), IsChangeUint32ToFloat64(param0));
327 }

References IsChangeUint32ToFloat64().

+ Here is the call graph for this function:

◆ TEST_F() [114/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeTaggedToFloat64WithConstant   
)

Definition at line 330 of file simplified-operator-reducer-unittest.cc.

330  {
331  TRACED_FOREACH(double, n, kFloat64Values) {
332  Reduction reduction = Reduce(graph()->NewNode(
333  simplified()->ChangeTaggedToFloat64(), NumberConstant(n)));
334  ASSERT_TRUE(reduction.Changed());
335  EXPECT_THAT(reduction.replacement(), IsFloat64Constant(n));
336  }
337 }

References IsFloat64Constant(), and v8::internal::compiler::anonymous_namespace{simplified-operator-reducer-unittest.cc}::kFloat64Values.

+ Here is the call graph for this function:

◆ TEST_F() [115/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeTaggedToFloat64WithNaNConstant1   
)

Definition at line 340 of file simplified-operator-reducer-unittest.cc.

340  {
341  Reduction reduction =
342  Reduce(graph()->NewNode(simplified()->ChangeTaggedToFloat64(),
343  NumberConstant(-base::OS::nan_value())));
344  ASSERT_TRUE(reduction.Changed());
345  EXPECT_THAT(reduction.replacement(), IsFloat64Constant(IsNaN()));
346 }

References IsFloat64Constant(), and v8::base::OS::nan_value().

+ Here is the call graph for this function:

◆ TEST_F() [116/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeTaggedToFloat64WithNaNConstant2   
)

Definition at line 349 of file simplified-operator-reducer-unittest.cc.

349  {
350  Reduction reduction =
351  Reduce(graph()->NewNode(simplified()->ChangeTaggedToFloat64(),
352  NumberConstant(base::OS::nan_value())));
353  ASSERT_TRUE(reduction.Changed());
354  EXPECT_THAT(reduction.replacement(), IsFloat64Constant(IsNaN()));
355 }

References IsFloat64Constant(), and v8::base::OS::nan_value().

+ Here is the call graph for this function:

◆ TEST_F() [117/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeTaggedToInt32WithChangeFloat64ToTagged   
)

Definition at line 362 of file simplified-operator-reducer-unittest.cc.

363  {
364  Node* param0 = Parameter(0);
365  Reduction reduction = Reduce(graph()->NewNode(
366  simplified()->ChangeTaggedToInt32(),
367  graph()->NewNode(simplified()->ChangeFloat64ToTagged(), param0)));
368  ASSERT_TRUE(reduction.Changed());
369  EXPECT_THAT(reduction.replacement(), IsChangeFloat64ToInt32(param0));
370 }

References IsChangeFloat64ToInt32().

+ Here is the call graph for this function:

◆ TEST_F() [118/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeTaggedToInt32WithChangeInt32ToTagged   
)

Definition at line 373 of file simplified-operator-reducer-unittest.cc.

374  {
375  Node* param0 = Parameter(0);
376  Reduction reduction = Reduce(graph()->NewNode(
377  simplified()->ChangeTaggedToInt32(),
378  graph()->NewNode(simplified()->ChangeInt32ToTagged(), param0)));
379  ASSERT_TRUE(reduction.Changed());
380  EXPECT_EQ(param0, reduction.replacement());
381 }

◆ TEST_F() [119/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeTaggedToInt32WithConstant   
)

Definition at line 384 of file simplified-operator-reducer-unittest.cc.

384  {
385  TRACED_FOREACH(double, n, kFloat64Values) {
386  Reduction reduction = Reduce(graph()->NewNode(
387  simplified()->ChangeTaggedToInt32(), NumberConstant(n)));
388  ASSERT_TRUE(reduction.Changed());
389  EXPECT_THAT(reduction.replacement(), IsInt32Constant(DoubleToInt32(n)));
390  }
391 }

References v8::internal::DoubleToInt32(), IsInt32Constant(), and v8::internal::compiler::anonymous_namespace{simplified-operator-reducer-unittest.cc}::kFloat64Values.

+ Here is the call graph for this function:

◆ TEST_F() [120/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeTaggedToInt32WithNaNConstant1   
)

Definition at line 394 of file simplified-operator-reducer-unittest.cc.

394  {
395  Reduction reduction =
396  Reduce(graph()->NewNode(simplified()->ChangeTaggedToInt32(),
397  NumberConstant(-base::OS::nan_value())));
398  ASSERT_TRUE(reduction.Changed());
399  EXPECT_THAT(reduction.replacement(), IsInt32Constant(0));
400 }

References IsInt32Constant(), and v8::base::OS::nan_value().

+ Here is the call graph for this function:

◆ TEST_F() [121/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeTaggedToInt32WithNaNConstant2   
)

Definition at line 403 of file simplified-operator-reducer-unittest.cc.

403  {
404  Reduction reduction =
405  Reduce(graph()->NewNode(simplified()->ChangeTaggedToInt32(),
406  NumberConstant(base::OS::nan_value())));
407  ASSERT_TRUE(reduction.Changed());
408  EXPECT_THAT(reduction.replacement(), IsInt32Constant(0));
409 }

References IsInt32Constant(), and v8::base::OS::nan_value().

+ Here is the call graph for this function:

◆ TEST_F() [122/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeTaggedToUint32WithChangeFloat64ToTagged   
)

Definition at line 416 of file simplified-operator-reducer-unittest.cc.

417  {
418  Node* param0 = Parameter(0);
419  Reduction reduction = Reduce(graph()->NewNode(
420  simplified()->ChangeTaggedToUint32(),
421  graph()->NewNode(simplified()->ChangeFloat64ToTagged(), param0)));
422  ASSERT_TRUE(reduction.Changed());
423  EXPECT_THAT(reduction.replacement(), IsChangeFloat64ToUint32(param0));
424 }

References IsChangeFloat64ToUint32().

+ Here is the call graph for this function:

◆ TEST_F() [123/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeTaggedToUint32WithChangeUint32ToTagged   
)

Definition at line 427 of file simplified-operator-reducer-unittest.cc.

428  {
429  Node* param0 = Parameter(0);
430  Reduction reduction = Reduce(graph()->NewNode(
431  simplified()->ChangeTaggedToUint32(),
432  graph()->NewNode(simplified()->ChangeUint32ToTagged(), param0)));
433  ASSERT_TRUE(reduction.Changed());
434  EXPECT_EQ(param0, reduction.replacement());
435 }

◆ TEST_F() [124/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeTaggedToUint32WithConstant   
)

Definition at line 438 of file simplified-operator-reducer-unittest.cc.

438  {
439  TRACED_FOREACH(double, n, kFloat64Values) {
440  Reduction reduction = Reduce(graph()->NewNode(
441  simplified()->ChangeTaggedToUint32(), NumberConstant(n)));
442  ASSERT_TRUE(reduction.Changed());
443  EXPECT_THAT(reduction.replacement(),
444  IsInt32Constant(bit_cast<int32_t>(DoubleToUint32(n))));
445  }
446 }
uint32_t DoubleToUint32(double x)
Definition: conversions.h:93

References v8::internal::DoubleToUint32(), IsInt32Constant(), and v8::internal::compiler::anonymous_namespace{simplified-operator-reducer-unittest.cc}::kFloat64Values.

+ Here is the call graph for this function:

◆ TEST_F() [125/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeTaggedToUint32WithNaNConstant1   
)

Definition at line 449 of file simplified-operator-reducer-unittest.cc.

449  {
450  Reduction reduction =
451  Reduce(graph()->NewNode(simplified()->ChangeTaggedToUint32(),
452  NumberConstant(-base::OS::nan_value())));
453  ASSERT_TRUE(reduction.Changed());
454  EXPECT_THAT(reduction.replacement(), IsInt32Constant(0));
455 }

References IsInt32Constant(), and v8::base::OS::nan_value().

+ Here is the call graph for this function:

◆ TEST_F() [126/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeTaggedToUint32WithNaNConstant2   
)

Definition at line 458 of file simplified-operator-reducer-unittest.cc.

458  {
459  Reduction reduction =
460  Reduce(graph()->NewNode(simplified()->ChangeTaggedToUint32(),
461  NumberConstant(base::OS::nan_value())));
462  ASSERT_TRUE(reduction.Changed());
463  EXPECT_THAT(reduction.replacement(), IsInt32Constant(0));
464 }

References IsInt32Constant(), and v8::base::OS::nan_value().

+ Here is the call graph for this function:

◆ TEST_F() [127/132]

v8::internal::compiler::TEST_F ( SimplifiedOperatorReducerTest  ,
ChangeUint32ToTagged   
)

Definition at line 471 of file simplified-operator-reducer-unittest.cc.

471  {
472  TRACED_FOREACH(uint32_t, n, kUint32Values) {
473  Reduction reduction =
474  Reduce(graph()->NewNode(simplified()->ChangeUint32ToTagged(),
475  Int32Constant(bit_cast<int32_t>(n))));
476  ASSERT_TRUE(reduction.Changed());
477  EXPECT_THAT(reduction.replacement(), IsNumberConstant(FastUI2D(n)));
478  }
479 }

References v8::internal::FastUI2D(), IsNumberConstant(), and v8::internal::compiler::anonymous_namespace{simplified-operator-reducer-unittest.cc}::kUint32Values.

+ Here is the call graph for this function:

◆ TEST_F() [128/132]

v8::internal::compiler::TEST_F ( ValueNumberingReducerTest  ,
AllInputsAreChecked   
)

Definition at line 38 of file value-numbering-reducer-unittest.cc.

38  {
39  Node* na = graph()->NewNode(&kOp0);
40  Node* nb = graph()->NewNode(&kOp0);
41  Node* n1 = graph()->NewNode(&kOp0, na);
42  Node* n2 = graph()->NewNode(&kOp0, nb);
43  EXPECT_FALSE(Reduce(n1).Changed());
44  EXPECT_FALSE(Reduce(n2).Changed());
45 }
const SimpleOperator kOp0(0, Operator::kNoProperties, 0, 1, "op0")

References v8::internal::compiler::anonymous_namespace{value-numbering-reducer-unittest.cc}::kOp0.

◆ TEST_F() [129/132]

v8::internal::compiler::TEST_F ( ValueNumberingReducerTest  ,
DeadNodesAreNeverReturned   
)

Definition at line 48 of file value-numbering-reducer-unittest.cc.

48  {
49  Node* n0 = graph()->NewNode(&kOp0);
50  Node* n1 = graph()->NewNode(&kOp1, n0);
51  EXPECT_FALSE(Reduce(n1).Changed());
52  n1->Kill();
53  EXPECT_FALSE(Reduce(graph()->NewNode(&kOp1, n0)).Changed());
54 }
const SimpleOperator kOp1(1, Operator::kNoProperties, 1, 1, "op1")

References v8::internal::compiler::anonymous_namespace{value-numbering-reducer-unittest.cc}::kOp0, and v8::internal::compiler::anonymous_namespace{value-numbering-reducer-unittest.cc}::kOp1.

◆ TEST_F() [130/132]

v8::internal::compiler::TEST_F ( ValueNumberingReducerTest  ,
OperatorEqualityNotIdentity   
)

Definition at line 57 of file value-numbering-reducer-unittest.cc.

57  {
58  static const size_t kMaxInputCount = 16;
59  Node* inputs[kMaxInputCount];
60  for (size_t i = 0; i < arraysize(inputs); ++i) {
61  Operator::Opcode opcode = static_cast<Operator::Opcode>(
62  std::numeric_limits<Operator::Opcode>::max() - i);
63  inputs[i] = graph()->NewNode(new (zone()) SimpleOperator(
64  opcode, Operator::kNoProperties, 0, 1, "Operator"));
65  }
66  TRACED_FORRANGE(size_t, input_count, 0, arraysize(inputs)) {
67  const SimpleOperator op1(static_cast<Operator::Opcode>(input_count),
68  Operator::kNoProperties,
69  static_cast<int>(input_count), 1, "op");
70  Node* n1 = graph()->NewNode(&op1, static_cast<int>(input_count), inputs);
71  Reduction r1 = Reduce(n1);
72  EXPECT_FALSE(r1.Changed());
73 
74  const SimpleOperator op2(static_cast<Operator::Opcode>(input_count),
75  Operator::kNoProperties,
76  static_cast<int>(input_count), 1, "op");
77  Node* n2 = graph()->NewNode(&op2, static_cast<int>(input_count), inputs);
78  Reduction r2 = Reduce(n2);
79  EXPECT_TRUE(r2.Changed());
80  EXPECT_EQ(n1, r2.replacement());
81  }
82 }

References arraysize, v8::internal::compiler::Operator::kNoProperties, v8::internal::r1, and v8::internal::r2.

◆ TEST_F() [131/132]

v8::internal::compiler::TEST_F ( ValueNumberingReducerTest  ,
SubsequentReductionsYieldTheSameNode   
)

Definition at line 85 of file value-numbering-reducer-unittest.cc.

85  {
86  static const size_t kMaxInputCount = 16;
87  Node* inputs[kMaxInputCount];
88  for (size_t i = 0; i < arraysize(inputs); ++i) {
89  Operator::Opcode opcode = static_cast<Operator::Opcode>(
90  std::numeric_limits<Operator::Opcode>::max() - i);
91  inputs[i] = graph()->NewNode(new (zone()) SimpleOperator(
92  opcode, Operator::kNoProperties, 0, 1, "Operator"));
93  }
94  TRACED_FORRANGE(size_t, input_count, 0, arraysize(inputs)) {
95  const SimpleOperator op1(1, Operator::kNoProperties,
96  static_cast<int>(input_count), 1, "op1");
97  Node* n = graph()->NewNode(&op1, static_cast<int>(input_count), inputs);
98  Reduction r = Reduce(n);
99  EXPECT_FALSE(r.Changed());
100 
101  r = Reduce(graph()->NewNode(&op1, static_cast<int>(input_count), inputs));
102  ASSERT_TRUE(r.Changed());
103  EXPECT_EQ(n, r.replacement());
104 
105  r = Reduce(graph()->NewNode(&op1, static_cast<int>(input_count), inputs));
106  ASSERT_TRUE(r.Changed());
107  EXPECT_EQ(n, r.replacement());
108  }
109 }

References arraysize, and v8::internal::compiler::Operator::kNoProperties.

◆ TEST_F() [132/132]

v8::internal::compiler::TEST_F ( ValueNumberingReducerTest  ,
WontReplaceNodeWithItself   
)

Definition at line 112 of file value-numbering-reducer-unittest.cc.

112  {
113  Node* n = graph()->NewNode(&kOp0);
114  EXPECT_FALSE(Reduce(n).Changed());
115  EXPECT_FALSE(Reduce(n).Changed());
116 }

References v8::internal::compiler::anonymous_namespace{value-numbering-reducer-unittest.cc}::kOp0.

◆ TEST_P() [1/76]

v8::internal::compiler::TEST_P ( CommonSharedOperatorTest  ,
InstancesAreGloballyShared   
)

Definition at line 67 of file common-operator-unittest.cc.

67  {
68  const SharedOperator& sop = GetParam();
69  CommonOperatorBuilder common1(zone());
70  CommonOperatorBuilder common2(zone());
71  EXPECT_EQ((common1.*sop.constructor)(), (common2.*sop.constructor)());
72 }

◆ TEST_P() [2/76]

v8::internal::compiler::TEST_P ( CommonSharedOperatorTest  ,
NumberOfInputsAndOutputs   
)

Definition at line 75 of file common-operator-unittest.cc.

75  {
76  CommonOperatorBuilder common(zone());
77  const SharedOperator& sop = GetParam();
78  const Operator* op = (common.*sop.constructor)();
79 
80  EXPECT_EQ(sop.value_input_count, OperatorProperties::GetValueInputCount(op));
81  EXPECT_EQ(sop.effect_input_count,
82  OperatorProperties::GetEffectInputCount(op));
83  EXPECT_EQ(sop.control_input_count,
84  OperatorProperties::GetControlInputCount(op));
85  EXPECT_EQ(
86  sop.value_input_count + sop.effect_input_count + sop.control_input_count,
87  OperatorProperties::GetTotalInputCount(op));
88 
89  EXPECT_EQ(0, OperatorProperties::GetValueOutputCount(op));
90  EXPECT_EQ(sop.effect_output_count,
91  OperatorProperties::GetEffectOutputCount(op));
92  EXPECT_EQ(sop.control_output_count,
93  OperatorProperties::GetControlOutputCount(op));
94 }

References v8::internal::compiler::OperatorProperties::GetControlInputCount(), v8::internal::compiler::OperatorProperties::GetControlOutputCount(), v8::internal::compiler::OperatorProperties::GetEffectInputCount(), v8::internal::compiler::OperatorProperties::GetEffectOutputCount(), v8::internal::compiler::OperatorProperties::GetTotalInputCount(), v8::internal::compiler::OperatorProperties::GetValueInputCount(), and v8::internal::compiler::OperatorProperties::GetValueOutputCount().

+ Here is the call graph for this function:

◆ TEST_P() [3/76]

v8::internal::compiler::TEST_P ( CommonSharedOperatorTest  ,
OpcodeIsCorrect   
)

Definition at line 97 of file common-operator-unittest.cc.

97  {
98  CommonOperatorBuilder common(zone());
99  const SharedOperator& sop = GetParam();
100  const Operator* op = (common.*sop.constructor)();
101  EXPECT_EQ(sop.opcode, op->opcode());
102 }

References v8::internal::compiler::Operator::opcode().

+ Here is the call graph for this function:

◆ TEST_P() [4/76]

v8::internal::compiler::TEST_P ( CommonSharedOperatorTest  ,
Properties   
)

Definition at line 105 of file common-operator-unittest.cc.

105  {
106  CommonOperatorBuilder common(zone());
107  const SharedOperator& sop = GetParam();
108  const Operator* op = (common.*sop.constructor)();
109  EXPECT_EQ(sop.properties, op->properties());
110 }

References v8::internal::compiler::Operator::properties().

+ Here is the call graph for this function:

◆ TEST_P() [5/76]

v8::internal::compiler::TEST_P ( InstructionSelectorAddSubTest  ,
ImmediateOnLeft   
)

Definition at line 327 of file instruction-selector-arm64-unittest.cc.

327  {
328  const MachInst2 dpi = GetParam();
329  const MachineType type = dpi.machine_type;
330 
331  TRACED_FOREACH(int32_t, imm, kAddSubImmediates) {
332  StreamBuilder m(this, type, type);
333  m.Return((m.*dpi.constructor)(BuildConstant(m, type, imm), m.Parameter(0)));
334  Stream s = m.Build();
335 
336  // Add can support an immediate on the left by commuting, but Sub can't
337  // commute. We test zero-on-left Sub later.
338  if (strstr(dpi.constructor_name, "Add") != NULL) {
339  ASSERT_EQ(1U, s.size());
340  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
341  ASSERT_EQ(2U, s[0]->InputCount());
342  EXPECT_TRUE(s[0]->InputAt(1)->IsImmediate());
343  EXPECT_EQ(imm, s.ToInt64(s[0]->InputAt(1)));
344  EXPECT_EQ(1U, s[0]->OutputCount());
345  }
346  }
347 }
Node * BuildConstant(InstructionSelectorTest::StreamBuilder &m, MachineType type, int64_t value)

References v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::BuildConstant(), v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::kAddSubImmediates, and NULL.

+ Here is the call graph for this function:

◆ TEST_P() [6/76]

v8::internal::compiler::TEST_P ( InstructionSelectorAddSubTest  ,
ImmediateOnRight   
)

Definition at line 310 of file instruction-selector-arm64-unittest.cc.

310  {
311  const MachInst2 dpi = GetParam();
312  const MachineType type = dpi.machine_type;
313  TRACED_FOREACH(int32_t, imm, kAddSubImmediates) {
314  StreamBuilder m(this, type, type);
315  m.Return((m.*dpi.constructor)(m.Parameter(0), BuildConstant(m, type, imm)));
316  Stream s = m.Build();
317  ASSERT_EQ(1U, s.size());
318  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
319  ASSERT_EQ(2U, s[0]->InputCount());
320  EXPECT_TRUE(s[0]->InputAt(1)->IsImmediate());
321  EXPECT_EQ(imm, s.ToInt64(s[0]->InputAt(1)));
322  EXPECT_EQ(1U, s[0]->OutputCount());
323  }
324 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::BuildConstant(), and v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::kAddSubImmediates.

+ Here is the call graph for this function:

◆ TEST_P() [7/76]

v8::internal::compiler::TEST_P ( InstructionSelectorComparisonTest  ,
WithImmediate   
)

Definition at line 1140 of file instruction-selector-arm64-unittest.cc.

1140  {
1141  const MachInst2 cmp = GetParam();
1142  const MachineType type = cmp.machine_type;
1143  TRACED_FOREACH(int32_t, imm, kAddSubImmediates) {
1144  // Compare with 0 are turned into tst instruction.
1145  if (imm == 0) continue;
1146  StreamBuilder m(this, type, type);
1147  m.Return((m.*cmp.constructor)(m.Parameter(0), BuildConstant(m, type, imm)));
1148  Stream s = m.Build();
1149  ASSERT_EQ(1U, s.size());
1150  EXPECT_EQ(cmp.arch_opcode, s[0]->arch_opcode());
1151  ASSERT_EQ(2U, s[0]->InputCount());
1152  ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
1153  EXPECT_EQ(imm, s.ToInt64(s[0]->InputAt(1)));
1154  EXPECT_EQ(1U, s[0]->OutputCount());
1155  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
1156  EXPECT_EQ(kEqual, s[0]->flags_condition());
1157  }
1158  TRACED_FOREACH(int32_t, imm, kAddSubImmediates) {
1159  // Compare with 0 are turned into tst instruction.
1160  if (imm == 0) continue;
1161  StreamBuilder m(this, type, type);
1162  m.Return((m.*cmp.constructor)(BuildConstant(m, type, imm), m.Parameter(0)));
1163  Stream s = m.Build();
1164  ASSERT_EQ(1U, s.size());
1165  EXPECT_EQ(cmp.arch_opcode, s[0]->arch_opcode());
1166  ASSERT_EQ(2U, s[0]->InputCount());
1167  ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
1168  EXPECT_EQ(imm, s.ToInt64(s[0]->InputAt(1)));
1169  EXPECT_EQ(1U, s[0]->OutputCount());
1170  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
1171  EXPECT_EQ(kEqual, s[0]->flags_condition());
1172  }
1173 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::BuildConstant(), v8::internal::compiler::InstructionOperand::IMMEDIATE, v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::kAddSubImmediates, kEqual, and kFlags_set.

+ Here is the call graph for this function:

◆ TEST_P() [8/76]

v8::internal::compiler::TEST_P ( InstructionSelectorComparisonTest  ,
WithParameters   
)

Definition at line 1125 of file instruction-selector-arm64-unittest.cc.

1125  {
1126  const MachInst2 cmp = GetParam();
1127  const MachineType type = cmp.machine_type;
1128  StreamBuilder m(this, type, type, type);
1129  m.Return((m.*cmp.constructor)(m.Parameter(0), m.Parameter(1)));
1130  Stream s = m.Build();
1131  ASSERT_EQ(1U, s.size());
1132  EXPECT_EQ(cmp.arch_opcode, s[0]->arch_opcode());
1133  EXPECT_EQ(2U, s[0]->InputCount());
1134  EXPECT_EQ(1U, s[0]->OutputCount());
1135  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
1136  EXPECT_EQ(kEqual, s[0]->flags_condition());
1137 }

References kEqual, and kFlags_set.

◆ TEST_P() [9/76]

v8::internal::compiler::TEST_P ( InstructionSelectorConversionTest  ,
Parameter   
)

Definition at line 967 of file instruction-selector-arm64-unittest.cc.

967  {
968  const Conversion conv = GetParam();
969  StreamBuilder m(this, conv.mi.machine_type, conv.src_machine_type);
970  m.Return((m.*conv.mi.constructor)(m.Parameter(0)));
971  Stream s = m.Build();
972  ASSERT_EQ(1U, s.size());
973  EXPECT_EQ(conv.mi.arch_opcode, s[0]->arch_opcode());
974  EXPECT_EQ(1U, s[0]->InputCount());
975  EXPECT_EQ(1U, s[0]->OutputCount());
976 }

◆ TEST_P() [10/76]

v8::internal::compiler::TEST_P ( InstructionSelectorDPFlagSetTest  ,
BranchWithParameters   
)

Definition at line 389 of file instruction-selector-arm64-unittest.cc.

389  {
390  const MachInst2 dpi = GetParam();
391  const MachineType type = dpi.machine_type;
392  StreamBuilder m(this, type, type, type);
393  MLabel a, b;
394  m.Branch((m.*dpi.constructor)(m.Parameter(0), m.Parameter(1)), &a, &b);
395  m.Bind(&a);
396  m.Return(m.Int32Constant(1));
397  m.Bind(&b);
398  m.Return(m.Int32Constant(0));
399  Stream s = m.Build();
400  ASSERT_EQ(1U, s.size());
401  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
402  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
403  EXPECT_EQ(kNotEqual, s[0]->flags_condition());
404 }

References kFlags_branch, and kNotEqual.

◆ TEST_P() [11/76]

v8::internal::compiler::TEST_P ( InstructionSelectorDPITest  ,
BranchIfNotZeroWithImmediate   
)

Definition at line 455 of file instruction-selector-arm-unittest.cc.

455  {
456  const DPI dpi = GetParam();
457  TRACED_FOREACH(int32_t, imm, kImmediates) {
458  StreamBuilder m(this, kMachInt32, kMachInt32);
459  MLabel a, b;
460  m.Branch(m.Word32NotEqual(
461  (m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm)),
462  m.Int32Constant(0)),
463  &a, &b);
464  m.Bind(&a);
465  m.Return(m.Int32Constant(1));
466  m.Bind(&b);
467  m.Return(m.Int32Constant(0));
468  Stream s = m.Build();
469  ASSERT_EQ(1U, s.size());
470  EXPECT_EQ(dpi.test_arch_opcode, s[0]->arch_opcode());
471  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
472  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
473  EXPECT_EQ(kNotEqual, s[0]->flags_condition());
474  }
475  TRACED_FOREACH(int32_t, imm, kImmediates) {
476  StreamBuilder m(this, kMachInt32, kMachInt32);
477  MLabel a, b;
478  m.Branch(m.Word32NotEqual(
479  (m.*dpi.constructor)(m.Int32Constant(imm), m.Parameter(0)),
480  m.Int32Constant(0)),
481  &a, &b);
482  m.Bind(&a);
483  m.Return(m.Int32Constant(1));
484  m.Bind(&b);
485  m.Return(m.Int32Constant(0));
486  Stream s = m.Build();
487  ASSERT_EQ(1U, s.size());
488  EXPECT_EQ(dpi.test_arch_opcode, s[0]->arch_opcode());
489  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
490  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
491  EXPECT_EQ(kNotEqual, s[0]->flags_condition());
492  }
493 }

References kFlags_branch, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kImmediates, kMachInt32, and kNotEqual.

◆ TEST_P() [12/76]

v8::internal::compiler::TEST_P ( InstructionSelectorDPITest  ,
BranchIfNotZeroWithParameters   
)

Definition at line 393 of file instruction-selector-arm-unittest.cc.

393  {
394  const DPI dpi = GetParam();
395  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
396  MLabel a, b;
397  m.Branch(
398  m.Word32NotEqual((m.*dpi.constructor)(m.Parameter(0), m.Parameter(1)),
399  m.Int32Constant(0)),
400  &a, &b);
401  m.Bind(&a);
402  m.Return(m.Int32Constant(1));
403  m.Bind(&b);
404  m.Return(m.Int32Constant(0));
405  Stream s = m.Build();
406  ASSERT_EQ(1U, s.size());
407  EXPECT_EQ(dpi.test_arch_opcode, s[0]->arch_opcode());
408  EXPECT_EQ(kMode_Operand2_R, s[0]->addressing_mode());
409  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
410  EXPECT_EQ(kNotEqual, s[0]->flags_condition());
411 }

References kFlags_branch, kMachInt32, and kNotEqual.

◆ TEST_P() [13/76]

v8::internal::compiler::TEST_P ( InstructionSelectorDPITest  ,
BranchIfZeroWithImmediate   
)

Definition at line 414 of file instruction-selector-arm-unittest.cc.

414  {
415  const DPI dpi = GetParam();
416  TRACED_FOREACH(int32_t, imm, kImmediates) {
417  StreamBuilder m(this, kMachInt32, kMachInt32);
418  MLabel a, b;
419  m.Branch(m.Word32Equal(
420  (m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm)),
421  m.Int32Constant(0)),
422  &a, &b);
423  m.Bind(&a);
424  m.Return(m.Int32Constant(1));
425  m.Bind(&b);
426  m.Return(m.Int32Constant(0));
427  Stream s = m.Build();
428  ASSERT_EQ(1U, s.size());
429  EXPECT_EQ(dpi.test_arch_opcode, s[0]->arch_opcode());
430  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
431  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
432  EXPECT_EQ(kEqual, s[0]->flags_condition());
433  }
434  TRACED_FOREACH(int32_t, imm, kImmediates) {
435  StreamBuilder m(this, kMachInt32, kMachInt32);
436  MLabel a, b;
437  m.Branch(m.Word32Equal(
438  (m.*dpi.constructor)(m.Int32Constant(imm), m.Parameter(0)),
439  m.Int32Constant(0)),
440  &a, &b);
441  m.Bind(&a);
442  m.Return(m.Int32Constant(1));
443  m.Bind(&b);
444  m.Return(m.Int32Constant(0));
445  Stream s = m.Build();
446  ASSERT_EQ(1U, s.size());
447  EXPECT_EQ(dpi.test_arch_opcode, s[0]->arch_opcode());
448  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
449  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
450  EXPECT_EQ(kEqual, s[0]->flags_condition());
451  }
452 }

References kEqual, kFlags_branch, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kImmediates, and kMachInt32.

◆ TEST_P() [14/76]

v8::internal::compiler::TEST_P ( InstructionSelectorDPITest  ,
BranchIfZeroWithParameters   
)

Definition at line 373 of file instruction-selector-arm-unittest.cc.

373  {
374  const DPI dpi = GetParam();
375  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
376  MLabel a, b;
377  m.Branch(m.Word32Equal((m.*dpi.constructor)(m.Parameter(0), m.Parameter(1)),
378  m.Int32Constant(0)),
379  &a, &b);
380  m.Bind(&a);
381  m.Return(m.Int32Constant(1));
382  m.Bind(&b);
383  m.Return(m.Int32Constant(0));
384  Stream s = m.Build();
385  ASSERT_EQ(1U, s.size());
386  EXPECT_EQ(dpi.test_arch_opcode, s[0]->arch_opcode());
387  EXPECT_EQ(kMode_Operand2_R, s[0]->addressing_mode());
388  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
389  EXPECT_EQ(kEqual, s[0]->flags_condition());
390 }

References kEqual, kFlags_branch, and kMachInt32.

◆ TEST_P() [15/76]

v8::internal::compiler::TEST_P ( InstructionSelectorDPITest  ,
BranchWithImmediate   
)

Definition at line 246 of file instruction-selector-arm-unittest.cc.

246  {
247  const DPI dpi = GetParam();
248  TRACED_FOREACH(int32_t, imm, kImmediates) {
249  StreamBuilder m(this, kMachInt32, kMachInt32);
250  MLabel a, b;
251  m.Branch((m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm)), &a,
252  &b);
253  m.Bind(&a);
254  m.Return(m.Int32Constant(1));
255  m.Bind(&b);
256  m.Return(m.Int32Constant(0));
257  Stream s = m.Build();
258  ASSERT_EQ(1U, s.size());
259  EXPECT_EQ(dpi.test_arch_opcode, s[0]->arch_opcode());
260  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
261  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
262  EXPECT_EQ(kNotEqual, s[0]->flags_condition());
263  }
264  TRACED_FOREACH(int32_t, imm, kImmediates) {
265  StreamBuilder m(this, kMachInt32, kMachInt32);
266  MLabel a, b;
267  m.Branch((m.*dpi.constructor)(m.Int32Constant(imm), m.Parameter(0)), &a,
268  &b);
269  m.Bind(&a);
270  m.Return(m.Int32Constant(1));
271  m.Bind(&b);
272  m.Return(m.Int32Constant(0));
273  Stream s = m.Build();
274  ASSERT_EQ(1U, s.size());
275  EXPECT_EQ(dpi.test_arch_opcode, s[0]->arch_opcode());
276  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
277  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
278  EXPECT_EQ(kNotEqual, s[0]->flags_condition());
279  }
280 }

References kFlags_branch, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kImmediates, kMachInt32, and kNotEqual.

◆ TEST_P() [16/76]

v8::internal::compiler::TEST_P ( InstructionSelectorDPITest  ,
BranchWithParameters   
)

Definition at line 228 of file instruction-selector-arm-unittest.cc.

228  {
229  const DPI dpi = GetParam();
230  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
231  MLabel a, b;
232  m.Branch((m.*dpi.constructor)(m.Parameter(0), m.Parameter(1)), &a, &b);
233  m.Bind(&a);
234  m.Return(m.Int32Constant(1));
235  m.Bind(&b);
236  m.Return(m.Int32Constant(0));
237  Stream s = m.Build();
238  ASSERT_EQ(1U, s.size());
239  EXPECT_EQ(dpi.test_arch_opcode, s[0]->arch_opcode());
240  EXPECT_EQ(kMode_Operand2_R, s[0]->addressing_mode());
241  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
242  EXPECT_EQ(kNotEqual, s[0]->flags_condition());
243 }

References kFlags_branch, kMachInt32, and kNotEqual.

◆ TEST_P() [17/76]

v8::internal::compiler::TEST_P ( InstructionSelectorDPITest  ,
BranchWithShiftByImmediate   
)

Definition at line 324 of file instruction-selector-arm-unittest.cc.

324  {
325  const DPI dpi = GetParam();
326  TRACED_FOREACH(Shift, shift, kShifts) {
327  TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
328  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
329  MLabel a, b;
330  m.Branch((m.*dpi.constructor)(m.Parameter(0),
331  (m.*shift.constructor)(
332  m.Parameter(1), m.Int32Constant(imm))),
333  &a, &b);
334  m.Bind(&a);
335  m.Return(m.Int32Constant(1));
336  m.Bind(&b);
337  m.Return(m.Int32Constant(0));
338  Stream s = m.Build();
339  ASSERT_EQ(1U, s.size());
340  EXPECT_EQ(dpi.test_arch_opcode, s[0]->arch_opcode());
341  EXPECT_EQ(shift.i_mode, s[0]->addressing_mode());
342  ASSERT_EQ(5U, s[0]->InputCount());
343  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(2)));
344  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
345  EXPECT_EQ(kNotEqual, s[0]->flags_condition());
346  }
347  }
348  TRACED_FOREACH(Shift, shift, kShifts) {
349  TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
350  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
351  MLabel a, b;
352  m.Branch((m.*dpi.constructor)(
353  (m.*shift.constructor)(m.Parameter(0), m.Int32Constant(imm)),
354  m.Parameter(1)),
355  &a, &b);
356  m.Bind(&a);
357  m.Return(m.Int32Constant(1));
358  m.Bind(&b);
359  m.Return(m.Int32Constant(0));
360  Stream s = m.Build();
361  ASSERT_EQ(1U, s.size());
362  EXPECT_EQ(dpi.test_arch_opcode, s[0]->arch_opcode());
363  EXPECT_EQ(shift.i_mode, s[0]->addressing_mode());
364  ASSERT_EQ(5U, s[0]->InputCount());
365  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(2)));
366  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
367  EXPECT_EQ(kNotEqual, s[0]->flags_condition());
368  }
369  }
370 }

References kFlags_branch, kMachInt32, kNotEqual, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kShifts, and shift.

◆ TEST_P() [18/76]

v8::internal::compiler::TEST_P ( InstructionSelectorDPITest  ,
BranchWithShiftByParameter   
)

Definition at line 283 of file instruction-selector-arm-unittest.cc.

283  {
284  const DPI dpi = GetParam();
285  TRACED_FOREACH(Shift, shift, kShifts) {
286  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
287  MLabel a, b;
288  m.Branch((m.*dpi.constructor)(
289  m.Parameter(0),
290  (m.*shift.constructor)(m.Parameter(1), m.Parameter(2))),
291  &a, &b);
292  m.Bind(&a);
293  m.Return(m.Int32Constant(1));
294  m.Bind(&b);
295  m.Return(m.Int32Constant(0));
296  Stream s = m.Build();
297  ASSERT_EQ(1U, s.size());
298  EXPECT_EQ(dpi.test_arch_opcode, s[0]->arch_opcode());
299  EXPECT_EQ(shift.r_mode, s[0]->addressing_mode());
300  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
301  EXPECT_EQ(kNotEqual, s[0]->flags_condition());
302  }
303  TRACED_FOREACH(Shift, shift, kShifts) {
304  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
305  MLabel a, b;
306  m.Branch((m.*dpi.constructor)(
307  (m.*shift.constructor)(m.Parameter(0), m.Parameter(1)),
308  m.Parameter(2)),
309  &a, &b);
310  m.Bind(&a);
311  m.Return(m.Int32Constant(1));
312  m.Bind(&b);
313  m.Return(m.Int32Constant(0));
314  Stream s = m.Build();
315  ASSERT_EQ(1U, s.size());
316  EXPECT_EQ(dpi.test_arch_opcode, s[0]->arch_opcode());
317  EXPECT_EQ(shift.r_mode, s[0]->addressing_mode());
318  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
319  EXPECT_EQ(kNotEqual, s[0]->flags_condition());
320  }
321 }

References kFlags_branch, kMachInt32, kNotEqual, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kShifts, and shift.

◆ TEST_P() [19/76]

v8::internal::compiler::TEST_P ( InstructionSelectorDPITest  ,
Immediate   
)

Definition at line 137 of file instruction-selector-arm-unittest.cc.

137  {
138  const DPI dpi = GetParam();
139  TRACED_FOREACH(int32_t, imm, kImmediates) {
140  StreamBuilder m(this, kMachInt32, kMachInt32);
141  m.Return((m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm)));
142  Stream s = m.Build();
143  ASSERT_EQ(1U, s.size());
144  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
145  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
146  ASSERT_EQ(2U, s[0]->InputCount());
147  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
148  EXPECT_EQ(1U, s[0]->OutputCount());
149  }
150  TRACED_FOREACH(int32_t, imm, kImmediates) {
151  StreamBuilder m(this, kMachInt32, kMachInt32);
152  m.Return((m.*dpi.constructor)(m.Int32Constant(imm), m.Parameter(0)));
153  Stream s = m.Build();
154  ASSERT_EQ(1U, s.size());
155  EXPECT_EQ(dpi.reverse_arch_opcode, s[0]->arch_opcode());
156  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
157  ASSERT_EQ(2U, s[0]->InputCount());
158  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
159  EXPECT_EQ(1U, s[0]->OutputCount());
160  }
161 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kImmediates, and kMachInt32.

◆ TEST_P() [20/76]

v8::internal::compiler::TEST_P ( InstructionSelectorDPITest  ,
Parameters   
)

Definition at line 124 of file instruction-selector-arm-unittest.cc.

124  {
125  const DPI dpi = GetParam();
126  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
127  m.Return((m.*dpi.constructor)(m.Parameter(0), m.Parameter(1)));
128  Stream s = m.Build();
129  ASSERT_EQ(1U, s.size());
130  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
131  EXPECT_EQ(kMode_Operand2_R, s[0]->addressing_mode());
132  EXPECT_EQ(2U, s[0]->InputCount());
133  EXPECT_EQ(1U, s[0]->OutputCount());
134 }

References kMachInt32.

◆ TEST_P() [21/76]

v8::internal::compiler::TEST_P ( InstructionSelectorDPITest  ,
ShiftByImmediate   
)

Definition at line 193 of file instruction-selector-arm-unittest.cc.

193  {
194  const DPI dpi = GetParam();
195  TRACED_FOREACH(Shift, shift, kShifts) {
196  TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
197  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
198  m.Return((m.*dpi.constructor)(
199  m.Parameter(0),
200  (m.*shift.constructor)(m.Parameter(1), m.Int32Constant(imm))));
201  Stream s = m.Build();
202  ASSERT_EQ(1U, s.size());
203  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
204  EXPECT_EQ(shift.i_mode, s[0]->addressing_mode());
205  ASSERT_EQ(3U, s[0]->InputCount());
206  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(2)));
207  EXPECT_EQ(1U, s[0]->OutputCount());
208  }
209  }
210  TRACED_FOREACH(Shift, shift, kShifts) {
211  TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
212  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
213  m.Return((m.*dpi.constructor)(
214  (m.*shift.constructor)(m.Parameter(0), m.Int32Constant(imm)),
215  m.Parameter(1)));
216  Stream s = m.Build();
217  ASSERT_EQ(1U, s.size());
218  EXPECT_EQ(dpi.reverse_arch_opcode, s[0]->arch_opcode());
219  EXPECT_EQ(shift.i_mode, s[0]->addressing_mode());
220  ASSERT_EQ(3U, s[0]->InputCount());
221  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(2)));
222  EXPECT_EQ(1U, s[0]->OutputCount());
223  }
224  }
225 }

References kMachInt32, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kShifts, and shift.

◆ TEST_P() [22/76]

v8::internal::compiler::TEST_P ( InstructionSelectorDPITest  ,
ShiftByParameter   
)

Definition at line 164 of file instruction-selector-arm-unittest.cc.

164  {
165  const DPI dpi = GetParam();
166  TRACED_FOREACH(Shift, shift, kShifts) {
167  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
168  m.Return((m.*dpi.constructor)(
169  m.Parameter(0),
170  (m.*shift.constructor)(m.Parameter(1), m.Parameter(2))));
171  Stream s = m.Build();
172  ASSERT_EQ(1U, s.size());
173  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
174  EXPECT_EQ(shift.r_mode, s[0]->addressing_mode());
175  EXPECT_EQ(3U, s[0]->InputCount());
176  EXPECT_EQ(1U, s[0]->OutputCount());
177  }
178  TRACED_FOREACH(Shift, shift, kShifts) {
179  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
180  m.Return((m.*dpi.constructor)(
181  (m.*shift.constructor)(m.Parameter(0), m.Parameter(1)),
182  m.Parameter(2)));
183  Stream s = m.Build();
184  ASSERT_EQ(1U, s.size());
185  EXPECT_EQ(dpi.reverse_arch_opcode, s[0]->arch_opcode());
186  EXPECT_EQ(shift.r_mode, s[0]->addressing_mode());
187  EXPECT_EQ(3U, s[0]->InputCount());
188  EXPECT_EQ(1U, s[0]->OutputCount());
189  }
190 }

References kMachInt32, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kShifts, and shift.

◆ TEST_P() [23/76]

v8::internal::compiler::TEST_P ( InstructionSelectorFPCmpTest  ,
Parameter   
)

Definition at line 942 of file instruction-selector-arm64-unittest.cc.

942  {
943  const FPCmp cmp = GetParam();
944  StreamBuilder m(this, kMachInt32, cmp.mi.machine_type, cmp.mi.machine_type);
945  m.Return((m.*cmp.mi.constructor)(m.Parameter(0), m.Parameter(1)));
946  Stream s = m.Build();
947  ASSERT_EQ(1U, s.size());
948  EXPECT_EQ(cmp.mi.arch_opcode, s[0]->arch_opcode());
949  EXPECT_EQ(2U, s[0]->InputCount());
950  EXPECT_EQ(1U, s[0]->OutputCount());
951  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
952  EXPECT_EQ(cmp.cond, s[0]->flags_condition());
953 }

References kFlags_set, and kMachInt32.

◆ TEST_P() [24/76]

v8::internal::compiler::TEST_P ( InstructionSelectorIntDPWithIntMulTest  ,
AddWithMul   
)

Definition at line 841 of file instruction-selector-arm64-unittest.cc.

841  {
842  const MulDPInst mdpi = GetParam();
843  const MachineType type = mdpi.machine_type;
844  {
845  StreamBuilder m(this, type, type, type, type);
846  Node* n = (m.*mdpi.mul_constructor)(m.Parameter(1), m.Parameter(2));
847  m.Return((m.*mdpi.add_constructor)(m.Parameter(0), n));
848  Stream s = m.Build();
849  ASSERT_EQ(1U, s.size());
850  EXPECT_EQ(mdpi.add_arch_opcode, s[0]->arch_opcode());
851  EXPECT_EQ(3U, s[0]->InputCount());
852  EXPECT_EQ(1U, s[0]->OutputCount());
853  }
854  {
855  StreamBuilder m(this, type, type, type, type);
856  Node* n = (m.*mdpi.mul_constructor)(m.Parameter(0), m.Parameter(1));
857  m.Return((m.*mdpi.add_constructor)(n, m.Parameter(2)));
858  Stream s = m.Build();
859  ASSERT_EQ(1U, s.size());
860  EXPECT_EQ(mdpi.add_arch_opcode, s[0]->arch_opcode());
861  EXPECT_EQ(3U, s[0]->InputCount());
862  EXPECT_EQ(1U, s[0]->OutputCount());
863  }
864 }

◆ TEST_P() [25/76]

v8::internal::compiler::TEST_P ( InstructionSelectorIntDPWithIntMulTest  ,
NegativeMul   
)

Definition at line 883 of file instruction-selector-arm64-unittest.cc.

883  {
884  const MulDPInst mdpi = GetParam();
885  const MachineType type = mdpi.machine_type;
886  {
887  StreamBuilder m(this, type, type, type);
888  Node* n =
889  (m.*mdpi.sub_constructor)(BuildConstant(m, type, 0), m.Parameter(0));
890  m.Return((m.*mdpi.mul_constructor)(n, m.Parameter(1)));
891  Stream s = m.Build();
892  ASSERT_EQ(1U, s.size());
893  EXPECT_EQ(mdpi.neg_arch_opcode, s[0]->arch_opcode());
894  EXPECT_EQ(2U, s[0]->InputCount());
895  EXPECT_EQ(1U, s[0]->OutputCount());
896  }
897  {
898  StreamBuilder m(this, type, type, type);
899  Node* n =
900  (m.*mdpi.sub_constructor)(BuildConstant(m, type, 0), m.Parameter(1));
901  m.Return((m.*mdpi.mul_constructor)(m.Parameter(0), n));
902  Stream s = m.Build();
903  ASSERT_EQ(1U, s.size());
904  EXPECT_EQ(mdpi.neg_arch_opcode, s[0]->arch_opcode());
905  EXPECT_EQ(2U, s[0]->InputCount());
906  EXPECT_EQ(1U, s[0]->OutputCount());
907  }
908 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::BuildConstant().

+ Here is the call graph for this function:

◆ TEST_P() [26/76]

v8::internal::compiler::TEST_P ( InstructionSelectorIntDPWithIntMulTest  ,
SubWithMul   
)

Definition at line 867 of file instruction-selector-arm64-unittest.cc.

867  {
868  const MulDPInst mdpi = GetParam();
869  const MachineType type = mdpi.machine_type;
870  {
871  StreamBuilder m(this, type, type, type, type);
872  Node* n = (m.*mdpi.mul_constructor)(m.Parameter(1), m.Parameter(2));
873  m.Return((m.*mdpi.sub_constructor)(m.Parameter(0), n));
874  Stream s = m.Build();
875  ASSERT_EQ(1U, s.size());
876  EXPECT_EQ(mdpi.sub_arch_opcode, s[0]->arch_opcode());
877  EXPECT_EQ(3U, s[0]->InputCount());
878  EXPECT_EQ(1U, s[0]->OutputCount());
879  }
880 }

◆ TEST_P() [27/76]

v8::internal::compiler::TEST_P ( InstructionSelectorLogicalTest  ,
Immediate   
)

Definition at line 252 of file instruction-selector-arm64-unittest.cc.

252  {
253  const MachInst2 dpi = GetParam();
254  const MachineType type = dpi.machine_type;
255  // TODO(all): Add support for testing 64-bit immediates.
256  if (type == kMachInt32) {
257  // Immediate on the right.
258  TRACED_FOREACH(int32_t, imm, kLogicalImmediates) {
259  StreamBuilder m(this, type, type);
260  m.Return((m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm)));
261  Stream s = m.Build();
262  ASSERT_EQ(1U, s.size());
263  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
264  ASSERT_EQ(2U, s[0]->InputCount());
265  EXPECT_TRUE(s[0]->InputAt(1)->IsImmediate());
266  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
267  EXPECT_EQ(1U, s[0]->OutputCount());
268  }
269 
270  // Immediate on the left; all logical ops should commute.
271  TRACED_FOREACH(int32_t, imm, kLogicalImmediates) {
272  StreamBuilder m(this, type, type);
273  m.Return((m.*dpi.constructor)(m.Int32Constant(imm), m.Parameter(0)));
274  Stream s = m.Build();
275  ASSERT_EQ(1U, s.size());
276  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
277  ASSERT_EQ(2U, s[0]->InputCount());
278  EXPECT_TRUE(s[0]->InputAt(1)->IsImmediate());
279  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
280  EXPECT_EQ(1U, s[0]->OutputCount());
281  }
282  }
283 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::kLogicalImmediates, and kMachInt32.

◆ TEST_P() [28/76]

v8::internal::compiler::TEST_P ( InstructionSelectorLogicalTest  ,
Parameter   
)

Definition at line 239 of file instruction-selector-arm64-unittest.cc.

239  {
240  const MachInst2 dpi = GetParam();
241  const MachineType type = dpi.machine_type;
242  StreamBuilder m(this, type, type, type);
243  m.Return((m.*dpi.constructor)(m.Parameter(0), m.Parameter(1)));
244  Stream s = m.Build();
245  ASSERT_EQ(1U, s.size());
246  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
247  EXPECT_EQ(2U, s[0]->InputCount());
248  EXPECT_EQ(1U, s[0]->OutputCount());
249 }

◆ TEST_P() [29/76]

v8::internal::compiler::TEST_P ( InstructionSelectorMemoryAccessTest  ,
LoadWithImmediateBase   
)

Definition at line 184 of file instruction-selector-ia32-unittest.cc.

184  {
185  const MemoryAccess memacc = GetParam();
186  TRACED_FOREACH(int32_t, base, kImmediates) {
187  StreamBuilder m(this, memacc.type, kMachPtr);
188  m.Return(m.Load(memacc.type, m.Int32Constant(base), m.Parameter(0)));
189  Stream s = m.Build();
190  ASSERT_EQ(1U, s.size());
191  EXPECT_EQ(memacc.load_opcode, s[0]->arch_opcode());
192  if (base == 0) {
193  ASSERT_EQ(1U, s[0]->InputCount());
194  } else {
195  ASSERT_EQ(2U, s[0]->InputCount());
196  ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
197  EXPECT_EQ(base, s.ToInt32(s[0]->InputAt(1)));
198  }
199  EXPECT_EQ(1U, s[0]->OutputCount());
200  }
201 }

References v8::internal::compiler::InstructionOperand::IMMEDIATE, v8::internal::compiler::anonymous_namespace{instruction-selector-ia32-unittest.cc}::kImmediates, and kMachPtr.

◆ TEST_P() [30/76]

v8::internal::compiler::TEST_P ( InstructionSelectorMemoryAccessTest  ,
LoadWithImmediateIndex   
)

Definition at line 1285 of file instruction-selector-arm-unittest.cc.

1285  {
1286  const MemoryAccess memacc = GetParam();
1287  TRACED_FOREACH(int32_t, index, memacc.immediates) {
1288  StreamBuilder m(this, memacc.type, kMachPtr);
1289  m.Return(m.Load(memacc.type, m.Parameter(0), m.Int32Constant(index)));
1290  Stream s = m.Build();
1291  ASSERT_EQ(1U, s.size());
1292  EXPECT_EQ(memacc.ldr_opcode, s[0]->arch_opcode());
1293  EXPECT_EQ(kMode_Offset_RI, s[0]->addressing_mode());
1294  ASSERT_EQ(2U, s[0]->InputCount());
1295  ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
1296  EXPECT_EQ(index, s.ToInt32(s[0]->InputAt(1)));
1297  ASSERT_EQ(1U, s[0]->OutputCount());
1298  EXPECT_TRUE((s.*memacc.val_predicate)(s[0]->Output()));
1299  }
1300 }

References v8::internal::compiler::InstructionOperand::IMMEDIATE, and kMachPtr.

◆ TEST_P() [31/76]

v8::internal::compiler::TEST_P ( InstructionSelectorMemoryAccessTest  ,
LoadWithParameters   
)

Definition at line 1271 of file instruction-selector-arm-unittest.cc.

1271  {
1272  const MemoryAccess memacc = GetParam();
1273  StreamBuilder m(this, memacc.type, kMachPtr, kMachInt32);
1274  m.Return(m.Load(memacc.type, m.Parameter(0), m.Parameter(1)));
1275  Stream s = m.Build();
1276  ASSERT_EQ(1U, s.size());
1277  EXPECT_EQ(memacc.ldr_opcode, s[0]->arch_opcode());
1278  EXPECT_EQ(kMode_Offset_RR, s[0]->addressing_mode());
1279  EXPECT_EQ(2U, s[0]->InputCount());
1280  ASSERT_EQ(1U, s[0]->OutputCount());
1281  EXPECT_TRUE((s.*memacc.val_predicate)(s[0]->Output()));
1282 }

References kMachInt32, and kMachPtr.

◆ TEST_P() [32/76]

v8::internal::compiler::TEST_P ( InstructionSelectorMemoryAccessTest  ,
StoreWithImmediateBase   
)

Definition at line 237 of file instruction-selector-ia32-unittest.cc.

237  {
238  const MemoryAccess memacc = GetParam();
239  TRACED_FOREACH(int32_t, base, kImmediates) {
240  StreamBuilder m(this, kMachInt32, kMachInt32, memacc.type);
241  m.Store(memacc.type, m.Int32Constant(base), m.Parameter(0), m.Parameter(1));
242  m.Return(m.Int32Constant(0));
243  Stream s = m.Build();
244  ASSERT_EQ(1U, s.size());
245  EXPECT_EQ(memacc.store_opcode, s[0]->arch_opcode());
246  if (base == 0) {
247  ASSERT_EQ(2U, s[0]->InputCount());
248  } else {
249  ASSERT_EQ(3U, s[0]->InputCount());
250  ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
251  EXPECT_EQ(base, s.ToInt32(s[0]->InputAt(1)));
252  }
253  EXPECT_EQ(0U, s[0]->OutputCount());
254  }
255 }
#define U(name)
Definition: runtime.cc:9020

References v8::internal::compiler::InstructionOperand::IMMEDIATE, v8::internal::compiler::anonymous_namespace{instruction-selector-ia32-unittest.cc}::kImmediates, kMachInt32, and v8::internal::U.

◆ TEST_P() [33/76]

v8::internal::compiler::TEST_P ( InstructionSelectorMemoryAccessTest  ,
StoreWithImmediateIndex   
)

Definition at line 1317 of file instruction-selector-arm-unittest.cc.

1317  {
1318  const MemoryAccess memacc = GetParam();
1319  TRACED_FOREACH(int32_t, index, memacc.immediates) {
1320  StreamBuilder m(this, kMachInt32, kMachPtr, memacc.type);
1321  m.Store(memacc.type, m.Parameter(0), m.Int32Constant(index),
1322  m.Parameter(1));
1323  m.Return(m.Int32Constant(0));
1324  Stream s = m.Build();
1325  ASSERT_EQ(1U, s.size());
1326  EXPECT_EQ(memacc.str_opcode, s[0]->arch_opcode());
1327  EXPECT_EQ(kMode_Offset_RI, s[0]->addressing_mode());
1328  ASSERT_EQ(3U, s[0]->InputCount());
1329  ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
1330  EXPECT_EQ(index, s.ToInt32(s[0]->InputAt(1)));
1331  EXPECT_EQ(0U, s[0]->OutputCount());
1332  }
1333 }

References v8::internal::compiler::InstructionOperand::IMMEDIATE, kMachInt32, kMachPtr, and v8::internal::U.

◆ TEST_P() [34/76]

v8::internal::compiler::TEST_P ( InstructionSelectorMemoryAccessTest  ,
StoreWithParameters   
)

Definition at line 1303 of file instruction-selector-arm-unittest.cc.

1303  {
1304  const MemoryAccess memacc = GetParam();
1305  StreamBuilder m(this, kMachInt32, kMachPtr, kMachInt32, memacc.type);
1306  m.Store(memacc.type, m.Parameter(0), m.Parameter(1), m.Parameter(2));
1307  m.Return(m.Int32Constant(0));
1308  Stream s = m.Build();
1309  ASSERT_EQ(1U, s.size());
1310  EXPECT_EQ(memacc.str_opcode, s[0]->arch_opcode());
1311  EXPECT_EQ(kMode_Offset_RR, s[0]->addressing_mode());
1312  EXPECT_EQ(3U, s[0]->InputCount());
1313  EXPECT_EQ(0U, s[0]->OutputCount());
1314 }

References kMachInt32, kMachPtr, and v8::internal::U.

◆ TEST_P() [35/76]

v8::internal::compiler::TEST_P ( InstructionSelectorODPITest  ,
BothWithImmediate   
)

Definition at line 766 of file instruction-selector-arm-unittest.cc.

766  {
767  const ODPI odpi = GetParam();
768  TRACED_FOREACH(int32_t, imm, kImmediates) {
769  StreamBuilder m(this, kMachInt32, kMachInt32);
770  Node* n = (m.*odpi.constructor)(m.Parameter(0), m.Int32Constant(imm));
771  m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
772  Stream s = m.Build();
773  ASSERT_LE(1U, s.size());
774  EXPECT_EQ(odpi.arch_opcode, s[0]->arch_opcode());
775  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
776  ASSERT_EQ(2U, s[0]->InputCount());
777  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
778  EXPECT_EQ(2U, s[0]->OutputCount());
779  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
780  EXPECT_EQ(kOverflow, s[0]->flags_condition());
781  }
782  TRACED_FOREACH(int32_t, imm, kImmediates) {
783  StreamBuilder m(this, kMachInt32, kMachInt32);
784  Node* n = (m.*odpi.constructor)(m.Int32Constant(imm), m.Parameter(0));
785  m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
786  Stream s = m.Build();
787  ASSERT_LE(1U, s.size());
788  EXPECT_EQ(odpi.reverse_arch_opcode, s[0]->arch_opcode());
789  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
790  ASSERT_EQ(2U, s[0]->InputCount());
791  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
792  EXPECT_EQ(2U, s[0]->OutputCount());
793  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
794  EXPECT_EQ(kOverflow, s[0]->flags_condition());
795  }
796 }

References kFlags_set, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kImmediates, kMachInt32, and kOverflow.

◆ TEST_P() [36/76]

v8::internal::compiler::TEST_P ( InstructionSelectorODPITest  ,
BothWithParameters   
)

Definition at line 750 of file instruction-selector-arm-unittest.cc.

750  {
751  const ODPI odpi = GetParam();
752  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
753  Node* n = (m.*odpi.constructor)(m.Parameter(0), m.Parameter(1));
754  m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
755  Stream s = m.Build();
756  ASSERT_LE(1U, s.size());
757  EXPECT_EQ(odpi.arch_opcode, s[0]->arch_opcode());
758  EXPECT_EQ(kMode_Operand2_R, s[0]->addressing_mode());
759  EXPECT_EQ(2U, s[0]->InputCount());
760  EXPECT_EQ(2U, s[0]->OutputCount());
761  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
762  EXPECT_EQ(kOverflow, s[0]->flags_condition());
763 }

References kFlags_set, kMachInt32, and kOverflow.

◆ TEST_P() [37/76]

v8::internal::compiler::TEST_P ( InstructionSelectorODPITest  ,
BothWithShiftByImmediate   
)

Definition at line 832 of file instruction-selector-arm-unittest.cc.

832  {
833  const ODPI odpi = GetParam();
834  TRACED_FOREACH(Shift, shift, kShifts) {
835  TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
836  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
837  Node* n = (m.*odpi.constructor)(
838  m.Parameter(0),
839  (m.*shift.constructor)(m.Parameter(1), m.Int32Constant(imm)));
840  m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
841  Stream s = m.Build();
842  ASSERT_LE(1U, s.size());
843  EXPECT_EQ(odpi.arch_opcode, s[0]->arch_opcode());
844  EXPECT_EQ(shift.i_mode, s[0]->addressing_mode());
845  ASSERT_EQ(3U, s[0]->InputCount());
846  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(2)));
847  EXPECT_EQ(2U, s[0]->OutputCount());
848  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
849  EXPECT_EQ(kOverflow, s[0]->flags_condition());
850  }
851  }
852  TRACED_FOREACH(Shift, shift, kShifts) {
853  TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
854  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
855  Node* n = (m.*odpi.constructor)(
856  (m.*shift.constructor)(m.Parameter(0), m.Int32Constant(imm)),
857  m.Parameter(1));
858  m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
859  Stream s = m.Build();
860  ASSERT_LE(1U, s.size());
861  EXPECT_EQ(odpi.reverse_arch_opcode, s[0]->arch_opcode());
862  EXPECT_EQ(shift.i_mode, s[0]->addressing_mode());
863  ASSERT_EQ(3U, s[0]->InputCount());
864  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(2)));
865  EXPECT_EQ(2U, s[0]->OutputCount());
866  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
867  EXPECT_EQ(kOverflow, s[0]->flags_condition());
868  }
869  }
870 }

References kFlags_set, kMachInt32, kOverflow, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kShifts, and shift.

◆ TEST_P() [38/76]

v8::internal::compiler::TEST_P ( InstructionSelectorODPITest  ,
BothWithShiftByParameter   
)

Definition at line 799 of file instruction-selector-arm-unittest.cc.

799  {
800  const ODPI odpi = GetParam();
801  TRACED_FOREACH(Shift, shift, kShifts) {
802  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
803  Node* n = (m.*odpi.constructor)(
804  m.Parameter(0), (m.*shift.constructor)(m.Parameter(1), m.Parameter(2)));
805  m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
806  Stream s = m.Build();
807  ASSERT_LE(1U, s.size());
808  EXPECT_EQ(odpi.arch_opcode, s[0]->arch_opcode());
809  EXPECT_EQ(shift.r_mode, s[0]->addressing_mode());
810  EXPECT_EQ(3U, s[0]->InputCount());
811  EXPECT_EQ(2U, s[0]->OutputCount());
812  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
813  EXPECT_EQ(kOverflow, s[0]->flags_condition());
814  }
815  TRACED_FOREACH(Shift, shift, kShifts) {
816  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
817  Node* n = (m.*odpi.constructor)(
818  (m.*shift.constructor)(m.Parameter(0), m.Parameter(1)), m.Parameter(2));
819  m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
820  Stream s = m.Build();
821  ASSERT_LE(1U, s.size());
822  EXPECT_EQ(odpi.reverse_arch_opcode, s[0]->arch_opcode());
823  EXPECT_EQ(shift.r_mode, s[0]->addressing_mode());
824  EXPECT_EQ(3U, s[0]->InputCount());
825  EXPECT_EQ(2U, s[0]->OutputCount());
826  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
827  EXPECT_EQ(kOverflow, s[0]->flags_condition());
828  }
829 }

References kFlags_set, kMachInt32, kOverflow, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kShifts, and shift.

◆ TEST_P() [39/76]

v8::internal::compiler::TEST_P ( InstructionSelectorODPITest  ,
BranchIfNotZeroWithParameters   
)

Definition at line 958 of file instruction-selector-arm-unittest.cc.

958  {
959  const ODPI odpi = GetParam();
960  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
961  MLabel a, b;
962  Node* n = (m.*odpi.constructor)(m.Parameter(0), m.Parameter(1));
963  m.Branch(m.Word32NotEqual(m.Projection(1, n), m.Int32Constant(0)), &a, &b);
964  m.Bind(&a);
965  m.Return(m.Projection(0, n));
966  m.Bind(&b);
967  m.Return(m.Int32Constant(0));
968  Stream s = m.Build();
969  ASSERT_EQ(1U, s.size());
970  EXPECT_EQ(odpi.arch_opcode, s[0]->arch_opcode());
971  EXPECT_EQ(kMode_Operand2_R, s[0]->addressing_mode());
972  EXPECT_EQ(4U, s[0]->InputCount());
973  EXPECT_EQ(1U, s[0]->OutputCount());
974  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
975  EXPECT_EQ(kOverflow, s[0]->flags_condition());
976 }

References kFlags_branch, kMachInt32, and kOverflow.

◆ TEST_P() [40/76]

v8::internal::compiler::TEST_P ( InstructionSelectorODPITest  ,
BranchIfZeroWithParameters   
)

Definition at line 937 of file instruction-selector-arm-unittest.cc.

937  {
938  const ODPI odpi = GetParam();
939  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
940  MLabel a, b;
941  Node* n = (m.*odpi.constructor)(m.Parameter(0), m.Parameter(1));
942  m.Branch(m.Word32Equal(m.Projection(1, n), m.Int32Constant(0)), &a, &b);
943  m.Bind(&a);
944  m.Return(m.Projection(0, n));
945  m.Bind(&b);
946  m.Return(m.Int32Constant(0));
947  Stream s = m.Build();
948  ASSERT_EQ(1U, s.size());
949  EXPECT_EQ(odpi.arch_opcode, s[0]->arch_opcode());
950  EXPECT_EQ(kMode_Operand2_R, s[0]->addressing_mode());
951  EXPECT_EQ(4U, s[0]->InputCount());
952  EXPECT_EQ(1U, s[0]->OutputCount());
953  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
954  EXPECT_EQ(kNotOverflow, s[0]->flags_condition());
955 }

References kFlags_branch, kMachInt32, and kNotOverflow.

◆ TEST_P() [41/76]

v8::internal::compiler::TEST_P ( InstructionSelectorODPITest  ,
BranchWithImmediate   
)

Definition at line 894 of file instruction-selector-arm-unittest.cc.

894  {
895  const ODPI odpi = GetParam();
896  TRACED_FOREACH(int32_t, imm, kImmediates) {
897  StreamBuilder m(this, kMachInt32, kMachInt32);
898  MLabel a, b;
899  Node* n = (m.*odpi.constructor)(m.Parameter(0), m.Int32Constant(imm));
900  m.Branch(m.Projection(1, n), &a, &b);
901  m.Bind(&a);
902  m.Return(m.Int32Constant(0));
903  m.Bind(&b);
904  m.Return(m.Projection(0, n));
905  Stream s = m.Build();
906  ASSERT_EQ(1U, s.size());
907  EXPECT_EQ(odpi.arch_opcode, s[0]->arch_opcode());
908  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
909  ASSERT_EQ(4U, s[0]->InputCount());
910  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
911  EXPECT_EQ(1U, s[0]->OutputCount());
912  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
913  EXPECT_EQ(kOverflow, s[0]->flags_condition());
914  }
915  TRACED_FOREACH(int32_t, imm, kImmediates) {
916  StreamBuilder m(this, kMachInt32, kMachInt32);
917  MLabel a, b;
918  Node* n = (m.*odpi.constructor)(m.Int32Constant(imm), m.Parameter(0));
919  m.Branch(m.Projection(1, n), &a, &b);
920  m.Bind(&a);
921  m.Return(m.Int32Constant(0));
922  m.Bind(&b);
923  m.Return(m.Projection(0, n));
924  Stream s = m.Build();
925  ASSERT_EQ(1U, s.size());
926  EXPECT_EQ(odpi.reverse_arch_opcode, s[0]->arch_opcode());
927  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
928  ASSERT_EQ(4U, s[0]->InputCount());
929  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
930  EXPECT_EQ(1U, s[0]->OutputCount());
931  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
932  EXPECT_EQ(kOverflow, s[0]->flags_condition());
933  }
934 }

References kFlags_branch, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kImmediates, kMachInt32, and kOverflow.

◆ TEST_P() [42/76]

v8::internal::compiler::TEST_P ( InstructionSelectorODPITest  ,
BranchWithParameters   
)

Definition at line 873 of file instruction-selector-arm-unittest.cc.

873  {
874  const ODPI odpi = GetParam();
875  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
876  MLabel a, b;
877  Node* n = (m.*odpi.constructor)(m.Parameter(0), m.Parameter(1));
878  m.Branch(m.Projection(1, n), &a, &b);
879  m.Bind(&a);
880  m.Return(m.Int32Constant(0));
881  m.Bind(&b);
882  m.Return(m.Projection(0, n));
883  Stream s = m.Build();
884  ASSERT_EQ(1U, s.size());
885  EXPECT_EQ(odpi.arch_opcode, s[0]->arch_opcode());
886  EXPECT_EQ(kMode_Operand2_R, s[0]->addressing_mode());
887  EXPECT_EQ(4U, s[0]->InputCount());
888  EXPECT_EQ(1U, s[0]->OutputCount());
889  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
890  EXPECT_EQ(kOverflow, s[0]->flags_condition());
891 }

References kFlags_branch, kMachInt32, and kOverflow.

◆ TEST_P() [43/76]

v8::internal::compiler::TEST_P ( InstructionSelectorODPITest  ,
OvfWithImmediate   
)

Definition at line 523 of file instruction-selector-arm-unittest.cc.

523  {
524  const ODPI odpi = GetParam();
525  TRACED_FOREACH(int32_t, imm, kImmediates) {
526  StreamBuilder m(this, kMachInt32, kMachInt32);
527  m.Return(m.Projection(
528  1, (m.*odpi.constructor)(m.Parameter(0), m.Int32Constant(imm))));
529  Stream s = m.Build();
530  ASSERT_EQ(1U, s.size());
531  EXPECT_EQ(odpi.arch_opcode, s[0]->arch_opcode());
532  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
533  ASSERT_EQ(2U, s[0]->InputCount());
534  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
535  EXPECT_LE(1U, s[0]->OutputCount());
536  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
537  EXPECT_EQ(kOverflow, s[0]->flags_condition());
538  }
539  TRACED_FOREACH(int32_t, imm, kImmediates) {
540  StreamBuilder m(this, kMachInt32, kMachInt32);
541  m.Return(m.Projection(
542  1, (m.*odpi.constructor)(m.Int32Constant(imm), m.Parameter(0))));
543  Stream s = m.Build();
544  ASSERT_EQ(1U, s.size());
545  EXPECT_EQ(odpi.reverse_arch_opcode, s[0]->arch_opcode());
546  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
547  ASSERT_EQ(2U, s[0]->InputCount());
548  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
549  EXPECT_LE(1U, s[0]->OutputCount());
550  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
551  EXPECT_EQ(kOverflow, s[0]->flags_condition());
552  }
553 }

References kFlags_set, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kImmediates, kMachInt32, and kOverflow.

◆ TEST_P() [44/76]

v8::internal::compiler::TEST_P ( InstructionSelectorODPITest  ,
OvfWithParameters   
)

Definition at line 507 of file instruction-selector-arm-unittest.cc.

507  {
508  const ODPI odpi = GetParam();
509  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
510  m.Return(
511  m.Projection(1, (m.*odpi.constructor)(m.Parameter(0), m.Parameter(1))));
512  Stream s = m.Build();
513  ASSERT_EQ(1U, s.size());
514  EXPECT_EQ(odpi.arch_opcode, s[0]->arch_opcode());
515  EXPECT_EQ(kMode_Operand2_R, s[0]->addressing_mode());
516  EXPECT_EQ(2U, s[0]->InputCount());
517  EXPECT_LE(1U, s[0]->OutputCount());
518  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
519  EXPECT_EQ(kOverflow, s[0]->flags_condition());
520 }

References kFlags_set, kMachInt32, and kOverflow.

◆ TEST_P() [45/76]

v8::internal::compiler::TEST_P ( InstructionSelectorODPITest  ,
OvfWithShiftByImmediate   
)

Definition at line 591 of file instruction-selector-arm-unittest.cc.

591  {
592  const ODPI odpi = GetParam();
593  TRACED_FOREACH(Shift, shift, kShifts) {
594  TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
595  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
596  m.Return(m.Projection(
597  1, (m.*odpi.constructor)(m.Parameter(0),
598  (m.*shift.constructor)(
599  m.Parameter(1), m.Int32Constant(imm)))));
600  Stream s = m.Build();
601  ASSERT_EQ(1U, s.size());
602  EXPECT_EQ(odpi.arch_opcode, s[0]->arch_opcode());
603  EXPECT_EQ(shift.i_mode, s[0]->addressing_mode());
604  ASSERT_EQ(3U, s[0]->InputCount());
605  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(2)));
606  EXPECT_LE(1U, s[0]->OutputCount());
607  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
608  EXPECT_EQ(kOverflow, s[0]->flags_condition());
609  }
610  }
611  TRACED_FOREACH(Shift, shift, kShifts) {
612  TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
613  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
614  m.Return(m.Projection(
615  1, (m.*odpi.constructor)(
616  (m.*shift.constructor)(m.Parameter(1), m.Int32Constant(imm)),
617  m.Parameter(0))));
618  Stream s = m.Build();
619  ASSERT_EQ(1U, s.size());
620  EXPECT_EQ(odpi.reverse_arch_opcode, s[0]->arch_opcode());
621  EXPECT_EQ(shift.i_mode, s[0]->addressing_mode());
622  ASSERT_EQ(3U, s[0]->InputCount());
623  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(2)));
624  EXPECT_LE(1U, s[0]->OutputCount());
625  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
626  EXPECT_EQ(kOverflow, s[0]->flags_condition());
627  }
628  }
629 }

References kFlags_set, kMachInt32, kOverflow, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kShifts, and shift.

◆ TEST_P() [46/76]

v8::internal::compiler::TEST_P ( InstructionSelectorODPITest  ,
OvfWithShiftByParameter   
)

Definition at line 556 of file instruction-selector-arm-unittest.cc.

556  {
557  const ODPI odpi = GetParam();
558  TRACED_FOREACH(Shift, shift, kShifts) {
559  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
560  m.Return(m.Projection(
561  1, (m.*odpi.constructor)(
562  m.Parameter(0),
563  (m.*shift.constructor)(m.Parameter(1), m.Parameter(2)))));
564  Stream s = m.Build();
565  ASSERT_EQ(1U, s.size());
566  EXPECT_EQ(odpi.arch_opcode, s[0]->arch_opcode());
567  EXPECT_EQ(shift.r_mode, s[0]->addressing_mode());
568  EXPECT_EQ(3U, s[0]->InputCount());
569  EXPECT_LE(1U, s[0]->OutputCount());
570  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
571  EXPECT_EQ(kOverflow, s[0]->flags_condition());
572  }
573  TRACED_FOREACH(Shift, shift, kShifts) {
574  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
575  m.Return(m.Projection(
576  1, (m.*odpi.constructor)(
577  (m.*shift.constructor)(m.Parameter(0), m.Parameter(1)),
578  m.Parameter(0))));
579  Stream s = m.Build();
580  ASSERT_EQ(1U, s.size());
581  EXPECT_EQ(odpi.reverse_arch_opcode, s[0]->arch_opcode());
582  EXPECT_EQ(shift.r_mode, s[0]->addressing_mode());
583  EXPECT_EQ(3U, s[0]->InputCount());
584  EXPECT_LE(1U, s[0]->OutputCount());
585  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
586  EXPECT_EQ(kOverflow, s[0]->flags_condition());
587  }
588 }

References kFlags_set, kMachInt32, kOverflow, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kShifts, and shift.

◆ TEST_P() [47/76]

v8::internal::compiler::TEST_P ( InstructionSelectorODPITest  ,
ValWithImmediate   
)

Definition at line 647 of file instruction-selector-arm-unittest.cc.

647  {
648  const ODPI odpi = GetParam();
649  TRACED_FOREACH(int32_t, imm, kImmediates) {
650  StreamBuilder m(this, kMachInt32, kMachInt32);
651  m.Return(m.Projection(
652  0, (m.*odpi.constructor)(m.Parameter(0), m.Int32Constant(imm))));
653  Stream s = m.Build();
654  ASSERT_EQ(1U, s.size());
655  EXPECT_EQ(odpi.arch_opcode, s[0]->arch_opcode());
656  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
657  ASSERT_EQ(2U, s[0]->InputCount());
658  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
659  EXPECT_LE(1U, s[0]->OutputCount());
660  EXPECT_EQ(kFlags_none, s[0]->flags_mode());
661  }
662  TRACED_FOREACH(int32_t, imm, kImmediates) {
663  StreamBuilder m(this, kMachInt32, kMachInt32);
664  m.Return(m.Projection(
665  0, (m.*odpi.constructor)(m.Int32Constant(imm), m.Parameter(0))));
666  Stream s = m.Build();
667  ASSERT_EQ(1U, s.size());
668  EXPECT_EQ(odpi.reverse_arch_opcode, s[0]->arch_opcode());
669  EXPECT_EQ(kMode_Operand2_I, s[0]->addressing_mode());
670  ASSERT_EQ(2U, s[0]->InputCount());
671  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
672  EXPECT_LE(1U, s[0]->OutputCount());
673  EXPECT_EQ(kFlags_none, s[0]->flags_mode());
674  }
675 }

References kFlags_none, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kImmediates, and kMachInt32.

◆ TEST_P() [48/76]

v8::internal::compiler::TEST_P ( InstructionSelectorODPITest  ,
ValWithParameters   
)

Definition at line 632 of file instruction-selector-arm-unittest.cc.

632  {
633  const ODPI odpi = GetParam();
634  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
635  m.Return(
636  m.Projection(0, (m.*odpi.constructor)(m.Parameter(0), m.Parameter(1))));
637  Stream s = m.Build();
638  ASSERT_EQ(1U, s.size());
639  EXPECT_EQ(odpi.arch_opcode, s[0]->arch_opcode());
640  EXPECT_EQ(kMode_Operand2_R, s[0]->addressing_mode());
641  EXPECT_EQ(2U, s[0]->InputCount());
642  EXPECT_LE(1U, s[0]->OutputCount());
643  EXPECT_EQ(kFlags_none, s[0]->flags_mode());
644 }

References kFlags_none, and kMachInt32.

◆ TEST_P() [49/76]

v8::internal::compiler::TEST_P ( InstructionSelectorODPITest  ,
ValWithShiftByImmediate   
)

Definition at line 711 of file instruction-selector-arm-unittest.cc.

711  {
712  const ODPI odpi = GetParam();
713  TRACED_FOREACH(Shift, shift, kShifts) {
714  TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
715  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
716  m.Return(m.Projection(
717  0, (m.*odpi.constructor)(m.Parameter(0),
718  (m.*shift.constructor)(
719  m.Parameter(1), m.Int32Constant(imm)))));
720  Stream s = m.Build();
721  ASSERT_EQ(1U, s.size());
722  EXPECT_EQ(odpi.arch_opcode, s[0]->arch_opcode());
723  EXPECT_EQ(shift.i_mode, s[0]->addressing_mode());
724  ASSERT_EQ(3U, s[0]->InputCount());
725  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(2)));
726  EXPECT_LE(1U, s[0]->OutputCount());
727  EXPECT_EQ(kFlags_none, s[0]->flags_mode());
728  }
729  }
730  TRACED_FOREACH(Shift, shift, kShifts) {
731  TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
732  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
733  m.Return(m.Projection(
734  0, (m.*odpi.constructor)(
735  (m.*shift.constructor)(m.Parameter(1), m.Int32Constant(imm)),
736  m.Parameter(0))));
737  Stream s = m.Build();
738  ASSERT_EQ(1U, s.size());
739  EXPECT_EQ(odpi.reverse_arch_opcode, s[0]->arch_opcode());
740  EXPECT_EQ(shift.i_mode, s[0]->addressing_mode());
741  ASSERT_EQ(3U, s[0]->InputCount());
742  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(2)));
743  EXPECT_LE(1U, s[0]->OutputCount());
744  EXPECT_EQ(kFlags_none, s[0]->flags_mode());
745  }
746  }
747 }

References kFlags_none, kMachInt32, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kShifts, and shift.

◆ TEST_P() [50/76]

v8::internal::compiler::TEST_P ( InstructionSelectorODPITest  ,
ValWithShiftByParameter   
)

Definition at line 678 of file instruction-selector-arm-unittest.cc.

678  {
679  const ODPI odpi = GetParam();
680  TRACED_FOREACH(Shift, shift, kShifts) {
681  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
682  m.Return(m.Projection(
683  0, (m.*odpi.constructor)(
684  m.Parameter(0),
685  (m.*shift.constructor)(m.Parameter(1), m.Parameter(2)))));
686  Stream s = m.Build();
687  ASSERT_EQ(1U, s.size());
688  EXPECT_EQ(odpi.arch_opcode, s[0]->arch_opcode());
689  EXPECT_EQ(shift.r_mode, s[0]->addressing_mode());
690  EXPECT_EQ(3U, s[0]->InputCount());
691  EXPECT_LE(1U, s[0]->OutputCount());
692  EXPECT_EQ(kFlags_none, s[0]->flags_mode());
693  }
694  TRACED_FOREACH(Shift, shift, kShifts) {
695  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
696  m.Return(m.Projection(
697  0, (m.*odpi.constructor)(
698  (m.*shift.constructor)(m.Parameter(0), m.Parameter(1)),
699  m.Parameter(0))));
700  Stream s = m.Build();
701  ASSERT_EQ(1U, s.size());
702  EXPECT_EQ(odpi.reverse_arch_opcode, s[0]->arch_opcode());
703  EXPECT_EQ(shift.r_mode, s[0]->addressing_mode());
704  EXPECT_EQ(3U, s[0]->InputCount());
705  EXPECT_LE(1U, s[0]->OutputCount());
706  EXPECT_EQ(kFlags_none, s[0]->flags_mode());
707  }
708 }

References kFlags_none, kMachInt32, v8::internal::compiler::anonymous_namespace{instruction-selector-arm-unittest.cc}::kShifts, and shift.

◆ TEST_P() [51/76]

v8::internal::compiler::TEST_P ( InstructionSelectorOvfAddSubTest  ,
BothImmediateOnRight   
)

Definition at line 596 of file instruction-selector-arm64-unittest.cc.

596  {
597  const MachInst2 dpi = GetParam();
598  const MachineType type = dpi.machine_type;
599  TRACED_FOREACH(int32_t, imm, kAddSubImmediates) {
600  StreamBuilder m(this, type, type);
601  Node* n = (m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm));
602  m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
603  Stream s = m.Build();
604  ASSERT_LE(1U, s.size());
605  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
606  ASSERT_EQ(2U, s[0]->InputCount());
607  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
608  EXPECT_EQ(2U, s[0]->OutputCount());
609  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
610  EXPECT_EQ(kOverflow, s[0]->flags_condition());
611  }
612 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::kAddSubImmediates, kFlags_set, and kOverflow.

◆ TEST_P() [52/76]

v8::internal::compiler::TEST_P ( InstructionSelectorOvfAddSubTest  ,
BothParameter   
)

Definition at line 580 of file instruction-selector-arm64-unittest.cc.

580  {
581  const MachInst2 dpi = GetParam();
582  const MachineType type = dpi.machine_type;
583  StreamBuilder m(this, type, type, type);
584  Node* n = (m.*dpi.constructor)(m.Parameter(0), m.Parameter(1));
585  m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
586  Stream s = m.Build();
587  ASSERT_LE(1U, s.size());
588  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
589  EXPECT_EQ(2U, s[0]->InputCount());
590  EXPECT_EQ(2U, s[0]->OutputCount());
591  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
592  EXPECT_EQ(kOverflow, s[0]->flags_condition());
593 }

References kFlags_set, and kOverflow.

◆ TEST_P() [53/76]

v8::internal::compiler::TEST_P ( InstructionSelectorOvfAddSubTest  ,
BranchWithImmediateOnRight   
)

Definition at line 636 of file instruction-selector-arm64-unittest.cc.

636  {
637  const MachInst2 dpi = GetParam();
638  const MachineType type = dpi.machine_type;
639  TRACED_FOREACH(int32_t, imm, kAddSubImmediates) {
640  StreamBuilder m(this, type, type);
641  MLabel a, b;
642  Node* n = (m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm));
643  m.Branch(m.Projection(1, n), &a, &b);
644  m.Bind(&a);
645  m.Return(m.Int32Constant(0));
646  m.Bind(&b);
647  m.Return(m.Projection(0, n));
648  Stream s = m.Build();
649  ASSERT_EQ(1U, s.size());
650  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
651  ASSERT_EQ(4U, s[0]->InputCount());
652  EXPECT_EQ(1U, s[0]->OutputCount());
653  EXPECT_EQ(kFlags_branch, s[0]->flags_mode());
654  EXPECT_EQ(kOverflow, s[0]->flags_condition());
655  }
656 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::kAddSubImmediates, kFlags_branch, and kOverflow.

◆ TEST_P() [54/76]

v8::internal::compiler::TEST_P ( InstructionSelectorOvfAddSubTest  ,
OvfImmediateOnRight   
)

Definition at line 528 of file instruction-selector-arm64-unittest.cc.

528  {
529  const MachInst2 dpi = GetParam();
530  const MachineType type = dpi.machine_type;
531  TRACED_FOREACH(int32_t, imm, kAddSubImmediates) {
532  StreamBuilder m(this, type, type);
533  m.Return(m.Projection(
534  1, (m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm))));
535  Stream s = m.Build();
536  ASSERT_EQ(1U, s.size());
537  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
538  ASSERT_EQ(2U, s[0]->InputCount());
539  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
540  EXPECT_LE(1U, s[0]->OutputCount());
541  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
542  EXPECT_EQ(kOverflow, s[0]->flags_condition());
543  }
544 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::kAddSubImmediates, kFlags_set, and kOverflow.

◆ TEST_P() [55/76]

v8::internal::compiler::TEST_P ( InstructionSelectorOvfAddSubTest  ,
OvfParameter   
)

Definition at line 512 of file instruction-selector-arm64-unittest.cc.

512  {
513  const MachInst2 dpi = GetParam();
514  const MachineType type = dpi.machine_type;
515  StreamBuilder m(this, type, type, type);
516  m.Return(
517  m.Projection(1, (m.*dpi.constructor)(m.Parameter(0), m.Parameter(1))));
518  Stream s = m.Build();
519  ASSERT_EQ(1U, s.size());
520  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
521  EXPECT_EQ(2U, s[0]->InputCount());
522  EXPECT_LE(1U, s[0]->OutputCount());
523  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
524  EXPECT_EQ(kOverflow, s[0]->flags_condition());
525 }

References kFlags_set, and kOverflow.

◆ TEST_P() [56/76]

v8::internal::compiler::TEST_P ( InstructionSelectorOvfAddSubTest  ,
ValImmediateOnRight   
)

Definition at line 562 of file instruction-selector-arm64-unittest.cc.

562  {
563  const MachInst2 dpi = GetParam();
564  const MachineType type = dpi.machine_type;
565  TRACED_FOREACH(int32_t, imm, kAddSubImmediates) {
566  StreamBuilder m(this, type, type);
567  m.Return(m.Projection(
568  0, (m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm))));
569  Stream s = m.Build();
570  ASSERT_EQ(1U, s.size());
571  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
572  ASSERT_EQ(2U, s[0]->InputCount());
573  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
574  EXPECT_LE(1U, s[0]->OutputCount());
575  EXPECT_EQ(kFlags_none, s[0]->flags_mode());
576  }
577 }

References v8::internal::compiler::anonymous_namespace{instruction-selector-arm64-unittest.cc}::kAddSubImmediates, and kFlags_none.

◆ TEST_P() [57/76]

v8::internal::compiler::TEST_P ( InstructionSelectorOvfAddSubTest  ,
ValParameter   
)

Definition at line 547 of file instruction-selector-arm64-unittest.cc.

547  {
548  const MachInst2 dpi = GetParam();
549  const MachineType type = dpi.machine_type;
550  StreamBuilder m(this, type, type, type);
551  m.Return(
552  m.Projection(0, (m.*dpi.constructor)(m.Parameter(0), m.Parameter(1))));
553  Stream s = m.Build();
554  ASSERT_EQ(1U, s.size());
555  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
556  EXPECT_EQ(2U, s[0]->InputCount());
557  EXPECT_LE(1U, s[0]->OutputCount());
558  EXPECT_EQ(kFlags_none, s[0]->flags_mode());
559 }

References kFlags_none.

◆ TEST_P() [58/76]

v8::internal::compiler::TEST_P ( InstructionSelectorShiftTest  ,
Immediate   
)

Definition at line 1003 of file instruction-selector-arm-unittest.cc.

1003  {
1004  const Shift shift = GetParam();
1005  TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
1006  StreamBuilder m(this, kMachInt32, kMachInt32);
1007  m.Return((m.*shift.constructor)(m.Parameter(0), m.Int32Constant(imm)));
1008  Stream s = m.Build();
1009  ASSERT_EQ(1U, s.size());
1010  EXPECT_EQ(kArmMov, s[0]->arch_opcode());
1011  EXPECT_EQ(shift.i_mode, s[0]->addressing_mode());
1012  ASSERT_EQ(2U, s[0]->InputCount());
1013  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
1014  EXPECT_EQ(1U, s[0]->OutputCount());
1015  }
1016 }

References kMachInt32, and shift.

◆ TEST_P() [59/76]

v8::internal::compiler::TEST_P ( InstructionSelectorShiftTest  ,
Parameter   
)

Definition at line 748 of file instruction-selector-arm64-unittest.cc.

748  {
749  const MachInst2 dpi = GetParam();
750  const MachineType type = dpi.machine_type;
751  StreamBuilder m(this, type, type, type);
752  m.Return((m.*dpi.constructor)(m.Parameter(0), m.Parameter(1)));
753  Stream s = m.Build();
754  ASSERT_EQ(1U, s.size());
755  EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
756  EXPECT_EQ(2U, s[0]->InputCount());
757  EXPECT_EQ(1U, s[0]->OutputCount());
758 }

◆ TEST_P() [60/76]

v8::internal::compiler::TEST_P ( InstructionSelectorShiftTest  ,
Parameters   
)

Definition at line 990 of file instruction-selector-arm-unittest.cc.

990  {
991  const Shift shift = GetParam();
992  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
993  m.Return((m.*shift.constructor)(m.Parameter(0), m.Parameter(1)));
994  Stream s = m.Build();
995  ASSERT_EQ(1U, s.size());
996  EXPECT_EQ(kArmMov, s[0]->arch_opcode());
997  EXPECT_EQ(shift.r_mode, s[0]->addressing_mode());
998  EXPECT_EQ(2U, s[0]->InputCount());
999  EXPECT_EQ(1U, s[0]->OutputCount());
1000 }

References kMachInt32, and shift.

◆ TEST_P() [61/76]

v8::internal::compiler::TEST_P ( InstructionSelectorShiftTest  ,
Word32AndWithWord32NotWithImmediate   
)

Definition at line 1168 of file instruction-selector-arm-unittest.cc.

1168  {
1169  const Shift shift = GetParam();
1170  TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
1171  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1172  m.Return(m.Word32And(m.Parameter(0),
1173  m.Word32Not((m.*shift.constructor)(
1174  m.Parameter(1), m.Int32Constant(imm)))));
1175  Stream s = m.Build();
1176  ASSERT_EQ(1U, s.size());
1177  EXPECT_EQ(kArmBic, s[0]->arch_opcode());
1178  EXPECT_EQ(shift.i_mode, s[0]->addressing_mode());
1179  ASSERT_EQ(3U, s[0]->InputCount());
1180  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(2)));
1181  EXPECT_EQ(1U, s[0]->OutputCount());
1182  }
1183 }

References kMachInt32, and shift.

◆ TEST_P() [62/76]

v8::internal::compiler::TEST_P ( InstructionSelectorShiftTest  ,
Word32AndWithWord32NotWithParameters   
)

Definition at line 1154 of file instruction-selector-arm-unittest.cc.

1154  {
1155  const Shift shift = GetParam();
1156  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
1157  m.Return(m.Word32And(m.Parameter(0), m.Word32Not((m.*shift.constructor)(
1158  m.Parameter(1), m.Parameter(2)))));
1159  Stream s = m.Build();
1160  ASSERT_EQ(1U, s.size());
1161  EXPECT_EQ(kArmBic, s[0]->arch_opcode());
1162  EXPECT_EQ(shift.r_mode, s[0]->addressing_mode());
1163  EXPECT_EQ(3U, s[0]->InputCount());
1164  EXPECT_EQ(1U, s[0]->OutputCount());
1165 }

References kMachInt32, and shift.

◆ TEST_P() [63/76]

v8::internal::compiler::TEST_P ( InstructionSelectorShiftTest  ,
Word32EqualToZeroWithImmediate   
)

Definition at line 1104 of file instruction-selector-arm-unittest.cc.

1104  {
1105  const Shift shift = GetParam();
1106  TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
1107  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1108  m.Return(m.Word32Equal(
1109  m.Int32Constant(0),
1110  (m.*shift.constructor)(m.Parameter(0), m.Int32Constant(imm))));
1111  Stream s = m.Build();
1112  ASSERT_EQ(1U, s.size());
1113  EXPECT_EQ(kArmMov, s[0]->arch_opcode());
1114  EXPECT_EQ(shift.i_mode, s[0]->addressing_mode());
1115  ASSERT_EQ(2U, s[0]->InputCount());
1116  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
1117  EXPECT_EQ(2U, s[0]->OutputCount());
1118  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
1119  EXPECT_EQ(kEqual, s[0]->flags_condition());
1120  }
1121 }

References kEqual, kFlags_set, kMachInt32, and shift.

◆ TEST_P() [64/76]

v8::internal::compiler::TEST_P ( InstructionSelectorShiftTest  ,
Word32EqualToZeroWithParameters   
)

Definition at line 1087 of file instruction-selector-arm-unittest.cc.

1087  {
1088  const Shift shift = GetParam();
1089  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1090  m.Return(
1091  m.Word32Equal(m.Int32Constant(0),
1092  (m.*shift.constructor)(m.Parameter(0), m.Parameter(1))));
1093  Stream s = m.Build();
1094  ASSERT_EQ(1U, s.size());
1095  EXPECT_EQ(kArmMov, s[0]->arch_opcode());
1096  EXPECT_EQ(shift.r_mode, s[0]->addressing_mode());
1097  EXPECT_EQ(2U, s[0]->InputCount());
1098  EXPECT_EQ(2U, s[0]->OutputCount());
1099  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
1100  EXPECT_EQ(kEqual, s[0]->flags_condition());
1101 }

References kEqual, kFlags_set, kMachInt32, and shift.

◆ TEST_P() [65/76]

v8::internal::compiler::TEST_P ( InstructionSelectorShiftTest  ,
Word32EqualWithParameter   
)

Definition at line 1019 of file instruction-selector-arm-unittest.cc.

1019  {
1020  const Shift shift = GetParam();
1021  {
1022  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
1023  m.Return(
1024  m.Word32Equal(m.Parameter(0),
1025  (m.*shift.constructor)(m.Parameter(1), m.Parameter(2))));
1026  Stream s = m.Build();
1027  ASSERT_EQ(1U, s.size());
1028  EXPECT_EQ(kArmCmp, s[0]->arch_opcode());
1029  EXPECT_EQ(shift.r_mode, s[0]->addressing_mode());
1030  EXPECT_EQ(3U, s[0]->InputCount());
1031  EXPECT_EQ(1U, s[0]->OutputCount());
1032  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
1033  EXPECT_EQ(kEqual, s[0]->flags_condition());
1034  }
1035  {
1036  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
1037  m.Return(
1038  m.Word32Equal((m.*shift.constructor)(m.Parameter(1), m.Parameter(2)),
1039  m.Parameter(0)));
1040  Stream s = m.Build();
1041  ASSERT_EQ(1U, s.size());
1042  EXPECT_EQ(kArmCmp, s[0]->arch_opcode());
1043  EXPECT_EQ(shift.r_mode, s[0]->addressing_mode());
1044  EXPECT_EQ(3U, s[0]->InputCount());
1045  EXPECT_EQ(1U, s[0]->OutputCount());
1046  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
1047  EXPECT_EQ(kEqual, s[0]->flags_condition());
1048  }
1049 }

References kEqual, kFlags_set, kMachInt32, and shift.

◆ TEST_P() [66/76]

v8::internal::compiler::TEST_P ( InstructionSelectorShiftTest  ,
Word32EqualWithParameterAndImmediate   
)

Definition at line 1052 of file instruction-selector-arm-unittest.cc.

1052  {
1053  const Shift shift = GetParam();
1054  TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
1055  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1056  m.Return(m.Word32Equal(
1057  (m.*shift.constructor)(m.Parameter(1), m.Int32Constant(imm)),
1058  m.Parameter(0)));
1059  Stream s = m.Build();
1060  ASSERT_EQ(1U, s.size());
1061  EXPECT_EQ(kArmCmp, s[0]->arch_opcode());
1062  EXPECT_EQ(shift.i_mode, s[0]->addressing_mode());
1063  ASSERT_EQ(3U, s[0]->InputCount());
1064  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(2)));
1065  EXPECT_EQ(1U, s[0]->OutputCount());
1066  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
1067  EXPECT_EQ(kEqual, s[0]->flags_condition());
1068  }
1069  TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
1070  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1071  m.Return(m.Word32Equal(
1072  m.Parameter(0),
1073  (m.*shift.constructor)(m.Parameter(1), m.Int32Constant(imm))));
1074  Stream s = m.Build();
1075  ASSERT_EQ(1U, s.size());
1076  EXPECT_EQ(kArmCmp, s[0]->arch_opcode());
1077  EXPECT_EQ(shift.i_mode, s[0]->addressing_mode());
1078  ASSERT_EQ(3U, s[0]->InputCount());
1079  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(2)));
1080  EXPECT_EQ(1U, s[0]->OutputCount());
1081  EXPECT_EQ(kFlags_set, s[0]->flags_mode());
1082  EXPECT_EQ(kEqual, s[0]->flags_condition());
1083  }
1084 }

References kEqual, kFlags_set, kMachInt32, and shift.

◆ TEST_P() [67/76]

v8::internal::compiler::TEST_P ( InstructionSelectorShiftTest  ,
Word32NotWithImmediate   
)

Definition at line 1137 of file instruction-selector-arm-unittest.cc.

1137  {
1138  const Shift shift = GetParam();
1139  TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
1140  StreamBuilder m(this, kMachInt32, kMachInt32);
1141  m.Return(m.Word32Not(
1142  (m.*shift.constructor)(m.Parameter(0), m.Int32Constant(imm))));
1143  Stream s = m.Build();
1144  ASSERT_EQ(1U, s.size());
1145  EXPECT_EQ(kArmMvn, s[0]->arch_opcode());
1146  EXPECT_EQ(shift.i_mode, s[0]->addressing_mode());
1147  ASSERT_EQ(2U, s[0]->InputCount());
1148  EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
1149  EXPECT_EQ(1U, s[0]->OutputCount());
1150  }
1151 }

References kMachInt32, and shift.

◆ TEST_P() [68/76]

v8::internal::compiler::TEST_P ( InstructionSelectorShiftTest  ,
Word32NotWithParameters   
)

Definition at line 1124 of file instruction-selector-arm-unittest.cc.

1124  {
1125  const Shift shift = GetParam();
1126  StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1127  m.Return(m.Word32Not((m.*shift.constructor)(m.Parameter(0), m.Parameter(1))));
1128  Stream s = m.Build();
1129  ASSERT_EQ(1U, s.size());
1130  EXPECT_EQ(kArmMvn, s[0]->arch_opcode());
1131  EXPECT_EQ(shift.r_mode, s[0]->addressing_mode());
1132  EXPECT_EQ(2U, s[0]->InputCount());
1133  EXPECT_EQ(1U, s[0]->OutputCount());
1134 }

References kMachInt32, and shift.

◆ TEST_P() [69/76]

v8::internal::compiler::TEST_P ( MachineUnaryOperatorReducerTest  ,
Parameter   
)

Definition at line 232 of file machine-operator-reducer-unittest.cc.

232  {
233  const UnaryOperator unop = GetParam();
234  Reduction reduction =
235  Reduce(graph()->NewNode((machine()->*unop.constructor)(), Parameter(0)));
236  EXPECT_FALSE(reduction.Changed());
237 }

◆ TEST_P() [70/76]

v8::internal::compiler::TEST_P ( SimplifiedElementAccessOperatorTest  ,
LoadElement   
)

Definition at line 176 of file simplified-operator-unittest.cc.

176  {
177  SimplifiedOperatorBuilder simplified(zone());
178  const ElementAccess& access = GetParam();
179  const Operator* op = simplified.LoadElement(access);
180 
181  EXPECT_EQ(IrOpcode::kLoadElement, op->opcode());
182  EXPECT_EQ(Operator::kNoThrow | Operator::kNoWrite, op->properties());
183  EXPECT_EQ(access, ElementAccessOf(op));
184 
185  EXPECT_EQ(3, OperatorProperties::GetValueInputCount(op));
186  EXPECT_EQ(1, OperatorProperties::GetEffectInputCount(op));
187  EXPECT_EQ(0, OperatorProperties::GetControlInputCount(op));
188  EXPECT_EQ(4, OperatorProperties::GetTotalInputCount(op));
189 
190  EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op));
191  EXPECT_EQ(1, OperatorProperties::GetEffectOutputCount(op));
192  EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op));
193 }
const ElementAccess & ElementAccessOf(const Operator *op)

References ElementAccessOf(), v8::internal::compiler::OperatorProperties::GetControlInputCount(), v8::internal::compiler::OperatorProperties::GetControlOutputCount(), v8::internal::compiler::OperatorProperties::GetEffectInputCount(), v8::internal::compiler::OperatorProperties::GetEffectOutputCount(), v8::internal::compiler::OperatorProperties::GetTotalInputCount(), v8::internal::compiler::OperatorProperties::GetValueInputCount(), v8::internal::compiler::OperatorProperties::GetValueOutputCount(), v8::internal::compiler::Operator::kNoThrow, v8::internal::compiler::Operator::kNoWrite, v8::internal::compiler::Operator::opcode(), and v8::internal::compiler::Operator::properties().

+ Here is the call graph for this function:

◆ TEST_P() [71/76]

v8::internal::compiler::TEST_P ( SimplifiedElementAccessOperatorTest  ,
StoreElement   
)

Definition at line 196 of file simplified-operator-unittest.cc.

196  {
197  SimplifiedOperatorBuilder simplified(zone());
198  const ElementAccess& access = GetParam();
199  const Operator* op = simplified.StoreElement(access);
200 
201  EXPECT_EQ(IrOpcode::kStoreElement, op->opcode());
202  EXPECT_EQ(Operator::kNoRead | Operator::kNoThrow, op->properties());
203  EXPECT_EQ(access, ElementAccessOf(op));
204 
205  EXPECT_EQ(4, OperatorProperties::GetValueInputCount(op));
206  EXPECT_EQ(1, OperatorProperties::GetEffectInputCount(op));
207  EXPECT_EQ(1, OperatorProperties::GetControlInputCount(op));
208  EXPECT_EQ(6, OperatorProperties::GetTotalInputCount(op));
209 
210  EXPECT_EQ(0, OperatorProperties::GetValueOutputCount(op));
211  EXPECT_EQ(1, OperatorProperties::GetEffectOutputCount(op));
212  EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op));
213 }

References ElementAccessOf(), v8::internal::compiler::OperatorProperties::GetControlInputCount(), v8::internal::compiler::OperatorProperties::GetControlOutputCount(), v8::internal::compiler::OperatorProperties::GetEffectInputCount(), v8::internal::compiler::OperatorProperties::GetEffectOutputCount(), v8::internal::compiler::OperatorProperties::GetTotalInputCount(), v8::internal::compiler::OperatorProperties::GetValueInputCount(), v8::internal::compiler::OperatorProperties::GetValueOutputCount(), v8::internal::compiler::Operator::kNoRead, v8::internal::compiler::Operator::kNoThrow, v8::internal::compiler::Operator::opcode(), and v8::internal::compiler::Operator::properties().

+ Here is the call graph for this function:

◆ TEST_P() [72/76]

v8::internal::compiler::TEST_P ( SimplifiedPureOperatorTest  ,
InstancesAreGloballyShared   
)

Definition at line 81 of file simplified-operator-unittest.cc.

81  {
82  const PureOperator& pop = GetParam();
83  SimplifiedOperatorBuilder simplified1(zone());
84  SimplifiedOperatorBuilder simplified2(zone());
85  EXPECT_EQ((simplified1.*pop.constructor)(), (simplified2.*pop.constructor)());
86 }

◆ TEST_P() [73/76]

v8::internal::compiler::TEST_P ( SimplifiedPureOperatorTest  ,
NumberOfInputsAndOutputs   
)

Definition at line 89 of file simplified-operator-unittest.cc.

89  {
90  SimplifiedOperatorBuilder simplified(zone());
91  const PureOperator& pop = GetParam();
92  const Operator* op = (simplified.*pop.constructor)();
93 
94  EXPECT_EQ(pop.value_input_count, OperatorProperties::GetValueInputCount(op));
95  EXPECT_EQ(0, OperatorProperties::GetEffectInputCount(op));
96  EXPECT_EQ(0, OperatorProperties::GetControlInputCount(op));
97  EXPECT_EQ(pop.value_input_count, OperatorProperties::GetTotalInputCount(op));
98 
99  EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op));
100  EXPECT_EQ(0, OperatorProperties::GetEffectOutputCount(op));
101  EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op));
102 }

References v8::internal::compiler::OperatorProperties::GetControlInputCount(), v8::internal::compiler::OperatorProperties::GetControlOutputCount(), v8::internal::compiler::OperatorProperties::GetEffectInputCount(), v8::internal::compiler::OperatorProperties::GetEffectOutputCount(), v8::internal::compiler::OperatorProperties::GetTotalInputCount(), v8::internal::compiler::OperatorProperties::GetValueInputCount(), and v8::internal::compiler::OperatorProperties::GetValueOutputCount().

+ Here is the call graph for this function:

◆ TEST_P() [74/76]

v8::internal::compiler::TEST_P ( SimplifiedPureOperatorTest  ,
OpcodeIsCorrect   
)

Definition at line 105 of file simplified-operator-unittest.cc.

105  {
106  SimplifiedOperatorBuilder simplified(zone());
107  const PureOperator& pop = GetParam();
108  const Operator* op = (simplified.*pop.constructor)();
109  EXPECT_EQ(pop.opcode, op->opcode());
110 }

References v8::internal::compiler::Operator::opcode().

+ Here is the call graph for this function:

◆ TEST_P() [75/76]

v8::internal::compiler::TEST_P ( SimplifiedPureOperatorTest  ,
Properties   
)

Definition at line 113 of file simplified-operator-unittest.cc.

113  {
114  SimplifiedOperatorBuilder simplified(zone());
115  const PureOperator& pop = GetParam();
116  const Operator* op = (simplified.*pop.constructor)();
117  EXPECT_EQ(pop.properties, op->properties() & pop.properties);
118 }

References v8::internal::compiler::Operator::properties().

+ Here is the call graph for this function:

◆ TEST_P() [76/76]

v8::internal::compiler::TEST_P ( SimplifiedUnaryOperatorTest  ,
Parameter   
)

Definition at line 162 of file simplified-operator-reducer-unittest.cc.

162  {
163  const UnaryOperator& unop = GetParam();
164  Reduction reduction = Reduce(
165  graph()->NewNode((simplified()->*unop.constructor)(), Parameter(0)));
166  EXPECT_FALSE(reduction.Changed());
167 }

◆ Trace()

static void v8::internal::compiler::Trace ( const char *  msg,
  ... 
)
inlinestatic

Definition at line 21 of file scheduler.cc.

21  {
22  if (FLAG_trace_turbo_scheduler) {
23  va_list arguments;
24  va_start(arguments, msg);
25  base::OS::VPrint(msg, arguments);
26  va_end(arguments);
27  }
28 }

References v8::base::OS::VPrint().

Referenced by v8::internal::compiler::CFGBuilder::BuildBlockForNode(), v8::internal::compiler::Scheduler::BuildCFG(), v8::internal::compiler::Scheduler::ComputeSpecialRPO(), v8::internal::compiler::Scheduler::ConnectFloatingControl(), v8::internal::compiler::Scheduler::ConnectFloatingControlSubgraph(), v8::internal::compiler::Scheduler::GenerateImmediateDominatorTree(), v8::internal::compiler::ScheduleLateNodeVisitor::GetBlockForUse(), v8::internal::compiler::Scheduler::GetPlacement(), v8::internal::compiler::ScheduleEarlyNodeVisitor::Post(), v8::internal::compiler::PrepareUsesVisitor::PostEdge(), v8::internal::compiler::ScheduleEarlyNodeVisitor::Pre(), v8::internal::compiler::PrepareUsesVisitor::Pre(), v8::internal::compiler::ScheduleLateNodeVisitor::Pre(), v8::internal::compiler::Scheduler::PrepareUses(), v8::internal::compiler::Scheduler::ScheduleEarly(), v8::internal::compiler::Scheduler::ScheduleLate(), v8::internal::compiler::ScheduleLateNodeVisitor::ScheduleNode(), and v8::internal::compiler::CFGBuilder::TraceConnect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TraceSchedule()

static void v8::internal::compiler::TraceSchedule ( Schedule schedule)
static

Definition at line 159 of file pipeline.cc.

159  {
160  if (!FLAG_trace_turbo) return;
161  OFStream os(stdout);
162  os << "-- Schedule --------------------------------------\n" << *schedule;
163 }

Referenced by v8::internal::compiler::Pipeline::ComputeSchedule(), and v8::internal::compiler::Pipeline::GenerateCodeForMachineGraph().

+ Here is the caller graph for this function:

◆ TryMatchASR()

static bool v8::internal::compiler::TryMatchASR ( InstructionSelector *  selector,
InstructionCode opcode_return,
Node *  node,
InstructionOperand **  value_return,
InstructionOperand **  shift_return 
)
inlinestatic

Definition at line 142 of file instruction-selector-arm.cc.

145  {
146  ArmOperandGenerator g(selector);
147  if (node->opcode() != IrOpcode::kWord32Sar) return false;
148  Int32BinopMatcher m(node);
149  *value_return = g.UseRegister(m.left().node());
150  if (m.right().IsInRange(1, 32)) {
151  *opcode_return |= AddressingModeField::encode(kMode_Operand2_R_ASR_I);
152  *shift_return = g.UseImmediate(m.right().node());
153  } else {
154  *opcode_return |= AddressingModeField::encode(kMode_Operand2_R_ASR_R);
155  *shift_return = g.UseRegister(m.right().node());
156  }
157  return true;
158 }
BinopMatcher< Int32Matcher, Int32Matcher > Int32BinopMatcher

References v8::internal::BitFieldBase< T, shift, size, uint32_t >::encode(), v8::internal::compiler::OperandGenerator::UseImmediate(), and v8::internal::compiler::OperandGenerator::UseRegister().

Referenced by TryMatchShift().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TryMatchImmediateOrShift()

static bool v8::internal::compiler::TryMatchImmediateOrShift ( InstructionSelector *  selector,
InstructionCode opcode_return,
Node *  node,
size_t *  input_count_return,
InstructionOperand **  inputs 
)
inlinestatic

Definition at line 211 of file instruction-selector-arm.cc.

215  {
216  ArmOperandGenerator g(selector);
217  if (g.CanBeImmediate(node, *opcode_return)) {
218  *opcode_return |= AddressingModeField::encode(kMode_Operand2_I);
219  inputs[0] = g.UseImmediate(node);
220  *input_count_return = 1;
221  return true;
222  }
223  if (TryMatchShift(selector, opcode_return, node, &inputs[0], &inputs[1])) {
224  *input_count_return = 2;
225  return true;
226  }
227  return false;
228 }

References v8::internal::compiler::ArmOperandGenerator::CanBeImmediate(), v8::internal::BitFieldBase< T, shift, size, uint32_t >::encode(), TryMatchShift(), and v8::internal::compiler::OperandGenerator::UseImmediate().

Referenced by VisitBinop(), and VisitWordCompare().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TryMatchLSL()

static bool v8::internal::compiler::TryMatchLSL ( InstructionSelector *  selector,
InstructionCode opcode_return,
Node *  node,
InstructionOperand **  value_return,
InstructionOperand **  shift_return 
)
inlinestatic

Definition at line 161 of file instruction-selector-arm.cc.

164  {
165  ArmOperandGenerator g(selector);
166  if (node->opcode() != IrOpcode::kWord32Shl) return false;
167  Int32BinopMatcher m(node);
168  *value_return = g.UseRegister(m.left().node());
169  if (m.right().IsInRange(0, 31)) {
170  *opcode_return |= AddressingModeField::encode(kMode_Operand2_R_LSL_I);
171  *shift_return = g.UseImmediate(m.right().node());
172  } else {
173  *opcode_return |= AddressingModeField::encode(kMode_Operand2_R_LSL_R);
174  *shift_return = g.UseRegister(m.right().node());
175  }
176  return true;
177 }

References v8::internal::BitFieldBase< T, shift, size, uint32_t >::encode(), v8::internal::compiler::OperandGenerator::UseImmediate(), and v8::internal::compiler::OperandGenerator::UseRegister().

Referenced by TryMatchShift().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TryMatchLSR()

static bool v8::internal::compiler::TryMatchLSR ( InstructionSelector *  selector,
InstructionCode opcode_return,
Node *  node,
InstructionOperand **  value_return,
InstructionOperand **  shift_return 
)
inlinestatic

Definition at line 180 of file instruction-selector-arm.cc.

183  {
184  ArmOperandGenerator g(selector);
185  if (node->opcode() != IrOpcode::kWord32Shr) return false;
186  Int32BinopMatcher m(node);
187  *value_return = g.UseRegister(m.left().node());
188  if (m.right().IsInRange(1, 32)) {
189  *opcode_return |= AddressingModeField::encode(kMode_Operand2_R_LSR_I);
190  *shift_return = g.UseImmediate(m.right().node());
191  } else {
192  *opcode_return |= AddressingModeField::encode(kMode_Operand2_R_LSR_R);
193  *shift_return = g.UseRegister(m.right().node());
194  }
195  return true;
196 }

References v8::internal::BitFieldBase< T, shift, size, uint32_t >::encode(), v8::internal::compiler::OperandGenerator::UseImmediate(), and v8::internal::compiler::OperandGenerator::UseRegister().

Referenced by TryMatchShift().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TryMatchROR()

static bool v8::internal::compiler::TryMatchROR ( InstructionSelector *  selector,
InstructionCode opcode_return,
Node *  node,
InstructionOperand **  value_return,
InstructionOperand **  shift_return 
)
static

Definition at line 123 of file instruction-selector-arm.cc.

126  {
127  ArmOperandGenerator g(selector);
128  if (node->opcode() != IrOpcode::kWord32Ror) return false;
129  Int32BinopMatcher m(node);
130  *value_return = g.UseRegister(m.left().node());
131  if (m.right().IsInRange(1, 31)) {
132  *opcode_return |= AddressingModeField::encode(kMode_Operand2_R_ROR_I);
133  *shift_return = g.UseImmediate(m.right().node());
134  } else {
135  *opcode_return |= AddressingModeField::encode(kMode_Operand2_R_ROR_R);
136  *shift_return = g.UseRegister(m.right().node());
137  }
138  return true;
139 }

References v8::internal::BitFieldBase< T, shift, size, uint32_t >::encode(), v8::internal::compiler::OperandGenerator::UseImmediate(), and v8::internal::compiler::OperandGenerator::UseRegister().

Referenced by TryMatchShift().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TryMatchShift()

static bool v8::internal::compiler::TryMatchShift ( InstructionSelector *  selector,
InstructionCode opcode_return,
Node *  node,
InstructionOperand **  value_return,
InstructionOperand **  shift_return 
)
inlinestatic

Definition at line 199 of file instruction-selector-arm.cc.

202  {
203  return (
204  TryMatchASR(selector, opcode_return, node, value_return, shift_return) ||
205  TryMatchLSL(selector, opcode_return, node, value_return, shift_return) ||
206  TryMatchLSR(selector, opcode_return, node, value_return, shift_return) ||
207  TryMatchROR(selector, opcode_return, node, value_return, shift_return));
208 }
static bool TryMatchASR(InstructionSelector *selector, InstructionCode *opcode_return, Node *node, InstructionOperand **value_return, InstructionOperand **shift_return)
static bool TryMatchLSR(InstructionSelector *selector, InstructionCode *opcode_return, Node *node, InstructionOperand **value_return, InstructionOperand **shift_return)
static bool TryMatchLSL(InstructionSelector *selector, InstructionCode *opcode_return, Node *node, InstructionOperand **value_return, InstructionOperand **shift_return)
static bool TryMatchROR(InstructionSelector *selector, InstructionCode *opcode_return, Node *node, InstructionOperand **value_return, InstructionOperand **shift_return)

References TryMatchASR(), TryMatchLSL(), TryMatchLSR(), and TryMatchROR().

Referenced by EmitBic(), and TryMatchImmediateOrShift().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TypeOf()

MachineType v8::internal::compiler::TypeOf ( MachineType  machine_type)
inline

Definition at line 70 of file machine-type.h.

70  {
71  int result = machine_type & kTypeMask;
72  return static_cast<MachineType>(result);
73 }
const MachineTypeUnion kTypeMask
Definition: machine-type.h:65

References kTypeMask.

Referenced by v8::internal::HInstruction::PrintTo(), and v8::internal::compiler::AstGraphBuilder::VisitTypeof().

+ Here is the caller graph for this function:

◆ UnhandledSortHelper()

static int v8::internal::compiler::UnhandledSortHelper ( LiveRange *const *  a,
LiveRange *const *  b 
)
static

Definition at line 1703 of file register-allocator.cc.

1703  {
1704  DCHECK(!(*a)->ShouldBeAllocatedBefore(*b) ||
1705  !(*b)->ShouldBeAllocatedBefore(*a));
1706  if ((*a)->ShouldBeAllocatedBefore(*b)) return 1;
1707  if ((*b)->ShouldBeAllocatedBefore(*a)) return -1;
1708  return (*a)->id() - (*b)->id();
1709 }

References DCHECK.

◆ UseOrImmediate()

static InstructionOperand* v8::internal::compiler::UseOrImmediate ( OperandGenerator g,
Node *  input 
)
static

Definition at line 1012 of file instruction-selector.cc.

1012  {
1013  switch (input->opcode()) {
1014  case IrOpcode::kInt32Constant:
1015  case IrOpcode::kNumberConstant:
1016  case IrOpcode::kFloat64Constant:
1017  case IrOpcode::kHeapConstant:
1018  return g->UseImmediate(input);
1019  default:
1020  return g->UseUnique(input);
1021  }
1022 }

References v8::internal::compiler::OperandGenerator::UseImmediate(), and v8::internal::compiler::OperandGenerator::UseUnique().

+ Here is the call graph for this function:

◆ VerifyGraphs()

static bool v8::internal::compiler::VerifyGraphs ( )
inlinestatic

Definition at line 82 of file pipeline.cc.

82  {
83 #ifdef DEBUG
84  return true;
85 #else
86  return FLAG_turbo_verify;
87 #endif
88 }

Referenced by v8::internal::compiler::Pipeline::ComputeSchedule(), and v8::internal::compiler::Pipeline::VerifyAndPrintGraph().

+ Here is the caller graph for this function:

◆ VerifyMovesAreInjective()

static void v8::internal::compiler::VerifyMovesAreInjective ( ZoneList< MoveOperands > *  moves)
static

Definition at line 29 of file gap-resolver.cc.

29  {
30 #ifdef ENABLE_SLOW_DCHECKS
31  std::set<InstructionOperand*, InstructionOperandComparator> seen;
32  for (op_iterator i = moves->begin(); i != moves->end(); ++i) {
33  SLOW_DCHECK(seen.find(i->destination()) == seen.end());
34  seen.insert(i->destination());
35  }
36 #endif
37 }
#define SLOW_DCHECK(condition)
Definition: checks.h:30
iterator end() const
Definition: list.h:75
iterator begin() const
Definition: list.h:74
ZoneList< MoveOperands >::iterator op_iterator
Definition: gap-resolver.cc:15

References v8::internal::List< T, AllocationPolicy >::begin(), v8::internal::List< T, AllocationPolicy >::end(), and SLOW_DCHECK.

+ Here is the call graph for this function:

◆ VisitBinop() [1/8]

template<typename Matcher >
static void v8::internal::compiler::VisitBinop ( InstructionSelector *  selector,
Node *  node,
ArchOpcode  opcode,
ImmediateMode  operand_mode 
)
static

Definition at line 151 of file instruction-selector-arm64.cc.

152  {
153  FlagsContinuation cont;
154  VisitBinop<Matcher>(selector, node, opcode, operand_mode, &cont);
155 }

◆ VisitBinop() [2/8]

static void v8::internal::compiler::VisitBinop ( InstructionSelector *  selector,
Node *  node,
InstructionCode  opcode 
)
static

Definition at line 298 of file instruction-selector-ia32.cc.

299  {
300  FlagsContinuation cont;
301  VisitBinop(selector, node, opcode, &cont);
302 }
static void VisitBinop(InstructionSelector *selector, Node *node, InstructionCode opcode)

References VisitBinop().

+ Here is the call graph for this function:

◆ VisitBinop() [3/8]

static void v8::internal::compiler::VisitBinop ( InstructionSelector *  selector,
Node *  node,
InstructionCode  opcode 
)
static

Definition at line 290 of file instruction-selector-x64.cc.

291  {
292  FlagsContinuation cont;
293  VisitBinop(selector, node, opcode, &cont);
294 }

References VisitBinop().

+ Here is the call graph for this function:

◆ VisitBinop() [4/8]

static void v8::internal::compiler::VisitBinop ( InstructionSelector *  selector,
Node *  node,
InstructionCode  opcode,
FlagsContinuation *  cont 
)
static

Definition at line 251 of file instruction-selector-ia32.cc.

252  {
253  IA32OperandGenerator g(selector);
254  Int32BinopMatcher m(node);
255  Node* left = m.left().node();
256  Node* right = m.right().node();
257  InstructionOperand* inputs[4];
258  size_t input_count = 0;
259  InstructionOperand* outputs[2];
260  size_t output_count = 0;
261 
262  // TODO(turbofan): match complex addressing modes.
263  if (g.CanBeImmediate(right)) {
264  inputs[input_count++] = g.Use(left);
265  inputs[input_count++] = g.UseImmediate(right);
266  } else {
267  if (node->op()->HasProperty(Operator::kCommutative) &&
268  g.CanBeBetterLeftOperand(right)) {
269  std::swap(left, right);
270  }
271  inputs[input_count++] = g.UseRegister(left);
272  inputs[input_count++] = g.Use(right);
273  }
274 
275  if (cont->IsBranch()) {
276  inputs[input_count++] = g.Label(cont->true_block());
277  inputs[input_count++] = g.Label(cont->false_block());
278  }
279 
280  outputs[output_count++] = g.DefineSameAsFirst(node);
281  if (cont->IsSet()) {
282  // TODO(turbofan): Use byte register here.
283  outputs[output_count++] = g.DefineAsRegister(cont->result());
284  }
285 
286  DCHECK_NE(0, input_count);
287  DCHECK_NE(0, output_count);
288  DCHECK_GE(arraysize(inputs), input_count);
289  DCHECK_GE(arraysize(outputs), output_count);
290 
291  Instruction* instr = selector->Emit(cont->Encode(opcode), output_count,
292  outputs, input_count, inputs);
293  if (cont->IsBranch()) instr->MarkAsControl();
294 }
#define DCHECK_NE(v1, v2)
Definition: logging.h:207
#define DCHECK_GE(v1, v2)
Definition: logging.h:208

References arraysize, DCHECK_GE, DCHECK_NE, v8::internal::compiler::Operator::kCommutative, and v8::internal::compiler::Instruction::MarkAsControl().

+ Here is the call graph for this function:

◆ VisitBinop() [5/8]

static void v8::internal::compiler::VisitBinop ( InstructionSelector *  selector,
Node *  node,
InstructionCode  opcode,
FlagsContinuation *  cont 
)
static

Definition at line 244 of file instruction-selector-x64.cc.

245  {
246  X64OperandGenerator g(selector);
247  Int32BinopMatcher m(node);
248  Node* left = m.left().node();
249  Node* right = m.right().node();
250  InstructionOperand* inputs[4];
251  size_t input_count = 0;
252  InstructionOperand* outputs[2];
253  size_t output_count = 0;
254 
255  // TODO(turbofan): match complex addressing modes.
256  if (g.CanBeImmediate(right)) {
257  inputs[input_count++] = g.Use(left);
258  inputs[input_count++] = g.UseImmediate(right);
259  } else {
260  if (node->op()->HasProperty(Operator::kCommutative) &&
261  g.CanBeBetterLeftOperand(right)) {
262  std::swap(left, right);
263  }
264  inputs[input_count++] = g.UseRegister(left);
265  inputs[input_count++] = g.Use(right);
266  }
267 
268  if (cont->IsBranch()) {
269  inputs[input_count++] = g.Label(cont->true_block());
270  inputs[input_count++] = g.Label(cont->false_block());
271  }
272 
273  outputs[output_count++] = g.DefineSameAsFirst(node);
274  if (cont->IsSet()) {
275  outputs[output_count++] = g.DefineAsRegister(cont->result());
276  }
277 
278  DCHECK_NE(0, input_count);
279  DCHECK_NE(0, output_count);
280  DCHECK_GE(arraysize(inputs), input_count);
281  DCHECK_GE(arraysize(outputs), output_count);
282 
283  Instruction* instr = selector->Emit(cont->Encode(opcode), output_count,
284  outputs, input_count, inputs);
285  if (cont->IsBranch()) instr->MarkAsControl();
286 }

References arraysize, DCHECK_GE, DCHECK_NE, v8::internal::compiler::Operator::kCommutative, and v8::internal::compiler::Instruction::MarkAsControl().

+ Here is the call graph for this function:

◆ VisitBinop() [6/8]

template<typename Matcher >
static void v8::internal::compiler::VisitBinop ( InstructionSelector *  selector,
Node *  node,
InstructionCode  opcode,
ImmediateMode  operand_mode,
FlagsContinuation *  cont 
)
static

Definition at line 115 of file instruction-selector-arm64.cc.

117  {
118  Arm64OperandGenerator g(selector);
119  Matcher m(node);
120  InstructionOperand* inputs[4];
121  size_t input_count = 0;
122  InstructionOperand* outputs[2];
123  size_t output_count = 0;
124 
125  inputs[input_count++] = g.UseRegister(m.left().node());
126  inputs[input_count++] = g.UseOperand(m.right().node(), operand_mode);
127 
128  if (cont->IsBranch()) {
129  inputs[input_count++] = g.Label(cont->true_block());
130  inputs[input_count++] = g.Label(cont->false_block());
131  }
132 
133  outputs[output_count++] = g.DefineAsRegister(node);
134  if (cont->IsSet()) {
135  outputs[output_count++] = g.DefineAsRegister(cont->result());
136  }
137 
138  DCHECK_NE(0, input_count);
139  DCHECK_NE(0, output_count);
140  DCHECK_GE(arraysize(inputs), input_count);
141  DCHECK_GE(arraysize(outputs), output_count);
142 
143  Instruction* instr = selector->Emit(cont->Encode(opcode), output_count,
144  outputs, input_count, inputs);
145  if (cont->IsBranch()) instr->MarkAsControl();
146 }

References arraysize, DCHECK_GE, DCHECK_NE, and v8::internal::compiler::Instruction::MarkAsControl().

+ Here is the call graph for this function:

◆ VisitBinop() [7/8]

static void v8::internal::compiler::VisitBinop ( InstructionSelector *  selector,
Node *  node,
InstructionCode  opcode,
InstructionCode  reverse_opcode 
)
static

Definition at line 279 of file instruction-selector-arm.cc.

280  {
281  FlagsContinuation cont;
282  VisitBinop(selector, node, opcode, reverse_opcode, &cont);
283 }
static void VisitBinop(InstructionSelector *selector, Node *node, InstructionCode opcode, InstructionCode reverse_opcode)

References VisitBinop().

+ Here is the call graph for this function:

◆ VisitBinop() [8/8]

static void v8::internal::compiler::VisitBinop ( InstructionSelector *  selector,
Node *  node,
InstructionCode  opcode,
InstructionCode  reverse_opcode,
FlagsContinuation *  cont 
)
static

Definition at line 231 of file instruction-selector-arm.cc.

233  {
234  ArmOperandGenerator g(selector);
235  Int32BinopMatcher m(node);
236  InstructionOperand* inputs[5];
237  size_t input_count = 0;
238  InstructionOperand* outputs[2];
239  size_t output_count = 0;
240 
241  if (TryMatchImmediateOrShift(selector, &opcode, m.right().node(),
242  &input_count, &inputs[1])) {
243  inputs[0] = g.UseRegister(m.left().node());
244  input_count++;
245  } else if (TryMatchImmediateOrShift(selector, &reverse_opcode,
246  m.left().node(), &input_count,
247  &inputs[1])) {
248  inputs[0] = g.UseRegister(m.right().node());
249  opcode = reverse_opcode;
250  input_count++;
251  } else {
252  opcode |= AddressingModeField::encode(kMode_Operand2_R);
253  inputs[input_count++] = g.UseRegister(m.left().node());
254  inputs[input_count++] = g.UseRegister(m.right().node());
255  }
256 
257  if (cont->IsBranch()) {
258  inputs[input_count++] = g.Label(cont->true_block());
259  inputs[input_count++] = g.Label(cont->false_block());
260  }
261 
262  outputs[output_count++] = g.DefineAsRegister(node);
263  if (cont->IsSet()) {
264  outputs[output_count++] = g.DefineAsRegister(cont->result());
265  }
266 
267  DCHECK_NE(0, input_count);
268  DCHECK_NE(0, output_count);
269  DCHECK_GE(arraysize(inputs), input_count);
270  DCHECK_GE(arraysize(outputs), output_count);
271  DCHECK_NE(kMode_None, AddressingModeField::decode(opcode));
272 
273  Instruction* instr = selector->Emit(cont->Encode(opcode), output_count,
274  outputs, input_count, inputs);
275  if (cont->IsBranch()) instr->MarkAsControl();
276 }
static bool TryMatchImmediateOrShift(InstructionSelector *selector, InstructionCode *opcode_return, Node *node, size_t *input_count_return, InstructionOperand **inputs)

References arraysize, DCHECK_GE, DCHECK_NE, v8::internal::BitFieldBase< T, shift, size, uint32_t >::decode(), v8::internal::compiler::OperandGenerator::DefineAsRegister(), v8::internal::BitFieldBase< T, shift, size, uint32_t >::encode(), v8::internal::compiler::OperandGenerator::Label(), v8::internal::compiler::Instruction::MarkAsControl(), TryMatchImmediateOrShift(), and v8::internal::compiler::OperandGenerator::UseRegister().

Referenced by VisitBinop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VisitCompare() [1/3]

static void v8::internal::compiler::VisitCompare ( InstructionSelector *  selector,
InstructionCode  opcode,
InstructionOperand left,
InstructionOperand right,
FlagsContinuation *  cont 
)
static

Definition at line 726 of file instruction-selector-arm64.cc.

728  {
729  Arm64OperandGenerator g(selector);
730  opcode = cont->Encode(opcode);
731  if (cont->IsBranch()) {
732  selector->Emit(opcode, NULL, left, right, g.Label(cont->true_block()),
733  g.Label(cont->false_block()))->MarkAsControl();
734  } else {
735  DCHECK(cont->IsSet());
736  selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right);
737  }
738 }

References DCHECK, and NULL.

Referenced by VisitWordCompare().

+ Here is the caller graph for this function:

◆ VisitCompare() [2/3]

static void v8::internal::compiler::VisitCompare ( InstructionSelector *  selector,
InstructionCode  opcode,
InstructionOperand left,
InstructionOperand right,
FlagsContinuation *  cont 
)
inlinestatic

Definition at line 543 of file instruction-selector-ia32.cc.

547  {
548  IA32OperandGenerator g(selector);
549  if (cont->IsBranch()) {
550  selector->Emit(cont->Encode(opcode), NULL, left, right,
551  g.Label(cont->true_block()),
552  g.Label(cont->false_block()))->MarkAsControl();
553  } else {
554  DCHECK(cont->IsSet());
555  // TODO(titzer): Needs byte register.
556  selector->Emit(cont->Encode(opcode), g.DefineAsRegister(cont->result()),
557  left, right);
558  }
559 }

References DCHECK, and NULL.

◆ VisitCompare() [3/3]

static void v8::internal::compiler::VisitCompare ( InstructionSelector *  selector,
InstructionCode  opcode,
InstructionOperand left,
InstructionOperand right,
FlagsContinuation *  cont 
)
static

Definition at line 666 of file instruction-selector-x64.cc.

668  {
669  X64OperandGenerator g(selector);
670  opcode = cont->Encode(opcode);
671  if (cont->IsBranch()) {
672  selector->Emit(opcode, NULL, left, right, g.Label(cont->true_block()),
673  g.Label(cont->false_block()))->MarkAsControl();
674  } else {
675  DCHECK(cont->IsSet());
676  selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right);
677  }
678 }

References DCHECK, and NULL.

◆ VisitDiv() [1/3]

static void v8::internal::compiler::VisitDiv ( InstructionSelector *  selector,
Node *  node,
ArchOpcode  div_opcode,
ArchOpcode  f64i32_opcode,
ArchOpcode  i32f64_opcode 
)
static

Definition at line 635 of file instruction-selector-arm.cc.

637  {
638  ArmOperandGenerator g(selector);
639  Int32BinopMatcher m(node);
640  EmitDiv(selector, div_opcode, f64i32_opcode, i32f64_opcode,
641  g.DefineAsRegister(node), g.UseRegister(m.left().node()),
642  g.UseRegister(m.right().node()));
643 }
static void EmitDiv(InstructionSelector *selector, ArchOpcode div_opcode, ArchOpcode f64i32_opcode, ArchOpcode i32f64_opcode, InstructionOperand *result_operand, InstructionOperand *left_operand, InstructionOperand *right_operand)

References v8::internal::compiler::OperandGenerator::DefineAsRegister(), EmitDiv(), and v8::internal::compiler::OperandGenerator::UseRegister().

+ Here is the call graph for this function:

◆ VisitDiv() [2/3]

static void v8::internal::compiler::VisitDiv ( InstructionSelector *  selector,
Node *  node,
ArchOpcode  opcode 
)
inlinestatic

Definition at line 405 of file instruction-selector-ia32.cc.

406  {
407  IA32OperandGenerator g(selector);
408  InstructionOperand* temps[] = {g.TempRegister(edx)};
409  size_t temp_count = arraysize(temps);
410  selector->Emit(opcode, g.DefineAsFixed(node, eax),
411  g.UseFixed(node->InputAt(0), eax),
412  g.UseUnique(node->InputAt(1)), temp_count, temps);
413 }
const Register edx
const Register eax

References arraysize, v8::internal::eax, and v8::internal::edx.

◆ VisitDiv() [3/3]

static void v8::internal::compiler::VisitDiv ( InstructionSelector *  selector,
Node *  node,
ArchOpcode  opcode 
)
static

Definition at line 492 of file instruction-selector-x64.cc.

493  {
494  X64OperandGenerator g(selector);
495  InstructionOperand* temps[] = {g.TempRegister(rdx)};
496  selector->Emit(
497  opcode, g.DefineAsFixed(node, rax), g.UseFixed(node->InputAt(0), rax),
498  g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps);
499 }
const Register rdx
const Register rax

References arraysize, v8::internal::rax, and v8::internal::rdx.

◆ VisitLogical()

template<typename Matcher >
static void v8::internal::compiler::VisitLogical ( InstructionSelector *  selector,
Node *  node,
Matcher *  m,
ArchOpcode  opcode,
bool  left_can_cover,
bool  right_can_cover,
ImmediateMode  imm_mode 
)
static

Definition at line 271 of file instruction-selector-arm64.cc.

273  {
274  Arm64OperandGenerator g(selector);
275 
276  // Map instruction to equivalent operation with inverted right input.
277  ArchOpcode inv_opcode = opcode;
278  switch (opcode) {
279  case kArm64And32:
280  inv_opcode = kArm64Bic32;
281  break;
282  case kArm64And:
283  inv_opcode = kArm64Bic;
284  break;
285  case kArm64Or32:
286  inv_opcode = kArm64Orn32;
287  break;
288  case kArm64Or:
289  inv_opcode = kArm64Orn;
290  break;
291  case kArm64Eor32:
292  inv_opcode = kArm64Eon32;
293  break;
294  case kArm64Eor:
295  inv_opcode = kArm64Eon;
296  break;
297  default:
298  UNREACHABLE();
299  }
300 
301  // Select Logical(y, ~x) for Logical(Xor(x, -1), y).
302  if ((m->left().IsWord32Xor() || m->left().IsWord64Xor()) && left_can_cover) {
303  Matcher mleft(m->left().node());
304  if (mleft.right().Is(-1)) {
305  // TODO(all): support shifted operand on right.
306  selector->Emit(inv_opcode, g.DefineAsRegister(node),
307  g.UseRegister(m->right().node()),
308  g.UseRegister(mleft.left().node()));
309  return;
310  }
311  }
312 
313  // Select Logical(x, ~y) for Logical(x, Xor(y, -1)).
314  if ((m->right().IsWord32Xor() || m->right().IsWord64Xor()) &&
315  right_can_cover) {
316  Matcher mright(m->right().node());
317  if (mright.right().Is(-1)) {
318  // TODO(all): support shifted operand on right.
319  selector->Emit(inv_opcode, g.DefineAsRegister(node),
320  g.UseRegister(m->left().node()),
321  g.UseRegister(mright.left().node()));
322  return;
323  }
324  }
325 
326  if (m->IsWord32Xor() && m->right().Is(-1)) {
327  selector->Emit(kArm64Not32, g.DefineAsRegister(node),
328  g.UseRegister(m->left().node()));
329  } else if (m->IsWord64Xor() && m->right().Is(-1)) {
330  selector->Emit(kArm64Not, g.DefineAsRegister(node),
331  g.UseRegister(m->left().node()));
332  } else {
333  VisitBinop<Matcher>(selector, node, opcode, imm_mode);
334  }
335 }

References UNREACHABLE.

◆ VisitMod() [1/3]

static void v8::internal::compiler::VisitMod ( InstructionSelector *  selector,
Node *  node,
ArchOpcode  div_opcode,
ArchOpcode  f64i32_opcode,
ArchOpcode  i32f64_opcode 
)
static

Definition at line 656 of file instruction-selector-arm.cc.

658  {
659  ArmOperandGenerator g(selector);
660  Int32BinopMatcher m(node);
661  InstructionOperand* div_operand = g.TempRegister();
662  InstructionOperand* result_operand = g.DefineAsRegister(node);
663  InstructionOperand* left_operand = g.UseRegister(m.left().node());
664  InstructionOperand* right_operand = g.UseRegister(m.right().node());
665  EmitDiv(selector, div_opcode, f64i32_opcode, i32f64_opcode, div_operand,
666  left_operand, right_operand);
667  if (selector->IsSupported(MLS)) {
668  selector->Emit(kArmMls, result_operand, div_operand, right_operand,
669  left_operand);
670  return;
671  }
672  InstructionOperand* mul_operand = g.TempRegister();
673  selector->Emit(kArmMul, mul_operand, div_operand, right_operand);
674  selector->Emit(kArmSub, result_operand, left_operand, mul_operand);
675 }

References v8::internal::compiler::OperandGenerator::DefineAsRegister(), EmitDiv(), v8::internal::MLS, v8::internal::compiler::OperandGenerator::TempRegister(), and v8::internal::compiler::OperandGenerator::UseRegister().

+ Here is the call graph for this function:

◆ VisitMod() [2/3]

static void v8::internal::compiler::VisitMod ( InstructionSelector *  selector,
Node *  node,
ArchOpcode  opcode 
)
inlinestatic

Definition at line 426 of file instruction-selector-ia32.cc.

427  {
428  IA32OperandGenerator g(selector);
429  InstructionOperand* temps[] = {g.TempRegister(eax), g.TempRegister(edx)};
430  size_t temp_count = arraysize(temps);
431  selector->Emit(opcode, g.DefineAsFixed(node, edx),
432  g.UseFixed(node->InputAt(0), eax),
433  g.UseUnique(node->InputAt(1)), temp_count, temps);
434 }

References arraysize, v8::internal::eax, and v8::internal::edx.

◆ VisitMod() [3/3]

static void v8::internal::compiler::VisitMod ( InstructionSelector *  selector,
Node *  node,
ArchOpcode  opcode 
)
static

Definition at line 522 of file instruction-selector-x64.cc.

523  {
524  X64OperandGenerator g(selector);
525  InstructionOperand* temps[] = {g.TempRegister(rax), g.TempRegister(rdx)};
526  selector->Emit(
527  opcode, g.DefineAsFixed(node, rdx), g.UseFixed(node->InputAt(0), rax),
528  g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps);
529 }

References arraysize, v8::internal::rax, and v8::internal::rdx.

◆ VisitMul()

static void v8::internal::compiler::VisitMul ( InstructionSelector *  selector,
Node *  node,
ArchOpcode  opcode 
)
static

Definition at line 463 of file instruction-selector-x64.cc.

464  {
465  X64OperandGenerator g(selector);
466  Int32BinopMatcher m(node);
467  Node* left = m.left().node();
468  Node* right = m.right().node();
469  if (g.CanBeImmediate(right)) {
470  selector->Emit(opcode, g.DefineAsRegister(node), g.Use(left),
471  g.UseImmediate(right));
472  } else {
473  if (g.CanBeBetterLeftOperand(right)) {
474  std::swap(left, right);
475  }
476  selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left),
477  g.Use(right));
478  }
479 }

◆ VisitRRO()

static void v8::internal::compiler::VisitRRO ( InstructionSelector *  selector,
ArchOpcode  opcode,
Node *  node,
ImmediateMode  operand_mode 
)
static

Definition at line 104 of file instruction-selector-arm64.cc.

105  {
106  Arm64OperandGenerator g(selector);
107  selector->Emit(opcode, g.DefineAsRegister(node),
108  g.UseRegister(node->InputAt(0)),
109  g.UseOperand(node->InputAt(1), operand_mode));
110 }

◆ VisitRRR()

static void v8::internal::compiler::VisitRRR ( InstructionSelector *  selector,
ArchOpcode  opcode,
Node *  node 
)
static

Definition at line 86 of file instruction-selector-arm64.cc.

87  {
88  Arm64OperandGenerator g(selector);
89  selector->Emit(opcode, g.DefineAsRegister(node),
90  g.UseRegister(node->InputAt(0)),
91  g.UseRegister(node->InputAt(1)));
92 }

◆ VisitRRRFloat64() [1/2]

static void v8::internal::compiler::VisitRRRFloat64 ( InstructionSelector *  selector,
ArchOpcode  opcode,
Node *  node 
)
static

Definition at line 114 of file instruction-selector-arm.cc.

115  {
116  ArmOperandGenerator g(selector);
117  selector->Emit(opcode, g.DefineAsRegister(node),
118  g.UseRegister(node->InputAt(0)),
119  g.UseRegister(node->InputAt(1)));
120 }

References v8::internal::compiler::OperandGenerator::DefineAsRegister(), and v8::internal::compiler::OperandGenerator::UseRegister().

+ Here is the call graph for this function:

◆ VisitRRRFloat64() [2/2]

static void v8::internal::compiler::VisitRRRFloat64 ( InstructionSelector *  selector,
ArchOpcode  opcode,
Node *  node 
)
static

Definition at line 95 of file instruction-selector-arm64.cc.

96  {
97  Arm64OperandGenerator g(selector);
98  selector->Emit(opcode, g.DefineAsRegister(node),
99  g.UseRegister(node->InputAt(0)),
100  g.UseRegister(node->InputAt(1)));
101 }

◆ VisitShift() [1/3]

static void v8::internal::compiler::VisitShift ( InstructionSelector *  selector,
Node *  node,
ArchOpcode  opcode 
)
inlinestatic

Definition at line 327 of file instruction-selector-ia32.cc.

328  {
329  IA32OperandGenerator g(selector);
330  Node* left = node->InputAt(0);
331  Node* right = node->InputAt(1);
332 
333  // TODO(turbofan): assembler only supports some addressing modes for shifts.
334  if (g.CanBeImmediate(right)) {
335  selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left),
336  g.UseImmediate(right));
337  } else {
338  Int32BinopMatcher m(node);
339  if (m.right().IsWord32And()) {
340  Int32BinopMatcher mright(right);
341  if (mright.right().Is(0x1F)) {
342  right = mright.left().node();
343  }
344  }
345  selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left),
346  g.UseFixed(right, ecx));
347  }
348 }
const Register ecx

References v8::internal::ecx.

◆ VisitShift() [2/3]

template<typename TryMatchShift >
static void v8::internal::compiler::VisitShift ( InstructionSelector *  selector,
Node *  node,
TryMatchShift  try_match_shift 
)
inlinestatic

Definition at line 510 of file instruction-selector-arm.cc.

511  {
512  FlagsContinuation cont;
513  VisitShift(selector, node, try_match_shift, &cont);
514 }
static void VisitShift(InstructionSelector *selector, Node *node, TryMatchShift try_match_shift)

References VisitShift().

+ Here is the call graph for this function:

◆ VisitShift() [3/3]

template<typename TryMatchShift >
static void v8::internal::compiler::VisitShift ( InstructionSelector *  selector,
Node *  node,
TryMatchShift  try_match_shift,
FlagsContinuation *  cont 
)
inlinestatic

Definition at line 475 of file instruction-selector-arm.cc.

477  {
478  ArmOperandGenerator g(selector);
479  InstructionCode opcode = kArmMov;
480  InstructionOperand* inputs[4];
481  size_t input_count = 2;
482  InstructionOperand* outputs[2];
483  size_t output_count = 0;
484 
485  CHECK(try_match_shift(selector, &opcode, node, &inputs[0], &inputs[1]));
486 
487  if (cont->IsBranch()) {
488  inputs[input_count++] = g.Label(cont->true_block());
489  inputs[input_count++] = g.Label(cont->false_block());
490  }
491 
492  outputs[output_count++] = g.DefineAsRegister(node);
493  if (cont->IsSet()) {
494  outputs[output_count++] = g.DefineAsRegister(cont->result());
495  }
496 
497  DCHECK_NE(0, input_count);
498  DCHECK_NE(0, output_count);
499  DCHECK_GE(arraysize(inputs), input_count);
500  DCHECK_GE(arraysize(outputs), output_count);
501  DCHECK_NE(kMode_None, AddressingModeField::decode(opcode));
502 
503  Instruction* instr = selector->Emit(cont->Encode(opcode), output_count,
504  outputs, input_count, inputs);
505  if (cont->IsBranch()) instr->MarkAsControl();
506 }

References arraysize, CHECK, DCHECK_GE, DCHECK_NE, v8::internal::BitFieldBase< T, shift, size, uint32_t >::decode(), v8::internal::compiler::OperandGenerator::DefineAsRegister(), v8::internal::compiler::OperandGenerator::Label(), and v8::internal::compiler::Instruction::MarkAsControl().

Referenced by VisitShift().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VisitWord32Shift()

static void v8::internal::compiler::VisitWord32Shift ( InstructionSelector *  selector,
Node *  node,
ArchOpcode  opcode 
)
static

Definition at line 341 of file instruction-selector-x64.cc.

342  {
343  X64OperandGenerator g(selector);
344  Node* left = node->InputAt(0);
345  Node* right = node->InputAt(1);
346 
347  // TODO(turbofan): assembler only supports some addressing modes for shifts.
348  if (g.CanBeImmediate(right)) {
349  selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left),
350  g.UseImmediate(right));
351  } else {
352  Int32BinopMatcher m(node);
353  if (m.right().IsWord32And()) {
354  Int32BinopMatcher mright(right);
355  if (mright.right().Is(0x1F)) {
356  right = mright.left().node();
357  }
358  }
359  selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left),
360  g.UseFixed(right, rcx));
361  }
362 }
const Register rcx

References v8::internal::rcx.

◆ VisitWord64Shift()

static void v8::internal::compiler::VisitWord64Shift ( InstructionSelector *  selector,
Node *  node,
ArchOpcode  opcode 
)
static

Definition at line 367 of file instruction-selector-x64.cc.

368  {
369  X64OperandGenerator g(selector);
370  Node* left = node->InputAt(0);
371  Node* right = node->InputAt(1);
372 
373  // TODO(turbofan): assembler only supports some addressing modes for shifts.
374  if (g.CanBeImmediate(right)) {
375  selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left),
376  g.UseImmediate(right));
377  } else {
378  Int64BinopMatcher m(node);
379  if (m.right().IsWord64And()) {
380  Int64BinopMatcher mright(right);
381  if (mright.right().Is(0x3F)) {
382  right = mright.left().node();
383  }
384  }
385  selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left),
386  g.UseFixed(right, rcx));
387  }
388 }
BinopMatcher< Int64Matcher, Int64Matcher > Int64BinopMatcher

References v8::internal::rcx.

◆ VisitWordCompare() [1/4]

static void v8::internal::compiler::VisitWordCompare ( InstructionSelector *  selector,
Node *  node,
InstructionCode  opcode,
FlagsContinuation *  cont,
bool  commutative 
)
static

Definition at line 862 of file instruction-selector-arm.cc.

864  {
865  ArmOperandGenerator g(selector);
866  Int32BinopMatcher m(node);
867  InstructionOperand* inputs[5];
868  size_t input_count = 0;
869  InstructionOperand* outputs[1];
870  size_t output_count = 0;
871 
872  if (TryMatchImmediateOrShift(selector, &opcode, m.right().node(),
873  &input_count, &inputs[1])) {
874  inputs[0] = g.UseRegister(m.left().node());
875  input_count++;
876  } else if (TryMatchImmediateOrShift(selector, &opcode, m.left().node(),
877  &input_count, &inputs[1])) {
878  if (!commutative) cont->Commute();
879  inputs[0] = g.UseRegister(m.right().node());
880  input_count++;
881  } else {
882  opcode |= AddressingModeField::encode(kMode_Operand2_R);
883  inputs[input_count++] = g.UseRegister(m.left().node());
884  inputs[input_count++] = g.UseRegister(m.right().node());
885  }
886 
887  if (cont->IsBranch()) {
888  inputs[input_count++] = g.Label(cont->true_block());
889  inputs[input_count++] = g.Label(cont->false_block());
890  } else {
891  DCHECK(cont->IsSet());
892  outputs[output_count++] = g.DefineAsRegister(cont->result());
893  }
894 
895  DCHECK_NE(0, input_count);
896  DCHECK_GE(arraysize(inputs), input_count);
897  DCHECK_GE(arraysize(outputs), output_count);
898 
899  Instruction* instr = selector->Emit(cont->Encode(opcode), output_count,
900  outputs, input_count, inputs);
901  if (cont->IsBranch()) instr->MarkAsControl();
902 }

References arraysize, DCHECK, DCHECK_GE, DCHECK_NE, v8::internal::compiler::OperandGenerator::DefineAsRegister(), v8::internal::BitFieldBase< T, shift, size, uint32_t >::encode(), v8::internal::compiler::OperandGenerator::Label(), v8::internal::compiler::Instruction::MarkAsControl(), TryMatchImmediateOrShift(), and v8::internal::compiler::OperandGenerator::UseRegister().

+ Here is the call graph for this function:

◆ VisitWordCompare() [2/4]

static void v8::internal::compiler::VisitWordCompare ( InstructionSelector *  selector,
Node *  node,
InstructionCode  opcode,
FlagsContinuation *  cont,
bool  commutative 
)
static

Definition at line 742 of file instruction-selector-arm64.cc.

744  {
745  Arm64OperandGenerator g(selector);
746  Node* left = node->InputAt(0);
747  Node* right = node->InputAt(1);
748 
749  // Match immediates on left or right side of comparison.
750  if (g.CanBeImmediate(right, kArithmeticImm)) {
751  VisitCompare(selector, opcode, g.UseRegister(left), g.UseImmediate(right),
752  cont);
753  } else if (g.CanBeImmediate(left, kArithmeticImm)) {
754  if (!commutative) cont->Commute();
755  VisitCompare(selector, opcode, g.UseRegister(right), g.UseImmediate(left),
756  cont);
757  } else {
758  VisitCompare(selector, opcode, g.UseRegister(left), g.UseRegister(right),
759  cont);
760  }
761 }
static void VisitCompare(InstructionSelector *selector, InstructionCode opcode, InstructionOperand *left, InstructionOperand *right, FlagsContinuation *cont)

References kArithmeticImm, and VisitCompare().

+ Here is the call graph for this function:

◆ VisitWordCompare() [3/4]

static void v8::internal::compiler::VisitWordCompare ( InstructionSelector *  selector,
Node *  node,
InstructionCode  opcode,
FlagsContinuation *  cont,
bool  commutative 
)
inlinestatic

Definition at line 563 of file instruction-selector-ia32.cc.

565  {
566  IA32OperandGenerator g(selector);
567  Node* left = node->InputAt(0);
568  Node* right = node->InputAt(1);
569 
570  // Match immediates on left or right side of comparison.
571  if (g.CanBeImmediate(right)) {
572  VisitCompare(selector, opcode, g.Use(left), g.UseImmediate(right), cont);
573  } else if (g.CanBeImmediate(left)) {
574  if (!commutative) cont->Commute();
575  VisitCompare(selector, opcode, g.Use(right), g.UseImmediate(left), cont);
576  } else {
577  VisitCompare(selector, opcode, g.UseRegister(left), g.Use(right), cont);
578  }
579 }

References VisitCompare().

+ Here is the call graph for this function:

◆ VisitWordCompare() [4/4]

static void v8::internal::compiler::VisitWordCompare ( InstructionSelector *  selector,
Node *  node,
InstructionCode  opcode,
FlagsContinuation *  cont,
bool  commutative 
)
static

Definition at line 682 of file instruction-selector-x64.cc.

684  {
685  X64OperandGenerator g(selector);
686  Node* left = node->InputAt(0);
687  Node* right = node->InputAt(1);
688 
689  // Match immediates on left or right side of comparison.
690  if (g.CanBeImmediate(right)) {
691  VisitCompare(selector, opcode, g.Use(left), g.UseImmediate(right), cont);
692  } else if (g.CanBeImmediate(left)) {
693  if (!commutative) cont->Commute();
694  VisitCompare(selector, opcode, g.Use(right), g.UseImmediate(left), cont);
695  } else {
696  VisitCompare(selector, opcode, g.UseRegister(left), g.Use(right), cont);
697  }
698 }

References VisitCompare().

+ Here is the call graph for this function:

Variable Documentation

◆ kBlockOnStack

const int v8::internal::compiler::kBlockOnStack = -2
static

Definition at line 728 of file scheduler.cc.

Referenced by v8::internal::compiler::Scheduler::ComputeSpecialRPO(), and Push().

◆ kBlockStartInstruction

const InstructionCode v8::internal::compiler::kBlockStartInstruction = -2

◆ kBlockUnvisited1

const int v8::internal::compiler::kBlockUnvisited1 = -1
static

Definition at line 731 of file scheduler.cc.

Referenced by v8::internal::compiler::Scheduler::ComputeSpecialRPO().

◆ kBlockUnvisited2

const int v8::internal::compiler::kBlockUnvisited2 = kBlockVisited1
static

Definition at line 732 of file scheduler.cc.

Referenced by v8::internal::compiler::Scheduler::ComputeSpecialRPO().

◆ kBlockVisited1

const int v8::internal::compiler::kBlockVisited1 = -3
static

Definition at line 729 of file scheduler.cc.

Referenced by v8::internal::compiler::Scheduler::ComputeSpecialRPO().

◆ kBlockVisited2

const int v8::internal::compiler::kBlockVisited2 = -4
static

Definition at line 730 of file scheduler.cc.

Referenced by v8::internal::compiler::Scheduler::ComputeSpecialRPO().

◆ kComparisonInstructions

const MachInst2 v8::internal::compiler::kComparisonInstructions[]
static
Initial value:
= {
{&RawMachineAssembler::Word32Equal, "Word32Equal", kArm64Cmp32, kMachInt32},
{&RawMachineAssembler::Word64Equal, "Word64Equal", kArm64Cmp, kMachInt64},
}

Definition at line 1115 of file instruction-selector-arm64-unittest.cc.

◆ kGapInstruction

const InstructionCode v8::internal::compiler::kGapInstruction = -1

◆ kImpl [1/3]

base::LazyInstance<CommonOperatorBuilderImpl>::type v8::internal::compiler::kImpl
static
Initial value:
=
#define LAZY_INSTANCE_INITIALIZER
Definition: lazy-instance.h:81

Definition at line 86 of file common-operator.cc.

◆ kImpl [2/3]

base::LazyInstance<MachineOperatorBuilderImpl>::type v8::internal::compiler::kImpl
static
Initial value:

Definition at line 189 of file machine-operator.cc.

◆ kImpl [3/3]

base::LazyInstance<SimplifiedOperatorBuilderImpl>::type v8::internal::compiler::kImpl
static
Initial value:

Definition at line 145 of file simplified-operator.cc.

◆ kLogicalWithNotRHSs

const MachInst2 v8::internal::compiler::kLogicalWithNotRHSs[]
static
Initial value:
= {
{&RawMachineAssembler::Word32And, "Word32And", kArm64Bic32, kMachInt32},
{&RawMachineAssembler::Word64And, "Word64And", kArm64Bic, kMachInt64},
{&RawMachineAssembler::Word32Or, "Word32Or", kArm64Orn32, kMachInt32},
{&RawMachineAssembler::Word64Or, "Word64Or", kArm64Orn, kMachInt64},
{&RawMachineAssembler::Word32Xor, "Word32Xor", kArm64Eon32, kMachInt32},
{&RawMachineAssembler::Word64Xor, "Word64Xor", kArm64Eon, kMachInt64}}

Definition at line 1240 of file instruction-selector-arm64-unittest.cc.

◆ kMemoryAccesses

const MemoryAccess v8::internal::compiler::kMemoryAccesses[]
static

Definition at line 1007 of file instruction-selector-arm64-unittest.cc.

◆ kMulDPInstructions

const MulDPInst v8::internal::compiler::kMulDPInstructions[]
static
Initial value:
= {
{"Int32Mul", &RawMachineAssembler::Int32Mul, &RawMachineAssembler::Int32Add,
&RawMachineAssembler::Int32Sub, kArm64Madd32, kArm64Msub32, kArm64Mneg32,
{"Int64Mul", &RawMachineAssembler::Int64Mul, &RawMachineAssembler::Int64Add,
&RawMachineAssembler::Int64Sub, kArm64Madd, kArm64Msub, kArm64Mneg,

Definition at line 828 of file instruction-selector-arm64-unittest.cc.

◆ kNonHeapObjectHeaderSize

const int v8::internal::compiler::kNonHeapObjectHeaderSize = kHeapObjectTag
static

Definition at line 67 of file simplified-operator.h.

◆ kRepMask

◆ kSourcePositionInstruction

const InstructionCode v8::internal::compiler::kSourcePositionInstruction = -3

Definition at line 36 of file instruction.h.

Referenced by v8::internal::compiler::Instruction::IsSourcePosition().

◆ kTypeMask

◆ kWin64