V8 Project
v8::internal::HBinaryOperation Class Reference

#include <hydrogen-instructions.h>

+ Inheritance diagram for v8::internal::HBinaryOperation:
+ Collaboration diagram for v8::internal::HBinaryOperation:

Public Member Functions

 HBinaryOperation (HValue *context, HValue *left, HValue *right, HType type=HType::Tagged())
 
HValuecontext () const
 
HValueleft () const
 
HValueright () const
 
bool AreOperandsBetterSwitched ()
 
HValueBetterLeftOperand ()
 
HValueBetterRightOperand ()
 
void set_observed_input_representation (int index, Representation rep)
 
virtual void initialize_output_representation (Representation observed)
 
virtual Representation observed_input_representation (int index) OVERRIDE
 
virtual void UpdateRepresentation (Representation new_rep, HInferRepresentationPhase *h_infer, const char *reason) OVERRIDE
 
virtual void InferRepresentation (HInferRepresentationPhase *h_infer) OVERRIDE
 
virtual Representation RepresentationFromInputs () OVERRIDE
 
Representation RepresentationFromOutput ()
 
virtual void AssumeRepresentation (Representation r) OVERRIDE
 
virtual bool IsCommutative () const
 
virtual OStreamPrintDataTo (OStream &os) const OVERRIDE
 
virtual Representation RequiredInputRepresentation (int index) OVERRIDE
 
void SetOperandPositions (Zone *zone, HSourcePosition left_pos, HSourcePosition right_pos)
 
bool RightIsPowerOf2 ()
 
- Public Member Functions inherited from v8::internal::HTemplateInstruction< 3 >
virtual int OperandCount () const FINAL OVERRIDE
 
virtual HValueOperandAt (int i) const FINAL OVERRIDE
 
- Public Member Functions inherited from v8::internal::HInstruction
HInstructionnext () const
 
HInstructionprevious () const
 
virtual OStreamPrintTo (OStream &os) const OVERRIDE
 
bool IsLinked () const
 
void Unlink ()
 
void InsertBefore (HInstruction *next)
 
template<class T >
TPrepend (T *instr)
 
void InsertAfter (HInstruction *previous)
 
template<class T >
TAppend (T *instr)
 
virtual HSourcePosition position () const OVERRIDE
 
bool has_position () const
 
void set_position (HSourcePosition position)
 
virtual HSourcePosition operand_position (int index) const OVERRIDE
 
void set_operand_position (Zone *zone, int index, HSourcePosition pos)
 
bool Dominates (HInstruction *other)
 
bool CanTruncateToSmi () const
 
bool CanTruncateToInt32 () const
 
virtual LInstructionCompileToLithium (LChunkBuilder *builder)=0
 
bool CanDeoptimize ()
 
virtual bool HasStackCheck ()
 
- Public Member Functions inherited from v8::internal::HValue
 STATIC_ASSERT (kLastFlag< kBitsPerInt)
 
virtual Opcode opcode () const =0
 
bool IsPhi () const
 
bool IsBitwiseBinaryShift ()
 
 HValue (HType type=HType::Tagged())
 
virtual ~HValue ()
 
HBasicBlock * block () const
 
void SetBlock (HBasicBlock *block)
 
Isolateisolate () const
 
int id () const
 
void set_id (int id)
 
HUseIterator uses () const
 
virtual bool EmitAtUses ()
 
Representation representation () const
 
void ChangeRepresentation (Representation r)
 
virtual Representation KnownOptimalRepresentation ()
 
HType type () const
 
void set_type (HType new_type)
 
virtual int RedefinedOperandIndex ()
 
bool IsInformativeDefinition ()
 
HValueRedefinedOperand ()
 
bool CanReplaceWithDummyUses ()
 
virtual int argument_delta () const
 
virtual bool IsPurelyInformativeDefinition ()
 
HValueActualValue ()
 
bool IsInteger32Constant ()
 
int32_t GetInteger32Constant ()
 
bool EqualsInteger32Constant (int32_t value)
 
bool IsDefinedAfter (HBasicBlock *other) const
 
