V8 Project
v8::internal::HPositionInfo Class Reference

#include <hydrogen-instructions.h>

+ Collaboration diagram for v8::internal::HPositionInfo:

Public Member Functions

 HPositionInfo (int pos)
 
HSourcePosition position () const
 
void set_position (HSourcePosition pos)
 
void ensure_storage_for_operand_positions (Zone *zone, int operand_count)
 
HSourcePosition operand_position (int idx) const
 
void set_operand_position (int idx, HSourcePosition pos)
 

Private Member Functions

HSourcePositionoperand_position_slot (int idx) const
 
bool has_operand_positions () const
 
HSourcePositionoperand_positions () const
 

Static Private Member Functions

static bool IsTaggedPosition (intptr_t val)
 
static intptr_t UntagPosition (intptr_t val)
 
static intptr_t TagPosition (intptr_t val)
 

Private Attributes

intptr_t data_
 

Static Private Attributes

static const intptr_t kInstructionPosIndex = 0
 
static const intptr_t kFirstOperandPosIndex = 1
 
static const intptr_t kPositionTag = 1
 
static const intptr_t kPositionShift = 1
 

Detailed Description

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

Constructor & Destructor Documentation

◆ HPositionInfo()

v8::internal::HPositionInfo::HPositionInfo ( int  pos)
inlineexplicit

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

1061 : data_(TagPosition(pos)) { }
static intptr_t TagPosition(intptr_t val)

Member Function Documentation

◆ ensure_storage_for_operand_positions()

void v8::internal::HPositionInfo::ensure_storage_for_operand_positions ( Zone zone,
int  operand_count 
)
inline

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

1078  {
1079  if (has_operand_positions()) {
1080  return;
1081  }
1082 
1083  const int length = kFirstOperandPosIndex + operand_count;
1084  HSourcePosition* positions =
1085  zone->NewArray<HSourcePosition>(length);
1086  for (int i = 0; i < length; i++) {
1087  positions[i] = HSourcePosition::Unknown();
1088  }
1089 
1090  const HSourcePosition pos = position();
1091  data_ = reinterpret_cast<intptr_t>(positions);
1092  set_position(pos);
1093 
1095  }
void set_position(HSourcePosition pos)
HSourcePosition position() const
static const intptr_t kFirstOperandPosIndex
static HSourcePosition Unknown()
#define DCHECK(condition)
Definition: logging.h:205

References data_, DCHECK, has_operand_positions(), kFirstOperandPosIndex, v8::internal::Zone::NewArray(), position(), set_position(), and v8::internal::HSourcePosition::Unknown().

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

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

◆ has_operand_positions()

bool v8::internal::HPositionInfo::has_operand_positions ( ) const
inlineprivate

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

1117  {
1118  return !IsTaggedPosition(data_);
1119  }
static bool IsTaggedPosition(intptr_t val)

References data_, and IsTaggedPosition().

Referenced by ensure_storage_for_operand_positions(), operand_position(), operand_position_slot(), operand_positions(), position(), and set_position().

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

◆ IsTaggedPosition()

static bool v8::internal::HPositionInfo::IsTaggedPosition ( intptr_t  val)
inlinestaticprivate

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

1128  {
1129  return (val & kPositionTag) != 0;
1130  }
static const intptr_t kPositionTag

References kPositionTag.

Referenced by has_operand_positions(), and UntagPosition().

+ Here is the caller graph for this function:

◆ operand_position()

HSourcePosition v8::internal::HPositionInfo::operand_position ( int  idx) const
inline

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

1097  {
1098  if (!has_operand_positions()) {
1099  return position();
1100  }
1101  return *operand_position_slot(idx);
1102  }
HSourcePosition * operand_position_slot(int idx) const

References has_operand_positions(), operand_position_slot(), and position().

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

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

◆ operand_position_slot()

HSourcePosition* v8::internal::HPositionInfo::operand_position_slot ( int  idx) const
inlineprivate

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

1112  {
1114  return &(operand_positions()[kFirstOperandPosIndex + idx]);
1115  }
HSourcePosition * operand_positions() const

References DCHECK, has_operand_positions(), kFirstOperandPosIndex, and operand_positions().

Referenced by operand_position(), and set_operand_position().

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

◆ operand_positions()

HSourcePosition* v8::internal::HPositionInfo::operand_positions ( ) const
inlineprivate

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

1121  {
1123  return reinterpret_cast<HSourcePosition*>(data_);
1124  }

References data_, DCHECK, and has_operand_positions().

Referenced by operand_position_slot(), position(), and set_position().

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

◆ position()

HSourcePosition v8::internal::HPositionInfo::position ( ) const
inline

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

1063  {
1064  if (has_operand_positions()) {
1066  }
1067  return HSourcePosition(static_cast<int>(UntagPosition(data_)));
1068  }
static const intptr_t kInstructionPosIndex
static intptr_t UntagPosition(intptr_t val)

References data_, has_operand_positions(), kInstructionPosIndex, operand_positions(), and UntagPosition().

Referenced by ensure_storage_for_operand_positions(), operand_position(), and v8::internal::HInstruction::position().

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

◆ set_operand_position()

void v8::internal::HPositionInfo::set_operand_position ( int  idx,
HSourcePosition  pos 
)
inline

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

1104  {
1105  *operand_position_slot(idx) = pos;
1106  }

References operand_position_slot().

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

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

◆ set_position()

void v8::internal::HPositionInfo::set_position ( HSourcePosition  pos)
inline

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

1070  {
1071  if (has_operand_positions()) {
1073  } else {
1074  data_ = TagPosition(pos.raw());
1075  }
1076  }

References data_, has_operand_positions(), kInstructionPosIndex, operand_positions(), v8::internal::HSourcePosition::raw(), and TagPosition().

Referenced by ensure_storage_for_operand_positions(), and v8::internal::HInstruction::set_position().

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

◆ TagPosition()

static intptr_t v8::internal::HPositionInfo::TagPosition ( intptr_t  val)
inlinestaticprivate

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

1135  {
1136  const intptr_t result = (val << kPositionShift) | kPositionTag;
1137  DCHECK(UntagPosition(result) == val);
1138  return result;
1139  }
static const intptr_t kPositionShift

References DCHECK, kPositionShift, kPositionTag, and UntagPosition().

Referenced by set_position().

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

◆ UntagPosition()

static intptr_t v8::internal::HPositionInfo::UntagPosition ( intptr_t  val)
inlinestaticprivate

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

1131  {
1132  DCHECK(IsTaggedPosition(val));
1133  return val >> kPositionShift;
1134  }

References DCHECK, IsTaggedPosition(), and kPositionShift.

Referenced by position(), and TagPosition().

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

Member Data Documentation

◆ data_

intptr_t v8::internal::HPositionInfo::data_
private

◆ kFirstOperandPosIndex

const intptr_t v8::internal::HPositionInfo::kFirstOperandPosIndex = 1
staticprivate

◆ kInstructionPosIndex

const intptr_t v8::internal::HPositionInfo::kInstructionPosIndex = 0
staticprivate

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

Referenced by position(), and set_position().

◆ kPositionShift

const intptr_t v8::internal::HPositionInfo::kPositionShift = 1
staticprivate

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

Referenced by TagPosition(), and UntagPosition().

◆ kPositionTag

const intptr_t v8::internal::HPositionInfo::kPositionTag = 1
staticprivate

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

Referenced by IsTaggedPosition(), and TagPosition().


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