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

#include <instruction.h>

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

Public Member Functions

size_t OutputCount () const
 
InstructionOperandOutputAt (size_t i) const
 
bool HasOutput () const
 
InstructionOperandOutput () const
 
size_t InputCount () const
 
InstructionOperandInputAt (size_t i) const
 
size_t TempCount () const
 
InstructionOperandTempAt (size_t i) const
 
InstructionCode opcode () const
 
ArchOpcode arch_opcode () const
 
AddressingMode addressing_mode () const
 
FlagsMode flags_mode () const
 
FlagsCondition flags_condition () const
 
InstructionMarkAsControl ()
 
InstructionMarkAsCall ()
 
bool IsControl () const
 
bool IsCall () const
 
bool NeedsPointerMap () const
 
bool HasPointerMap () const
 
bool IsGapMoves () const
 
bool IsBlockStart () const
 
bool IsSourcePosition () const
 
bool ClobbersRegisters () const
 
bool ClobbersTemps () const
 
bool ClobbersDoubleRegisters () const
 
PointerMap * pointer_map () const
 
void set_pointer_map (PointerMap *map)
 
void * operator new (size_t, void *location)
 
void operator delete (void *pointer, void *location)
 
- Public Member Functions inherited from v8::internal::ZoneObject
 INLINE (void *operator new(size_t size, Zone *zone))
 
void operator delete (void *, size_t)
 
void operator delete (void *pointer, Zone *zone)
 

Static Public Member Functions

static InstructionNew (Zone *zone, InstructionCode opcode)
 
static InstructionNew (Zone *zone, InstructionCode opcode, size_t output_count, InstructionOperand **outputs, size_t input_count, InstructionOperand **inputs, size_t temp_count, InstructionOperand **temps)
 

Protected Types

typedef BitField< size_t, 0, 8 > OutputCountField
 
typedef BitField< size_t, 8, 16 > InputCountField
 
typedef BitField< size_t, 24, 6 > TempCountField
 
typedef BitField< bool, 30, 1 > IsCallField
 
typedef BitField< bool, 31, 1 > IsControlField
 

Protected Member Functions

 Instruction (InstructionCode opcode)
 
 Instruction (InstructionCode opcode, size_t output_count, InstructionOperand **outputs, size_t input_count, InstructionOperand **inputs, size_t temp_count, InstructionOperand **temps)
 

Protected Attributes

InstructionCode opcode_
 
uint32_t bit_field_
 
PointerMap * pointer_map_
 
InstructionOperandoperands_ [1]
 

Detailed Description

Definition at line 404 of file instruction.h.

Member Typedef Documentation

◆ InputCountField

Definition at line 530 of file instruction.h.

◆ IsCallField

Definition at line 532 of file instruction.h.

◆ IsControlField

Definition at line 533 of file instruction.h.

◆ OutputCountField

Definition at line 529 of file instruction.h.

◆ TempCountField

Definition at line 531 of file instruction.h.

Constructor & Destructor Documentation

◆ Instruction() [1/2]

v8::internal::compiler::Instruction::Instruction ( InstructionCode  opcode)
inlineexplicitprotected

Definition at line 500 of file instruction.h.

501  : opcode_(opcode),
504  IsControlField::encode(false)),
505  pointer_map_(NULL) {}
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 enable alignment of csp to bytes on platforms which prefer the register to always be NULL

Referenced by New().

+ Here is the caller graph for this function:

◆ Instruction() [2/2]

v8::internal::compiler::Instruction::Instruction ( InstructionCode  opcode,
size_t  output_count,
InstructionOperand **  outputs,
size_t  input_count,
InstructionOperand **  inputs,
size_t  temp_count,
InstructionOperand **  temps 
)
inlineprotected

Definition at line 507 of file instruction.h.

