-
Notifications
You must be signed in to change notification settings - Fork 0
/
jumpTable.h
executable file
·46 lines (36 loc) · 1.04 KB
/
jumpTable.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef __JUMP_TABLE__H
#define __JUMP_TABLE__H
#include <boost/utility.hpp>
class memoryManager;
/*
* Contains addresses of instructions in a nativeCode block that coresponds to
* platters in an array. Has the same size as the source array.
*
* Instances of this class are created by nativeCode::create(...).
*/
class jumpTable: boost::noncopyable
{
private:
friend class context;
friend class nativeCode;
static jumpTable * create(memoryManager & mm, size_t slotCount);
private:
~jumpTable();
/* Delete via destroy(...) call. */
void operator delete(void * p);
public:
void destroy(memoryManager & mm);
void ** begin();
void * const * begin() const;
/*
* Returns an address of the first instruction to execute when control
* finger points to platter i.
*/
void * address(size_t i) const;
private:
/*
* Actual jump table goes here. It is allocated by the
* generateNativeCode(...) call.
*/
};
#endif /* __JUMP_TABLE__H */