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

#include <code-generator-impl.h>

+ Inheritance diagram for v8::internal::compiler::InstructionOperandConverter:
+ Collaboration diagram for v8::internal::compiler::InstructionOperandConverter:

Public Member Functions

 InstructionOperandConverter (CodeGenerator *gen, Instruction *instr)
 
Register InputRegister (int index)
 
DoubleRegister InputDoubleRegister (int index)
 
double InputDouble (int index)
 
int32_t InputInt32 (int index)
 
int8_t InputInt8 (int index)
 
int16_t InputInt16 (int index)
 
uint8_t InputInt5 (int index)
 
uint8_t InputInt6 (int index)
 
Handle< HeapObjectInputHeapObject (int index)
 
Label * InputLabel (int index)
 
BasicBlock * InputBlock (int index)
 
Register OutputRegister (int index=0)
 
DoubleRegister OutputDoubleRegister ()
 
Register TempRegister (int index)
 
Register ToRegister (InstructionOperand *op)
 
DoubleRegister ToDoubleRegister (InstructionOperand *op)
 
Constant ToConstant (InstructionOperand *operand)
 
double ToDouble (InstructionOperand *operand)
 
Handle< HeapObjectToHeapObject (InstructionOperand *operand)
 
Frameframe () const
 
Isolateisolate () const
 
Linkagelinkage () const
 

Protected Attributes

CodeGeneratorgen_
 
Instructioninstr_
 

Detailed Description

Definition at line 26 of file code-generator-impl.h.

Constructor & Destructor Documentation

◆ InstructionOperandConverter()

v8::internal::compiler::InstructionOperandConverter::InstructionOperandConverter ( CodeGenerator gen,
Instruction instr 
)
inline

Member Function Documentation

◆ frame()

Frame* v8::internal::compiler::InstructionOperandConverter::frame ( ) const
inline

Definition at line 110 of file code-generator-impl.h.

110 { return gen_->frame(); }

References gen_.

Referenced by v8::internal::compiler::IA32OperandConverter::ToOperand(), and v8::internal::compiler::X64OperandConverter::ToRegisterOrOperand().

+ Here is the caller graph for this function:

◆ InputBlock()

BasicBlock* v8::internal::compiler::InstructionOperandConverter::InputBlock ( int  index)
inline

Definition at line 67 of file code-generator-impl.h.

67  {
68  NodeId block_id = static_cast<NodeId>(InputInt32(index));
69  // operand should be a block id.
70  DCHECK(block_id >= 0);
71  DCHECK(block_id < gen_->schedule()->BasicBlockCount());
72  return gen_->schedule()->GetBlockById(block_id);
73  }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, gen_, and InputInt32().

Referenced by InputLabel().

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

◆ InputDouble()

double v8::internal::compiler::InstructionOperandConverter::InputDouble ( int  index)
inline

Definition at line 39 of file code-generator-impl.h.

39 { return ToDouble(instr_->InputAt(index)); }
InstructionOperand * InputAt(size_t i) const
Definition: instruction.h:416

References v8::internal::compiler::Instruction::InputAt(), instr_, and ToDouble().

+ Here is the call graph for this function:

◆ InputDoubleRegister()

DoubleRegister v8::internal::compiler::InstructionOperandConverter::InputDoubleRegister ( int  index)
inline

Definition at line 35 of file code-generator-impl.h.

35  {
36  return ToDoubleRegister(instr_->InputAt(index));
37  }
DoubleRegister ToDoubleRegister(InstructionOperand *op)

References v8::internal::compiler::Instruction::InputAt(), instr_, and ToDoubleRegister().

+ Here is the call graph for this function:

◆ InputHeapObject()

Handle<HeapObject> v8::internal::compiler::InstructionOperandConverter::InputHeapObject ( int  index)
inline

Definition at line 59 of file code-generator-impl.h.

59  {
60  return ToHeapObject(instr_->InputAt(index));
61  }
Handle< HeapObject > ToHeapObject(InstructionOperand *operand)

References v8::internal::compiler::Instruction::InputAt(), instr_, and ToHeapObject().

+ Here is the call graph for this function:

◆ InputInt16()

int16_t v8::internal::compiler::InstructionOperandConverter::InputInt16 ( int  index)
inline

Definition at line 47 of file code-generator-impl.h.

47  {
48  return static_cast<int16_t>(InputInt32(index));
49  }
signed short int16_t
Definition: unicode.cc:22

References InputInt32().

+ Here is the call graph for this function:

◆ InputInt32()

int32_t v8::internal::compiler::InstructionOperandConverter::InputInt32 ( int  index)
inline

Definition at line 41 of file code-generator-impl.h.

41  {
42  return ToConstant(instr_->InputAt(index)).ToInt32();
43  }
Constant ToConstant(InstructionOperand *operand)

References v8::internal::compiler::Instruction::InputAt(), instr_, and ToConstant().

Referenced by InputBlock(), InputInt16(), InputInt5(), InputInt6(), InputInt8(), v8::internal::compiler::IA32OperandConverter::MemoryOperand(), and v8::internal::compiler::X64OperandConverter::MemoryOperand().

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

◆ InputInt5()

uint8_t v8::internal::compiler::InstructionOperandConverter::InputInt5 ( int  index)
inline

Definition at line 51 of file code-generator-impl.h.

51  {
52  return static_cast<uint8_t>(InputInt32(index) & 0x1F);
53  }

References InputInt32().

+ Here is the call graph for this function:

◆ InputInt6()

uint8_t v8::internal::compiler::InstructionOperandConverter::InputInt6 ( int  index)
inline

Definition at line 55 of file code-generator-impl.h.

55  {
56  return static_cast<uint8_t>(InputInt32(index) & 0x3F);
57  }

References InputInt32().

+ Here is the call graph for this function:

◆ InputInt8()

int8_t v8::internal::compiler::InstructionOperandConverter::InputInt8 ( int  index)
inline

Definition at line 45 of file code-generator-impl.h.

45 { return static_cast<int8_t>(InputInt32(index)); }

References InputInt32().

+ Here is the call graph for this function:

◆ InputLabel()

Label* v8::internal::compiler::InstructionOperandConverter::InputLabel ( int  index)
inline

Definition at line 63 of file code-generator-impl.h.

63  {
64  return gen_->code()->GetLabel(InputBlock(index));
65  }

References gen_, and InputBlock().

+ Here is the call graph for this function:

◆ InputRegister()

Register v8::internal::compiler::InstructionOperandConverter::InputRegister ( int  index)
inline

Definition at line 31 of file code-generator-impl.h.

31  {
32  return ToRegister(instr_->InputAt(index));
33  }

References v8::internal::compiler::Instruction::InputAt(), instr_, and ToRegister().

Referenced by v8::internal::compiler::IA32OperandConverter::MemoryOperand(), and v8::internal::compiler::X64OperandConverter::MemoryOperand().

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

◆ isolate()

Isolate* v8::internal::compiler::InstructionOperandConverter::isolate ( ) const
inline

Definition at line 111 of file code-generator-impl.h.

111 { return gen_->isolate(); }

References gen_.

Referenced by v8::internal::compiler::IA32OperandConverter::ToImmediate(), and v8::internal::compiler::X64OperandConverter::ToImmediate64().

+ Here is the caller graph for this function:

◆ linkage()

Linkage* v8::internal::compiler::InstructionOperandConverter::linkage ( ) const
inline

Definition at line 112 of file code-generator-impl.h.

112 { return gen_->linkage(); }

References gen_.

Referenced by v8::internal::compiler::IA32OperandConverter::ToOperand(), and v8::internal::compiler::X64OperandConverter::ToRegisterOrOperand().

+ Here is the caller graph for this function:

◆ OutputDoubleRegister()

DoubleRegister v8::internal::compiler::InstructionOperandConverter::OutputDoubleRegister ( )
inline

Definition at line 79 of file code-generator-impl.h.

79  {
80  return ToDoubleRegister(instr_->Output());
81  }
InstructionOperand * Output() const
Definition: instruction.h:413

References instr_, v8::internal::compiler::Instruction::Output(), and ToDoubleRegister().

