Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
dart::RegisterSource< RegisterType > Class Template Reference

#include <deopt_instructions.h>

Public Types

enum  Kind { kStackSlot = 0 , kRegister = 1 }
 

Public Member Functions

 RegisterSource (intptr_t source_index)
 
 RegisterSource (Kind kind, intptr_t index)
 
template<typename T >
T Value (DeoptContext *context) const
 
intptr_t StackSlot (DeoptContext *context) const
 
intptr_t source_index () const
 
const char * ToCString () const
 

Detailed Description

template<typename RegisterType>
class dart::RegisterSource< RegisterType >

Definition at line 399 of file deopt_instructions.h.

Member Enumeration Documentation

◆ Kind

template<typename RegisterType >
enum dart::RegisterSource::Kind
Enumerator
kStackSlot 
kRegister 

Definition at line 401 of file deopt_instructions.h.

401 {
402 // Spilled register source represented as its spill slot.
403 kStackSlot = 0,
404 // Register source represented as its register index.
405 kRegister = 1
406 };

Constructor & Destructor Documentation

◆ RegisterSource() [1/2]

template<typename RegisterType >
dart::RegisterSource< RegisterType >::RegisterSource ( intptr_t  source_index)
inlineexplicit

Definition at line 408 of file deopt_instructions.h.

409 : source_index_(source_index) {}
intptr_t source_index() const

◆ RegisterSource() [2/2]

template<typename RegisterType >
dart::RegisterSource< RegisterType >::RegisterSource ( Kind  kind,
intptr_t  index 
)
inline

Definition at line 411 of file deopt_instructions.h.

412 : source_index_(KindField::encode(kind) |
static constexpr intptr_t encode(intptr_t value)
Definition bitfield.h:167

Member Function Documentation

◆ source_index()

template<typename RegisterType >
intptr_t dart::RegisterSource< RegisterType >::source_index ( ) const
inline

Definition at line 431 of file deopt_instructions.h.

431{ return source_index_; }

◆ StackSlot()

template<typename RegisterType >
intptr_t dart::RegisterSource< RegisterType >::StackSlot ( DeoptContext context) const
inline

Definition at line 426 of file deopt_instructions.h.

426 {
427 ASSERT(!is_register());
428 return context->GetStackSlot(raw_index());
429 }
#define ASSERT(E)

◆ ToCString()

template<typename RegisterType >
const char * dart::RegisterSource< RegisterType >::ToCString ( ) const
inline

Definition at line 433 of file deopt_instructions.h.

433 {
434 if (is_register()) {
435 return Name(reg());
436 } else {
437 return Thread::Current()->zone()->PrintToString("s%" Pd "", raw_index());
438 }
439 }
Zone * zone() const
static Thread * Current()
Definition thread.h:361
char * PrintToString(const char *format,...) PRINTF_ATTRIBUTE(2
Definition zone.cc:313
#define Pd
Definition globals.h:408

◆ Value()

template<typename RegisterType >
template<typename T >
T dart::RegisterSource< RegisterType >::Value ( DeoptContext context) const
inline

Definition at line 416 of file deopt_instructions.h.

416 {
417 if (is_register()) {
418 return static_cast<T>(
419 RegisterReader<RegisterType, T>::Read(context, reg()));
420 } else {
421 return *reinterpret_cast<T*>(
422 context->GetSourceFrameAddressAt(raw_index()));
423 }
424 }
#define T

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