Modified: MacRuby/trunk/compiler.cpp (4373 => 4374)
--- MacRuby/trunk/compiler.cpp 2010-07-24 01:07:02 UTC (rev 4373)
+++ MacRuby/trunk/compiler.cpp 2010-07-24 02:16:49 UTC (rev 4374)
@@ -853,7 +853,7 @@
for (int i = 0; i < argc; i++) {
Value *idx = ConstantInt::get(Int32Ty, i);
Value *slot = GetElementPtrInst::Create(dispatch_argv, idx, "", bb);
- new StoreInst(params[offset + i], slot, "", bb);
+ new StoreInst(params[offset + i], slot, bb);
}
return dispatch_argv;
@@ -1093,7 +1093,7 @@
int flags = 0;
params.push_back(compile_prepare_block_args(current_block_func, &flags));
if (nd_type(current_block_node) == NODE_SCOPE
- && current_block_node->nd_body == NULL) {
+ && current_block_node->nd_body == NULL) {
flags |= VM_BLOCK_EMPTY;
}
params.push_back(ConstantInt::get(Int32Ty, flags));
@@ -2257,6 +2257,7 @@
return NULL;
}
SEL new_sel = mid_to_sel(SYM2ID(sym), argc - 1);
+ new_sel = rb_objc_ignored_sel(new_sel);
GlobalVariable *is_redefined = GET_CORE()->redefined_op_gvar(sel, true);
@@ -2974,6 +2975,7 @@
SEL sel;
if (mid != 0) {
sel = mid_to_sel(mid, positive_arity ? 1 : 0);
+ sel = rb_objc_ignored_sel(sel);
sel_val = compile_sel(sel);
if (block_declaration && super_call) {
// A super call inside a block. The selector cannot
@@ -4739,7 +4741,7 @@
Value *val = CallInst::Create(getConstCacheFunc,
compile_const_global_string(rb_id2name(name)), "", bb);
- new StoreInst(val, gvar, "", bb);
+ new StoreInst(val, gvar, bb);
}
// Compile selectors.
@@ -4756,7 +4758,7 @@
Value *val = CallInst::Create(registerSelFunc,
compile_const_global_string(sel_getName(sel)), "", bb);
val = new BitCastInst(val, PtrTy, "", bb);
- new StoreInst(val, gvar, "", bb);
+ new StoreInst(val, gvar, bb);
}
// Compile literals.
@@ -4862,7 +4864,7 @@
}
assert(lit_val != NULL);
- new StoreInst(lit_val, gvar, "", bb);
+ new StoreInst(lit_val, gvar, bb);
}
// Compile IDs.
@@ -4880,7 +4882,7 @@
Value *val = CallInst::Create(rbInternFunc,
compile_const_global_string(rb_id2name(name)), "", bb);
- new StoreInst(val, gvar, "", bb);
+ new StoreInst(val, gvar, bb);
}
// Compile global entries.
@@ -4899,7 +4901,7 @@
Value *val = CallInst::Create(rbInternFunc,
compile_const_global_string(rb_id2name(name)), "", bb);
val = CallInst::Create(globalEntryFunc, val, "", bb);
- new StoreInst(val, gvar, "", bb);
+ new StoreInst(val, gvar, bb);
}
// Compile constant class references.
@@ -4912,7 +4914,7 @@
Value *val = CallInst::Create(getClassFunc,
compile_const_global_string(gvar->getName().str().c_str()),
"",bb);
- new StoreInst(val, gvar, "", bb);
+ new StoreInst(val, gvar, bb);
}
// Instance variable slots.
@@ -4927,7 +4929,7 @@
GlobalVariable *gvar = *i;
Value *val = CallInst::Create(ivarSlotAlloc, "", bb);
- new StoreInst(val, gvar, "", bb);
+ new StoreInst(val, gvar, bb);
}
// Stubs.
@@ -5312,7 +5314,7 @@
"", bb);
Value *rval = compile_conversion_to_ruby(
arg_ctypes[i].c_str(), arg_types[i], arg++);
- new StoreInst(rval, aslot, "", bb);
+ new StoreInst(rval, aslot, bb);
}
}
@@ -6351,7 +6353,7 @@
for (int i = 0; i < arity; i++) {
Value *index = ConstantInt::get(Int32Ty, i);
Value *slot = GetElementPtrInst::Create(argv, index, "", bb);
- new StoreInst(arg++, slot, "", bb);
+ new StoreInst(arg++, slot, bb);
}
}
Modified: MacRuby/trunk/vm.cpp (4373 => 4374)
--- MacRuby/trunk/vm.cpp 2010-07-24 01:07:02 UTC (rev 4373)
+++ MacRuby/trunk/vm.cpp 2010-07-24 02:16:49 UTC (rev 4374)
@@ -1821,7 +1821,7 @@
#if MACRUBY_STATIC
if (objc_imp == NULL) {
- printf("can't define method `%s' because no Objective-C stub was pre-compiled", sel_getName(sel));
+ printf("can't define method `%s' because no Objective-C stub was pre-compiled for types `%s'\n", sel_getName(sel), types);
abort();
}
#else
@@ -1996,10 +1996,7 @@
flags |= VM_METHOD_PROTECTED;
}
- if (rb_objc_ignore_sel(sel)) {
- // TODO
- return;
- }
+ sel = rb_objc_ignored_sel(sel);
const char *sel_name = sel_getName(sel);
const bool genuine_selector = sel_name[strlen(sel_name) - 1] == ':';
@@ -2152,7 +2149,7 @@
static void
push_method(VALUE ary, SEL sel, int flags, int (*filter) (VALUE, ID, VALUE))
{
- if (rb_objc_ignore_sel(sel)) {
+ if (rb_objc_ignored_sel(sel) != sel) {
return;
}
@@ -2488,10 +2485,7 @@
{
assert(klass != NULL);
- if (rb_objc_ignore_sel(sel)) {
- // TODO
- return NULL;
- }
+ sel = rb_objc_ignored_sel(sel);
const char *sel_name = sel_getName(sel);
const bool genuine_selector = sel_name[strlen(sel_name) - 1] == ':';
Modified: MacRuby/trunk/vm.h (4373 => 4374)
--- MacRuby/trunk/vm.h 2010-07-24 01:07:02 UTC (rev 4373)
+++ MacRuby/trunk/vm.h 2010-07-24 02:16:49 UTC (rev 4374)
@@ -596,9 +596,12 @@
argc, argv);
}
+SEL rb_objc_ignored_sel(SEL);
+
static inline VALUE
rb_vm_call(VALUE self, SEL sel, int argc, const VALUE *argv)
{
+ sel = rb_objc_ignored_sel(sel);
return rb_vm_call0(rb_vm_current_vm(), 0, self, (Class)CLASS_OF(self), sel,
NULL, DISPATCH_FCALL, argc, argv);
}
@@ -606,6 +609,7 @@
static inline VALUE
rb_vm_call_super(VALUE self, SEL sel, int argc, const VALUE *argv)
{
+ sel = rb_objc_ignored_sel(sel);
return rb_vm_call0(rb_vm_current_vm(), 0, self, (Class)CLASS_OF(self), sel,
NULL, DISPATCH_SUPER, argc, argv);
}
@@ -617,6 +621,7 @@
if (klass == 0) {
klass = CLASS_OF(self);
}
+ sel = rb_objc_ignored_sel(sel);
return rb_vm_call0(rb_vm_current_vm(), 0, self, (Class)klass, sel, block,
DISPATCH_FCALL, argc, argv);
}
@@ -1152,6 +1157,6 @@
#endif /* __cplusplus */
#define not_implemented_in_static(s) \
- rb_raise(rb_eRuntimeError, "%s is not supported in MacRuby static", sel_getName(s))
+ rb_raise(rb_eRuntimeError, "%s: not supported in static compilation", sel_getName(s))
#endif /* __VM_H_ */