Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
dart::compiler::Label Class Reference

#include <assembler_base.h>

Inheritance diagram for dart::compiler::Label:
dart::ZoneAllocated

Public Member Functions

 Label ()
 
 ~Label ()
 
intptr_t Position () const
 
intptr_t LinkPosition () const
 
intptr_t NearPosition ()
 
bool IsBound () const
 
bool IsUnused () const
 
bool IsLinked () const
 
bool HasNear () const
 
- Public Member Functions inherited from dart::ZoneAllocated
 ZoneAllocated ()
 
void * operator new (size_t size)
 
void * operator new (size_t size, Zone *zone)
 
void operator delete (void *pointer)
 

Friends

class Assembler
 

Detailed Description

Definition at line 276 of file assembler_base.h.

Constructor & Destructor Documentation

◆ Label()

dart::compiler::Label::Label ( )
inline

Definition at line 278 of file assembler_base.h.

278 : position_(0), unresolved_(0) {
279#ifdef DEBUG
280 for (int i = 0; i < kMaxUnresolvedBranches; i++) {
281 unresolved_near_positions_[i] = -1;
282 }
283#endif // DEBUG
284 }

◆ ~Label()

dart::compiler::Label::~Label ( )
inline

Definition at line 286 of file assembler_base.h.

286 {
287 // Assert if label is being destroyed with unresolved branches pending.
288 ASSERT(!IsLinked());
289 ASSERT(!HasNear());
290 }
#define ASSERT(E)

Member Function Documentation

◆ HasNear()

bool dart::compiler::Label::HasNear ( ) const
inline

Definition at line 312 of file assembler_base.h.

312{ return unresolved_ != 0; }

◆ IsBound()

bool dart::compiler::Label::IsBound ( ) const
inline

Definition at line 309 of file assembler_base.h.

309{ return position_ < 0; }

◆ IsLinked()

bool dart::compiler::Label::IsLinked ( ) const
inline

Definition at line 311 of file assembler_base.h.

311{ return position_ > 0; }

◆ IsUnused()

bool dart::compiler::Label::IsUnused ( ) const
inline

Definition at line 310 of file assembler_base.h.

310{ return position_ == 0 && unresolved_ == 0; }

◆ LinkPosition()

intptr_t dart::compiler::Label::LinkPosition ( ) const
inline

Definition at line 299 of file assembler_base.h.

299 {
300 ASSERT(IsLinked());
301 return position_ - kBias;
302 }

◆ NearPosition()

intptr_t dart::compiler::Label::NearPosition ( )
inline

Definition at line 304 of file assembler_base.h.

304 {
305 ASSERT(HasNear());
306 return unresolved_near_positions_[--unresolved_];
307 }

◆ Position()

intptr_t dart::compiler::Label::Position ( ) const
inline

Definition at line 294 of file assembler_base.h.

294 {
295 ASSERT(!IsUnused());
296 return IsBound() ? -position_ - kBias : position_ - kBias;
297 }

Friends And Related Symbol Documentation

◆ Assembler

friend class Assembler
friend

Definition at line 383 of file assembler_base.h.


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