-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkrgc.h
44 lines (36 loc) · 1.01 KB
/
krgc.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
#ifndef KRGC_H_
#define KRGC_H_
#include <cstdint>
#include <type_traits>
class krgc {
public:
static const int loc_shift;
static const int insn_mask;
static const int int_flag;
static const uint32_t jit_flag;
enum class location : int {
unused = 0,
overhead = 1 << 0,
LdaKeyedProperty = 1 << 1,
};
enum class instruction {
unused = 0,
rdtscp = 1 << 0,
rdpmc = 1 << 1,
};
enum class check : uint32_t {
none = 0,
smi = 1 << 0,
shape = 1 << 1,
array_length = 1 << 2,
array_hole = 1 << 3,
};
static location loc() { return static_cast<krgc::location>(krgc::int_flag >> krgc::loc_shift); };
static instruction insn() { return static_cast<krgc::instruction>(krgc::int_flag & krgc::insn_mask); }
static void make_rich(bool);
static bool has_money();
static bool skip_check(check c) { return krgc::jit_flag & static_cast<uint32_t>(c); }
static void make_bank(const char* functions);
static void count_cash(const char* function);
};
#endif // KRGC_H_