V8 Project
v8::internal::compiler::IA32OperandConverter Class Reference
+ Inheritance diagram for v8::internal::compiler::IA32OperandConverter:
+ Collaboration diagram for v8::internal::compiler::IA32OperandConverter:

Public Member Functions

 IA32OperandConverter (CodeGenerator *gen, Instruction *instr)
 
Operand InputOperand (int index)
 
Immediate InputImmediate (int index)
 
Operand OutputOperand ()
 
Operand TempOperand (int index)
 
Operand ToOperand (InstructionOperand *op, int extra=0)
 
Operand HighOperand (InstructionOperand *op)
 
Immediate ToImmediate (InstructionOperand *operand)
 
Operand MemoryOperand (int *offset)
 
Operand MemoryOperand ()
 
- Public Member Functions inherited from v8::internal::compiler::InstructionOperandConverter
 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
 

Static Public Member Functions

static int NextOffset (int *offset)
 
static ScaleFactor ScaleFor (AddressingMode one, AddressingMode mode)
 

Additional Inherited Members

- Protected Attributes inherited from v8::internal::compiler::InstructionOperandConverter
CodeGeneratorgen_
 
Instructioninstr_
 

Detailed Description

Definition at line 23 of file code-generator-ia32.cc.

Constructor & Destructor Documentation

◆ IA32OperandConverter()

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

Definition at line 25 of file code-generator-ia32.cc.

26  : InstructionOperandConverter(gen, instr) {}
InstructionOperandConverter(CodeGenerator *gen, Instruction *instr)

Member Function Documentation

◆ HighOperand()

Operand v8::internal::compiler::IA32OperandConverter::HighOperand ( InstructionOperand op)
inline

Definition at line 52 of file code-generator-ia32.cc.

52  {
53  DCHECK(op->IsDoubleStackSlot());
54  return ToOperand(op, kPointerSize);
55  }
Operand ToOperand(InstructionOperand *op, int extra=0)
#define DCHECK(condition)
Definition: logging.h:205
const int kPointerSize
Definition: globals.h:129

References DCHECK, v8::internal::kPointerSize, and ToOperand().

+ Here is the call graph for this function:

◆ InputImmediate()

Immediate v8::internal::compiler::IA32OperandConverter::InputImmediate ( int  index)
inline

Definition at line 30 of file code-generator-ia32.cc.

30  {
31  return ToImmediate(instr_->InputAt(index));
32  }
Immediate ToImmediate(InstructionOperand *operand)
InstructionOperand * InputAt(size_t i) const
Definition: instruction.h:416

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

+ Here is the call graph for this function:

◆ InputOperand()

Operand v8::internal::compiler::IA32OperandConverter::InputOperand ( int  index)
inline

Definition at line 28 of file code-generator-ia32.cc.

28 { return ToOperand(instr_->InputAt(index)); }

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

+ Here is the call graph for this function:

◆ MemoryOperand() [1/2]

Operand v8::internal::compiler::IA32OperandConverter::MemoryOperand ( )
inline

Definition at line 158 of file code-generator-ia32.cc.

158  {
159  int first_input = 0;
160  return MemoryOperand(&first_input);
161  }

◆ MemoryOperand() [2/2]

Operand v8::internal::compiler::IA32OperandConverter::MemoryOperand ( int offset)
inline

Definition at line 95 of file code-generator-ia32.cc.

95  {
97  switch (mode) {
98  case kMode_MR: {
99  Register base = InputRegister(NextOffset(offset));
100  int32_t disp = 0;
101  return Operand(base, disp);
102  }
103  case kMode_MRI: {
104  Register base = InputRegister(NextOffset(offset));
105  int32_t disp = InputInt32(NextOffset(offset));
106  return Operand(base, disp);
107  }
108  case kMode_MR1:
109  case kMode_MR2:
110  case kMode_MR4:
111  case kMode_MR8: {
112  Register base = InputRegister(NextOffset(offset));
113  Register index = InputRegister(NextOffset(offset));
114  ScaleFactor scale = ScaleFor(kMode_MR1, mode);
115  int32_t disp = 0;
116  return Operand(base, index, scale, disp);
117  }
118  case kMode_MR1I:
119  case kMode_MR2I:
120  case kMode_MR4I:
121  case kMode_MR8I: {
122  Register base = InputRegister(NextOffset(offset));
123  Register index = InputRegister(NextOffset(offset));
124  ScaleFactor scale = ScaleFor(kMode_MR1I, mode);
125  int32_t disp = InputInt32(NextOffset(offset));
126  return Operand(base, index, scale, disp);
127  }
128  case kMode_M1:
129  case kMode_M2:
130  case kMode_M4:
131  case kMode_M8: {
132  Register index = InputRegister(NextOffset(offset));
133  ScaleFactor scale = ScaleFor(kMode_M1, mode);
134  int32_t disp = 0;
135  return Operand(index, scale, disp);
136  }
137  case kMode_M1I:
138  case kMode_M2I:
139  case kMode_M4I:
140  case kMode_M8I: {
141  Register index = InputRegister(NextOffset(offset));
142  ScaleFactor scale = ScaleFor(kMode_M1I, mode);
143  int32_t disp = InputInt32(NextOffset(offset));
144  return Operand(index, scale, disp);
145  }
146  case kMode_MI: {
147  int32_t disp = InputInt32(NextOffset(offset));
148  return Operand(Immediate(disp));
149  }
150  case kMode_None:
151  UNREACHABLE();
152  return Operand(no_reg, 0);
153  }
154  UNREACHABLE();
155  return Operand(no_reg, 0);
156  }
static ScaleFactor ScaleFor(AddressingMode one, AddressingMode mode)
InstructionCode opcode() const
Definition: instruction.h:427
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long mode(MIPS only)") DEFINE_BOOL(enable_always_align_csp
#define UNREACHABLE()
Definition: logging.h:30
int int32_t
Definition: unicode.cc:24
const Register no_reg

