V8 Project
v8::internal::LifetimePosition Class Reference

#include <lithium-allocator.h>

+ Collaboration diagram for v8::internal::LifetimePosition:

Public Member Functions

int Value () const
 
int InstructionIndex () const
 
bool IsInstructionStart () const
 
LifetimePosition InstructionStart () const
 
LifetimePosition InstructionEnd () const
 
LifetimePosition NextInstruction () const
 
LifetimePosition PrevInstruction () const
 
 LifetimePosition ()
 
bool IsValid () const
 

Static Public Member Functions

static LifetimePosition FromInstructionIndex (int index)
 
static LifetimePosition Invalid ()
 
static LifetimePosition MaxPosition ()
 

Private Member Functions

 STATIC_ASSERT (IS_POWER_OF_TWO(kStep))
 
 LifetimePosition (int value)
 

Private Attributes

int value_
 

Static Private Attributes

static const int kStep = 2
 

Detailed Description

Definition at line 38 of file lithium-allocator.h.

Constructor & Destructor Documentation

◆ LifetimePosition() [1/2]

v8::internal::LifetimePosition::LifetimePosition ( )
inline

Definition at line 94 of file lithium-allocator.h.

Referenced by FromInstructionIndex(), InstructionEnd(), InstructionStart(), Invalid(), MaxPosition(), NextInstruction(), and PrevInstruction().

+ Here is the caller graph for this function:

◆ LifetimePosition() [2/2]

v8::internal::LifetimePosition::LifetimePosition ( int  value)
inlineexplicitprivate

Definition at line 114 of file lithium-allocator.h.

114 : value_(value) { }

Member Function Documentation

◆ FromInstructionIndex()

static LifetimePosition v8::internal::LifetimePosition::FromInstructionIndex ( int  index)
inlinestatic

Definition at line 42 of file lithium-allocator.h.

42  {
43  return LifetimePosition(index * kStep);
44  }

References kStep, and LifetimePosition().

+ Here is the call graph for this function:

◆ InstructionEnd()

LifetimePosition v8::internal::LifetimePosition::InstructionEnd ( ) const
inline

Definition at line 73 of file lithium-allocator.h.

73  {
74  DCHECK(IsValid());
76  }
LifetimePosition InstructionStart() const
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, InstructionStart(), IsValid(), kStep, LifetimePosition(), and Value().

Referenced by v8::internal::LiveRange::CanBeSpilled().

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

◆ InstructionIndex()

int v8::internal::LifetimePosition::InstructionIndex ( ) const
inline

Definition at line 53 of file lithium-allocator.h.

53  {
54  DCHECK(IsValid());
55  return value_ / kStep;
56  }

References DCHECK, IsValid(), kStep, and value_.

+ Here is the call graph for this function:

◆ InstructionStart()

LifetimePosition v8::internal::LifetimePosition::InstructionStart ( ) const
inline

Definition at line 66 of file lithium-allocator.h.

66  {
67  DCHECK(IsValid());
68  return LifetimePosition(value_ & ~(kStep - 1));
69  }

References DCHECK, IsValid(), kStep, LifetimePosition(), and value_.

Referenced by InstructionEnd(), NextInstruction(), and PrevInstruction().

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

◆ Invalid()

static LifetimePosition v8::internal::LifetimePosition::Invalid ( )
inlinestatic

Definition at line 100 of file lithium-allocator.h.

100 { return LifetimePosition(); }

References LifetimePosition().

Referenced by v8::internal::LiveRange::AdvanceLastProcessedMarker(), v8::internal::LiveRange::FirstIntersection(), and v8::internal::UseInterval::Intersect().

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

◆ IsInstructionStart()

bool v8::internal::LifetimePosition::IsInstructionStart ( ) const
inline

Definition at line 60 of file lithium-allocator.h.

60  {
61  return (value_ & (kStep - 1)) == 0;
62  }

References kStep, and value_.

◆ IsValid()

bool v8::internal::LifetimePosition::IsValid ( ) const
inline

Definition at line 98 of file lithium-allocator.h.

98 { return value_ != -1; }

References value_.

Referenced by v8::internal::LiveRange::FirstIntersection(), InstructionEnd(), InstructionIndex(), InstructionStart(), NextInstruction(), PrevInstruction(), and v8::internal::UsePosition::UsePosition().

+ Here is the caller graph for this function:

◆ MaxPosition()

static LifetimePosition v8::internal::LifetimePosition::MaxPosition ( )
inlinestatic

Definition at line 102 of file lithium-allocator.h.

102  {
103  // We have to use this kind of getter instead of static member due to
104  // crash bug in GDB.
105  return LifetimePosition(kMaxInt);
106  }
const int kMaxInt
Definition: globals.h:109

References v8::internal::kMaxInt, and LifetimePosition().

+ Here is the call graph for this function:

◆ NextInstruction()

LifetimePosition v8::internal::LifetimePosition::NextInstruction ( ) const
inline

Definition at line 79 of file lithium-allocator.h.

79  {
80  DCHECK(IsValid());
82  }

References DCHECK, InstructionStart(), IsValid(), kStep, LifetimePosition(), and Value().

Referenced by v8::internal::LiveRange::CanBeSpilled().

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

◆ PrevInstruction()

LifetimePosition v8::internal::LifetimePosition::PrevInstruction ( ) const
inline

Definition at line 86 of file lithium-allocator.h.

86  {
87  DCHECK(IsValid());
88  DCHECK(value_ > 1);
90  }

References DCHECK, InstructionStart(), IsValid(), kStep, LifetimePosition(), Value(), and value_.

+ Here is the call graph for this function:

◆ STATIC_ASSERT()

v8::internal::LifetimePosition::STATIC_ASSERT ( IS_POWER_OF_TWO(kStep )
private

◆ Value()

Member Data Documentation

◆ kStep

const int v8::internal::LifetimePosition::kStep = 2
staticprivate

◆ value_

int v8::internal::LifetimePosition::value_
private

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