v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HValue Class Referenceabstract

#include <hydrogen-instructions.h>

Inheritance diagram for HValue:
Collaboration diagram for HValue:

Public Types

enum  Flag {
  kFlexibleRepresentation, kCannotBeTagged, kUseGVN, kTrackSideEffectDominators,
  kCanOverflow, kBailoutOnMinusZero, kCanBeDivByZero, kLeftCanBeMinInt,
  kLeftCanBeNegative, kLeftCanBePositive, kAllowUndefinedAsNaN, kIsArguments,
  kTruncatingToInt32, kAllUsesTruncatingToInt32, kTruncatingToSmi, kAllUsesTruncatingToSmi,
  kIsDead, kUint32, kHasNoObservableSideEffects, kIsLive,
  kEndsLiveRange = kIsLive, kLastFlag = kIsLive
}
 
enum  Opcode { kPhi }
 

Public Member Functions

 STATIC_ASSERT (kLastFlag< kBitsPerInt)
 
virtual Opcode opcode () const =0
 
bool IsPhi () const
 
 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)
 
bool IsHeapObject ()
 
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 ()=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 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 void PrintTo (StringStream *stream)=0
 
void PrintNameTo (StringStream *stream)
 
void PrintTypeTo (StringStream *stream)
 
void PrintRangeTo (StringStream *stream)
 
void PrintChangesTo (StringStream *stream)
 
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 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)
 
virtual Representation RepresentationFromInputs ()
 
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_
 

Detailed Description

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

Member Enumeration Documentation

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

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

enum Opcode
Enumerator
kPhi 

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

Constructor & Destructor Documentation

HValue ( HType  type = HType::Tagged())
inline

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

virtual ~HValue ( )
inlinevirtual

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

Member Function Documentation

void AddDependantsToWorklist ( HInferRepresentationPhase h_infer)
protected
void AddNewRange ( Range *  r,
Zone zone 
)
static GVNFlagSet AllFlagSet ( )
inlinestaticprotected
static GVNFlagSet AllObservableSideEffectsFlagSet ( )
inlinestaticprotected
void AssumeRepresentation ( Representation  r)
virtual
bool CannotBeEliminated ( ) const
inline

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

References HValue::HasObservableSideEffects().

bool CanReplaceWithDummyUses ( )

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

References HValue::block().

bool CheckChangesFlag ( GVNFlag  f) const
inline
bool CheckDependsOnFlag ( GVNFlag  f) const
inline
bool CheckUsesForFlag ( Flag  f) const

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

References HValue::uses().

bool CheckUsesForFlag ( Flag  f,
HValue **  value 
) const

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

References HValue::uses().

void clear_block ( )
inlineprotected

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

References ASSERT, HValue::block_, and v8::internal::NULL.

Referenced by HInstruction::Unlink().

void ClearAllSideEffects ( )
inline
void ClearChangesFlag ( GVNFlag  f)
inline

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

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

void ClearDependsOnFlag ( GVNFlag  f)
inline
void ComputeInitialRange ( Zone zone)
void CopyFlag ( Flag  f,
HValue other 
)
inline

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

References HValue::CheckFlag(), and HValue::SetFlag().

Referenced by HGraphBuilder::BuildBinaryOperation().

virtual bool DataEquals ( HValue other)
inlineprotectedvirtual

Reimplemented in V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, and V8_FINAL< kOperandKind, kNumCachedOperands >.

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

References UNREACHABLE.

Referenced by HValue::Equals().

virtual void DeleteFromGraph ( )
protectedpure virtual
GVNFlagSet DependsOnFlags ( ) const
inline

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

References HValue::depends_on_flags_.

virtual bool EmitAtUses ( )
inlinevirtual

Reimplemented in V8_FINAL< kOperandKind, kNumCachedOperands >.

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

bool EqualsInteger32Constant ( int32_t  value)
int flags ( ) const
inline

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

References HValue::flags_.

Referenced by HValue::Equals().

virtual Handle<Map> GetMonomorphicJSObjectMap ( )
inlinevirtual
virtual bool HandleSideEffectDominator ( GVNFlag  side_effect,
HValue dominator 
)
inlinevirtual
bool HasAtLeastOneUseWithFlagAndNoneWithout ( Flag  f) const

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

References HValue::uses().

Referenced by HCanonicalizePhase::Run().

bool HasMonomorphicJSObjectType ( )

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

References HValue::GetMonomorphicJSObjectMap().

bool HasMultipleUses ( ) const
inline
bool HasNoUses ( ) const
inline

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

References v8::internal::NULL, and HValue::use_list_.

Referenced by HValue::RepresentationFromUses().

virtual bool HasOutOfBoundsAccess ( int  size)
inlinevirtual
bool HasRange ( ) const
inline
bool HasSideEffects ( ) const
inline
bool IsDefinedAfter ( HBasicBlock *  other) const

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

References HValue::block().

bool IsHeapObject ( )
inline
bool IsInformativeDefinition ( )
inline
Isolate * isolate ( ) const

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

References ASSERT, HValue::block(), and v8::internal::NULL.

virtual bool IsPurelyInformativeDefinition ( )
inlinevirtual
GVNFlagSet ObservableChangesFlags ( ) const
inline
virtual HSourcePosition operand_position ( int  index) const
inlinevirtual

Reimplemented in HInstruction.

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

References HValue::position().

virtual HSourcePosition position ( ) const
inlinevirtual
void PrintRangeTo ( StringStream stream)

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

References StringStream::Add(), v8::internal::NULL, and HValue::range().

Referenced by HInstruction::PrintTo().

void PrintTypeTo ( StringStream stream)
Range* range ( ) const
inline

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

References HValue::range_.

Referenced by HValue::PrintRangeTo().

HValue* RedefinedOperand ( )
inline
void RegisterUse ( int  index,
HValue new_value 
)
protected
void RemoveLastAddedRange ( )
virtual void RepresentationChanged ( Representation  to)
inlineprotectedvirtual
virtual Representation RequiredInputRepresentation ( int  index)
pure virtual

Implemented in V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, HIsConstructCallAndBranch, HStringCompareAndBranch, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, HCompareObjectEqAndBranch, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, HCompareNumericAndBranch, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, HBinaryOperation, V8_FINAL< kOperandKind, kNumCachedOperands >, HDematerializedObject, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, HBinaryCall, HUnaryCall, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, V8_FINAL< kOperandKind, kNumCachedOperands >, and V8_FINAL< kOperandKind, kNumCachedOperands >.

void set_id ( int  id)
inline

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

References HValue::id(), and HValue::id_.

void set_representation ( Representation  r)
inlineprotected
void set_type ( HType  new_type)
inline
void SetAllSideEffects ( )
inline
void SetBlock ( HBasicBlock *  block)
void SetChangesFlag ( GVNFlag  f)
inline

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

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

void SetDependsOnFlag ( GVNFlag  f)
inline
void SetOperandAt ( int  index,
HValue value 
)
GVNFlagSet SideEffectFlags ( ) const
inline
STATIC_ASSERT ( )
bool ToStringCanBeObserved ( ) const
inline
bool UpdateInferredType ( )
int UseCount ( ) const

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

References HValue::uses().

Referenced by HBinaryOperation::AreOperandsBetterSwitched().

Field Documentation

HBasicBlock* block_
protected

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

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

int flags_
protected
int id_
protected

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

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

const int kNoNumber = -1
static

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

Referenced by HValue::SetBlock().

const int kNoRedefinedOperand = -1
static

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