Skip to content
Snippets Groups Projects
Commit 31efe7f7 authored by whh8b's avatar whh8b
Browse files

Track FallthroughPatched and Coalesced status

FallthroughPatched: This is whether or not the
fallthrough to the subsequent dollop has been
converted into a jump instruction that has
been added to the dollop. This affects future
size calculations.

Coalesced: This is whether or not this dollop
has been coalesced with its fallthrough dollop.
This affects size calculations.
parent 8722d1a0
No related branches found
No related tags found
No related merge requests found
...@@ -89,7 +89,12 @@ class Dollop_t : public Placeable_t, public std::list<DollopEntry_t*> { ...@@ -89,7 +89,12 @@ class Dollop_t : public Placeable_t, public std::list<DollopEntry_t*> {
static Dollop_t *CreateNewDollop(libIRDB::Instruction_t *start); static Dollop_t *CreateNewDollop(libIRDB::Instruction_t *start);
Dollop_t(libIRDB::Instruction_t *start); Dollop_t(libIRDB::Instruction_t *start);
Dollop_t() { m_size = 0; m_was_truncated = false; } Dollop_t() :
m_size(0),
m_fallthrough_dollop(NULL),
m_fallthrough_patched(false),
m_coalesced(false),
m_was_truncated(false) {}
size_t GetSize() const { size_t GetSize() const {
return m_size; return m_size;
...@@ -108,16 +113,23 @@ class Dollop_t : public Placeable_t, public std::list<DollopEntry_t*> { ...@@ -108,16 +113,23 @@ class Dollop_t : public Placeable_t, public std::list<DollopEntry_t*> {
m_fallthrough_dollop = fallthrough; m_fallthrough_dollop = fallthrough;
} }
Dollop_t *FallthroughDollop(void) const { return m_fallthrough_dollop; } Dollop_t *FallthroughDollop(void) const { return m_fallthrough_dollop; }
bool FallthroughPatched(void) const { return m_fallthrough_patched; }
void FallthroughPatched(bool patched);
DollopEntry_t *FallthroughDollopEntry(DollopEntry_t *) const; DollopEntry_t *FallthroughDollopEntry(DollopEntry_t *) const;
void WasTruncated(bool truncated) { m_was_truncated = truncated; } void WasTruncated(bool truncated) { m_was_truncated = truncated; }
bool WasTruncated(void) const { return m_was_truncated; } bool WasTruncated(void) const { return m_was_truncated; }
void WasCoalesced(bool coalesced);
bool WasCoalesced(void) const { return m_coalesced; }
private: private:
size_t CalculateWorstCaseSize(); size_t CalculateWorstCaseSize();
size_t m_size; size_t m_size;
Dollop_t *m_fallthrough_dollop; Dollop_t *m_fallthrough_dollop;
bool m_fallthrough_patched;
bool m_coalesced;
bool m_was_truncated; bool m_was_truncated;
}; };
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment