Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Xbyak::LabelManager Class Reference

#include <xbyak.h>

Public Member Functions

 LabelManager ()
 
void reset ()
 
void enterLocal ()
 
void leaveLocal ()
 
void set (CodeArray *base)
 
void defineSlabel (std::string label)
 
void defineClabel (const Label &label)
 
void assign (Label &dst, const Label &src)
 
bool getOffset (size_t *offset, std::string &label) const
 
bool getOffset (size_t *offset, const Label &label) const
 
void addUndefinedLabel (const std::string &label, const JmpLabel &jmp)
 
void addUndefinedLabel (const Label &label, const JmpLabel &jmp)
 
bool hasUndefSlabel () const
 
bool hasUndefClabel () const
 
const uint8getCode () const
 
bool isReady () const
 

Friends

class Label
 

Detailed Description

Definition at line 1116 of file xbyak.h.

Constructor & Destructor Documentation

◆ LabelManager()

Xbyak::LabelManager::LabelManager ( )
inline

Definition at line 1214 of file xbyak.h.

1215 {
1216 reset();
1217 }

Member Function Documentation

◆ addUndefinedLabel() [1/2]

void Xbyak::LabelManager::addUndefinedLabel ( const Label & label,
const JmpLabel & jmp )
inline

Definition at line 1297 of file xbyak.h.

1298 {
1299 clabelUndefList_.insert(ClabelUndefList::value_type(label.id, jmp));
1300 }
char * label

◆ addUndefinedLabel() [2/2]

void Xbyak::LabelManager::addUndefinedLabel ( const std::string & label,
const JmpLabel & jmp )
inline

Definition at line 1292 of file xbyak.h.

1293 {
1294 SlabelState& st = *label.c_str() == '.' ? stateList_.back() : stateList_.front();
1295 st.undefList.insert(SlabelUndefList::value_type(label, jmp));
1296 }

◆ assign()

void Xbyak::LabelManager::assign ( Label & dst,
const Label & src )
inline

Definition at line 1264 of file xbyak.h.

1265 {
1266 ClabelDefList::const_iterator i = clabelDefList_.find(src.id);
1267 if (i == clabelDefList_.end()) throw Error(ERR_LABEL_ISNOT_SET_BY_L);
1268 define_inner(clabelDefList_, clabelUndefList_, dst.id, i->second.offset);
1269 dst.mgr = this;
1270 }
Error
Definition calc.cpp:23
@ ERR_LABEL_ISNOT_SET_BY_L
Definition xbyak.h:166
Here is the caller graph for this function:

◆ defineClabel()

void Xbyak::LabelManager::defineClabel ( const Label & label)
inline

Definition at line 1259 of file xbyak.h.

1260 {
1261 define_inner(clabelDefList_, clabelUndefList_, getId(label), base_->getSize());
1262 label.mgr = this;
1263 }
size_t getSize() const
Definition xbyak.h:911
Here is the caller graph for this function:

◆ defineSlabel()

void Xbyak::LabelManager::defineSlabel ( std::string label)
inline

Definition at line 1239 of file xbyak.h.

1240 {
1241 if (label == "@b" || label == "@f") throw Error(ERR_BAD_LABEL_STR);
1242 if (label == "@@") {
1243 SlabelDefList& defList = stateList_.front().defList;
1244 SlabelDefList::iterator i = defList.find("@f");
1245 if (i != defList.end()) {
1246 defList.erase(i);
1247 label = "@b";
1248 } else {
1249 i = defList.find("@b");
1250 if (i != defList.end()) {
1251 defList.erase(i);
1252 }
1253 label = "@f";
1254 }
1255 }
1256 SlabelState& st = *label.c_str() == '.' ? stateList_.back() : stateList_.front();
1257 define_inner(st.defList, st.undefList, label, base_->getSize());
1258 }
@ ERR_BAD_LABEL_STR
Definition xbyak.h:168
Here is the caller graph for this function:

◆ enterLocal()

void Xbyak::LabelManager::enterLocal ( )
inline