511  : opcode_(opcode),
512  bit_field_(OutputCountField::encode(output_count) |
513  InputCountField::encode(input_count) |
514  TempCountField::encode(temp_count) |
516  pointer_map_(NULL) {
517  for (size_t i = 0; i < output_count; ++i) {
518  operands_[i] = outputs[i];
519  }
520  for (size_t i = 0; i < input_count; ++i) {
521  operands_[output_count + i] = inputs[i];
522  }
523  for (size_t i = 0; i < temp_count; ++i) {
524  operands_[output_count + input_count + i] = temps[i];
525  }
526  }
InstructionOperand * operands_[1]
Definition: instruction.h:538

References operands_.

Member Function Documentation

◆ addressing_mode()

AddressingMode v8::internal::compiler::Instruction::addressing_mode ( ) const
inline

Definition at line 429 of file instruction.h.

429  {
431  }

References v8::internal::BitFieldBase< T, shift, size, uint32_t >::decode(), and opcode().

+ Here is the call graph for this function:

◆ arch_opcode()

ArchOpcode v8::internal::compiler::Instruction::arch_opcode ( ) const
inline

Definition at line 428 of file instruction.h.

428 { return ArchOpcodeField::decode(opcode()); }

References v8::internal::BitFieldBase< T, shift, size, uint32_t >::decode(), and opcode().

Referenced by v8::internal::compiler::TARGET_TEST_F().

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

◆ ClobbersDoubleRegisters()

bool v8::internal::compiler::Instruction::ClobbersDoubleRegisters ( ) const
inline

Definition at line 484 of file instruction.h.

484 { return IsCall(); }

References IsCall().

+ Here is the call graph for this function:

◆ ClobbersRegisters()

bool v8::internal::compiler::Instruction::ClobbersRegisters ( ) const
inline

Definition at line 482 of file instruction.h.

482 { return IsCall(); }

References IsCall().

+ Here is the call graph for this function:

◆ ClobbersTemps()

bool v8::internal::compiler::Instruction::ClobbersTemps ( ) const
inline

Definition at line 483 of file instruction.h.

483 { return IsCall(); }

References IsCall().

+ Here is the call graph for this function:

◆ flags_condition()

FlagsCondition v8::internal::compiler::Instruction::flags_condition ( ) const
inline

Definition at line 433 of file instruction.h.

433  {
435  }

References v8::internal::BitFieldBase< T, shift, size, uint32_t >::decode(), and opcode().

+ Here is the call graph for this function:

◆ flags_mode()

FlagsMode v8::internal::compiler::Instruction::flags_mode ( ) const
inline

Definition at line 432 of file instruction.h.

432 { return FlagsModeField::decode(opcode()); }

References v8::internal::BitFieldBase< T, shift, size, uint32_t >::decode(), and opcode().

+ Here is the call graph for this function:

◆ HasOutput()

bool v8::internal::compiler::Instruction::HasOutput ( ) const
inline

Definition at line 412 of file instruction.h.

412 { return OutputCount() == 1; }

References OutputCount().

+ Here is the call graph for this function:

◆ HasPointerMap()

bool v8::internal::compiler::Instruction::HasPointerMap ( ) const
inline

Definition at line 472 of file instruction.h.

472 { return pointer_map_ != NULL; }

References NULL, and pointer_map_.

◆ InputAt()

InstructionOperand* v8::internal::compiler::Instruction::InputAt ( size_t  i) const
inline

◆ InputCount()

size_t v8::internal::compiler::Instruction::InputCount ( ) const
inline

Definition at line 415 of file instruction.h.

References bit_field_, and v8::internal::BitFieldBase< T, shift, size, uint32_t >::decode().

Referenced by InputAt(), v8::internal::compiler::TARGET_TEST_F(), and TempAt().

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

◆ IsBlockStart()

bool v8::internal::compiler::Instruction::IsBlockStart ( ) const
inline

Definition at line 477 of file instruction.h.

477 { return opcode() == kBlockStartInstruction; }
const InstructionCode kBlockStartInstruction
Definition: instruction.h:35

References v8::internal::compiler::kBlockStartInstruction, and opcode().

Referenced by v8::internal::compiler::FINAL< kOperandKind, kNumCachedOperands >::cast().

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

◆ IsCall()

bool v8::internal::compiler::Instruction::IsCall ( ) const
inline

Definition at line 470 of file instruction.h.

470 { return IsCallField::decode(bit_field_); }

References bit_field_, and v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by ClobbersDoubleRegisters(), ClobbersRegisters(), ClobbersTemps(), and NeedsPointerMap().

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

◆ IsControl()

bool v8::internal::compiler::Instruction::IsControl ( ) const
inline

Definition at line 469 of file instruction.h.

References bit_field_, and v8::internal::BitFieldBase< T, shift, size, U >::decode().

+ Here is the call graph for this function:

◆ IsGapMoves()

bool v8::internal::compiler::Instruction::IsGapMoves ( ) const
inline

Definition at line 474 of file instruction.h.

474  {
476  }
const InstructionCode kGapInstruction
Definition: instruction.h:34

References v8::internal::compiler::kBlockStartInstruction, v8::internal::compiler::kGapInstruction, and opcode().

Referenced by v8::internal::compiler::GapInstruction::cast().

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

◆ IsSourcePosition()

bool v8::internal::compiler::Instruction::IsSourcePosition ( ) const
inline

Definition at line 478 of file instruction.h.

478  {
480  }
const InstructionCode kSourcePositionInstruction
Definition: instruction.h:36

References v8::internal::compiler::kSourcePositionInstruction, and opcode().

Referenced by v8::internal::compiler::FINAL< kOperandKind, kNumCachedOperands >::cast().

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

◆ MarkAsCall()

Instruction* v8::internal::compiler::Instruction::MarkAsCall ( )
inline

Definition at line 465 of file instruction.h.

465  {
467  return this;
468  }
static U update(U previous, T value)
Definition: utils.h:223

References bit_field_, and v8::internal::BitFieldBase< T, shift, size, U >::update().

+ Here is the call graph for this function:

◆ MarkAsControl()

Instruction* v8::internal::compiler::Instruction::MarkAsControl ( )
inline

Definition at line 461 of file instruction.h.

461  {
463  return this;
464  }

References bit_field_, and v8::internal::BitFieldBase< T, shift, size, U >::update().

Referenced by v8::internal::compiler::VisitBinop(), v8::internal::compiler::VisitShift(), and v8::internal::compiler::VisitWordCompare().

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

◆ NeedsPointerMap()

bool v8::internal::compiler::Instruction::NeedsPointerMap ( ) const
inline

Definition at line 471 of file instruction.h.

471 { return IsCall(); }

References IsCall().

Referenced by set_pointer_map().

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

◆ New() [1/2]

static Instruction* v8::internal::compiler::Instruction::New ( Zone zone,
InstructionCode  opcode 
)
inlinestatic

Definition at line 438 of file instruction.h.

438  {
439  return New(zone, opcode, 0, NULL, 0, NULL, 0, NULL);
440  }
static Instruction * New(Zone *zone, InstructionCode opcode)
Definition: instruction.h:438

References NULL, and opcode().

+ Here is the call graph for this function:

◆ New() [2/2]

static Instruction* v8::internal::compiler::Instruction::New ( Zone zone,
InstructionCode  opcode,
size_t  output_count,
InstructionOperand **  outputs,
size_t  input_count,
InstructionOperand **  inputs,
size_t  temp_count,
InstructionOperand **  temps 
)
inlinestatic

Definition at line 442 of file instruction.h.

445  {
446  DCHECK(opcode >= 0);
447  DCHECK(output_count == 0 || outputs != NULL);
448  DCHECK(input_count == 0 || inputs != NULL);
449  DCHECK(temp_count == 0 || temps != NULL);
450  InstructionOperand* none = NULL;
451  USE(none);
452  int size = static_cast<int>(RoundUp(sizeof(Instruction), kPointerSize) +
453  (output_count + input_count + temp_count - 1) *
454  sizeof(none));
455  return new (zone->New(size)) Instruction(
456  opcode, output_count, outputs, input_count, inputs, temp_count, temps);
457  }
Instruction(InstructionCode opcode)
Definition: instruction.h:500
enable harmony numeric enable harmony object literal extensions Optimize object size
void USE(T)
Definition: macros.h:322
const int kPointerSize
Definition: globals.h:129
static void RoundUp(Vector< char > buffer, int *length, int *decimal_point)
Definition: fixed-dtoa.cc:171

References DCHECK, Instruction(), v8::internal::kPointerSize, v8::internal::Zone::New(), NULL, opcode(), v8::internal::RoundUp(), size, and USE().

+ Here is the call graph for this function:

◆ opcode()

InstructionCode v8::internal::compiler::Instruction::opcode ( ) const
inline

Definition at line 427 of file instruction.h.

427 { return opcode_; }

References opcode_.

Referenced by addressing_mode(), arch_opcode(), flags_condition(), flags_mode(), IsBlockStart(), IsGapMoves(), IsSourcePosition(), v8::internal::compiler::IA32OperandConverter::MemoryOperand(), v8::internal::compiler::X64OperandConverter::MemoryOperand(), and New().

+ Here is the caller graph for this function:

◆ operator delete()

void v8::internal::compiler::Instruction::operator delete ( void *  pointer,
void *  location 
)
inline

Definition at line 497 of file instruction.h.

497 { UNREACHABLE(); }
#define UNREACHABLE()
Definition: logging.h:30

References UNREACHABLE.

◆ operator new()

void* v8::internal::compiler::Instruction::operator new ( size_t  ,
void *  location 
)
inline

Definition at line 495 of file instruction.h.

495 { return location; }

◆ Output()

InstructionOperand* v8::internal::compiler::Instruction::Output ( ) const
inline

Definition at line 413 of file instruction.h.

413 { return OutputAt(0); }
InstructionOperand * OutputAt(size_t i) const
Definition: instruction.h:407

References OutputAt().

Referenced by v8::internal::compiler::InstructionOperandConverter::OutputDoubleRegister(), v8::internal::compiler::IA32OperandConverter::OutputOperand(), and v8::internal::compiler::X64OperandConverter::OutputRegisterOrOperand().

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

◆ OutputAt()

InstructionOperand* v8::internal::compiler::Instruction::OutputAt ( size_t  i) const
inline

Definition at line 407 of file instruction.h.

407  {
408  DCHECK(i < OutputCount());
409  return operands_[i];
410  }

References DCHECK, operands_, and OutputCount().

Referenced by Output(), and v8::internal::compiler::InstructionOperandConverter::OutputRegister().

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

◆ OutputCount()

size_t v8::internal::compiler::Instruction::OutputCount ( ) const
inline

Definition at line 406 of file instruction.h.

References bit_field_, and v8::internal::BitFieldBase< T, shift, size, uint32_t >::decode().

Referenced by HasOutput(), InputAt(), OutputAt(), v8::internal::compiler::TARGET_TEST_F(), and TempAt().

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

◆ pointer_map()

PointerMap* v8::internal::compiler::Instruction::pointer_map ( ) const
inline

Definition at line 485 of file instruction.h.

485 { return pointer_map_; }

References pointer_map_.

◆ set_pointer_map()

void v8::internal::compiler::Instruction::set_pointer_map ( PointerMap *  map)
inline

Definition at line 487 of file instruction.h.

487  {
490  pointer_map_ = map;
491  }
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 map
#define DCHECK_EQ(v1, v2)
Definition: logging.h:206

References DCHECK, DCHECK_EQ, map, NeedsPointerMap(), NULL, and pointer_map_.

+ Here is the call graph for this function:

◆ TempAt()

InstructionOperand* v8::internal::compiler::Instruction::TempAt ( size_t  i) const
inline

Definition at line 422 of file instruction.h.

422  {
423  DCHECK(i < TempCount());
424  return operands_[OutputCount() + InputCount() + i];
425  }

References DCHECK, InputCount(), operands_, OutputCount(), and TempCount().

Referenced by v8::internal::compiler::IA32OperandConverter::TempOperand(), and v8::internal::compiler::InstructionOperandConverter::TempRegister().

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

◆ TempCount()

size_t v8::internal::compiler::Instruction::TempCount ( ) const
inline

Definition at line 421 of file instruction.h.

References bit_field_, and v8::internal::BitFieldBase< T, shift, size, uint32_t >::decode().

Referenced by TempAt().

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

Member Data Documentation

◆ bit_field_

uint32_t v8::internal::compiler::Instruction::bit_field_
protected

◆ opcode_

InstructionCode v8::internal::compiler::Instruction::opcode_
protected

Definition at line 535 of file instruction.h.

Referenced by opcode().

◆ operands_

InstructionOperand* v8::internal::compiler::Instruction::operands_[1]
protected

Definition at line 538 of file instruction.h.

Referenced by InputAt(), Instruction(), OutputAt(), and TempAt().

◆ pointer_map_

PointerMap* v8::internal::compiler::Instruction::pointer_map_
protected

Definition at line 537 of file instruction.h.

Referenced by HasPointerMap(), pointer_map(), and set_pointer_map().


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