void SetOperandAt (int index, HValue *value)
 
void DeleteAndReplaceWith (HValue *other)
 
void ReplaceAllUsesWith (HValue *other)
 
bool HasNoUses () const
 
bool HasOneUse () const
 
bool HasMultipleUses () const
 
int UseCount () const
 
void Kill ()
 
int flags () const
 
void SetFlag (Flag f)
 
void ClearFlag (Flag f)
 
bool CheckFlag (Flag f) const
 
void CopyFlag (Flag f, HValue *other)
 
bool CheckUsesForFlag (Flag f) const
 
bool CheckUsesForFlag (Flag f, HValue **value) const
 
bool HasAtLeastOneUseWithFlagAndNoneWithout (Flag f) const
 
GVNFlagSet ChangesFlags () const
 
GVNFlagSet DependsOnFlags () const
 
void SetChangesFlag (GVNFlag f)
 
void SetDependsOnFlag (GVNFlag f)
 
void ClearChangesFlag (GVNFlag f)
 
void ClearDependsOnFlag (GVNFlag f)
 
bool CheckChangesFlag (GVNFlag f) const
 
bool CheckDependsOnFlag (GVNFlag f) const
 
void SetAllSideEffects ()
 
void ClearAllSideEffects ()
 
bool HasSideEffects () const
 
bool HasObservableSideEffects () const
 
GVNFlagSet SideEffectFlags () const
 
GVNFlagSet ObservableChangesFlags () const
 
Range * range () const
 
bool HasRange () const
 
void AddNewRange (Range *r, Zone *zone)
 
void RemoveLastAddedRange ()
 
void ComputeInitialRange (Zone *zone)
 
virtual bool HasEscapingOperandAt (int index)
 
virtual bool HasOutOfBoundsAccess (int size)
 
virtual HValueCanonicalize ()
 
bool Equals (HValue *other)
 
virtual intptr_t Hashcode ()
 
virtual void FinalizeUniqueness ()
 
const char * Mnemonic () const
 
bool HasMonomorphicJSObjectType ()
 
virtual Handle< MapGetMonomorphicJSObjectMap ()
 
bool UpdateInferredType ()
 
virtual HType CalculateInferredType ()
 
virtual bool HandleSideEffectDominator (GVNFlag side_effect, HValue *dominator)
 
bool CannotBeEliminated () const
 
virtual bool TryDecompose (DecompositionResult *decomposition)
 
bool ToStringCanBeObserved () const
 
bool ToNumberCanBeObserved () const
 
MinusZeroMode GetMinusZeroMode ()
 
- Public Member Functions inherited from v8::internal::ZoneObject
 INLINE (void *operator new(size_t size, Zone *zone))
 
void operator delete (void *, size_t)
 
void operator delete (void *pointer, Zone *zone)
 

Private Member Functions

bool IgnoreObservedOutputRepresentation (Representation current_rep)
 

Private Attributes

Representation observed_input_representation_ [2]
 
Representation observed_output_representation_
 

Additional Inherited Members

- Public Types inherited from v8::internal::HValue
enum  Flag {
  kFlexibleRepresentation , kCannotBeTagged , kUseGVN , kTrackSideEffectDominators ,
  kCanOverflow , kBailoutOnMinusZero , kCanBeDivByZero , kLeftCanBeMinInt ,
  kLeftCanBeNegative , kLeftCanBePositive , kAllowUndefinedAsNaN , kIsArguments ,
  kTruncatingToInt32 , kAllUsesTruncatingToInt32 , kTruncatingToSmi , kAllUsesTruncatingToSmi ,
  kIsDead , kUint32 , kHasNoObservableSideEffects , kCantBeReplaced ,
  kIsLive , kEndsLiveRange = kIsLive , kLastFlag = kIsLive
}
 
enum  Opcode { kPhi }
 
- Static Public Member Functions inherited from v8::internal::HValue
static HValuecast (HValue *value)
 
- Static Public Attributes inherited from v8::internal::HValue
static const int kNoNumber = -1
 
static const int kNoRedefinedOperand = -1
 
