forked from rubinius/rubinius
/
machine_method.hpp
51 lines (38 loc) · 1.16 KB
/
machine_method.hpp
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
47
48
49
50
51
#ifndef RBX_BUILTIN_MACHINE_METHOD
#define RBX_BUILTIN_MACHINE_METHOD
#include "assembler/code_map.hpp"
#include "assembler/relocation.hpp"
namespace rubinius {
class JITCompiler;
class VMMethod;
class MachineMethod : public Object {
public:
const static object_type type = MachineMethodType;
private:
VMMethod* vmmethod_;
size_t code_size_;
CodeMap* virtual2native_;
AddressComments* comments_;
assembler::Relocation** relocations_;
void* function_;
void* jit_data_;
public:
static void init(STATE);
static MachineMethod* create(STATE, VMMethod* vmm, JITCompiler& jit);
static MachineMethod* create(STATE, VMMethod* vmm);
void* function() {
return reinterpret_cast<void*>(function_);
}
void set_function(void* p) {
function_ = p;
}
// Used for debugging. Gives us a place to break on before entering jit'd code
static Object* run_code(STATE, VMMethod* const vmm, CallFrame* const call_frame);
// Ruby.primitive :machine_method_show
Object* show(STATE);
// Ruby.primitive :machine_method_activate
Object* activate();
void* resolve_virtual_ip(int ip);
};
}
#endif