V8 Project
v8::internal::HValue Class Referenceabstract

#include <hydrogen-instructions.h>

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

Public Types

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 }
 

Public Member Functions

 STATIC_ASSERT (kLastFlag< kBitsPerInt)
 
virtual Opcode opcode () const =0
 
bool IsPhi () const
 
bool IsBitwiseBinaryShift ()
 
 HValue (HType type=HType::Tagged())
 
virtual ~HValue ()
 
virtual HSourcePosition position () const
 
virtual HSourcePosition operand_position (int index) const
 
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 void AssumeRepresentation (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
 
virtual int OperandCount () const =0
 
virtual HValueOperandAt (int index) const =0
 
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 Representation observed_input_representation (int index)
 
virtual Representation RequiredInputRepresentation (int index)=0
 
virtual void InferRepresentation (HInferRepresentationPhase *h_infer)
 
virtual HValueCanonicalize ()
 
bool Equals (HValue *other)
 
virtual intptr_t Hashcode ()
 
virtual void FinalizeUniqueness ()
 
virtual OStreamPrintTo (OStream &os) const =0
 
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)
 

Static Public Member Functions

static HValuecast (HValue *value)
 

Static Public Attributes

static const int kNoNumber = -1
 
static const int kNoRedefinedOperand = -1
 

Protected Member Functions

virtual bool DataEquals (HValue *other)
 
bool ToStringOrToNumberCanBeObserved () const
 
virtual Representation RepresentationFromInputs ()
 
virtual Representation RepresentationFromUses ()
 
Representation RepresentationFromUseRequirements ()
 
bool HasNonSmiUse ()
 
virtual void UpdateRepresentation (Representation new_rep, HInferRepresentationPhase *h_infer, const char *reason)
 
void AddDependantsToWorklist (HInferRepresentationPhase *h_infer)
 
virtual void RepresentationChanged (Representation to)
 
virtual Range * InferRange (Zone *zone)
 
virtual void DeleteFromGraph ()=0
 
virtual void InternalSetOperandAt (int index, HValue *value)=0
 
void clear_block ()
 
void set_representation (Representation r)
 
HUseListNodeRemoveUse (HValue *value, int index)
 
void RegisterUse (int index, HValue *new_value)
 

Static Protected Member Functions

static GVNFlagSet AllFlagSet ()
 
static GVNFlagSet AllSideEffectsFlagSet ()
 
static GVNFlagSet AllObservableSideEffectsFlagSet ()
 

Protected Attributes

HBasicBlock * block_
 
int id_
 
Representation representation_
 
HType type_
 
HUseListNodeuse_list_
 
Range * range_
 
int flags_
 
GVNFlagSet changes_flags_
 
GVNFlagSet depends_on_flags_
 

Private Member Functions

virtual bool IsDeletable () const
 
 DISALLOW_COPY_AND_ASSIGN (HValue)
 

Friends

OStreamoperator<< (OStream &os, const ChangesOf &v)
 

Detailed Description

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

Member Enumeration Documentation

◆ Flag

Enumerator
kFlexibleRepresentation 
kCannotBeTagged 
kUseGVN 
kTrackSideEffectDominators 
kCanOverflow 
kBailoutOnMinusZero 
kCanBeDivByZero 
kLeftCanBeMinInt 
kLeftCanBeNegative 
kLeftCanBePositive 
kAllowUndefinedAsNaN 
kIsArguments 
kTruncatingToInt32 
kAllUsesTruncatingToInt32 
kTruncatingToSmi 
kAllUsesTruncatingToSmi 
kIsDead 
kUint32 
kHasNoObservableSideEffects 
kCantBeReplaced 
kIsLive 
kEndsLiveRange 
kLastFlag 

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

477  {
480  // Participate in Global Value Numbering, i.e. elimination of
481  // unnecessary recomputations. If an instruction sets this flag, it must
482  // implement DataEquals(), which will be used to determine if other
483  // occurrences of the instruction are indeed the same.
484  kUseGVN,
485  // Track instructions that are dominating side effects. If an instruction
486  // sets this flag, it must implement HandleSideEffectDominator() and should
487  // indicate which side effects to track by setting GVN flags.
489  kCanOverflow,
496  kIsArguments,
501  // Set after an instruction is killed.
502  kIsDead,
503  // Instructions that are allowed to produce full range unsigned integer
504  // values are marked with kUint32 flag. If arithmetic shift or a load from
505  // EXTERNAL_UINT32_ELEMENTS array is not marked with this flag
506  // it will deoptimize if result does not fit into signed integer range.
507  // HGraph::ComputeSafeUint32Operations is responsible for setting this
508  // flag.
509  kUint32,
511  // Indicates an instruction shouldn't be replaced by optimization, this flag
512  // is useful to set in cases where recomputing a value is cheaper than
513  // extending the value's live range and spilling it.
515  // Indicates the instruction is live during dead code elimination.
516  kIsLive,
517 
518  // HEnvironmentMarkers are deleted before dead code
519  // elimination takes place, so they can repurpose the kIsLive flag:
521 
522  // TODO(everyone): Don't forget to update this!
524  };

◆ Opcode

Enumerator
kPhi 

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

530  {
531  // Declare a unique enum value for each hydrogen instruction.
532  #define DECLARE_OPCODE(type) k##type,
534  kPhi
535  #undef DECLARE_OPCODE
536  };
#define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V)
#define DECLARE_OPCODE(type)

Constructor & Destructor Documentation

◆ HValue()

v8::internal::HValue::HValue ( HType  type = HType::Tagged())
inlineexplicit

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

557  : block_(NULL),
558  id_(kNoNumber),
559  type_(type),
560  use_list_(NULL),
561  range_(NULL),
562 #ifdef DEBUG
563  range_poisoned_(false),
564 #endif
565  flags_(0) {}
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

◆ ~HValue()

virtual v8::internal::HValue::~HValue ( )
inlinevirtual

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

566 {}

Member Function Documentation

◆ ActualValue()

HValue* v8::internal::HValue::ActualValue ( )
inline

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

648  {
649  HValue* value = this;
650  int index;
651  while ((index = value->RedefinedOperandIndex()) != kNoRedefinedOperand) {
652  value = value->OperandAt(index);
653  }
654  return value;
655  }
static const int kNoRedefinedOperand
HValue(HType type=HType::Tagged())

References kNoRedefinedOperand, OperandAt(), and RedefinedOperandIndex().

Referenced by v8::internal::HGraphBuilder::BuildCalculateElementsSize(), v8::internal::HOptimizedGraphBuilder::BuildLoadNamedField(), v8::internal::HOptimizedGraphBuilder::BuildStoreNamedField(), v8::internal::HGraphBuilder::BuildUncheckedMonomorphicElementAccess(), v8::internal::HCheckTable::Copy(), v8::internal::DehoistArrayIndex(), v8::internal::HOptimizedGraphBuilder::HandleKeyedElementAccess(), v8::internal::HLoadEliminationTable::KillIfMisaligned(), v8::internal::HLoadEliminationTable::load(), v8::internal::HLoadEliminationTable::Process(), v8::internal::HStoreEliminationPhase::ProcessLoad(), v8::internal::HStoreEliminationPhase::ProcessStore(), v8::internal::HCheckTable::ReduceCheckHeapObject(), v8::internal::HCheckTable::ReduceCheckInstanceType(), v8::internal::HCheckTable::ReduceCheckMaps(), v8::internal::HCheckTable::ReduceCompareObjectEqAndBranch(), v8::internal::HCheckTable::ReduceIsStringAndBranch(), v8::internal::HCheckTable::ReduceLoadNamedField(), v8::internal::HCheckTable::ReduceStoreNamedField(), v8::internal::HCheckTable::ReduceTransitionElementsKind(), and v8::internal::HLoadEliminationTable::store().

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