- Protected Member Functions inherited from v8::internal::HTemplateInstruction< 3 >
 HTemplateInstruction (HType type=HType::Tagged())
 
virtual void InternalSetOperandAt (int i, HValue *value) FINAL OVERRIDE
 
- Protected Member Functions inherited from v8::internal::HInstruction
 HInstruction (HType type=HType::Tagged())
 
virtual void DeleteFromGraph () OVERRIDE
 
- Protected Member Functions inherited from v8::internal::HValue
virtual bool DataEquals (HValue *other)
 
bool ToStringOrToNumberCanBeObserved () const
 
virtual Representation RepresentationFromUses ()
 
Representation RepresentationFromUseRequirements ()
 
bool HasNonSmiUse ()
 
void AddDependantsToWorklist (HInferRepresentationPhase *h_infer)
 
virtual void RepresentationChanged (Representation to)
 
virtual Range * InferRange (Zone *zone)
 
void clear_block ()
 
void set_representation (Representation r)
 
HUseListNodeRemoveUse (HValue *value, int index)
 
void RegisterUse (int index, HValue *new_value)
 
- Static Protected Member Functions inherited from v8::internal::HValue
static GVNFlagSet AllFlagSet ()
 
static GVNFlagSet AllSideEffectsFlagSet ()
 
static GVNFlagSet AllObservableSideEffectsFlagSet ()
 
- Protected Attributes inherited from v8::internal::HValue
HBasicBlock * block_
 
int id_
 
Representation representation_
 
HType type_
 
HUseListNodeuse_list_
 
Range * range_
 
int flags_
 
GVNFlagSet changes_flags_
 
GVNFlagSet depends_on_flags_
 

Detailed Description

Definition at line 3770 of file hydrogen-instructions.h.

Constructor & Destructor Documentation

◆ HBinaryOperation()

v8::internal::HBinaryOperation::HBinaryOperation ( HValue context,
HValue left,
HValue right,
HType  type = HType::Tagged() 
)
inline

Definition at line 3772 of file hydrogen-instructions.h.

3774  : HTemplateInstruction<3>(type),
3776  DCHECK(left != NULL && right != NULL);
3777  SetOperandAt(0, context);
3778  SetOperandAt(1, left);
3779  SetOperandAt(2, right);
3782  }
Representation observed_input_representation_[2]
void SetOperandAt(int index, HValue *value)
static Representation None()
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
#define DCHECK(condition)
Definition: logging.h:205

References context(), DCHECK, left(), v8::internal::Representation::None(), NULL, observed_input_representation_, right(), and v8::internal::HValue::SetOperandAt().

+ Here is the call graph for this function:

Member Function Documentation

◆ AreOperandsBetterSwitched()

bool v8::internal::HBinaryOperation::AreOperandsBetterSwitched ( )
inline

Definition at line 3789 of file hydrogen-instructions.h.

3789  {
3790  if (!IsCommutative()) return false;
3791 
3792  // Constant operands are better off on the right, they can be inlined in
3793  // many situations on most platforms.
3794  if (left()->IsConstant()) return true;
3795  if (right()->IsConstant()) return false;
3796 
3797  // Otherwise, if there is only one use of the right operand, it would be
3798  // better off on the left for platforms that only have 2-arg arithmetic
3799  // ops (e.g ia32, x64) that clobber the left operand.
3800  return right()->HasOneUse();
3801  }

References v8::internal::HValue::HasOneUse(), IsCommutative(), left(), and right().

Referenced by BetterLeftOperand(), and BetterRightOperand().

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

◆ AssumeRepresentation()

void v8::internal::HBinaryOperation::AssumeRepresentation ( Representation  r)
virtual

Reimplemented from v8::internal::HValue.

Definition at line 3026 of file hydrogen-instructions.cc.

3026  {
3030 }
void set_observed_input_representation(int index, Representation rep)
virtual void AssumeRepresentation(Representation r)

◆ BetterLeftOperand()

HValue* v8::internal::HBinaryOperation::BetterLeftOperand ( )
inline

Definition at line 3803 of file hydrogen-instructions.h.

