Sha256: bf2fe7096b8981ef5edab87acaa2e65b3be69c785e0481faf8531e698ceef4e7

Contents?: true

Size: 709 Bytes

Versions: 1

Compression:

Stored size: 709 Bytes

Contents

#include "cruby.h"

VALUE
llrb_insn_opt_ltlt(VALUE recv, VALUE obj)
{
  if (!SPECIAL_CONST_P(recv)) {
    if (RBASIC_CLASS(recv) == rb_cString &&
      BASIC_OP_UNREDEFINED_P(BOP_LTLT, STRING_REDEFINED_OP_FLAG)) {
      return rb_str_concat(recv, obj);
    }
    else if (RBASIC_CLASS(recv) == rb_cArray &&
        BASIC_OP_UNREDEFINED_P(BOP_LTLT, ARRAY_REDEFINED_OP_FLAG)) {
      return rb_ary_push(recv, obj);
    }
    else {
      //goto INSN_LABEL(normal_dispatch);
      return rb_funcall(recv, rb_intern("<<"), 1, obj);
    }
  }
  else {
    //INSN_LABEL(normal_dispatch):
    //PUSH(recv);
    //PUSH(obj);
    //CALL_SIMPLE_METHOD(recv);
    return rb_funcall(recv, rb_intern("<<"), 1, obj);
  }
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
llrb-0.0.1 ext/llrb_insn_opt_ltlt.c