◆ AddDependantsToWorklist()

void v8::internal::HValue::AddDependantsToWorklist ( HInferRepresentationPhase h_infer)
protected

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

121  {
122  for (HUseIterator it(uses()); !it.Done(); it.Advance()) {
123  h_infer->AddToWorklist(it.value());
124  }
125  for (int i = 0; i < OperandCount(); ++i) {
126  h_infer->AddToWorklist(OperandAt(i));
127  }
128 }
virtual int OperandCount() const =0
HUseIterator uses() const
virtual HValue * OperandAt(int index) const =0

References v8::internal::HInferRepresentationPhase::AddToWorklist(), OperandAt(), OperandCount(), and uses().

Referenced by UpdateRepresentation().

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

◆ AddNewRange()

void v8::internal::HValue::AddNewRange ( Range *  r,
Zone zone 
)

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

598  {
599  if (!HasRange()) ComputeInitialRange(zone);
600  if (!HasRange()) range_ = new(zone) Range();
601  DCHECK(HasRange());
602  r->StackUpon(range_);
603  range_ = r;
604 }
void ComputeInitialRange(Zone *zone)
#define DCHECK(condition)
Definition: logging.h:205

References ComputeInitialRange(), DCHECK, HasRange(), and range_.

Referenced by v8::internal::HRangeAnalysisPhase::AddRange().

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

◆ AllFlagSet()

static GVNFlagSet v8::internal::HValue::AllFlagSet ( )
inlinestaticprotected

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

875  {
876  GVNFlagSet result;
877 #define ADD_FLAG(Type) result.Add(k##Type);
880 #undef ADD_FLAG
881  return result;
882  }
#define ADD_FLAG(Type)
#define GVN_TRACKED_FLAG_LIST(V)
#define GVN_UNTRACKED_FLAG_LIST(V)
EnumSet< GVNFlag, int32_t > GVNFlagSet

References ADD_FLAG, GVN_TRACKED_FLAG_LIST, and GVN_UNTRACKED_FLAG_LIST.

Referenced by AllObservableSideEffectsFlagSet(), and AllSideEffectsFlagSet().

+ Here is the caller graph for this function:

◆ AllObservableSideEffectsFlagSet()

static GVNFlagSet v8::internal::HValue::AllObservableSideEffectsFlagSet ( )
inlinestaticprotected

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

894  {
895  GVNFlagSet result = AllFlagSet();
896  result.Remove(kNewSpacePromotion);
897  result.Remove(kElementsKind);
898  result.Remove(kElementsPointer);
899  result.Remove(kMaps);
900  return result;
901  }
static GVNFlagSet AllFlagSet()

References AllFlagSet(), and v8::internal::EnumSet< E, T >::Remove().

Referenced by HasObservableSideEffects(), and ObservableChangesFlags().

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

◆ AllSideEffectsFlagSet()

static GVNFlagSet v8::internal::HValue::AllSideEffectsFlagSet ( )
inlinestaticprotected

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

885  {
886  GVNFlagSet result = AllFlagSet();
887  result.Remove(kOsrEntries);
888  return result;
889  }

References AllFlagSet(), and v8::internal::EnumSet< E, T >::Remove().

Referenced by ClearAllSideEffects(), HasSideEffects(), SetAllSideEffects(), and SideEffectFlags().

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

◆ argument_delta()

◆ AssumeRepresentation()

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

Reimplemented in v8::internal::HBinaryOperation.

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

50  {
53  // The representation of the value is dictated by type feedback and
54  // will not be changed later.
56  }
57 }
void ChangeRepresentation(Representation r)
bool CheckFlag(Flag f) const

References ChangeRepresentation(), CheckFlag(), ClearFlag(), and kFlexibleRepresentation.

+ Here is the call graph for this function:

◆ block()

◆ CalculateInferredType()

◆ CannotBeEliminated()

bool v8::internal::HValue::CannotBeEliminated ( ) const
inline

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

802  {
803  return HasObservableSideEffects() || !IsDeletable();
804  }
bool HasObservableSideEffects() const
virtual bool IsDeletable() const

References HasObservableSideEffects(), and IsDeletable().

Referenced by v8::internal::HDeadCodeEliminationPhase::MarkLiveInstructions().

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

◆ Canonicalize()

◆ CanReplaceWithDummyUses()

bool v8::internal::HValue::CanReplaceWithDummyUses ( )

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

451  {
452  return FLAG_unreachable_code_elimination &&
453  !(block()->IsReachable() ||
454  IsBlockEntry() ||
455  IsControlInstruction() ||
456  IsArgumentsObject() ||
457  IsCapturedObject() ||
458  IsSimulate() ||
459  IsEnterInlined() ||
460  IsLeaveInlined());
461 }
HBasicBlock * block() const

References block().

+ Here is the call graph for this function:

◆ cast()

◆ ChangeRepresentation()

void v8::internal::HValue::ChangeRepresentation ( Representation  r)
inline

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

589  {
591  DCHECK(!CheckFlag(kCannotBeTagged) || !r.IsTagged());
593  representation_ = r;
594  if (r.IsTagged()) {
595  // Tagged is the bottom of the lattice, don't go any further.
597  }
598  }
virtual void RepresentationChanged(Representation to)

References CheckFlag(), ClearFlag(), DCHECK, v8::internal::Representation::IsTagged(), kCannotBeTagged, kFlexibleRepresentation, representation_, and RepresentationChanged().

Referenced by AssumeRepresentation(), v8::internal::HGraphBuilder::BuildUncheckedDictionaryElementLoad(), v8::internal::HInferRepresentationPhase::Run(), and UpdateRepresentation().

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

◆ ChangesFlags()

GVNFlagSet v8::internal::HValue::ChangesFlags ( ) const
inline

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

698 { return changes_flags_; }

References changes_flags_.

Referenced by ObservableChangesFlags(), v8::internal::HCheckMapsEffects::Process(), v8::internal::HLoadEliminationEffects::Process(), v8::internal::FINAL< kOperandKind, kNumCachedOperands >::ReuseSideEffectsFromStore(), and SideEffectFlags().

+ Here is the caller graph for this function:

◆ CheckChangesFlag()

bool v8::internal::HValue::CheckChangesFlag ( GVNFlag  f) const
inline

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

704  {
705  return changes_flags_.Contains(f);
706  }
bool Contains(E element) const
Definition: utils.h:851

References changes_flags_, and v8::internal::EnumSet< E, T >::Contains().

Referenced by v8::internal::HCheckTable::Process(), v8::internal::HLoadEliminationTable::Process(), and v8::internal::HStoreEliminationPhase::ProcessInstr().

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

◆ CheckDependsOnFlag()

bool v8::internal::HValue::CheckDependsOnFlag ( GVNFlag  f) const
inline

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

707  {
708  return depends_on_flags_.Contains(f);
709  }

References v8::internal::EnumSet< E, T >::Contains(), and depends_on_flags_.

+ Here is the call graph for this function:

◆ CheckFlag()

◆ CheckUsesForFlag() [1/2]

bool v8::internal::HValue::CheckUsesForFlag ( Flag  f) const

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

330  {
331  for (HUseIterator it(uses()); !it.Done(); it.Advance()) {
332  if (it.value()->IsSimulate()) continue;
333  if (!it.value()->CheckFlag(f)) return false;
334  }
335  return true;
336 }

References uses().

+ Here is the call graph for this function:

◆ CheckUsesForFlag() [2/2]

bool v8::internal::HValue::CheckUsesForFlag ( Flag  f,
HValue **  value 
) const

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

339  {
340  for (HUseIterator it(uses()); !it.Done(); it.Advance()) {
341  if (it.value()->IsSimulate()) continue;
342  if (!it.value()->CheckFlag(f)) {
343  *value = it.value();
344  return false;
345  }
346  }
347  return true;
348 }

References uses().

+ Here is the call graph for this function:

◆ clear_block()

void v8::internal::HValue::clear_block ( )
inlineprotected

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

865  {
866  DCHECK(block_ != NULL);
867  block_ = NULL;
868  }

References block_, DCHECK, and NULL.

Referenced by v8::internal::HInstruction::Unlink().

+ Here is the caller graph for this function:

◆ ClearAllSideEffects()

void v8::internal::HValue::ClearAllSideEffects ( )
inline

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

711  {
713  }
void Remove(E element)
Definition: utils.h:857
static GVNFlagSet AllSideEffectsFlagSet()

References AllSideEffectsFlagSet(), changes_flags_, and v8::internal::EnumSet< E, T >::Remove().

Referenced by v8::internal::HOptimizedGraphBuilder::BuildIncrement(), 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:

◆ ClearChangesFlag()

void v8::internal::HValue::ClearChangesFlag ( GVNFlag  f)
inline

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

702 { changes_flags_.Remove(f); }

References changes_flags_, and v8::internal::EnumSet< E, T >::Remove().

+ Here is the call graph for this function:

◆ ClearDependsOnFlag()

void v8::internal::HValue::ClearDependsOnFlag ( GVNFlag  f)
inline

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

References depends_on_flags_, and v8::internal::EnumSet< E, T >::Remove().

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

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

◆ ClearFlag()

void v8::internal::HValue::ClearFlag ( Flag  f)
inline

◆ ComputeInitialRange()

void v8::internal::HValue::ComputeInitialRange ( Zone zone)

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

614  {
615  DCHECK(!HasRange());
616  range_ = InferRange(zone);
617  DCHECK(HasRange());
618 }
virtual Range * InferRange(Zone *zone)

References DCHECK, HasRange(), InferRange(), and range_.

Referenced by AddNewRange(), and v8::internal::HRangeAnalysisPhase::InferRange().

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

◆ CopyFlag()

void v8::internal::HValue::CopyFlag ( Flag  f,
HValue other 
)
inline

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

686  {
687  if (other->CheckFlag(f)) SetFlag(f);
688  }

References CheckFlag(), and SetFlag().

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

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

◆ DataEquals()

virtual bool v8::internal::HValue::DataEquals ( HValue other)
inlineprotectedvirtual

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 >, and v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

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

838  {
839  UNREACHABLE();
840  return false;
841  }
#define UNREACHABLE()
Definition: logging.h:30

References UNREACHABLE.

Referenced by Equals().

+ Here is the caller graph for this function:

◆ DeleteAndReplaceWith()

void v8::internal::HValue::DeleteAndReplaceWith ( HValue other)

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

485  {
486  // We replace all uses first, so Delete can assert that there are none.
487  if (other != NULL) ReplaceAllUsesWith(other);
488  Kill();
489  DeleteFromGraph();
490 }
void ReplaceAllUsesWith(HValue *other)
virtual void DeleteFromGraph()=0

References DeleteFromGraph(), Kill(), NULL, and ReplaceAllUsesWith().

Referenced by v8::internal::HEscapeAnalysisPhase::AnalyzeDataFlow(), v8::internal::DehoistArrayIndex(), v8::internal::HRepresentationChangesPhase::InsertRepresentationChangesForValue(), v8::internal::HLoadEliminationTable::Process(), v8::internal::HCheckTable::ReduceCheckHeapObject(), v8::internal::HDeadCodeEliminationPhase::RemoveDeadInstructions(), and v8::internal::HCanonicalizePhase::Run().

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

◆ DeleteFromGraph()

virtual void v8::internal::HValue::DeleteFromGraph ( )
protectedpure virtual

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

Referenced by DeleteAndReplaceWith().

+ Here is the caller graph for this function:

◆ DependsOnFlags()

GVNFlagSet v8::internal::HValue::DependsOnFlags ( ) const
inline

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

699 { return depends_on_flags_; }

References depends_on_flags_.

Referenced by v8::internal::HStoreEliminationPhase::ProcessInstr().

+ Here is the caller graph for this function:

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::HValue::DISALLOW_COPY_AND_ASSIGN ( HValue  )
private

◆ EmitAtUses()

virtual bool v8::internal::HValue::EmitAtUses ( )
inlinevirtual

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

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

586 { return false; }

◆ Equals()

bool v8::internal::HValue::Equals ( HValue other)

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

415  {
416  if (other->opcode() != opcode()) return false;
417  if (!other->representation().Equals(representation())) return false;
418  if (!other->type_.Equals(type_)) return false;
419  if (other->flags() != flags()) return false;
420  if (OperandCount() != other->OperandCount()) return false;
421  for (int i = 0; i < OperandCount(); ++i) {
422  if (OperandAt(i)->id() != other->OperandAt(i)->id()) return false;
423  }
424  bool result = DataEquals(other);
425  DCHECK(!result || Hashcode() == other->Hashcode());
426  return result;
427 }
virtual Opcode opcode() const =0
virtual bool DataEquals(HValue *other)
virtual intptr_t Hashcode()
Representation representation() const

References DataEquals(), DCHECK, v8::internal::Representation::Equals(), flags(), Hashcode(), id(), opcode(), OperandAt(), OperandCount(), representation(), and type_.

Referenced by v8::internal::HGraphBuilder::BuildCopyElements(), v8::internal::HLoadEliminationTable::Equal(), and v8::internal::HAliasAnalyzer::Query().

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

◆ EqualsInteger32Constant()

bool v8::internal::HValue::EqualsInteger32Constant ( int32_t  value)

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

474  {
475  return IsInteger32Constant() && GetInteger32Constant() == value;
476 }

References GetInteger32Constant(), and IsInteger32Constant().

Referenced by v8::internal::HGraphBuilder::BuildBinaryOperation(), v8::internal::IsIdentityOperation(), and v8::internal::MatchLeftIsOnes().

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

◆ FinalizeUniqueness()

◆ flags()

int v8::internal::HValue::flags ( ) const
inline

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

682 { return flags_; }

References flags_.

Referenced by Equals().

+ Here is the caller graph for this function:

◆ GetInteger32Constant()

int32_t v8::internal::HValue::GetInteger32Constant ( )

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

469  {
470  return HConstant::cast(this)->Integer32Value();
471 }

Referenced by v8::internal::HGraphBuilder::BuildFillElementsWithValue(), EqualsInteger32Constant(), v8::internal::IsUint32Operation(), v8::internal::BASE_EMBEDDED< Visitor >::ProcessRelatedChecks(), and v8::internal::HBinaryOperation::RightIsPowerOf2().

+ Here is the caller graph for this function:

◆ GetMinusZeroMode()

MinusZeroMode v8::internal::HValue::GetMinusZeroMode ( )
inline

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