Definition at line 1228 of file xbyak.h.

1229 {
1230 stateList_.push_back(SlabelState());
1231 }
Here is the caller graph for this function:

◆ getCode()

const uint8 * Xbyak::LabelManager::getCode ( ) const
inline

Definition at line 1309 of file xbyak.h.

1309{ return base_->getCode(); }
const uint8 * getCode() const
Definition xbyak.h:905
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOffset() [1/2]

bool Xbyak::LabelManager::getOffset ( size_t * offset,
const Label & label ) const
inline

Definition at line 1288 of file xbyak.h.

1289 {
1290 return getOffset_inner(clabelDefList_, offset, getId(label));
1291 }

◆ getOffset() [2/2]

bool Xbyak::LabelManager::getOffset ( size_t * offset,
std::string & label ) const
inline

Definition at line 1271 of file xbyak.h.

1272 {
1273 const SlabelDefList& defList = stateList_.front().defList;
1274 if (label == "@b") {
1275 if (defList.find("@f") != defList.end()) {
1276 label = "@f";
1277 } else if (defList.find("@b") == defList.end()) {
1279 }
1280 } else if (label == "@f") {
1281 if (defList.find("@f") != defList.end()) {
1282 label = "@b";
1283 }
1284 }
1285 const SlabelState& st = *label.c_str() == '.' ? stateList_.back() : stateList_.front();
1286 return getOffset_inner(st.defList, offset, label);
1287 }
@ ERR_LABEL_IS_NOT_FOUND
Definition xbyak.h:148
Here is the caller graph for this function:

◆ hasUndefClabel()

bool Xbyak::LabelManager::hasUndefClabel ( ) const
inline

Definition at line 1308 of file xbyak.h.

1308{ return hasUndefinedLabel_inner(clabelUndefList_); }
Here is the caller graph for this function:

◆ hasUndefSlabel()

bool Xbyak::LabelManager::hasUndefSlabel ( ) const
inline

Definition at line 1301 of file xbyak.h.

1302 {
1303 for (StateList::const_iterator i = stateList_.begin(), ie = stateList_.end(); i != ie; ++i) {
1304 if (hasUndefinedLabel_inner(i->undefList)) return true;
1305 }
1306 return false;
1307 }
Here is the caller graph for this function:

◆ isReady()

bool Xbyak::LabelManager::isReady ( ) const
inline

Definition at line 1310 of file xbyak.h.

1310{ return !base_->isAutoGrow() || base_->isCalledCalcJmpAddress(); }
bool isCalledCalcJmpAddress() const
Definition xbyak.h:958
bool isAutoGrow() const
Definition xbyak.h:957
Here is the call graph for this function:
Here is the caller graph for this function:

◆ leaveLocal()

void Xbyak::LabelManager::leaveLocal ( )
inline

Definition at line 1232 of file xbyak.h.

1233 {
1234 if (stateList_.size() <= 2) throw Error(ERR_UNDER_LOCAL_LABEL);
1235 if (hasUndefinedLabel_inner(stateList_.back().undefList)) throw Error(ERR_LABEL_IS_NOT_FOUND);
1236 stateList_.pop_back();
1237 }
@ ERR_UNDER_LOCAL_LABEL
Definition xbyak.h:158
Here is the caller graph for this function:

◆ reset()

void Xbyak::LabelManager::reset ( )
inline

Definition at line 1218 of file xbyak.h.

1219 {
1220 base_ = 0;
1221 labelId_ = 1;
1222 stateList_.clear();
1223 stateList_.push_back(SlabelState());
1224 stateList_.push_back(SlabelState());
1225 clabelDefList_.clear();
1226 clabelUndefList_.clear();
1227 }
Here is the caller graph for this function:

◆ set()

void Xbyak::LabelManager::set ( CodeArray * base)
inline

Definition at line 1238 of file xbyak.h.

1238{ base_ = base; }
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ Label

friend class Label
friend

Definition at line 1191 of file xbyak.h.


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