3803  {
3804  return AreOperandsBetterSwitched() ? right() : left();
3805  }

References AreOperandsBetterSwitched(), left(), and right().

+ Here is the call graph for this function:

◆ BetterRightOperand()

HValue* v8::internal::HBinaryOperation::BetterRightOperand ( )
inline

Definition at line 3807 of file hydrogen-instructions.h.

3807  {
3808  return AreOperandsBetterSwitched() ? left() : right();
3809  }

References AreOperandsBetterSwitched(), left(), and right().

+ Here is the call graph for this function:

◆ context()

HValue* v8::internal::HBinaryOperation::context ( ) const
inline

Definition at line 3784 of file hydrogen-instructions.h.

3784 { return OperandAt(0); }
virtual HValue * OperandAt(int i) const FINAL OVERRIDE

References v8::internal::HTemplateInstruction< 3 >::OperandAt().

Referenced by HBinaryOperation().

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

◆ IgnoreObservedOutputRepresentation()

bool v8::internal::HBinaryOperation::IgnoreObservedOutputRepresentation ( Representation  current_rep)
private

Definition at line 3004 of file hydrogen-instructions.cc.

3005  {
3006  return ((current_rep.IsInteger32() && CheckUsesForFlag(kTruncatingToInt32)) ||
3007  (current_rep.IsSmi() && CheckUsesForFlag(kTruncatingToSmi))) &&
3008  // Mul in Integer32 mode would be too precise.
3009  (!this->IsMul() || HMul::cast(this)->MulMinusOne());
3010 }
bool CheckUsesForFlag(Flag f) const

References v8::internal::Representation::IsInteger32(), and v8::internal::Representation::IsSmi().

+ Here is the call graph for this function:

◆ InferRepresentation()

void v8::internal::HBinaryOperation::InferRepresentation ( HInferRepresentationPhase h_infer)
virtual

Reimplemented from v8::internal::HValue.

Reimplemented in v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, and v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

Definition at line 2966 of file hydrogen-instructions.cc.

2966  {
2968  Representation new_rep = RepresentationFromInputs();
2969  UpdateRepresentation(new_rep, h_infer, "inputs");
2970 
2971  if (representation().IsSmi() && HasNonSmiUse()) {
2973  Representation::Integer32(), h_infer, "use requirements");
2974  }
2975 
2977  new_rep = RepresentationFromUses();
2978  UpdateRepresentation(new_rep, h_infer, "uses");
2979  } else {
2980  new_rep = RepresentationFromOutput();
2981  UpdateRepresentation(new_rep, h_infer, "output");
2982  }
2983 }
virtual void UpdateRepresentation(Representation new_rep, HInferRepresentationPhase *h_infer, const char *reason) OVERRIDE
virtual Representation RepresentationFromInputs() OVERRIDE
Representation representation() const
bool CheckFlag(Flag f) const
virtual Representation RepresentationFromUses()
static Representation Integer32()

References DCHECK.

◆ initialize_output_representation()

virtual void v8::internal::HBinaryOperation::initialize_output_representation ( Representation  observed)
inlinevirtual

Reimplemented in v8::internal::HBitwiseBinaryOperation.

Definition at line 3816 of file hydrogen-instructions.h.

3816  {
3818  }

References observed_output_representation_.

Referenced by v8::internal::HGraphBuilder::BuildBinaryOperation(), and v8::internal::HBitwiseBinaryOperation::initialize_output_representation().

+ Here is the caller graph for this function:

◆ IsCommutative()

virtual bool v8::internal::HBinaryOperation::IsCommutative ( ) const
inlinevirtual

Reimplemented in v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, and v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

Definition at line 3839 of file hydrogen-instructions.h.

3839 { return false; }

Referenced by AreOperandsBetterSwitched().

+ Here is the caller graph for this function:

◆ left()

HValue* v8::internal::HBinaryOperation::left ( ) const
inline

Definition at line 3785 of file hydrogen-instructions.h.

3785 { return OperandAt(1); }

References v8::internal::HTemplateInstruction< 3 >::OperandAt().