830  {
833  }
@ FAIL_ON_MINUS_ZERO
Definition: globals.h:768
@ TREAT_MINUS_ZERO_AS_ZERO
Definition: globals.h:767

References CheckFlag(), v8::internal::FAIL_ON_MINUS_ZERO, kBailoutOnMinusZero, and v8::internal::TREAT_MINUS_ZERO_AS_ZERO.

+ Here is the call graph for this function:

◆ GetMonomorphicJSObjectMap()

virtual Handle<Map> v8::internal::HValue::GetMonomorphicJSObjectMap ( )
inlinevirtual

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

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

783 { return Handle<Map>(); }

Referenced by v8::internal::ComputeReceiverTypes(), and HasMonomorphicJSObjectType().

+ Here is the caller graph for this function:

◆ HandleSideEffectDominator()

virtual bool v8::internal::HValue::HandleSideEffectDominator ( GVNFlag  side_effect,
HValue dominator 
)
inlinevirtual

◆ HasAtLeastOneUseWithFlagAndNoneWithout()

bool v8::internal::HValue::HasAtLeastOneUseWithFlagAndNoneWithout ( Flag  f) const

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

351  {
352  bool return_value = false;
353  for (HUseIterator it(uses()); !it.Done(); it.Advance()) {
354  if (it.value()->IsSimulate()) continue;
355  if (!it.value()->CheckFlag(f)) return false;
356  return_value = true;
357  }
358  return return_value;
359 }

References uses().

Referenced by v8::internal::HCanonicalizePhase::Run().

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

◆ HasEscapingOperandAt()

◆ Hashcode()

intptr_t v8::internal::HValue::Hashcode ( )
virtual

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

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

430  {
431  intptr_t result = opcode();
432  int count = OperandCount();
433  for (int i = 0; i < count; ++i) {
434  result = result * 19 + OperandAt(i)->id() + (result >> 7);
435  }
436  return result;
437 }

References id(), opcode(), OperandAt(), and OperandCount().

Referenced by Equals(), and v8::internal::BoundsCheckKey::Hash().

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

◆ HasMonomorphicJSObjectType()

bool v8::internal::HValue::HasMonomorphicJSObjectType ( )

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

564  {
566 }
virtual Handle< Map > GetMonomorphicJSObjectMap()
bool is_null() const
Definition: handles.h:124

References GetMonomorphicJSObjectMap(), and v8::internal::Handle< T >::is_null().

Referenced by v8::internal::ComputeReceiverTypes().

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

◆ HasMultipleUses()

bool v8::internal::HValue::HasMultipleUses ( ) const
inline

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

674  {
675  return use_list_ != NULL && use_list_->tail() != NULL;
676  }

References NULL, v8::internal::HUseListNode::tail(), and use_list_.

+ Here is the call graph for this function:

◆ HasNonSmiUse()

bool v8::internal::HValue::HasNonSmiUse ( )
protected

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

4522  {
4523  for (HUseIterator it(uses()); !it.Done(); it.Advance()) {
4524  // We check for observed_input_representation elsewhere.
4525  Representation use_rep =
4526  it.value()->RequiredInputRepresentation(it.index());
4527  if (!use_rep.IsNone() &&
4528  !use_rep.IsSmi() &&
4529  !use_rep.IsTagged()) {
4530  return true;
4531  }
4532  }
4533  return false;
4534 }

References v8::internal::Representation::IsNone(), v8::internal::Representation::IsSmi(), and v8::internal::Representation::IsTagged().

Referenced by InferRepresentation().

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

◆ HasNoUses()

bool v8::internal::HValue::HasNoUses ( ) const
inline

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

670 { return use_list_ == NULL; }

References NULL, and use_list_.

Referenced by v8::internal::HEscapeAnalysisPhase::AnalyzeDataFlow(), v8::internal::DehoistArrayIndex(), v8::internal::HRepresentationChangesPhase::InsertRepresentationChangesForValue(), and RepresentationFromUses().

+ Here is the caller graph for this function:

◆ HasObservableSideEffects()

bool v8::internal::HValue::HasObservableSideEffects ( ) const
inline

◆ HasOneUse()

bool v8::internal::HValue::HasOneUse ( ) const
inline

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

671  {
672  return use_list_ != NULL && use_list_->tail() == NULL;
673  }

References NULL, v8::internal::HUseListNode::tail(), and use_list_.

Referenced by v8::internal::HBinaryOperation::AreOperandsBetterSwitched().

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

◆ HasOutOfBoundsAccess()

virtual bool v8::internal::HValue::HasOutOfBoundsAccess ( int  size)
inlinevirtual

◆ HasRange()

bool v8::internal::HValue::HasRange ( ) const
inline

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

738  {
739  DCHECK(!range_poisoned_);
740  return range_ != NULL;
741  }

References DCHECK, NULL, and range_.

Referenced by AddNewRange(), ComputeInitialRange(), v8::internal::HRangeAnalysisPhase::InferRange(), v8::internal::HRangeAnalysisPhase::PoisonRanges(), and RemoveLastAddedRange().

+ Here is the caller graph for this function:

◆ HasSideEffects()

bool v8::internal::HValue::HasSideEffects ( ) const
inline

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

714  {
716  }

References AllSideEffectsFlagSet(), changes_flags_, and v8::internal::EnumSet< E, T >::ContainsAnyOf().

+ Here is the call graph for this function:

◆ id()

int v8::internal::HValue::id ( ) const
inline

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

581 { return id_; }

References id_.

Referenced by v8::internal::HRangeAnalysisPhase::AddRange(), v8::internal::HInferRepresentationPhase::AddToWorklist(), v8::internal::HRangeAnalysisPhase::AddToWorklist(), v8::internal::HEscapeAnalysisPhase::AnalyzeDataFlow(), v8::internal::HEscapeAnalysisPhase::CollectCapturedValues(), Equals(), v8::internal::LCodeGen::GenerateDeferredCode(), v8::internal::HOptimizedGraphBuilder::HandleLiteralCompareNil(), v8::internal::HOptimizedGraphBuilder::HandlePolymorphicCallNamed(), Hashcode(), v8::internal::HEscapeAnalysisPhase::HasNoEscapingUses(), v8::internal::HRangeAnalysisPhase::InferRange(), v8::internal::HInferTypesPhase::InferTypes(), v8::internal::FINAL< kOperandKind, kNumCachedOperands >::IsDehoistedKey(), v8::internal::operator<<(), v8::internal::HCheckTable::Print(), v8::internal::HLoadEliminationTable::Process(), v8::internal::State::Process(), v8::internal::HStoreEliminationPhase::ProcessInstr(), v8::internal::HCheckTable::ReduceCheckMaps(), v8::internal::HCheckTable::ReduceCompareObjectEqAndBranch(), v8::internal::HInferRepresentationPhase::Run(), v8::internal::HRepresentationChangesPhase::Run(), set_id(), v8::internal::HOptimizedGraphBuilder::TryArgumentsAccess(), v8::internal::HOptimizedGraphBuilder::TryCallApply(), v8::internal::HOptimizedGraphBuilder::TryInlineBuiltinFunctionCall(), v8::internal::HOptimizedGraphBuilder::TryInlineBuiltinMethodCall(), v8::internal::HOptimizedGraphBuilder::TryInlineConstruct(), v8::internal::HRangeAnalysisPhase::UpdateControlFlowRange(), v8::internal::HOptimizedGraphBuilder::VisitDelete(), and v8::internal::HOptimizedGraphBuilder::VisitTypeof().

