Skip to content
This repository
Newer
Older
100644 409 lines (369 sloc) 13.111 kb
cfd7b4d8 »
2009-05-23 added licensing information on the new files
1 /*
2 * MacRuby compiler.
3 *
4 * This file is covered by the Ruby license. See COPYING for more details.
5 *
4aca1014 »
2010-01-20 Added 2010 Copyrights
6 * Copyright (C) 2008-2010, Apple Inc. All rights reserved.
cfd7b4d8 »
2009-05-23 added licensing information on the new files
7 */
8
cb654164 »
2009-05-23 the great schism, part I
9 #ifndef __COMPILER_H_
10 #define __COMPILER_H_
11
12 #if defined(__cplusplus)
13
14 // For the dispatcher.
9590d405 »
2009-08-22 fixing and adding several missing ruby method features
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
cb654164 »
2009-05-23 the great schism, part I
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
30 class RoxorCompiler {
31 public:
32 static llvm::Module *module;
33 static RoxorCompiler *shared;
34
cf73725a »
2010-01-17 experimental debugger
35 RoxorCompiler(bool debug_mode);
cb654164 »
2009-05-23 the great schism, part I
36 virtual ~RoxorCompiler(void) { }
37
0f14388c »
2009-12-15 emit dwarf metadata at compilation time and use it to establish backt…
38 void set_fname(const char *_fname);
3432fd19 »
2009-07-10 a better exception-based implementation for return-from-block
39
cb654164 »
2009-05-23 the great schism, part I
40 Value *compile_node(NODE *node);
41
42 virtual Function *compile_main_function(NODE *node);
43 Function *compile_read_attr(ID name);
44 Function *compile_write_attr(ID name);
9fab1acf »
2009-10-01 fixed variadic functions/methods calls
45 Function *compile_stub(const char *types, bool variadic, int min_argc,
46 bool is_objc);
cb654164 »
2009-05-23 the great schism, part I
47 Function *compile_bs_struct_new(rb_vm_bs_boxed_t *bs_boxed);
48 Function *compile_bs_struct_writer(rb_vm_bs_boxed_t *bs_boxed,
49 int field);
50 Function *compile_ffi_function(void *stub, void *imp, int argc);
51 Function *compile_to_rval_convertor(const char *type);
52 Function *compile_to_ocval_convertor(const char *type);
c1c347fc »
2009-07-12 AOT compiler: now supporting objc stubs and super dispatch
53 Function *compile_objc_stub(Function *ruby_func, IMP ruby_imp,
54 const rb_vm_arity_t &arity, const char *types);
208a965e »
2009-06-15 a quick implementation for #define_method (not yet 100% complete)
55 Function *compile_block_caller(rb_vm_block_t *block);
cb654164 »
2009-05-23 the great schism, part I
56
57 const Type *convert_type(const char *type);
58
c219e864 »
2009-06-19 don't slow ivars used inside an eval string
59 bool is_inside_eval(void) { return inside_eval; }
60 void set_inside_eval(bool flag) { inside_eval = flag; }
12a1d67f »
2009-08-25 fixing bugs in instance_eval & friends + fixed some specs so that the…
61 bool is_dynamic_class(void) { return dynamic_class; }
62 void set_dynamic_class(bool flag) { dynamic_class = flag; }
c219e864 »
2009-06-19 don't slow ivars used inside an eval string
63
cb654164 »
2009-05-23 the great schism, part I
64 protected:
0f14388c »
2009-12-15 emit dwarf metadata at compilation time and use it to establish backt…
65 DIFactory *debug_info;
66 DICompileUnit debug_compile_unit;
67 DISubprogram debug_subprogram;
68
cf73725a »
2010-01-17 experimental debugger
69 bool debug_mode;
cb654164 »
2009-05-23 the great schism, part I
70 const char *fname;
c219e864 »
2009-06-19 don't slow ivars used inside an eval string
71 bool inside_eval;
cb654164 »
2009-05-23 the great schism, part I
72
73 std::map<ID, Value *> lvars;
74 std::vector<ID> dvars;
f61f2c7d »
2009-09-28 const pointers should be real constants
75 std::map<ID, Value *> ivar_slots_cache;
cb654164 »
2009-05-23 the great schism, part I
76 std::map<std::string, GlobalVariable *> static_strings;
e3796866 »
2009-07-20 some work on unicode support (still in progress)
77 std::map<CFHashCode, GlobalVariable *> static_ustrings;
cb654164 »
2009-05-23 the great schism, part I
78
79 #if ROXOR_COMPILER_DEBUG
80 int level;
81 # define DEBUG_LEVEL_INC() (level++)
82 # define DEBUG_LEVEL_DEC() (level--)
83 #else
84 # define DEBUG_LEVEL_INC()
85 # define DEBUG_LEVEL_DEC()
86 #endif
87
2541db33 »
2009-09-18 added preliminary support for backtracing/symbolication
88 unsigned int current_line;
cb654164 »
2009-05-23 the great schism, part I
89 BasicBlock *bb;
90 BasicBlock *entry_bb;
91 ID current_mid;
164ca93c »
2009-08-04 fixed super within a method that has a splat argument
92 rb_vm_arity_t current_arity;
cb654164 »
2009-05-23 the great schism, part I
93 bool current_instance_method;
94 ID self_id;
95 Value *current_self;
96 bool current_block;
1961daae »
2009-07-29 better fix than last one
97 bool current_block_chain;
cb654164 »
2009-05-23 the great schism, part I
98 Value *current_var_uses;
99 Value *running_block;
cc6f8a94 »
2009-11-14 fixed a bug in super without argument, it should pass the method's &b…
100 Value *current_block_arg;
cb654164 »
2009-05-23 the great schism, part I
101 BasicBlock *begin_bb;
63c77f81 »
2009-09-20 now rescues in rescues should work properly in most cases
102 // block used in an invoke when an exception occurs
103 BasicBlock *rescue_invoke_bb;
104 // block to return to in a rescue if an exception is not handled
105 BasicBlock *rescue_rethrow_bb;
cb654164 »
2009-05-23 the great schism, part I
106 BasicBlock *ensure_bb;
107 bool current_rescue;
108 NODE *current_block_node;
109 Function *current_block_func;
110 GlobalVariable *current_opened_class;
12a1d67f »
2009-08-25 fixing bugs in instance_eval & friends + fixed some specs so that the…
111 bool dynamic_class;
cb654164 »
2009-05-23 the great schism, part I
112 bool current_module;
113 BasicBlock *current_loop_begin_bb;
114 BasicBlock *current_loop_body_bb;
115 BasicBlock *current_loop_end_bb;
513ee741 »
2009-09-23 Fixed the return value of while/until loops
116 PHINode *current_loop_exit_val;
3432fd19 »
2009-07-10 a better exception-based implementation for return-from-block
117 int return_from_block;
118 int return_from_block_ids;
5d7a33f5 »
2009-08-15 when there are multiple returns in an ensure,
119 PHINode *ensure_pn;
13f5368a »
2010-01-07 fixed a bunch of super-dispatch bugs
120 bool block_declaration;
cb654164 »
2009-05-23 the great schism, part I
121
122 Function *dispatcherFunc;
38456a4c »
2009-08-12 most fast ops in place
123 Function *fastPlusFunc;
124 Function *fastMinusFunc;
125 Function *fastMultFunc;
126 Function *fastDivFunc;
127 Function *fastLtFunc;
128 Function *fastLeFunc;
129 Function *fastGtFunc;
130 Function *fastGeFunc;
944d624b »
2009-08-07 optimize #== and #!= for non fixnum/float types
131 Function *fastEqFunc;
132 Function *fastNeqFunc;
cb654164 »
2009-05-23 the great schism, part I
133 Function *fastEqqFunc;
134 Function *whenSplatFunc;
135 Function *prepareBlockFunc;
136 Function *pushBindingFunc;
137 Function *getBlockFunc;
138 Function *currentBlockObjectFunc;
139 Function *getConstFunc;
140 Function *setConstFunc;
141 Function *prepareMethodFunc;
142 Function *singletonClassFunc;
143 Function *defineClassFunc;
144 Function *prepareIvarSlotFunc;
145 Function *getIvarFunc;
146 Function *setIvarFunc;
147 Function *definedFunc;
148 Function *undefFunc;
149 Function *aliasFunc;
150 Function *valiasFunc;
151 Function *newHashFunc;
152 Function *toAFunc;
153 Function *toAryFunc;
154 Function *catArrayFunc;
155 Function *dupArrayFunc;
156 Function *newArrayFunc;
157 Function *newStructFunc;
158 Function *newOpaqueFunc;
ff75d601 »
2009-06-12 added support for overwriting an ObjC method that accepts a pointer
159 Function *newPointerFunc;
cb654164 »
2009-05-23 the great schism, part I
160 Function *getStructFieldsFunc;
161 Function *getOpaqueDataFunc;
162 Function *getPointerPtrFunc;
163 Function *checkArityFunc;
164 Function *setStructFunc;
165 Function *newRangeFunc;
166 Function *newRegexpFunc;
167 Function *strInternFunc;
168 Function *keepVarsFunc;
169 Function *masgnGetElemBeforeSplatFunc;
170 Function *masgnGetElemAfterSplatFunc;
171 Function *masgnGetSplatFunc;
172 Function *newStringFunc;
913687b8 »
2009-07-02 fixed a bug in the way we compile literal strings
173 Function *newString2Func;
174 Function *newString3Func;
cb654164 »
2009-05-23 the great schism, part I
175 Function *yieldFunc;
7da28cbe »
2009-09-07 make sure break makes yield return from its scope
176 Function *getBrokenFunc;
208a965e »
2009-06-15 a quick implementation for #define_method (not yet 100% complete)
177 Function *blockEvalFunc;
cb654164 »
2009-05-23 the great schism, part I
178 Function *gvarSetFunc;
179 Function *gvarGetFunc;
180 Function *cvarSetFunc;
181 Function *cvarGetFunc;
182 Function *currentExceptionFunc;
183 Function *popExceptionFunc;
184 Function *getSpecialFunc;
185 Function *breakFunc;
6c5b476f »
2009-07-10 a new implementation for return-from-block which uses an exception in…
186 Function *returnFromBlockFunc;
208c475a »
2009-11-04 optimized returns from non-ensure-scoped and non-Proc blocks
187 Function *returnedFromBlockFunc;
3432fd19 »
2009-07-10 a better exception-based implementation for return-from-block
188 Function *checkReturnFromBlockFunc;
208c475a »
2009-11-04 optimized returns from non-ensure-scoped and non-Proc blocks
189 Function *setHasEnsureFunc;
cb654164 »
2009-05-23 the great schism, part I
190 Function *longjmpFunc;
191 Function *setjmpFunc;
9590d405 »
2009-08-22 fixing and adding several missing ruby method features
192 Function *setScopeFunc;
193 Function *setCurrentClassFunc;
77f9768b »
2009-09-10 implemented super from a block
194 Function *getCacheFunc;
cf73725a »
2010-01-17 experimental debugger
195 Function *debugTrapFunc;
cb654164 »
2009-05-23 the great schism, part I
196
197 Constant *zeroVal;
198 Constant *oneVal;
199 Constant *twoVal;
01528a72 »
2009-06-18 floating point arithmetic optimization: Float objects are now immedia…
200 Constant *threeVal;
cb654164 »
2009-05-23 the great schism, part I
201 Constant *nilVal;
202 Constant *trueVal;
203 Constant *falseVal;
204 Constant *undefVal;
205 Constant *splatArgFollowsVal;
9590d405 »
2009-08-22 fixing and adding several missing ruby method features
206 Constant *defaultScope;
207 Constant *publicScope;
bb0b28cb »
2009-09-25 moving to LLVM r82747
208
209 const Type *VoidTy;
210 const Type *Int1Ty;
211 const Type *Int8Ty;
212 const Type *Int16Ty;
213 const Type *Int32Ty;
214 const Type *Int64Ty;
215 const Type *FloatTy;
216 const Type *DoubleTy;
cb654164 »
2009-05-23 the great schism, part I
217 const Type *RubyObjTy;
f61f2c7d »
2009-09-28 const pointers should be real constants
218 const PointerType *RubyObjPtrTy;
219 const PointerType *RubyObjPtrPtrTy;
220 const PointerType *PtrTy;
221 const PointerType *PtrPtrTy;
cb654164 »
2009-05-23 the great schism, part I
222 const Type *IntTy;
f61f2c7d »
2009-09-28 const pointers should be real constants
223 const PointerType *Int32PtrTy;
cb654164 »
2009-05-23 the great schism, part I
224
225 void compile_node_error(const char *msg, NODE *node);
226
f61f2c7d »
2009-09-28 const pointers should be real constants
227 virtual Constant *
228 compile_const_pointer(void *ptr, const PointerType *type=NULL) {
85b7cc25 »
2009-07-02 AOT compiler: ivar slots support
229 if (type == NULL) {
230 type = PtrTy;
231 }
f61f2c7d »
2009-09-28 const pointers should be real constants
232 if (ptr == NULL) {
233 return ConstantPointerNull::get(type);
234 }
235 else {
236 Constant *ptrint = ConstantInt::get(IntTy, (long)ptr);
237 return ConstantExpr::getIntToPtr(ptrint, type);
238 }
cb654164 »
2009-05-23 the great schism, part I
239 }
240
f61f2c7d »
2009-09-28 const pointers should be real constants
241 Constant *
242 compile_const_pointer_to_pointer(void *ptr) {
243 return compile_const_pointer(ptr, PtrPtrTy);
cb654164 »
2009-05-23 the great schism, part I
244 }
245
c80c60a5 »
2009-10-07 in the objc->ruby 32-bit stub convert ruby exceptions to objc
246 Instruction *compile_protected_call(Value *imp,
cb654164 »
2009-05-23 the great schism, part I
247 std::vector<Value *> &params);
248 void compile_dispatch_arguments(NODE *args,
249 std::vector<Value *> &arguments, int *pargc);
250 Function::ArgumentListType::iterator compile_optional_arguments(
251 Function::ArgumentListType::iterator iter, NODE *node);
252 void compile_boolean_test(Value *condVal, BasicBlock *ifTrueBB,
253 BasicBlock *ifFalseBB);
254 void compile_when_arguments(NODE *args, Value *comparedToVal,
255 BasicBlock *thenBB);
256 void compile_single_when_argument(NODE *arg, Value *comparedToVal,
257 BasicBlock *thenBB);
12a1d67f »
2009-08-25 fixing bugs in instance_eval & friends + fixed some specs so that the…
258 virtual void compile_prepare_method(Value *classVal, Value *sel,
259 bool singleton, Function *new_function, rb_vm_arity_t &arity,
9590d405 »
2009-08-22 fixing and adding several missing ruby method features
260 NODE *body);
cb654164 »
2009-05-23 the great schism, part I
261 Value *compile_dispatch_call(std::vector<Value *> &params);
262 Value *compile_when_splat(Value *comparedToVal, Value *splatVal);
944d624b »
2009-08-07 optimize #== and #!= for non fixnum/float types
263 Value *compile_fast_op_call(SEL sel, Value *selfVal, Value *comparedToVal);
cb654164 »
2009-05-23 the great schism, part I
264 Value *compile_attribute_assign(NODE *node, Value *extra_val);
2c54dbd2 »
2009-07-01 AOT compiler: added support for blocks
265 virtual Value *compile_prepare_block_args(Function *func, int *flags);
cc6f8a94 »
2009-11-14 fixed a bug in super without argument, it should pass the method's &b…
266 Value *compile_block_create(void);
267 Value *compile_block_get(Value *block_object);
cb654164 »
2009-05-23 the great schism, part I
268 Value *compile_binding(void);
269 Value *compile_optimized_dispatch_call(SEL sel, int argc,
270 std::vector<Value *> &params);
271 Value *compile_ivar_read(ID vid);
272 Value *compile_ivar_assignment(ID vid, Value *val);
273 Value *compile_cvar_assignment(ID vid, Value *val);
eeb7a106 »
2009-08-03 added support for @@foo||=42, a lot of changes for a very stupid func…
274 Value *compile_cvar_get(ID vid, bool check);
42e4a2a2 »
2009-07-03 AOT compiler: added support for global variables
275 Value *compile_gvar_assignment(NODE *node, Value *val);
cb654164 »
2009-05-23 the great schism, part I
276 Value *compile_constant_declaration(NODE *node, Value *val);
277 Value *compile_multiple_assignment(NODE *node, Value *val);
278 void compile_multiple_assignment_element(NODE *node, Value *val);
279 Value *compile_current_class(void);
57d80850 »
2009-06-30 AOT compiler: added support for NSObject and ID compilation
280 virtual Value *compile_nsobject(void);
78b1e930 »
2009-09-22 added support for AOT compilation of the rb_eStandardError constant
281 virtual Value *compile_standarderror(void);
e037cf28 »
2010-01-22 fix a const lookup bug inside Foo::Bar modules
282 Value *compile_class_path(NODE *node, int *flags);
cb654164 »
2009-05-23 the great schism, part I
283 Value *compile_const(ID id, Value *outer);
284 Value *compile_singleton_class(Value *obj);
285 Value *compile_defined_expression(NODE *node);
286 Value *compile_dstr(NODE *node);
287 Value *compile_dvar_slot(ID name);
288 void compile_break_val(Value *val);
e8d79c75 »
2009-08-16 a return in an ensure should now work properly
289 void compile_simple_return(Value *val);
208c475a »
2009-11-04 optimized returns from non-ensure-scoped and non-Proc blocks
290 Value *compile_set_has_ensure(Value *val);
3432fd19 »
2009-07-10 a better exception-based implementation for return-from-block
291 void compile_return_from_block(Value *val, int id);
292 void compile_return_from_block_handler(int id);
cb654164 »
2009-05-23 the great schism, part I
293 Value *compile_jump(NODE *node);
294 virtual Value *compile_mcache(SEL sel, bool super);
77f9768b »
2009-09-10 implemented super from a block
295 Value *compile_get_mcache(Value *sel, bool super);
cb654164 »
2009-05-23 the great schism, part I
296 virtual Value *compile_ccache(ID id);
f61f2c7d »
2009-09-28 const pointers should be real constants
297 virtual Value *compile_sel(SEL sel, bool add_to_bb=true) {
298 return compile_const_pointer(sel, PtrTy);
cb654164 »
2009-05-23 the great schism, part I
299 }
57d80850 »
2009-06-30 AOT compiler: added support for NSObject and ID compilation
300 virtual Value *compile_id(ID id);
913687b8 »
2009-07-02 fixed a bug in the way we compile literal strings
301 GlobalVariable *compile_const_global_string(const char *str,
302 const size_t str_len);
303 GlobalVariable *compile_const_global_string(const char *str) {
304 return compile_const_global_string(str, strlen(str));
305 }
e3796866 »
2009-07-20 some work on unicode support (still in progress)
306 GlobalVariable *compile_const_global_ustring(const UniChar *str,
307 const size_t str_len, CFHashCode hash);
308
2c54dbd2 »
2009-07-01 AOT compiler: added support for blocks
309 Value *compile_arity(rb_vm_arity_t &arity);
95f3b233 »
2009-08-28 added support for AOT compilation of literal ranges
310 Instruction *compile_range(Value *beg, Value *end, bool exclude_end,
14423f11 »
2009-09-25 fixed AOT compilation of literal ranges (objects should be retained)
311 bool retain=false, bool add_to_bb=true);
913687b8 »
2009-07-02 fixed a bug in the way we compile literal strings
312 Value *compile_literal(VALUE val);
907bd816 »
2009-07-04 AOT compiler: added support for some immutable literals
313 virtual Value *compile_immutable_literal(VALUE val);
42e4a2a2 »
2009-07-03 AOT compiler: added support for global variables
314 virtual Value *compile_global_entry(NODE *node);
cb654164 »
2009-05-23 the great schism, part I
315
9590d405 »
2009-08-22 fixing and adding several missing ruby method features
316 void compile_set_current_scope(Value *klass, Value *scope);
317 Value *compile_set_current_class(Value *klass);
318
3432fd19 »
2009-07-10 a better exception-based implementation for return-from-block
319 Value *compile_landing_pad_header(void);
320 Value *compile_landing_pad_header(const std::type_info &eh_type);
6c5b476f »
2009-07-10 a new implementation for return-from-block which uses an exception in…
321 void compile_landing_pad_footer(bool pop_exception=true);
c80c60a5 »
2009-10-07 in the objc->ruby 32-bit stub convert ruby exceptions to objc
322 Value *compile_current_exception(void);
cb654164 »
2009-05-23 the great schism, part I
323 void compile_rethrow_exception(void);
23ef57ef »
2010-01-30 now properly popping exceptions from the VM stack when we unwind from…
324 void compile_pop_exception(int pos=0);
cb654164 »
2009-05-23 the great schism, part I
325 Value *compile_lvar_slot(ID name);
326 bool compile_lvars(ID *tbl);
327 Value *compile_new_struct(Value *klass, std::vector<Value *> &fields);
328 Value *compile_new_opaque(Value *klass, Value *val);
ff75d601 »
2009-06-12 added support for overwriting an ObjC method that accepts a pointer
329 Value *compile_new_pointer(const char *type, Value *val);
cb654164 »
2009-05-23 the great schism, part I
330 void compile_get_struct_fields(Value *val, Value *buf,
331 rb_vm_bs_boxed_t *bs_boxed);
332 Value *compile_get_opaque_data(Value *val, rb_vm_bs_boxed_t *bs_boxed,
333 Value *slot);
334 Value *compile_get_cptr(Value *val, const char *type, Value *slot);
335 void compile_check_arity(Value *given, Value *requested);
336 void compile_set_struct(Value *rcv, int field, Value *val);
337
338 Value *compile_conversion_to_c(const char *type, Value *val,
339 Value *slot);
340 Value *compile_conversion_to_ruby(const char *type,
341 const Type *llvm_type, Value *val);
cf73725a »
2010-01-17 experimental debugger
342 void compile_debug_trap(void);
cb654164 »
2009-05-23 the great schism, part I
343
f61f2c7d »
2009-09-28 const pointers should be real constants
344 Value *compile_slot_cache(ID id);
345 virtual Value *gen_slot_cache(ID id);
cb654164 »
2009-05-23 the great schism, part I
346 ICmpInst *is_value_a_fixnum(Value *val);
347 void compile_ivar_slots(Value *klass, BasicBlock::InstListType &list,
348 BasicBlock::InstListType::iterator iter);
349 bool unbox_ruby_constant(Value *val, VALUE *rval);
01528a72 »
2009-06-18 floating point arithmetic optimization: Float objects are now immedia…
350 Value *optimized_immediate_op(SEL sel, Value *leftVal, Value *rightVal,
351 bool float_op, bool *is_predicate);
352 Value *compile_double_coercion(Value *val, Value *mask,
353 BasicBlock *fallback_bb, Function *f);
2a1240c8 »
2009-08-12 some refactoring
354 void compile_keep_vars(BasicBlock *startBB, BasicBlock *mergeBB);
01528a72 »
2009-06-18 floating point arithmetic optimization: Float objects are now immedia…
355
cb654164 »
2009-05-23 the great schism, part I
356 SEL mid_to_sel(ID mid, int arity);
357 };
358
bb0b28cb »
2009-09-25 moving to LLVM r82747
359 #define context (RoxorCompiler::module->getContext())
360
cb654164 »
2009-05-23 the great schism, part I
361 class RoxorAOTCompiler : public RoxorCompiler {
362 public:
3432fd19 »
2009-07-10 a better exception-based implementation for return-from-block
363 RoxorAOTCompiler(void);
cb654164 »
2009-05-23 the great schism, part I
364
365 Function *compile_main_function(NODE *node);
366
367 private:
368 std::map<SEL, GlobalVariable *> mcaches;
369 std::map<ID, GlobalVariable *> ccaches;
370 std::map<SEL, GlobalVariable *> sels;
57d80850 »
2009-06-30 AOT compiler: added support for NSObject and ID compilation
371 std::map<ID, GlobalVariable *> ids;
42e4a2a2 »
2009-07-03 AOT compiler: added support for global variables
372 std::map<ID, GlobalVariable *> global_entries;
85b7cc25 »
2009-07-02 AOT compiler: ivar slots support
373 std::vector<GlobalVariable *> ivar_slots;
907bd816 »
2009-07-04 AOT compiler: added support for some immutable literals
374 std::map<VALUE, GlobalVariable *> literals;
375
57d80850 »
2009-06-30 AOT compiler: added support for NSObject and ID compilation
376 GlobalVariable *cObject_gvar;
78b1e930 »
2009-09-22 added support for AOT compilation of the rb_eStandardError constant
377 GlobalVariable *cStandardError_gvar;
378 std::vector<GlobalVariable *> class_gvars;
cb654164 »
2009-05-23 the great schism, part I
379
380 Value *compile_mcache(SEL sel, bool super);
381 Value *compile_ccache(ID id);
f61f2c7d »
2009-09-28 const pointers should be real constants
382 Value *compile_sel(SEL sel, bool add_to_bb=true);
12a1d67f »
2009-08-25 fixing bugs in instance_eval & friends + fixed some specs so that the…
383 void compile_prepare_method(Value *classVal, Value *sel,
384 bool singleton, Function *new_function, rb_vm_arity_t &arity,
9590d405 »
2009-08-22 fixing and adding several missing ruby method features
385 NODE *body);
2c54dbd2 »
2009-07-01 AOT compiler: added support for blocks
386 Value *compile_prepare_block_args(Function *func, int *flags);
57d80850 »
2009-06-30 AOT compiler: added support for NSObject and ID compilation
387 Value *compile_nsobject(void);
78b1e930 »
2009-09-22 added support for AOT compilation of the rb_eStandardError constant
388 Value *compile_standarderror(void);
57d80850 »
2009-06-30 AOT compiler: added support for NSObject and ID compilation
389 Value *compile_id(ID id);
907bd816 »
2009-07-04 AOT compiler: added support for some immutable literals
390 Value *compile_immutable_literal(VALUE val);
42e4a2a2 »
2009-07-03 AOT compiler: added support for global variables
391 Value *compile_global_entry(NODE *node);
cb654164 »
2009-05-23 the great schism, part I
392
f61f2c7d »
2009-09-28 const pointers should be real constants
393 Value *gen_slot_cache(ID id);
85b7cc25 »
2009-07-02 AOT compiler: ivar slots support
394
f61f2c7d »
2009-09-28 const pointers should be real constants
395 Constant *
396 compile_const_pointer(void *ptr, const PointerType *type=NULL) {
cb654164 »
2009-05-23 the great schism, part I
397 if (ptr == NULL) {
f61f2c7d »
2009-09-28 const pointers should be real constants
398 return RoxorCompiler::compile_const_pointer(ptr, type);
cb654164 »
2009-05-23 the great schism, part I
399 }
400 printf("compile_const_pointer() called with a non-NULL pointer " \
401 "on the AOT compiler - leaving the ship!\n");
402 abort();
403 }
404 };
405
406 #endif /* __cplusplus */
407
408 #endif /* __COMPILER_H_ */
Something went wrong with that request. Please try again.