V8 Project
v8::internal::compiler::LifetimePosition Class Reference

#include <register-allocator.h>

+ Collaboration diagram for v8::internal::compiler::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 register-allocator.h.

Constructor & Destructor Documentation

◆ LifetimePosition() [1/2]

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

Definition at line 90 of file register-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::compiler::LifetimePosition::LifetimePosition ( int  value)
inlineexplicitprivate

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

110 : value_(value) {}

Member Function Documentation

◆ FromInstructionIndex()

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

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

References kStep, and LifetimePosition().

+ Here is the call graph for this function:

◆ InstructionEnd()

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

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

69  {
70  DCHECK(IsValid());
71  return LifetimePosition(InstructionStart().Value() + kStep / 2);
72  }
#define DCHECK(condition)
Definition: logging.h:205

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

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

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

◆ InstructionIndex()

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

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

51  {
52  DCHECK(IsValid());
53  return value_ / kStep;
54  }

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

+ Here is the call graph for this function:

◆ InstructionStart()

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

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

62  {
63  DCHECK(IsValid());
64  return LifetimePosition(value_ & ~(kStep - 1));
65  }

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::compiler::LifetimePosition::Invalid ( )
inlinestatic

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

96 { return LifetimePosition(); }

References LifetimePosition().

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

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

◆ IsInstructionStart()

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

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

58 { return (value_ & (kStep - 1)) == 0; }

References kStep, and value_.

◆ IsValid()

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

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

94 { return value_ != -1; }

References value_.

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

+ Here is the caller graph for this function:

◆ MaxPosition()

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

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

98  {
99  // We have to use this kind of getter instead of static member due to
100  // crash bug in GDB.
101  return LifetimePosition(kMaxInt);
102  }
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::compiler::LifetimePosition::NextInstruction ( ) const
inline

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

75  {
76  DCHECK(IsValid());
78  }

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

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

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

◆ PrevInstruction()

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

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

82  {
83  DCHECK(IsValid());
84  DCHECK(value_ > 1);
86  }

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

+ Here is the call graph for this function:

◆ STATIC_ASSERT()

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

◆ Value()

Member Data Documentation

◆ kStep

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

◆ value_

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

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