+ Here is the caller graph for this function:

◆ InferRange()

Range * v8::internal::HValue::InferRange ( Zone zone)
protectedvirtual

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 >, and v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

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

1730  {
1731  Range* result;
1732  if (representation().IsSmi() || type().IsSmi()) {
1733  result = new(zone) Range(Smi::kMinValue, Smi::kMaxValue);
1734  result->set_can_be_minus_zero(false);
1735  } else {
1736  result = new(zone) Range();
1737  result->set_can_be_minus_zero(!CheckFlag(kAllUsesTruncatingToInt32));
1738  // TODO(jkummerow): The range cannot be minus zero when the upper type
1739  // bound is Integer32.
1740  }
1741  return result;
1742 }
static const int kMaxValue
Definition: objects.h:1272
static const int kMinValue
Definition: objects.h:1270

References CheckFlag(), kAllUsesTruncatingToInt32, v8::internal::Smi::kMaxValue, v8::internal::Smi::kMinValue, representation(), and type().

Referenced by ComputeInitialRange().

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

◆ InferRepresentation()

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

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

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

60  {
62  Representation new_rep = RepresentationFromInputs();
63  UpdateRepresentation(new_rep, h_infer, "inputs");
64  new_rep = RepresentationFromUses();
65  UpdateRepresentation(new_rep, h_infer, "uses");
66  if (representation().IsSmi() && HasNonSmiUse()) {
68  Representation::Integer32(), h_infer, "use requirements");
69  }
70 }
virtual Representation RepresentationFromInputs()
virtual Representation RepresentationFromUses()
virtual void UpdateRepresentation(Representation new_rep, HInferRepresentationPhase *h_infer, const char *reason)
static Representation Integer32()

References CheckFlag(), DCHECK, HasNonSmiUse(), v8::internal::Representation::Integer32(), kFlexibleRepresentation, representation(), RepresentationFromInputs(), RepresentationFromUses(), and UpdateRepresentation().

Referenced by v8::internal::HInferRepresentationPhase::Run().

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

◆ InternalSetOperandAt()

◆ IsBitwiseBinaryShift()

bool v8::internal::HValue::IsBitwiseBinaryShift ( )
inline

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

552  {
553  return IsShl() || IsShr() || IsSar();
554  }

◆ IsDefinedAfter()

bool v8::internal::HValue::IsDefinedAfter ( HBasicBlock *  other) const

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

316  {
317  return block()->block_id() > other->block_id();
318 }

References block().

+ Here is the call graph for this function:

◆ IsDeletable()

virtual bool v8::internal::HValue::IsDeletable ( ) const
inlineprivatevirtual

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::HArithmeticBinaryOperation, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::HBitwiseBinaryOperation, 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::HMaterializedLiteral< V >, v8::internal::HMaterializedLiteral< 1 >, and v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

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

927 { return false; }

Referenced by CannotBeEliminated().

+ Here is the caller graph for this function:

◆ IsInformativeDefinition()

bool v8::internal::HValue::IsInformativeDefinition ( )
inline

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

629  {
631  }
virtual int RedefinedOperandIndex()

References kNoRedefinedOperand, and RedefinedOperandIndex().

+ Here is the call graph for this function:

◆ IsInteger32Constant()

bool v8::internal::HValue::IsInteger32Constant ( )

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

464  {
465  return IsConstant() && HConstant::cast(this)->HasInteger32Value();
466 }

Referenced by v8::internal::HGraphBuilder::BuildFillElementsWithValue(), EqualsInteger32Constant(), v8::internal::IsUint32Operation(), v8::internal::BASE_EMBEDDED< Visitor >::ProcessRelatedChecks(), and v8::internal::HBinaryOperation::RightIsPowerOf2().

+ Here is the caller graph for this function:

◆ isolate()

Isolate * v8::internal::HValue::isolate ( ) const

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

44  {
45  DCHECK(block() != NULL);
46  return block()->isolate();
47 }

References block(), DCHECK, and NULL.

+ Here is the call graph for this function:

◆ IsPhi()

bool v8::internal::HValue::IsPhi ( ) const
inline

◆ IsPurelyInformativeDefinition()

virtual bool v8::internal::HValue::IsPurelyInformativeDefinition ( )
inlinevirtual

◆ Kill()

void v8::internal::HValue::Kill ( )

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

506  {
507  // Instead of going through the entire use list of each operand, we only
508  // check the first item in each use list and rely on the tail() method to
509  // skip dead items, removing them lazily next time we traverse the list.
510  SetFlag(kIsDead);
511  for (int i = 0; i < OperandCount(); ++i) {
512  HValue* operand = OperandAt(i);
513  if (operand == NULL) continue;
514  HUseListNode* first = operand->use_list_;
515  if (first != NULL && first->value()->CheckFlag(kIsDead)) {
516  operand->use_list_ = first->tail();
517  }
518  }
519 }

References CheckFlag(), kIsDead, NULL, OperandAt(), OperandCount(), SetFlag(), v8::internal::HUseListNode::tail(), use_list_, and v8::internal::HUseListNode::value().

Referenced by DeleteAndReplaceWith().

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

◆ KnownOptimalRepresentation()

virtual Representation v8::internal::HValue::KnownOptimalRepresentation ( )
inlinevirtual

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

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

601  {
602  Representation r = representation();
603  if (r.IsTagged()) {
604  HType t = type();
605  if (t.IsSmi()) return Representation::Smi();
606  if (t.IsHeapNumber()) return Representation::Double();
607  if (t.IsHeapObject()) return r;
608  return Representation::None();
609  }
610  return r;
611  }
static Representation Double()
static Representation Smi()
static Representation None()

References v8::internal::Representation::Double(), v8::internal::Representation::IsTagged(), v8::internal::Representation::None(), representation(), v8::internal::Representation::Smi(), and type().

+ Here is the call graph for this function:

◆ Mnemonic()

const char * v8::internal::HValue::Mnemonic ( ) const

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

440  {
441  switch (opcode()) {
442 #define MAKE_CASE(type) case k##type: return #type;
444 #undef MAKE_CASE
445  case kPhi: return "Phi";
446  default: return "";
447  }
448 }
#define MAKE_CASE(type)

References HYDROGEN_CONCRETE_INSTRUCTION_LIST, kPhi, MAKE_CASE, and opcode().

Referenced by v8::internal::HEscapeAnalysisPhase::AnalyzeDataFlow(), v8::internal::HEscapeAnalysisPhase::CollectCapturedValues(), v8::internal::HEscapeAnalysisPhase::HasNoEscapingUses(), v8::internal::HRangeAnalysisPhase::InferRange(), v8::internal::HInstruction::PrintTo(), v8::internal::State::Process(), v8::internal::HStoreEliminationPhase::ProcessInstr(), RepresentationFromUses(), v8::internal::HRepresentationChangesPhase::Run(), and UpdateRepresentation().

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

◆ ObservableChangesFlags()

GVNFlagSet v8::internal::HValue::ObservableChangesFlags ( ) const
inline

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

728  {
729  GVNFlagSet result = ChangesFlags();
730  result.Intersect(AllObservableSideEffectsFlagSet());
731  return result;
732  }
GVNFlagSet ChangesFlags() const

References AllObservableSideEffectsFlagSet(), ChangesFlags(), and v8::internal::EnumSet< E, T >::Intersect().

+ Here is the call graph for this function:

◆ observed_input_representation()