+ Here is the call graph for this function:

◆ OutputRegister()

Register v8::internal::compiler::InstructionOperandConverter::OutputRegister ( int  index = 0)
inline

Definition at line 75 of file code-generator-impl.h.

75  {
76  return ToRegister(instr_->OutputAt(index));
77  }
InstructionOperand * OutputAt(size_t i) const
Definition: instruction.h:407

References instr_, v8::internal::compiler::Instruction::OutputAt(), and ToRegister().

+ Here is the call graph for this function:

◆ TempRegister()

Register v8::internal::compiler::InstructionOperandConverter::TempRegister ( int  index)
inline

Definition at line 83 of file code-generator-impl.h.

83 { return ToRegister(instr_->TempAt(index)); }
InstructionOperand * TempAt(size_t i) const
Definition: instruction.h:422

References instr_, v8::internal::compiler::Instruction::TempAt(), and ToRegister().

+ Here is the call graph for this function:

◆ ToConstant()

Constant v8::internal::compiler::InstructionOperandConverter::ToConstant ( InstructionOperand operand)
inline

Definition at line 95 of file code-generator-impl.h.

95  {
96  if (operand->IsImmediate()) {
97  return gen_->code()->GetImmediate(operand->index());
98  }
99  return gen_->code()->GetConstant(operand->index());
100  }

References gen_, and v8::internal::compiler::InstructionOperand::index().

Referenced by InputInt32(), ToDouble(), ToHeapObject(), v8::internal::compiler::IA32OperandConverter::ToImmediate(), v8::internal::compiler::X64OperandConverter::ToImmediate(), and v8::internal::compiler::X64OperandConverter::ToImmediate64().

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

◆ ToDouble()

double v8::internal::compiler::InstructionOperandConverter::ToDouble ( InstructionOperand operand)
inline

Definition at line 102 of file code-generator-impl.h.

102  {
103  return ToConstant(operand).ToFloat64();
104  }

References ToConstant().

Referenced by InputDouble().

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

◆ ToDoubleRegister()

DoubleRegister v8::internal::compiler::InstructionOperandConverter::ToDoubleRegister ( InstructionOperand op)
inline

Definition at line 90 of file code-generator-impl.h.

90  {
91  DCHECK(op->IsDoubleRegister());
92  return DoubleRegister::FromAllocationIndex(op->index());
93  }
static DwVfpRegister FromAllocationIndex(int index)

References DCHECK, v8::internal::DwVfpRegister::FromAllocationIndex(), and v8::internal::compiler::InstructionOperand::index().

Referenced by InputDoubleRegister(), OutputDoubleRegister(), v8::internal::compiler::IA32OperandConverter::ToOperand(), and v8::internal::compiler::X64OperandConverter::ToRegisterOrOperand().

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

◆ ToHeapObject()

Handle<HeapObject> v8::internal::compiler::InstructionOperandConverter::ToHeapObject ( InstructionOperand operand)
inline

Definition at line 106 of file code-generator-impl.h.

106  {
107  return ToConstant(operand).ToHeapObject();
108  }

References ToConstant().

Referenced by InputHeapObject().

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

◆ ToRegister()

Register v8::internal::compiler::InstructionOperandConverter::ToRegister ( InstructionOperand op)
inline

Definition at line 85 of file code-generator-impl.h.

85  {
86  DCHECK(op->IsRegister());
87  return Register::FromAllocationIndex(op->index());
88  }
static Register FromAllocationIndex(int index)

References DCHECK, v8::internal::Register::FromAllocationIndex(), and v8::internal::compiler::InstructionOperand::index().

Referenced by InputRegister(), OutputRegister(), TempRegister(), v8::internal::compiler::IA32OperandConverter::ToOperand(), and v8::internal::compiler::X64OperandConverter::ToRegisterOrOperand().

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

Member Data Documentation

◆ gen_

CodeGenerator* v8::internal::compiler::InstructionOperandConverter::gen_
protected

Definition at line 115 of file code-generator-impl.h.

Referenced by frame(), InputBlock(), InputLabel(), isolate(), linkage(), and ToConstant().

◆ instr_


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