blob: 12e2d7e4eb2e2665d8d124848811aabaa84868e8 [file] [log] [blame]
Logan35849002011-01-15 07:30:43 +08001#ifndef BCC_CONFIG_H
2#define BCC_CONFIG_H
3
4//---------------------------------------------------------------------------
Shih-wei Liao898c5a92011-05-18 07:02:39 -07005// Configuration for JIT & MC Assembler
6//---------------------------------------------------------------------------
Joseph Wen739527e2011-07-07 10:04:54 -07007#define USE_OLD_JIT 0
8#define USE_MCJIT 1
Logan Chienb0ceca22011-06-12 13:34:49 +08009
10#if !USE_OLD_JIT && !USE_MCJIT
11#error "You should choose at least one code generation method."
12#endif
Shih-wei Liao898c5a92011-05-18 07:02:39 -070013
14//---------------------------------------------------------------------------
Logan1dc63142011-02-25 17:14:51 +080015// Configuration for libbcc
16//---------------------------------------------------------------------------
Logan35849002011-01-15 07:30:43 +080017
18#define USE_CACHE 1
19
20#define USE_DISASSEMBLER 1
Shih-wei Liao9f73de02011-07-01 04:40:24 -070021#define DEBUG_OLD_JIT_DISASSEMBLE 0
22#define DEBUG_MCJIT_DISASSEMBLE 0
Logan35849002011-01-15 07:30:43 +080023
24#define USE_DISASSEMBLER_FILE 0
Logan Chien9347e0b2011-07-07 19:51:47 +080025#define DEBUG_OLD_JIT_DISASSEMBLER_FILE "/data/local/tmp/oldjit-dis.s"
26#define DEBUG_MCJIT_DISASSEMBLER_FILE "/data/local/tmp/mcjit-dis.s"
Logan35849002011-01-15 07:30:43 +080027
Logan4dcd6792011-02-28 05:12:00 +080028#define USE_LOGGER 1
29
30#define USE_FUNC_LOGGER 0
31
Shih-wei Liao9f73de02011-07-01 04:40:24 -070032#define DEBUG_BCC_REFLECT 0
33
Joseph Wen739527e2011-07-07 10:04:54 -070034#define DEBUG_MCJIT_REFLECT 0
35
Logan35849002011-01-15 07:30:43 +080036//---------------------------------------------------------------------------
Logan1dc63142011-02-25 17:14:51 +080037// Configuration for ContextManager
38//---------------------------------------------------------------------------
39
40// Note: Most of the code should NOT use these constants. Use the public
41// static member of ContextManager instead, which is type-safe. For example,
42// if you need BCC_CONTEXT_FIXED_ADDR_, then you should write:
43// ContextManager::ContextFixedAddr
44
45#define BCC_CONTEXT_FIXED_ADDR_ reinterpret_cast<char *>(0x7e000000)
46
47#define BCC_CONTEXT_SLOT_COUNT_ 8
48
49#define BCC_CONTEXT_CODE_SIZE_ (128 * 1024)
50
51#define BCC_CONTEXT_DATA_SIZE_ (128 * 1024)
52
53//---------------------------------------------------------------------------
54// Configuration for CodeGen and CompilerRT
55//---------------------------------------------------------------------------
Logan35849002011-01-15 07:30:43 +080056
57#if defined(__arm__)
58 #define DEFAULT_ARM_CODEGEN
59 #define PROVIDE_ARM_CODEGEN
60#elif defined(__i386__)
61 #define DEFAULT_X86_CODEGEN
62 #define PROVIDE_X86_CODEGEN
63#elif defined(__x86_64__)
64 #define DEFAULT_X64_CODEGEN
65 #define PROVIDE_X64_CODEGEN
66#endif
67
68#if defined(FORCE_ARM_CODEGEN)
69 #define DEFAULT_ARM_CODEGEN
70 #undef DEFAULT_X86_CODEGEN
71 #undef DEFAULT_X64_CODEGEN
72 #define PROVIDE_ARM_CODEGEN
73 #undef PROVIDE_X86_CODEGEN
74 #undef PROVIDE_X64_CODEGEN
75#elif defined(FORCE_X86_CODEGEN)
76 #undef DEFAULT_ARM_CODEGEN
77 #define DEFAULT_X86_CODEGEN
78 #undef DEFAULT_X64_CODEGEN
79 #undef PROVIDE_ARM_CODEGEN
80 #define PROVIDE_X86_CODEGEN
81 #undef PROVIDE_X64_CODEGEN
82#elif defined(FORCE_X64_CODEGEN)
83 #undef DEFAULT_ARM_CODEGEN
84 #undef DEFAULT_X86_CODEGEN
85 #define DEFAULT_X64_CODEGEN
86 #undef PROVIDE_ARM_CODEGEN
87 #undef PROVIDE_X86_CODEGEN
88 #define PROVIDE_X64_CODEGEN
89#endif
90
91#if defined(DEFAULT_ARM_CODEGEN)
92 #define TARGET_TRIPLE_STRING "armv7-none-linux-gnueabi"
93#elif defined(DEFAULT_X86_CODEGEN)
94 #define TARGET_TRIPLE_STRING "i686-unknown-linux"
95#elif defined(DEFAULT_X64_CODEGEN)
96 #define TARGET_TRIPLE_STRING "x86_64-unknown-linux"
97#endif
98
99#if (defined(__VFP_FP__) && !defined(__SOFTFP__))
100 #define ARM_USE_VFP
101#endif
102
103//---------------------------------------------------------------------------
104
105#endif // BCC_CONFIG_H