◆ opcode()

virtual Opcode v8::internal::HValue::opcode ( ) const
pure virtual

◆ operand_position()

virtual HSourcePosition v8::internal::HValue::operand_position ( int  index) const
inlinevirtual

Reimplemented in v8::internal::HInstruction.

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

571  {
572  return position();
573  }
virtual HSourcePosition position() const

References position().

Referenced by v8::internal::HRepresentationChangesPhase::InsertRepresentationChangeForUse().

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

◆ OperandAt()

virtual HValue* v8::internal::HValue::OperandAt ( int  index) const
pure virtual

Implemented in v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::HDematerializedObject, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::HTemplateControlInstruction< S, V >, v8::internal::HTemplateControlInstruction< 2, 3 >, v8::internal::HTemplateControlInstruction< 2, 2 >, v8::internal::HTemplateControlInstruction< 0, 3 >, v8::internal::HTemplateControlInstruction< 2, 1 >, v8::internal::HTemplateControlInstruction< 2, 0 >, v8::internal::HTemplateControlInstruction< 1, 0 >, v8::internal::HTemplateControlInstruction< 0, 0 >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::HTemplateInstruction< V >, v8::internal::HTemplateInstruction< 0 >, v8::internal::HTemplateInstruction< 1 >, v8::internal::HTemplateInstruction< 2 >, v8::internal::HTemplateInstruction< 3 >, and v8::internal::HTemplateInstruction< 4 >.

Referenced by ActualValue(), AddDependantsToWorklist(), v8::internal::HEscapeAnalysisPhase::AnalyzeDataFlow(), v8::internal::HCheckTable::Copy(), Equals(), Hashcode(), Kill(), v8::internal::HDeadCodeEliminationPhase::MarkLive(), v8::internal::HCheckTable::Merge(), v8::internal::HEscapeAnalysisPhase::NewStateCopy(), v8::internal::HEscapeAnalysisPhase::NewStateForLoopHeader(), v8::internal::HInstruction::PrintDataTo(), v8::internal::HMarkDeoptimizeOnUndefinedPhase::ProcessPhi(), RedefinedOperand(), RegisterUse(), and v8::internal::HRepresentationChangesPhase::Run().

+ Here is the caller graph for this function:

◆ OperandCount()

◆ position()

virtual HSourcePosition v8::internal::HValue::position ( ) const
inlinevirtual

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

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

568  {
569  return HSourcePosition::Unknown();
570  }
static HSourcePosition Unknown()

References v8::internal::HSourcePosition::Unknown().

Referenced by v8::internal::LCodeGen::DeoptimizeBranch(), v8::internal::LCodeGen::DeoptimizeIf(), v8::internal::LCodeGen::GenerateDeferredCode(), and operand_position().

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

◆ PrintTo()

virtual OStream& v8::internal::HValue::PrintTo ( OStream os) const
pure virtual

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

Referenced by v8::internal::operator<<().

+ Here is the caller graph for this function:

◆ range()

Range* v8::internal::HValue::range ( ) const
inline

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

734  {
735  DCHECK(!range_poisoned_);
736  return range_;
737  }

References DCHECK, and range_.

Referenced by v8::internal::HRangeAnalysisPhase::AddRange(), v8::internal::HRangeAnalysisPhase::InferRange(), v8::internal::HRangeAnalysisPhase::PropagateMinusZeroChecks(), and v8::internal::HRangeAnalysisPhase::UpdateControlFlowRange().

+ Here is the caller graph for this function:

◆ RedefinedOperand()

HValue* v8::internal::HValue::RedefinedOperand ( )
inline

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

632  {
633  int index = RedefinedOperandIndex();
634  return index == kNoRedefinedOperand ? NULL : OperandAt(index);
635  }

References kNoRedefinedOperand, NULL, OperandAt(), and RedefinedOperandIndex().

Referenced by TryDecompose().

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

◆ RedefinedOperandIndex()

◆ RegisterUse()

void v8::internal::HValue::RegisterUse ( int  index,
HValue new_value 
)
protected

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

577  {
578  HValue* old_value = OperandAt(index);
579  if (old_value == new_value) return;
580 
581  HUseListNode* removed = NULL;
582  if (old_value != NULL) {
583  removed = old_value->RemoveUse(this, index);
584  }
585 
586  if (new_value != NULL) {
587  if (removed == NULL) {
588  new_value->use_list_ = new(new_value->block()->zone()) HUseListNode(
589  this, index, new_value->use_list_);
590  } else {
591  removed->set_tail(new_value->use_list_);
592  new_value->use_list_ = removed;
593  }
594  }
595 }

References block(), NULL, OperandAt(), RemoveUse(), v8::internal::HUseListNode::set_tail(), and use_list_.

Referenced by SetOperandAt().

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

◆ RemoveLastAddedRange()

void v8::internal::HValue::RemoveLastAddedRange ( )

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

607  {
608  DCHECK(HasRange());
609  DCHECK(range_->next() != NULL);
610  range_ = range_->next();
611 }

References DCHECK, HasRange(), NULL, and range_.

+ Here is the call graph for this function:

◆ RemoveUse()

HUseListNode * v8::internal::HValue::RemoveUse ( HValue value,
int  index 
)
protected

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

384  {
385  HUseListNode* previous = NULL;
386  HUseListNode* current = use_list_;
387  while (current != NULL) {
388  if (current->value() == value && current->index() == index) {
389  if (previous == NULL) {
390  use_list_ = current->tail();
391  } else {
392  previous->set_tail(current->tail());
393  }
394  break;
395  }
396 
397  previous = current;
398  current = current->tail();
399  }
400 
401 #ifdef DEBUG
402  // Do not reuse use list nodes in debug mode, zap them.
403  if (current != NULL) {
404  HUseListNode* temp =
405  new(block()->zone())
406  HUseListNode(current->value(), current->index(), NULL);
407  current->Zap();
408  current = temp;
409  }
410 #endif
411  return current;
412 }
void set_tail(HUseListNode *list)

References block(), v8::internal::HUseListNode::index(), NULL, v8::internal::HUseListNode::set_tail(), v8::internal::HUseListNode::tail(), use_list_, and v8::internal::HUseListNode::value().

Referenced by RegisterUse().

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

◆ ReplaceAllUsesWith()

void v8::internal::HValue::ReplaceAllUsesWith ( HValue other)

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

493  {
494  while (use_list_ != NULL) {
495  HUseListNode* list_node = use_list_;
496  HValue* value = list_node->value();
497  DCHECK(!value->block()->IsStartBlock());
498  value->InternalSetOperandAt(list_node->index(), other);
499  use_list_ = list_node->tail();
500  list_node->set_tail(other->use_list_);
501  other->use_list_ = list_node;
502  }
503 }

References block(), DCHECK, v8::internal::HUseListNode::index(), InternalSetOperandAt(), NULL, v8::internal::HUseListNode::set_tail(), v8::internal::HUseListNode::tail(), use_list_, and v8::internal::HUseListNode::value().

Referenced by DeleteAndReplaceWith().

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

◆ representation()

◆ RepresentationChanged()

virtual void v8::internal::HValue::RepresentationChanged ( Representation  to)
inlineprotectedvirtual

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

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

860 { }

Referenced by ChangeRepresentation().

+ Here is the caller graph for this function:

◆ RepresentationFromInputs()

virtual Representation v8::internal::HValue::RepresentationFromInputs ( )
inlineprotectedvirtual

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

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

849  {
850  return representation();
851  }

References representation().

Referenced by InferRepresentation().

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

◆ RepresentationFromUseRequirements()

Representation v8::internal::HValue::RepresentationFromUseRequirements ( )
protected

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

4498  {
4499  Representation rep = Representation::None();
4500  for (HUseIterator it(uses()); !it.Done(); it.Advance()) {
4501  // Ignore the use requirement from never run code
4502  if (it.value()->block()->IsUnreachable()) continue;
4503 
4504  // We check for observed_input_representation elsewhere.
4505  Representation use_rep =
4506  it.value()->RequiredInputRepresentation(it.index());
4507  if (rep.IsNone()) {
4508  rep = use_rep;
4509  continue;
4510  }
4511  if (use_rep.IsNone() || rep.Equals(use_rep)) continue;
4512  if (rep.generalize(use_rep).IsInteger32()) {
4513  rep = Representation::Integer32();
4514  continue;
4515  }
4516  return Representation::None();
4517  }
4518  return rep;
4519 }

References v8::internal::Representation::Equals(), v8::internal::Representation::generalize(), v8::internal::Representation::IsInteger32(), v8::internal::Representation::IsNone(), and v8::None.

+ Here is the call graph for this function:

◆ RepresentationFromUses()

Representation v8::internal::HValue::RepresentationFromUses ( )
protectedvirtual

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

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

73  {
74  if (HasNoUses()) return Representation::None();
75 
76  // Array of use counts for each representation.
77  int use_count[Representation::kNumRepresentations] = { 0 };
78 
79  for (HUseIterator it(uses()); !it.Done(); it.Advance()) {
80  HValue* use = it.value();
81  Representation rep = use->observed_input_representation(it.index());
82  if (rep.IsNone()) continue;
83  if (FLAG_trace_representation) {
84  PrintF("#%d %s is used by #%d %s as %s%s\n",
85  id(), Mnemonic(), use->id(), use->Mnemonic(), rep.Mnemonic(),
86  (use->CheckFlag(kTruncatingToInt32) ? "-trunc" : ""));
87  }
88  use_count[rep.kind()] += 1;
89  }
90  if (IsPhi()) HPhi::cast(this)->AddIndirectUsesTo(&use_count[0]);
91  int tagged_count = use_count[Representation::kTagged];
92  int double_count = use_count[Representation::kDouble];
93  int int32_count = use_count[Representation::kInteger32];
94  int smi_count = use_count[Representation::kSmi];
95 
96  if (tagged_count > 0) return Representation::Tagged();
97  if (double_count > 0) return Representation::Double();
98  if (int32_count > 0) return Representation::Integer32();
99  if (smi_count > 0) return Representation::Smi();
100 
101  return Representation::None();
102 }
const char * Mnemonic() const
static Representation Tagged()
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
void PrintF(const char *format,...)
Definition: utils.cc:80

References v8::internal::Representation::Double(), HasNoUses(), v8::internal::Representation::Integer32(), v8::internal::Representation::IsNone(), IsPhi(), v8::internal::Representation::kDouble, v8::internal::Representation::kind(), v8::internal::Representation::kInteger32, v8::internal::Representation::kNumRepresentations, v8::internal::Representation::kSmi, v8::internal::Representation::kTagged, kTruncatingToInt32, Mnemonic(), v8::internal::Representation::Mnemonic(), v8::internal::Representation::None(), v8::internal::PrintF(), v8::internal::Representation::Smi(), v8::internal::Representation::Tagged(), use(), and uses().

Referenced by InferRepresentation().

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

◆ RequiredInputRepresentation()

virtual Representation v8::internal::HValue::RequiredInputRepresentation ( int  index)
pure virtual

Implemented 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::HIsConstructCallAndBranch, v8::internal::HStringCompareAndBranch, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::HCompareObjectEqAndBranch, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::HCompareNumericAndBranch, 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::HBinaryOperation, 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::HDematerializedObject, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::HBinaryCall, v8::internal::HUnaryCall, v8::internal::HAllocateBlockContext, v8::internal::HStoreFrameContext, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, and v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

Referenced by v8::internal::HRepresentationChangesPhase::InsertRepresentationChangesForValue().

+ Here is the caller graph for this function:

◆ set_id()

void v8::internal::HValue::set_id ( int  id)
inline

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

582 { id_ = id; }

References id(), and id_.

+ Here is the call graph for this function:

◆ set_representation()

void v8::internal::HValue::set_representation ( Representation  r)
inlineprotected

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

870  {
871  DCHECK(representation_.IsNone() && !r.IsNone());
872  representation_ = r;
873  }

References DCHECK, v8::internal::Representation::IsNone(), and representation_.

Referenced by v8::internal::HAllocateBlockContext::HAllocateBlockContext(), v8::internal::HStoreFrameContext::HStoreFrameContext(), and v8::internal::HStringCompareAndBranch::HStringCompareAndBranch().

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

◆ set_type()

void v8::internal::HValue::set_type ( HType  new_type)
inline

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

614  {
615  DCHECK(new_type.IsSubtypeOf(type_));
616  type_ = new_type;
617  }

References DCHECK, and type_.

Referenced by v8::internal::HGraphBuilder::BuildNumberToString(), and v8::internal::HGraphBuilder::BuildUncheckedMonomorphicElementAccess().

+ Here is the caller graph for this function:

◆ SetAllSideEffects()

void v8::internal::HValue::SetAllSideEffects ( )
inline

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

References v8::internal::EnumSet< E, T >::Add(), AllSideEffectsFlagSet(), and changes_flags_.

Referenced by v8::internal::HArithmeticBinaryOperation::HArithmeticBinaryOperation(), v8::internal::HBitwiseBinaryOperation::HBitwiseBinaryOperation(), 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:

◆ SetBlock()

void v8::internal::HValue::SetBlock ( HBasicBlock *  block)

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

522  {
523  DCHECK(block_ == NULL || block == NULL);
524  block_ = block;
525  if (id_ == kNoNumber && block != NULL) {
526  id_ = block->graph()->GetNextValueID(this);
527  }
528 }

References block(), block_, DCHECK, id_, kNoNumber, and NULL.

Referenced by v8::internal::HInstruction::InitializeAsFirst(), v8::internal::HInstruction::InsertAfter(), and v8::internal::HInstruction::InsertBefore().

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

◆ SetChangesFlag()

void v8::internal::HValue::SetChangesFlag ( GVNFlag  f)
inline

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

700 { changes_flags_.Add(f); }

References v8::internal::EnumSet< E, T >::Add(), and changes_flags_.

Referenced by v8::internal::HStoreFrameContext::HStoreFrameContext(), v8::internal::HStringCompareAndBranch::HStringCompareAndBranch(), 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:

◆ SetDependsOnFlag()

void v8::internal::HValue::SetDependsOnFlag ( GVNFlag  f)
inline

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

701 { depends_on_flags_.Add(f); }

References v8::internal::EnumSet< E, T >::Add(), and depends_on_flags_.

Referenced by v8::internal::HInstruction::HInstruction().

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

◆ SetFlag()

◆ SetOperandAt()

void v8::internal::HValue::SetOperandAt ( int  index,
HValue value 
)

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

479  {
480  RegisterUse(index, value);
481  InternalSetOperandAt(index, value);
482 }
virtual void InternalSetOperandAt(int index, HValue *value)=0
void RegisterUse(int index, HValue *new_value)

References InternalSetOperandAt(), and RegisterUse().

