sourcemod/sourcepawn/jit/jit_function.h
David Anderson 3ac43497b9 Implement a watchdog timer for scripts that take too long to execute (bug 5837, r=fyren).
--HG--
extra : rebase_source : ffacb38457eca581660ce8f15c444ad828b7fedd
2013-08-14 23:54:25 -07:00

39 lines
787 B
C++

// vim: set ts=8 sts=2 sw=2 tw=99 et:
#ifndef _INCLUDE_SOURCEPAWN_JIT2_FUNCTION_H_
#define _INCLUDE_SOURCEPAWN_JIT2_FUNCTION_H_
#include <sp_vm_types.h>
#include <ke_vector.h>
struct LoopEdge
{
uint32_t offset;
int32_t disp32;
};
class JitFunction
{
public:
JitFunction(void *entry_addr, cell_t pcode_offs, LoopEdge *edges, uint32_t nedges);
~JitFunction();
public:
void *GetEntryAddress() const;
cell_t GetPCodeAddress() const;
uint32_t NumLoopEdges() const {
return nedges_;
}
const LoopEdge &GetLoopEdge(size_t i) const {
assert(i < nedges_);
return edges_[i];
}
private:
void *m_pEntryAddr;
cell_t m_PcodeOffs;
LoopEdge *edges_;
uint32_t nedges_;
};
#endif //_INCLUDE_SOURCEPAWN_JIT2_FUNCTION_H_