Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 397 lines (357 sloc) 12.77 kb
cfd7b4d added licensing information on the new files
Laurent Sansonetti authored
1 /*
2 * MacRuby compiler.
3 *
4 * This file is covered by the Ruby license. See COPYING for more details.
5 *
6 * Copyright (C) 2008-2009, Apple Inc. All rights reserved.
7 */
8
cb65416 the great schism, part I
Laurent Sansonetti authored
9 #ifndef __COMPILER_H_
10 #define __COMPILER_H_
11
12 #if defined(__cplusplus)
13
14 // For the dispatcher.
9590d40 fixing and adding several missing ruby method features
Laurent Sansonetti authored
15 #define DISPATCH_VCALL 1 // no receiver, no argument
16 #define DISPATCH_FCALL 2 // no receiver, one or more arguments
17 #define DISPATCH_SUPER 3 // super call
18 #define DISPATCH_SELF_ATTRASGN 4 // self attribute assignment
19 #define SPLAT_ARG_FOLLOWS 0xdeadbeef
cb65416 the great schism, part I
Laurent Sansonetti authored
20
21 // For defined?
22 #define DEFINED_IVAR 1
23 #define DEFINED_GVAR 2
24 #define DEFINED_CVAR 3
25 #define DEFINED_CONST 4
26 #define DEFINED_LCONST 5
27 #define DEFINED_SUPER 6
28 #define DEFINED_METHOD 7
29
2541db3 added preliminary support for backtracing/symbolication
Laurent Sansonetti authored
30 class RoxorFunctionAnnotation : public Annotation {
31 public:
32 static AnnotationID id;
33 std::string path;
34 std::vector<unsigned int> dispatch_lines;
35
36 RoxorFunctionAnnotation(Function *function, const char *_path)
37 : Annotation(RoxorFunctionAnnotation::id), path(_path) {
38 function->addAnnotation(this);
39 }
40
41 static RoxorFunctionAnnotation *from_function(Function *function) {
42 return (RoxorFunctionAnnotation *)
43 function->getAnnotation(RoxorFunctionAnnotation::id);
44 }
45 };
46
cb65416 the great schism, part I
Laurent Sansonetti authored
47 class RoxorCompiler {
48 public:
49 static llvm::Module *module;
50 static RoxorCompiler *shared;
51
3432fd1 a better exception-based implementation for return-from-block
Laurent Sansonetti authored
52 RoxorCompiler(void);
cb65416 the great schism, part I
Laurent Sansonetti authored
53 virtual ~RoxorCompiler(void) { }
54
3432fd1 a better exception-based implementation for return-from-block
Laurent Sansonetti authored
55 void set_fname(const char *_fname) {
56 fname = _fname;
57 }
58
cb65416 the great schism, part I
Laurent Sansonetti authored
59 Value *compile_node(NODE *node);
60
61 virtual Function *compile_main_function(NODE *node);
62 Function *compile_read_attr(ID name);
63 Function *compile_write_attr(ID name);
64 Function *compile_stub(const char *types, int argc, bool is_objc);
65 Function *compile_bs_struct_new(rb_vm_bs_boxed_t *bs_boxed);
66 Function *compile_bs_struct_writer(rb_vm_bs_boxed_t *bs_boxed,
67 int field);
68 Function *compile_ffi_function(void *stub, void *imp, int argc);
69 Function *compile_to_rval_convertor(const char *type);
70 Function *compile_to_ocval_convertor(const char *type);
c1c347f AOT compiler: now supporting objc stubs and super dispatch
Laurent Sansonetti authored
71 Function *compile_objc_stub(Function *ruby_func, IMP ruby_imp,
72 const rb_vm_arity_t &arity, const char *types);
208a965 a quick implementation for #define_method (not yet 100% complete)
Laurent Sansonetti authored
73 Function *compile_block_caller(rb_vm_block_t *block);
cb65416 the great schism, part I
Laurent Sansonetti authored
74
75 const Type *convert_type(const char *type);
76
c219e86 don't slow ivars used inside an eval string
Laurent Sansonetti authored
77 bool is_inside_eval(void) { return inside_eval; }
78 void set_inside_eval(bool flag) { inside_eval = flag; }
12a1d67 fixing bugs in instance_eval & friends + fixed some specs so that they p...
Laurent Sansonetti authored
79 bool is_dynamic_class(void) { return dynamic_class; }
80 void set_dynamic_class(bool flag) { dynamic_class = flag; }
c219e86 don't slow ivars used inside an eval string
Laurent Sansonetti authored
81
cb65416 the great schism, part I
Laurent Sansonetti authored
82 protected:
83 const char *fname;
c219e86 don't slow ivars used inside an eval string
Laurent Sansonetti authored
84 bool inside_eval;
cb65416 the great schism, part I
Laurent Sansonetti authored
85
86 std::map<ID, Value *> lvars;
87 std::vector<ID> dvars;
85b7cc2 AOT compiler: ivar slots support
Laurent Sansonetti authored
88 std::map<ID, Instruction *> ivar_slots_cache;
cb65416 the great schism, part I
Laurent Sansonetti authored
89 std::map<std::string, GlobalVariable *> static_strings;
e379686 some work on unicode support (still in progress)
Laurent Sansonetti authored
90 std::map<CFHashCode, GlobalVariable *> static_ustrings;
cb65416 the great schism, part I
Laurent Sansonetti authored
91
92 #if ROXOR_COMPILER_DEBUG
93 int level;
94 # define DEBUG_LEVEL_INC() (level++)
95 # define DEBUG_LEVEL_DEC() (level--)
96 #else
97 # define DEBUG_LEVEL_INC()
98 # define DEBUG_LEVEL_DEC()
99 #endif
100
2541db3 added preliminary support for backtracing/symbolication
Laurent Sansonetti authored
101 unsigned int current_line;
cb65416 the great schism, part I
Laurent Sansonetti authored
102 BasicBlock *bb;
103 BasicBlock *entry_bb;
104 ID current_mid;
164ca93 fixed super within a method that has a splat argument
Laurent Sansonetti authored
105 rb_vm_arity_t current_arity;
cb65416 the great schism, part I
Laurent Sansonetti authored
106 bool current_instance_method;
107 ID self_id;
108 Value *current_self;
109 bool current_block;
1961daa better fix than last one
Laurent Sansonetti authored
110 bool current_block_chain;
cb65416 the great schism, part I
Laurent Sansonetti authored
111 Value *current_var_uses;
112 Value *running_block;
113 BasicBlock *begin_bb;
114 BasicBlock *rescue_bb;
115 BasicBlock *ensure_bb;
116 bool current_rescue;
117 NODE *current_block_node;
118 Function *current_block_func;
119 GlobalVariable *current_opened_class;
12a1d67 fixing bugs in instance_eval & friends + fixed some specs so that they p...
Laurent Sansonetti authored
120 bool dynamic_class;
cb65416 the great schism, part I
Laurent Sansonetti authored
121 bool current_module;
122 BasicBlock *current_loop_begin_bb;
123 BasicBlock *current_loop_body_bb;
124 BasicBlock *current_loop_end_bb;
125 Value *current_loop_exit_val;
3432fd1 a better exception-based implementation for return-from-block
Laurent Sansonetti authored
126 int return_from_block;
127 int return_from_block_ids;
5d7a33f @vincentisambart when there are multiple returns in an ensure,
vincentisambart authored
128 PHINode *ensure_pn;
2541db3 added preliminary support for backtracing/symbolication
Laurent Sansonetti authored
129 RoxorFunctionAnnotation *func_annotation;
cb65416 the great schism, part I
Laurent Sansonetti authored
130
131 Function *dispatcherFunc;
38456a4 most fast ops in place
Laurent Sansonetti authored
132 Function *fastPlusFunc;
133 Function *fastMinusFunc;
134 Function *fastMultFunc;
135 Function *fastDivFunc;
136 Function *fastLtFunc;
137 Function *fastLeFunc;
138 Function *fastGtFunc;
139 Function *fastGeFunc;
944d624 optimize #== and #!= for non fixnum/float types
Laurent Sansonetti authored
140 Function *fastEqFunc;
141 Function *fastNeqFunc;
cb65416 the great schism, part I
Laurent Sansonetti authored
142 Function *fastEqqFunc;
143 Function *whenSplatFunc;
144 Function *prepareBlockFunc;
145 Function *pushBindingFunc;
146 Function *getBlockFunc;
147 Function *currentBlockObjectFunc;
148 Function *getConstFunc;
149 Function *setConstFunc;
150 Function *prepareMethodFunc;
151 Function *singletonClassFunc;
152 Function *defineClassFunc;
153 Function *prepareIvarSlotFunc;
154 Function *getIvarFunc;
155 Function *setIvarFunc;
156 Function *definedFunc;
157 Function *undefFunc;
158 Function *aliasFunc;
159 Function *valiasFunc;
160 Function *newHashFunc;
161 Function *toAFunc;
162 Function *toAryFunc;
163 Function *catArrayFunc;
164 Function *dupArrayFunc;
165 Function *newArrayFunc;
166 Function *newStructFunc;
167 Function *newOpaqueFunc;
ff75d60 added support for overwriting an ObjC method that accepts a pointer
Laurent Sansonetti authored
168 Function *newPointerFunc;
cb65416 the great schism, part I
Laurent Sansonetti authored
169 Function *getStructFieldsFunc;
170 Function *getOpaqueDataFunc;
171 Function *getPointerPtrFunc;
172 Function *checkArityFunc;
173 Function *setStructFunc;
174 Function *newRangeFunc;
175 Function *newRegexpFunc;
176 Function *strInternFunc;
177 Function *keepVarsFunc;
178 Function *masgnGetElemBeforeSplatFunc;
179 Function *masgnGetElemAfterSplatFunc;
180 Function *masgnGetSplatFunc;
181 Function *newStringFunc;
913687b fixed a bug in the way we compile literal strings
Laurent Sansonetti authored
182 Function *newString2Func;
183 Function *newString3Func;
cb65416 the great schism, part I
Laurent Sansonetti authored
184 Function *yieldFunc;
7da28cb make sure break makes yield return from its scope
Laurent Sansonetti authored
185 Function *getBrokenFunc;
208a965 a quick implementation for #define_method (not yet 100% complete)
Laurent Sansonetti authored
186 Function *blockEvalFunc;
cb65416 the great schism, part I
Laurent Sansonetti authored
187 Function *gvarSetFunc;
188 Function *gvarGetFunc;
189 Function *cvarSetFunc;
190 Function *cvarGetFunc;
191 Function *currentExceptionFunc;
192 Function *popExceptionFunc;
193 Function *getSpecialFunc;
194 Function *breakFunc;
6c5b476 a new implementation for return-from-block which uses an exception inste...
Laurent Sansonetti authored
195 Function *returnFromBlockFunc;
3432fd1 a better exception-based implementation for return-from-block
Laurent Sansonetti authored
196 Function *checkReturnFromBlockFunc;
cb65416 the great schism, part I
Laurent Sansonetti authored
197 Function *longjmpFunc;
198 Function *setjmpFunc;
9590d40 fixing and adding several missing ruby method features
Laurent Sansonetti authored
199 Function *setScopeFunc;
200 Function *setCurrentClassFunc;
77f9768 implemented super from a block
Laurent Sansonetti authored
201 Function *getCacheFunc;
cb65416 the great schism, part I
Laurent Sansonetti authored
202
203 Constant *zeroVal;
204 Constant *oneVal;
205 Constant *twoVal;
01528a7 floating point arithmetic optimization: Float objects are now immediate ...
Laurent Sansonetti authored
206 Constant *threeVal;
cb65416 the great schism, part I
Laurent Sansonetti authored
207 Constant *nilVal;
208 Constant *trueVal;
209 Constant *falseVal;
210 Constant *undefVal;
211 Constant *splatArgFollowsVal;
212 Constant *cObject;
9590d40 fixing and adding several missing ruby method features
Laurent Sansonetti authored
213 Constant *defaultScope;
214 Constant *publicScope;
cb65416 the great schism, part I
Laurent Sansonetti authored
215 const Type *RubyObjTy;
216 const Type *RubyObjPtrTy;
217 const Type *RubyObjPtrPtrTy;
218 const Type *PtrTy;
219 const Type *PtrPtrTy;
220 const Type *IntTy;
85b7cc2 AOT compiler: ivar slots support
Laurent Sansonetti authored
221 const Type *Int32PtrTy;
cb65416 the great schism, part I
Laurent Sansonetti authored
222
223 void compile_node_error(const char *msg, NODE *node);
224
225 virtual Instruction *
85b7cc2 AOT compiler: ivar slots support
Laurent Sansonetti authored
226 compile_const_pointer(void *ptr, const Type *type=NULL,
227 bool insert_to_bb=true) {
cb65416 the great schism, part I
Laurent Sansonetti authored
228 Value *ptrint = ConstantInt::get(IntTy, (long)ptr);
85b7cc2 AOT compiler: ivar slots support
Laurent Sansonetti authored
229 if (type == NULL) {
230 type = PtrTy;
231 }
cb65416 the great schism, part I
Laurent Sansonetti authored
232 return insert_to_bb
85b7cc2 AOT compiler: ivar slots support
Laurent Sansonetti authored
233 ? new IntToPtrInst(ptrint, type, "", bb)
234 : new IntToPtrInst(ptrint, type, "");
cb65416 the great schism, part I
Laurent Sansonetti authored
235 }
236
237 Instruction *
238 compile_const_pointer_to_pointer(void *ptr, bool insert_to_bb=true) {
85b7cc2 AOT compiler: ivar slots support
Laurent Sansonetti authored
239 return compile_const_pointer(ptr, PtrPtrTy, insert_to_bb);
cb65416 the great schism, part I
Laurent Sansonetti authored
240 }
241
95f3b23 added support for AOT compilation of literal ranges
Laurent Sansonetti authored
242 Instruction *compile_protected_call(Function *func,
cb65416 the great schism, part I
Laurent Sansonetti authored
243 std::vector<Value *> &params);
244 void compile_dispatch_arguments(NODE *args,
245 std::vector<Value *> &arguments, int *pargc);
246 Function::ArgumentListType::iterator compile_optional_arguments(
247 Function::ArgumentListType::iterator iter, NODE *node);
248 void compile_boolean_test(Value *condVal, BasicBlock *ifTrueBB,
249 BasicBlock *ifFalseBB);
250 void compile_when_arguments(NODE *args, Value *comparedToVal,
251 BasicBlock *thenBB);
252 void compile_single_when_argument(NODE *arg, Value *comparedToVal,
253 BasicBlock *thenBB);
12a1d67 fixing bugs in instance_eval & friends + fixed some specs so that they p...
Laurent Sansonetti authored
254 virtual void compile_prepare_method(Value *classVal, Value *sel,
255 bool singleton, Function *new_function, rb_vm_arity_t &arity,
9590d40 fixing and adding several missing ruby method features
Laurent Sansonetti authored
256 NODE *body);
cb65416 the great schism, part I
Laurent Sansonetti authored
257 Value *compile_dispatch_call(std::vector<Value *> &params);
258 Value *compile_when_splat(Value *comparedToVal, Value *splatVal);
944d624 optimize #== and #!= for non fixnum/float types
Laurent Sansonetti authored
259 Value *compile_fast_op_call(SEL sel, Value *selfVal, Value *comparedToVal);
cb65416 the great schism, part I
Laurent Sansonetti authored
260 Value *compile_attribute_assign(NODE *node, Value *extra_val);
2c54dbd AOT compiler: added support for blocks
Laurent Sansonetti authored
261 virtual Value *compile_prepare_block_args(Function *func, int *flags);
262 Value *compile_block_create(NODE *node);
cb65416 the great schism, part I
Laurent Sansonetti authored
263 Value *compile_binding(void);
264 Value *compile_optimized_dispatch_call(SEL sel, int argc,
265 std::vector<Value *> &params);
266 Value *compile_ivar_read(ID vid);
267 Value *compile_ivar_assignment(ID vid, Value *val);
268 Value *compile_cvar_assignment(ID vid, Value *val);
eeb7a10 added support for @@foo||=42, a lot of changes for a very stupid functio...
Laurent Sansonetti authored
269 Value *compile_cvar_get(ID vid, bool check);
42e4a2a AOT compiler: added support for global variables
Laurent Sansonetti authored
270 Value *compile_gvar_assignment(NODE *node, Value *val);
cb65416 the great schism, part I
Laurent Sansonetti authored
271 Value *compile_constant_declaration(NODE *node, Value *val);
272 Value *compile_multiple_assignment(NODE *node, Value *val);
273 void compile_multiple_assignment_element(NODE *node, Value *val);
274 Value *compile_current_class(void);
57d8085 AOT compiler: added support for NSObject and ID compilation
Laurent Sansonetti authored
275 virtual Value *compile_nsobject(void);
aca37ff fixed const lookup inside a module defined under an explicit (using ::) ...
Laurent Sansonetti authored
276 Value *compile_class_path(NODE *node, bool *outer);
cb65416 the great schism, part I
Laurent Sansonetti authored
277 Value *compile_const(ID id, Value *outer);
278 Value *compile_singleton_class(Value *obj);
279 Value *compile_defined_expression(NODE *node);
280 Value *compile_dstr(NODE *node);
281 Value *compile_dvar_slot(ID name);
282 void compile_break_val(Value *val);
e8d79c7 @vincentisambart a return in an ensure should now work properly
vincentisambart authored
283 void compile_simple_return(Value *val);
3432fd1 a better exception-based implementation for return-from-block
Laurent Sansonetti authored
284 void compile_return_from_block(Value *val, int id);
285 void compile_return_from_block_handler(int id);
cb65416 the great schism, part I
Laurent Sansonetti authored
286 Value *compile_jump(NODE *node);
287 virtual Value *compile_mcache(SEL sel, bool super);
77f9768 implemented super from a block
Laurent Sansonetti authored
288 Value *compile_get_mcache(Value *sel, bool super);
cb65416 the great schism, part I
Laurent Sansonetti authored
289 virtual Value *compile_ccache(ID id);
290 virtual Instruction *compile_sel(SEL sel, bool add_to_bb=true) {
85b7cc2 AOT compiler: ivar slots support
Laurent Sansonetti authored
291 return compile_const_pointer(sel, PtrTy, add_to_bb);
cb65416 the great schism, part I
Laurent Sansonetti authored
292 }
57d8085 AOT compiler: added support for NSObject and ID compilation
Laurent Sansonetti authored
293 virtual Value *compile_id(ID id);
913687b fixed a bug in the way we compile literal strings
Laurent Sansonetti authored
294 GlobalVariable *compile_const_global_string(const char *str,
295 const size_t str_len);
296 GlobalVariable *compile_const_global_string(const char *str) {
297 return compile_const_global_string(str, strlen(str));
298 }
e379686 some work on unicode support (still in progress)
Laurent Sansonetti authored
299 GlobalVariable *compile_const_global_ustring(const UniChar *str,
300 const size_t str_len, CFHashCode hash);
301
2c54dbd AOT compiler: added support for blocks
Laurent Sansonetti authored
302 Value *compile_arity(rb_vm_arity_t &arity);
95f3b23 added support for AOT compilation of literal ranges
Laurent Sansonetti authored
303 Instruction *compile_range(Value *beg, Value *end, bool exclude_end,
304 bool add_to_bb=true);
913687b fixed a bug in the way we compile literal strings
Laurent Sansonetti authored
305 Value *compile_literal(VALUE val);
907bd81 AOT compiler: added support for some immutable literals
Laurent Sansonetti authored
306 virtual Value *compile_immutable_literal(VALUE val);
42e4a2a AOT compiler: added support for global variables
Laurent Sansonetti authored
307 virtual Value *compile_global_entry(NODE *node);
cb65416 the great schism, part I
Laurent Sansonetti authored
308
9590d40 fixing and adding several missing ruby method features
Laurent Sansonetti authored
309 void compile_set_current_scope(Value *klass, Value *scope);
310 Value *compile_set_current_class(Value *klass);
311
3432fd1 a better exception-based implementation for return-from-block
Laurent Sansonetti authored
312 Value *compile_landing_pad_header(void);
313 Value *compile_landing_pad_header(const std::type_info &eh_type);
6c5b476 a new implementation for return-from-block which uses an exception inste...
Laurent Sansonetti authored
314 void compile_landing_pad_footer(bool pop_exception=true);
cb65416 the great schism, part I
Laurent Sansonetti authored
315 void compile_rethrow_exception(void);
316 void compile_pop_exception(void);
317 Value *compile_lvar_slot(ID name);
318 bool compile_lvars(ID *tbl);
319 Value *compile_new_struct(Value *klass, std::vector<Value *> &fields);
320 Value *compile_new_opaque(Value *klass, Value *val);
ff75d60 added support for overwriting an ObjC method that accepts a pointer
Laurent Sansonetti authored
321 Value *compile_new_pointer(const char *type, Value *val);
cb65416 the great schism, part I
Laurent Sansonetti authored
322 void compile_get_struct_fields(Value *val, Value *buf,
323 rb_vm_bs_boxed_t *bs_boxed);
324 Value *compile_get_opaque_data(Value *val, rb_vm_bs_boxed_t *bs_boxed,
325 Value *slot);
326 Value *compile_get_cptr(Value *val, const char *type, Value *slot);
327 void compile_check_arity(Value *given, Value *requested);
328 void compile_set_struct(Value *rcv, int field, Value *val);
329
330 Value *compile_conversion_to_c(const char *type, Value *val,
331 Value *slot);
332 Value *compile_conversion_to_ruby(const char *type,
333 const Type *llvm_type, Value *val);
334
85b7cc2 AOT compiler: ivar slots support
Laurent Sansonetti authored
335 Instruction *compile_slot_cache(ID id);
336 virtual Instruction *gen_slot_cache(ID id);
cb65416 the great schism, part I
Laurent Sansonetti authored
337 ICmpInst *is_value_a_fixnum(Value *val);
338 void compile_ivar_slots(Value *klass, BasicBlock::InstListType &list,
339 BasicBlock::InstListType::iterator iter);
340 bool unbox_ruby_constant(Value *val, VALUE *rval);
01528a7 floating point arithmetic optimization: Float objects are now immediate ...
Laurent Sansonetti authored
341 Value *optimized_immediate_op(SEL sel, Value *leftVal, Value *rightVal,
342 bool float_op, bool *is_predicate);
343 Value *compile_double_coercion(Value *val, Value *mask,
344 BasicBlock *fallback_bb, Function *f);
2a1240c @vincentisambart some refactoring
vincentisambart authored
345 void compile_keep_vars(BasicBlock *startBB, BasicBlock *mergeBB);
01528a7 floating point arithmetic optimization: Float objects are now immediate ...
Laurent Sansonetti authored
346
cb65416 the great schism, part I
Laurent Sansonetti authored
347 SEL mid_to_sel(ID mid, int arity);
348 };
349
350 class RoxorAOTCompiler : public RoxorCompiler {
351 public:
3432fd1 a better exception-based implementation for return-from-block
Laurent Sansonetti authored
352 RoxorAOTCompiler(void);
cb65416 the great schism, part I
Laurent Sansonetti authored
353
354 Function *compile_main_function(NODE *node);
355
356 private:
357 std::map<SEL, GlobalVariable *> mcaches;
358 std::map<ID, GlobalVariable *> ccaches;
359 std::map<SEL, GlobalVariable *> sels;
57d8085 AOT compiler: added support for NSObject and ID compilation
Laurent Sansonetti authored
360 std::map<ID, GlobalVariable *> ids;
42e4a2a AOT compiler: added support for global variables
Laurent Sansonetti authored
361 std::map<ID, GlobalVariable *> global_entries;
85b7cc2 AOT compiler: ivar slots support
Laurent Sansonetti authored
362 std::vector<GlobalVariable *> ivar_slots;
907bd81 AOT compiler: added support for some immutable literals
Laurent Sansonetti authored
363 std::map<VALUE, GlobalVariable *> literals;
364
57d8085 AOT compiler: added support for NSObject and ID compilation
Laurent Sansonetti authored
365 GlobalVariable *cObject_gvar;
cb65416 the great schism, part I
Laurent Sansonetti authored
366
367 Value *compile_mcache(SEL sel, bool super);
368 Value *compile_ccache(ID id);
369 Instruction *compile_sel(SEL sel, bool add_to_bb=true);
12a1d67 fixing bugs in instance_eval & friends + fixed some specs so that they p...
Laurent Sansonetti authored
370 void compile_prepare_method(Value *classVal, Value *sel,
371 bool singleton, Function *new_function, rb_vm_arity_t &arity,
9590d40 fixing and adding several missing ruby method features
Laurent Sansonetti authored
372 NODE *body);
2c54dbd AOT compiler: added support for blocks
Laurent Sansonetti authored
373 Value *compile_prepare_block_args(Function *func, int *flags);
57d8085 AOT compiler: added support for NSObject and ID compilation
Laurent Sansonetti authored
374 Value *compile_nsobject(void);
375 Value *compile_id(ID id);
907bd81 AOT compiler: added support for some immutable literals
Laurent Sansonetti authored
376 Value *compile_immutable_literal(VALUE val);
42e4a2a AOT compiler: added support for global variables
Laurent Sansonetti authored
377 Value *compile_global_entry(NODE *node);
cb65416 the great schism, part I
Laurent Sansonetti authored
378
85b7cc2 AOT compiler: ivar slots support
Laurent Sansonetti authored
379 Instruction *gen_slot_cache(ID id);
380
cb65416 the great schism, part I
Laurent Sansonetti authored
381 Instruction *
85b7cc2 AOT compiler: ivar slots support
Laurent Sansonetti authored
382 compile_const_pointer(void *ptr, const Type *type=NULL,
383 bool insert_to_bb=true) {
cb65416 the great schism, part I
Laurent Sansonetti authored
384 if (ptr == NULL) {
85b7cc2 AOT compiler: ivar slots support
Laurent Sansonetti authored
385 return RoxorCompiler::compile_const_pointer(ptr, type,
386 insert_to_bb);
cb65416 the great schism, part I
Laurent Sansonetti authored
387 }
388 printf("compile_const_pointer() called with a non-NULL pointer " \
389 "on the AOT compiler - leaving the ship!\n");
390 abort();
391 }
392 };
393
394 #endif /* __cplusplus */
395
396 #endif /* __COMPILER_H_ */
Something went wrong with that request. Please try again.