Referenced by v8::internal::HEscapeAnalysisPhase::AnalyzeDataFlow(), v8::internal::HAllocateBlockContext::HAllocateBlockContext(), v8::internal::HBinaryCall::HBinaryCall(), v8::internal::HBinaryOperation::HBinaryOperation(), v8::internal::HCompareNumericAndBranch::HCompareNumericAndBranch(), v8::internal::HCompareObjectEqAndBranch::HCompareObjectEqAndBranch(), v8::internal::HStringCompareAndBranch::HStringCompareAndBranch(), v8::internal::HUnaryCall::HUnaryCall(), v8::internal::HUnaryControlInstruction::HUnaryControlInstruction(), v8::internal::HUnaryOperation::HUnaryOperation(), v8::internal::HRepresentationChangesPhase::InsertRepresentationChangeForUse(), v8::internal::HRepresentationChangesPhase::InsertRepresentationChangesForValue(), v8::internal::HEscapeAnalysisPhase::NewStateCopy(), and v8::internal::HRedundantPhiEliminationPhase::ProcessPhis().

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

◆ SideEffectFlags()

GVNFlagSet v8::internal::HValue::SideEffectFlags ( ) const
inline

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

722  {
723  GVNFlagSet result = ChangesFlags();
724  result.Intersect(AllSideEffectsFlagSet());
725  return result;
726  }

References AllSideEffectsFlagSet(), ChangesFlags(), and v8::internal::EnumSet< E, T >::Intersect().

+ Here is the call graph for this function:

◆ STATIC_ASSERT()

v8::internal::HValue::STATIC_ASSERT ( )

◆ ToNumberCanBeObserved()

bool v8::internal::HValue::ToNumberCanBeObserved ( ) const
inline

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

826  {
828  }
bool ToStringOrToNumberCanBeObserved() const

References ToStringOrToNumberCanBeObserved().

Referenced by 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:

◆ ToStringCanBeObserved()

bool v8::internal::HValue::ToStringCanBeObserved ( ) const
inline

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

820  {
822  }

References ToStringOrToNumberCanBeObserved().

+ Here is the call graph for this function:

◆ ToStringOrToNumberCanBeObserved()

bool v8::internal::HValue::ToStringOrToNumberCanBeObserved ( ) const
inlineprotected

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

843  {
844  if (type().IsTaggedPrimitive()) return false;
845  if (type().IsJSObject()) return true;
847  }

References v8::internal::Representation::IsDouble(), v8::internal::Representation::IsSmiOrInteger32(), representation(), and type().

Referenced by ToNumberCanBeObserved(), and ToStringCanBeObserved().

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

◆ TryDecompose()

virtual bool v8::internal::HValue::TryDecompose ( DecompositionResult *  decomposition)
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 810 of file hydrogen-instructions.h.

810  {
811  if (RedefinedOperand() != NULL) {
812  return RedefinedOperand()->TryDecompose(decomposition);
813  } else {
814  return false;
815  }
816  }
virtual bool TryDecompose(DecompositionResult *decomposition)

References NULL, RedefinedOperand(), and TryDecompose().

Referenced by TryDecompose().

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

◆ type()

◆ UpdateInferredType()

bool v8::internal::HValue::UpdateInferredType ( )

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

569  {
570  HType type = CalculateInferredType();
571  bool result = (!type.Equals(type_));
572  type_ = type;
573  return result;
574 }
virtual HType CalculateInferredType()

References CalculateInferredType(), type(), and type_.

Referenced by v8::internal::HInferTypesPhase::InferTypes().

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

◆ UpdateRepresentation()

void v8::internal::HValue::UpdateRepresentation ( Representation  new_rep,
HInferRepresentationPhase h_infer,
const char *  reason 
)
protectedvirtual

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::HBitwiseBinaryOperation, and v8::internal::HBinaryOperation.

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

107  {
108  Representation r = representation();
109  if (new_rep.is_more_general_than(r)) {
110  if (CheckFlag(kCannotBeTagged) && new_rep.IsTagged()) return;
111  if (FLAG_trace_representation) {
112  PrintF("Changing #%d %s representation %s -> %s based on %s\n",
113  id(), Mnemonic(), r.Mnemonic(), new_rep.Mnemonic(), reason);
114  }
115  ChangeRepresentation(new_rep);
116  AddDependantsToWorklist(h_infer);
117  }
118 }
void AddDependantsToWorklist(HInferRepresentationPhase *h_infer)

References AddDependantsToWorklist(), ChangeRepresentation(), CheckFlag(), v8::internal::Representation::is_more_general_than(), v8::internal::Representation::IsTagged(), kCannotBeTagged, Mnemonic(), v8::internal::Representation::Mnemonic(), v8::internal::PrintF(), and representation().

Referenced by InferRepresentation(), and v8::internal::HBinaryOperation::UpdateRepresentation().

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

◆ UseCount()

int v8::internal::HValue::UseCount ( ) const

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

377  {
378  int count = 0;
379  for (HUseIterator it(uses()); !it.Done(); it.Advance()) ++count;
380  return count;
381 }

References uses().

+ Here is the call graph for this function:

◆ uses()

HUseIterator v8::internal::HValue::uses ( ) const
inline

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

584 { return HUseIterator(use_list_); }

References use_list_.

Referenced by AddDependantsToWorklist(), CheckUsesForFlag(), HasAtLeastOneUseWithFlagAndNoneWithout(), v8::internal::HEscapeAnalysisPhase::HasNoEscapingUses(), v8::internal::HInferTypesPhase::InferTypes(), v8::internal::HRepresentationChangesPhase::InsertRepresentationChangesForValue(), RepresentationFromUses(), and UseCount().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

OStream& operator<< ( OStream os,
const ChangesOf v 
)
friend

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

542  {
543  GVNFlagSet changes_flags = c.value->ChangesFlags();
544  if (changes_flags.IsEmpty()) return os;
545  os << " changes[";
546  if (changes_flags == c.value->AllSideEffectsFlagSet()) {
547  os << "*";
548  } else {
549  bool add_comma = false;
550 #define PRINT_DO(Type) \
551  if (changes_flags.Contains(k##Type)) { \
552  if (add_comma) os << ","; \
553  add_comma = true; \
554  os << #Type; \
555  }
558 #undef PRINT_DO
559  }
560  return os << "]";
561 }
#define PRINT_DO(Type)

Member Data Documentation

◆ block_

HBasicBlock* v8::internal::HValue::block_
protected

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

Referenced by block(), clear_block(), and SetBlock().

◆ changes_flags_

◆ depends_on_flags_

GVNFlagSet v8::internal::HValue::depends_on_flags_
protected

◆ flags_

int v8::internal::HValue::flags_
protected

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

Referenced by CheckFlag(), ClearFlag(), flags(), and SetFlag().

◆ id_

int v8::internal::HValue::id_
protected

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

Referenced by id(), set_id(), and SetBlock().

◆ kNoNumber

const int v8::internal::HValue::kNoNumber = -1
static

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

Referenced by SetBlock().

◆ kNoRedefinedOperand

const int v8::internal::HValue::kNoRedefinedOperand = -1
static

◆ range_

Range* v8::internal::HValue::range_
protected

◆ representation_

Representation v8::internal::HValue::representation_
protected

◆ type_

HType v8::internal::HValue::type_
protected

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

Referenced by Equals(), set_type(), type(), and UpdateInferredType().

◆ use_list_

HUseListNode* v8::internal::HValue::use_list_
protected

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