@@ -518,9 +518,7 @@ namespace rubinius {
518
518
return class_object (state);
519
519
}
520
520
521
- Object* Object::send (STATE, CallFrame* caller, Symbol* name, Array* ary,
522
- Object* block, bool allow_private)
523
- {
521
+ Object* Object::send (STATE, Symbol* name, Array* ary, Object* block, bool allow_private) {
524
522
LookupData lookup (this , this ->lookup_begin (state),
525
523
allow_private ? G (sym_private) : G (sym_protected));
526
524
Dispatch dispatch (name);
@@ -529,10 +527,10 @@ namespace rubinius {
529
527
args.set_block (block);
530
528
args.set_recv (this );
531
529
532
- return dispatch.send (state, caller, lookup, args);
530
+ return dispatch.send (state, lookup, args);
533
531
}
534
532
535
- Object* Object::send (STATE, CallFrame* caller, Symbol* name, bool allow_private) {
533
+ Object* Object::send (STATE, Symbol* name, bool allow_private) {
536
534
LookupData lookup (this , this ->lookup_begin (state),
537
535
allow_private ? G (sym_private) : G (sym_protected));
538
536
Dispatch dispatch (name);
@@ -541,26 +539,28 @@ namespace rubinius {
541
539
args.set_block (cNil);
542
540
args.set_recv (this );
543
541
544
- return dispatch.send (state, caller, lookup, args);
542
+ return dispatch.send (state, lookup, args);
545
543
}
546
544
547
- Object* Object::send_prim (STATE, Executable* exec,
545
+ Object* Object::send (STATE, Executable* exec,
548
546
Module* mod, Arguments& args, Symbol* min_visibility)
549
547
{
550
548
if (args.total () < 1 ) return Primitives::failure ();
551
549
552
- // Don't shift the argument because we might fail and we need Arguments
553
- // to be pristine in the fallback code.
550
+ /* Don't shift the argument because we might fail and we need Arguments to
551
+ * be pristine in the fallback code.
552
+ */
554
553
Object* meth = args.get_argument (0 );
555
554
Symbol* sym = try_as<Symbol>(meth);
556
555
557
- // All coercion must be done here. Coercing Ruby-side and then
558
- // re-calling #send/#__send__ would produce incorrect results when
559
- // sending messages that are sensitive to the call stack like
560
- // send("__callee__") and the regex globals following send("gsub").
561
- //
562
- // MRI checks for Fixnum explicitly and raises ArgumentError
563
- // instead of TypeError. Seems silly, so we don't bother.
556
+ /* All coercion must be done here. Coercing Ruby-side and then re-calling
557
+ * #send/#__send__ would produce incorrect results when sending messages
558
+ * that are sensitive to the call stack like send("__callee__") and the
559
+ * regex globals following send("gsub").
560
+ *
561
+ * MRI checks for Fixnum explicitly and raises ArgumentError instead of
562
+ * TypeError. Seems silly, so we don't bother.
563
+ */
564
564
if (!sym) {
565
565
if (String* str = try_as<String>(meth)) {
566
566
sym = str->to_sym (state);
@@ -573,9 +573,9 @@ namespace rubinius {
573
573
args.shift (state);
574
574
args.set_name (sym);
575
575
576
- // We have to send it with self from the current frame as the
577
- // source, not this object to have correct visibility checks
578
- // for protected.
576
+ /* We have to send it with self from the current frame as the source, not
577
+ * this object to have correct visibility checks for protected.
578
+ */
579
579
Dispatch dispatch (sym);
580
580
Object* scope = this ;
581
581
CallFrame* call_frame = state->vm ()->call_frame ();
@@ -584,19 +584,19 @@ namespace rubinius {
584
584
}
585
585
LookupData lookup (scope, lookup_begin (state), min_visibility);
586
586
587
- return dispatch.send (state, call_frame, lookup, args);
587
+ return dispatch.send (state, lookup, args);
588
588
}
589
589
590
590
Object* Object::private_send_prim (STATE,
591
591
Executable* exec, Module* mod, Arguments& args)
592
592
{
593
- return send_prim (state, exec, mod, args, G (sym_private));
593
+ return send (state, exec, mod, args, G (sym_private));
594
594
}
595
595
596
596
Object* Object::public_send_prim (STATE,
597
597
Executable* exec, Module* mod, Arguments& args)
598
598
{
599
- return send_prim (state, exec, mod, args, G (sym_public));
599
+ return send (state, exec, mod, args, G (sym_public));
600
600
}
601
601
602
602
void Object::set_field (STATE, size_t index, Object* val) {
@@ -921,7 +921,7 @@ namespace rubinius {
921
921
922
922
Arguments args (missing, this , 2 , buf);
923
923
924
- if (Object* responds = dispatch.send (state, 0 , lookup, args)) {
924
+ if (Object* responds = dispatch.send (state, lookup, args)) {
925
925
return RBOOL (CBOOL (responds));
926
926
}
927
927
0 commit comments