References v8::internal::BitFieldBase< T, shift, size, uint32_t >::decode(), v8::internal::compiler::InstructionOperandConverter::InputInt32(), v8::internal::compiler::InstructionOperandConverter::InputRegister(), v8::internal::compiler::InstructionOperandConverter::instr_, mode(), NextOffset(), v8::internal::no_reg, v8::internal::compiler::Instruction::opcode(), ScaleFor(), and UNREACHABLE.

+ Here is the call graph for this function:

◆ NextOffset()

static int v8::internal::compiler::IA32OperandConverter::NextOffset ( int offset)
inlinestatic

Definition at line 79 of file code-generator-ia32.cc.

79  {
80  int i = *offset;
81  (*offset)++;
82  return i;
83  }

Referenced by MemoryOperand().

+ Here is the caller graph for this function:

◆ OutputOperand()

Operand v8::internal::compiler::IA32OperandConverter::OutputOperand ( )
inline

Definition at line 34 of file code-generator-ia32.cc.

34 { return ToOperand(instr_->Output()); }
InstructionOperand * Output() const
Definition: instruction.h:413

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

+ Here is the call graph for this function:

◆ ScaleFor()

static ScaleFactor v8::internal::compiler::IA32OperandConverter::ScaleFor ( AddressingMode  one,
AddressingMode  mode 
)
inlinestatic

Definition at line 85 of file code-generator-ia32.cc.

85  {
86  STATIC_ASSERT(0 == static_cast<int>(times_1));
87  STATIC_ASSERT(1 == static_cast<int>(times_2));
88  STATIC_ASSERT(2 == static_cast<int>(times_4));
89  STATIC_ASSERT(3 == static_cast<int>(times_8));
90  int scale = static_cast<int>(mode - one);
91  DCHECK(scale >= 0 && scale < 4);
92  return static_cast<ScaleFactor>(scale);
93  }
STATIC_ASSERT(DoubleRegister::kMaxNumAllocatableRegisters >=Register::kMaxNumAllocatableRegisters)

References DCHECK, mode(), v8::internal::compiler::STATIC_ASSERT(), v8::internal::times_1, v8::internal::times_2, v8::internal::times_4, and v8::internal::times_8.

Referenced by MemoryOperand().

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

◆ TempOperand()

Operand v8::internal::compiler::IA32OperandConverter::TempOperand ( int  index)
inline

Definition at line 36 of file code-generator-ia32.cc.

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

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

+ Here is the call graph for this function:

◆ ToImmediate()

Immediate v8::internal::compiler::IA32OperandConverter::ToImmediate ( InstructionOperand operand)
inline

Definition at line 57 of file code-generator-ia32.cc.

57  {
58  Constant constant = ToConstant(operand);
59  switch (constant.type()) {
60  case Constant::kInt32:
61  return Immediate(constant.ToInt32());
62  case Constant::kFloat32:
63  return Immediate(
64  isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED));
65  case Constant::kFloat64:
66  return Immediate(
67  isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED));
68  case Constant::kExternalReference:
69  return Immediate(constant.ToExternalReference());
70  case Constant::kHeapObject:
71  return Immediate(constant.ToHeapObject());
72  case Constant::kInt64:
73  break;
74  }
75  UNREACHABLE();
76  return Immediate(-1);
77  }
Constant ToConstant(InstructionOperand *operand)

References v8::internal::compiler::InstructionOperandConverter::isolate(), v8::internal::TENURED, v8::internal::compiler::InstructionOperandConverter::ToConstant(), and UNREACHABLE.

Referenced by InputImmediate().

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

◆ ToOperand()

Operand v8::internal::compiler::IA32OperandConverter::ToOperand ( InstructionOperand op,
int  extra = 0 
)
inline

Definition at line 38 of file code-generator-ia32.cc.

38  {
39  if (op->IsRegister()) {
40  DCHECK(extra == 0);
41  return Operand(ToRegister(op));
42  } else if (op->IsDoubleRegister()) {
43  DCHECK(extra == 0);
44  return Operand(ToDoubleRegister(op));
45  }
46  DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot());
47  // The linkage computes where all spill slots are located.
48  FrameOffset offset = linkage()->GetFrameOffset(op->index(), frame(), extra);
49  return Operand(offset.from_stack_pointer() ? esp : ebp, offset.offset());
50  }
DoubleRegister ToDoubleRegister(InstructionOperand *op)
FrameOffset GetFrameOffset(int spill_slot, Frame *frame, int extra=0)
Definition: linkage.cc:63
const Register esp
const Register ebp

References DCHECK, v8::internal::ebp, v8::internal::esp, v8::internal::compiler::InstructionOperandConverter::frame(), v8::internal::compiler::FrameOffset::from_stack_pointer(), v8::internal::compiler::Linkage::GetFrameOffset(), v8::internal::compiler::InstructionOperand::index(), v8::internal::compiler::InstructionOperandConverter::linkage(), v8::internal::compiler::FrameOffset::offset(), v8::internal::compiler::InstructionOperandConverter::ToDoubleRegister(), and v8::internal::compiler::InstructionOperandConverter::ToRegister().

Referenced by HighOperand(), InputOperand(), OutputOperand(), and TempOperand().

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

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