2007-12-01 04:08:34 +00:00
|
|
|
#ifndef _BASICBLOCK_H_
|
|
|
|
#define _BASICBLOCK_H_
|
|
|
|
|
|
|
|
#include "MIPS.h"
|
|
|
|
|
2009-06-06 15:38:03 +00:00
|
|
|
class CCodeGen;
|
|
|
|
|
2007-12-01 04:08:34 +00:00
|
|
|
class CBasicBlock
|
|
|
|
{
|
|
|
|
public:
|
2007-12-06 21:36:12 +00:00
|
|
|
CBasicBlock(CMIPS&, uint32, uint32);
|
|
|
|
virtual ~CBasicBlock();
|
|
|
|
unsigned int Execute();
|
|
|
|
void Compile();
|
|
|
|
|
|
|
|
uint32 GetBeginAddress() const;
|
|
|
|
uint32 GetEndAddress() const;
|
|
|
|
bool IsCompiled() const;
|
2008-03-19 11:30:45 +00:00
|
|
|
unsigned int GetSelfLoopCount() const;
|
|
|
|
void SetSelfLoopCount(unsigned int);
|
2008-06-30 18:58:04 +00:00
|
|
|
CBasicBlock* GetBranchHint() const;
|
|
|
|
void SetBranchHint(CBasicBlock*);
|
2007-12-01 04:08:34 +00:00
|
|
|
|
2009-06-06 15:38:03 +00:00
|
|
|
protected:
|
2007-12-06 21:36:12 +00:00
|
|
|
uint32 m_begin;
|
|
|
|
uint32 m_end;
|
|
|
|
CMIPS& m_context;
|
2009-06-06 15:38:03 +00:00
|
|
|
|
|
|
|
virtual void CompileRange(CCodeGen&);
|
|
|
|
|
|
|
|
private:
|
|
|
|
uint8* m_text;
|
|
|
|
uint32 m_textSize;
|
2008-06-30 18:58:04 +00:00
|
|
|
CBasicBlock* m_branchHint;
|
2008-03-19 11:30:45 +00:00
|
|
|
unsigned int m_selfLoopCount;
|
2007-12-01 04:08:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|