Referenced by AreOperandsBetterSwitched(), BetterLeftOperand(), BetterRightOperand(), v8::internal::DehoistArrayIndex(), HBinaryOperation(), v8::internal::BoundsCheckBbData::MoveIndexIfNecessary(), v8::internal::HRangeAnalysisPhase::PropagateMinusZeroChecks(), v8::internal::HBitwiseBinaryOperation::RepresentationChanged(), and v8::internal::HArithmeticBinaryOperation::RepresentationChanged().

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

◆ observed_input_representation()

virtual Representation v8::internal::HBinaryOperation::observed_input_representation ( int  index)
inlinevirtual

Reimplemented from v8::internal::HValue.

Reimplemented in v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::HBitwiseBinaryOperation, and v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

Definition at line 3820 of file hydrogen-instructions.h.

3820  {
3821  if (index == 0) return Representation::Tagged();
3822  return observed_input_representation_[index - 1];
3823  }
static Representation Tagged()

References observed_input_representation_, and v8::internal::Representation::Tagged().

Referenced by v8::internal::HBitwiseBinaryOperation::observed_input_representation().

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

◆ PrintDataTo()

OStream & v8::internal::HBinaryOperation::PrintDataTo ( OStream os) const
virtual

Reimplemented from v8::internal::HInstruction.

Reimplemented in v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, and v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

Definition at line 2958 of file hydrogen-instructions.cc.

2958  { // NOLINT
2959  os << NameOf(left()) << " " << NameOf(right());
2960  if (CheckFlag(kCanOverflow)) os << " !";
2961  if (CheckFlag(kBailoutOnMinusZero)) os << " -0?";
2962  return os;
2963 }

◆ RepresentationFromInputs()

Representation v8::internal::HBinaryOperation::RepresentationFromInputs ( )
virtual

Reimplemented from v8::internal::HValue.

Reimplemented in v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, and v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

Definition at line 2986 of file hydrogen-instructions.cc.

2986  {
2987  // Determine the worst case of observed input representations and
2988  // the currently assumed output representation.
2989  Representation rep = representation();
2990  for (int i = 1; i <= 2; ++i) {
2991  rep = rep.generalize(observed_input_representation(i));
2992  }
2993  // If any of the actual input representation is more general than what we
2994  // have so far but not Tagged, use that representation instead.
2995  Representation left_rep = left()->representation();
2996  Representation right_rep = right()->representation();
2997  if (!left_rep.IsTagged()) rep = rep.generalize(left_rep);
2998  if (!right_rep.IsTagged()) rep = rep.generalize(right_rep);
2999 
3000  return rep;
3001 }
virtual Representation observed_input_representation(int index) OVERRIDE
Representation generalize(Representation other)

References v8::internal::Representation::generalize(), and v8::internal::Representation::IsTagged().

+ Here is the call graph for this function:

◆ RepresentationFromOutput()

Representation v8::internal::HBinaryOperation::RepresentationFromOutput ( )

Definition at line 3013 of file hydrogen-instructions.cc.

3013  {
3014  Representation rep = representation();
3015  // Consider observed output representation, but ignore it if it's Double,
3016  // this instruction is not a division, and all its uses are truncating
3017  // to Integer32.
3021  }
3022  return Representation::None();
3023 }
bool IgnoreObservedOutputRepresentation(Representation current_rep)
bool is_more_general_than(const Representation &other) const

References v8::None.

◆ RequiredInputRepresentation()

virtual Representation v8::internal::HBinaryOperation::RequiredInputRepresentation ( int  index)
inlinevirtual

Implements v8::internal::HValue.

Reimplemented in v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, and v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

Definition at line 3843 of file hydrogen-instructions.h.

3843  {
3844  if (index == 0) return Representation::Tagged();
3845  return representation();
3846  }

References v8::internal::HValue::representation(), and v8::internal::Representation::Tagged().

+ Here is the call graph for this function:

◆ right()

HValue* v8::internal::HBinaryOperation::right ( ) const
inline

Definition at line 3786 of file hydrogen-instructions.h.

3786 { return OperandAt(2); }

References v8::internal::HTemplateInstruction< 3 >::OperandAt().

Referenced by AreOperandsBetterSwitched(), BetterLeftOperand(), BetterRightOperand(), v8::internal::DehoistArrayIndex(), HBinaryOperation(), v8::internal::BoundsCheckBbData::MoveIndexIfNecessary(), v8::internal::HRangeAnalysisPhase::PropagateMinusZeroChecks(), v8::internal::HBitwiseBinaryOperation::RepresentationChanged(), v8::internal::HArithmeticBinaryOperation::RepresentationChanged(), and RightIsPowerOf2().

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

◆ RightIsPowerOf2()

bool v8::internal::HBinaryOperation::RightIsPowerOf2 ( )
inline

Definition at line 3855 of file hydrogen-instructions.h.

3855  {
3856  if (!right()->IsInteger32Constant()) return false;
3857  int32_t value = right()->GetInteger32Constant();
3858  if (value < 0) {
3859  return base::bits::IsPowerOfTwo32(static_cast<uint32_t>(-value));
3860  }
3861  return base::bits::IsPowerOfTwo32(static_cast<uint32_t>(value));
3862  }
int int32_t
Definition: unicode.cc:24
bool IsPowerOfTwo32(uint32_t value)
Definition: bits.h:77

References v8::internal::HValue::GetInteger32Constant(), v8::internal::HValue::IsInteger32Constant(), v8::base::bits::IsPowerOfTwo32(), and right().

+ Here is the call graph for this function:

◆ set_observed_input_representation()

void v8::internal::HBinaryOperation::set_observed_input_representation ( int  index,
Representation  rep 
)
inline

Definition at line 3811 of file hydrogen-instructions.h.

3811  {
3812  DCHECK(index >= 1 && index <= 2);
3813  observed_input_representation_[index - 1] = rep;
3814  }

References DCHECK, and observed_input_representation_.

Referenced by v8::internal::HGraphBuilder::BuildBinaryOperation().

+ Here is the caller graph for this function:

◆ SetOperandPositions()

void v8::internal::HBinaryOperation::SetOperandPositions ( Zone zone,
HSourcePosition  left_pos,
HSourcePosition  right_pos 
)
inline

Definition at line 3848 of file hydrogen-instructions.h.

3850  {
3851  set_operand_position(zone, 1, left_pos);
3852  set_operand_position(zone, 2, right_pos);
3853  }
void set_operand_position(Zone *zone, int index, HSourcePosition pos)

References v8::internal::HInstruction::set_operand_position().

+ Here is the call graph for this function:

◆ UpdateRepresentation()

virtual void v8::internal::HBinaryOperation::UpdateRepresentation ( Representation  new_rep,
HInferRepresentationPhase h_infer,
const char *  reason 
)
inlinevirtual

Reimplemented from v8::internal::HValue.

Reimplemented in v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, and v8::internal::HBitwiseBinaryOperation.

Definition at line 3825 of file hydrogen-instructions.h.

3827  {
3828  Representation rep = !FLAG_smi_binop && new_rep.IsSmi()
3829  ? Representation::Integer32() : new_rep;
3830  HValue::UpdateRepresentation(rep, h_infer, reason);
3831  }
virtual void UpdateRepresentation(Representation new_rep, HInferRepresentationPhase *h_infer, const char *reason)

References v8::internal::Representation::Integer32(), v8::internal::Representation::IsSmi(), and v8::internal::HValue::UpdateRepresentation().

Referenced by v8::internal::HBitwiseBinaryOperation::UpdateRepresentation(), and v8::internal::FINAL< kOperandKind, kNumCachedOperands >::UpdateRepresentation().

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

Member Data Documentation

◆ observed_input_representation_

Representation v8::internal::HBinaryOperation::observed_input_representation_[2]
private

◆ observed_output_representation_

Representation v8::internal::HBinaryOperation::observed_output_representation_
private

Definition at line 3870 of file hydrogen-instructions.h.

Referenced by initialize_output_representation().


The documentation for this class was generated from the following files: