Exemplo n.º 1
0
    @Specialization(guards = "isRubyBignum(b)")
    public DynamicObject coerce(DynamicObject a, DynamicObject b) {
      CompilerDirectives.transferToInterpreter();

      Object[] store = new Object[] {b, a};
      return Layouts.ARRAY.createArray(
          getContext().getCoreLibrary().getArrayFactory(), store, store.length);
    }
Exemplo n.º 2
0
    @Specialization
    public DynamicObject coerce(DynamicObject a, long b) {
      CompilerDirectives.transferToInterpreter();

      // TODO (eregon, 16 Feb. 2015): This is NOT spec, but let's try to see if we can make it work.
      // b is converted to a Bignum here in other implementations.
      Object[] store = new Object[] {b, a};
      return Layouts.ARRAY.createArray(
          getContext().getCoreLibrary().getArrayFactory(), store, store.length);
    }