public static Arity fromAnnotation(JRubyMethod anno, Class[] parameterTypes, boolean isStatic) { int required; if (anno.optional() == 0 && !anno.rest() && anno.required() == 0) { // try count specific args to determine required int i = parameterTypes.length; if (isStatic) i--; if (parameterTypes.length > 0) { if (parameterTypes[0] == ThreadContext.class) i--; if (parameterTypes[parameterTypes.length - 1] == Block.class) i--; } required = i; } else { required = anno.required(); } return createArity(required, anno.optional(), anno.rest()); }
public static Arity fromAnnotation(JRubyMethod anno, Class[] parameterTypes, boolean isStatic) { int required; if (anno.optional() == 0 && !anno.rest() && anno.required() == 0) { // try count specific args to determine required int i = parameterTypes.length; if (isStatic) i--; if (parameterTypes.length > 0) { if (parameterTypes[0] == ThreadContext.class) i--; if (parameterTypes[parameterTypes.length - 1] == Block.class) i--; } required = i; } else { required = anno.required(); } return createArity(required, anno.optional(), anno.rest()); }
public static long getEncodedSignature(JRubyMethod anno) { return encodeSignature(anno.required(), anno.optional(), 0, 0, 0, anno.rest(), false); }
public static Arity fromAnnotation(JRubyMethod anno, Class[] parameterTypes, boolean isStatic) { int required; if (anno.optional() == 0 && !anno.rest() && anno.required() == 0) { // try count specific args to determine required int i = parameterTypes.length; if (isStatic) i--; if (parameterTypes.length > 0) { if (parameterTypes[0] == ThreadContext.class) i--; if (parameterTypes[parameterTypes.length - 1] == Block.class) i--; } required = i; } else { required = anno.required(); } return createArity(required, anno.optional(), anno.rest()); }
public static Arity fromAnnotation(JRubyMethod anno, Class[] parameterTypes, boolean isStatic) { int required; if (anno.optional() == 0 && !anno.rest() && anno.required() == 0) { // try count specific args to determine required int i = parameterTypes.length; if (isStatic) i--; if (parameterTypes.length > 0) { if (parameterTypes[0] == ThreadContext.class) i--; if (parameterTypes[parameterTypes.length - 1] == Block.class) i--; } required = i; } else { required = anno.required(); } return createArity(required, anno.optional(), anno.rest()); }
public static Arity fromAnnotation(JRubyMethod anno) { return createArity(anno.required(), anno.optional(), anno.rest()); }
public static Arity fromAnnotation(JRubyMethod anno) { return createArity(anno.required(), anno.optional(), anno.rest()); }
public static long getEncodedSignature(JRubyMethod anno) { return encodeSignature(anno.required(), anno.optional(), 0, 0, 0, anno.rest(), false); }
public static Arity fromAnnotation(JRubyMethod anno) { return createArity(anno.required(), anno.optional(), anno.rest()); }
public static Arity fromAnnotation(JRubyMethod anno) { return createArity(anno.required(), anno.optional(), anno.rest()); }
required = anno.required();
required = anno.required();
required = anno.required();
false); int handleOffset = calculateHandleOffset(method.getParameters().size(), anno.required(), anno.optional(), anno.rest(), isStatic, hasContext, hasBlock);
boolean checkArity = false; if (jrubyMethod.rest()) { if (jrubyMethod.required() > 0) { method.ldc(jrubyMethod.required()); method.if_icmplt(arityError); checkArity = true; if (jrubyMethod.required() > 0) { method.ldc(jrubyMethod.required()); method.if_icmplt(arityError); method.ldc(jrubyMethod.required() + jrubyMethod.optional()); method.if_icmpgt(arityError); checkArity = true; method.ldc(jrubyMethod.required()); method.if_icmpne(arityError); checkArity = true; method.invokevirtual(p(ThreadContext.class), "getRuntime", sig(Ruby.class)); method.aload(ARGS_INDEX); method.ldc(jrubyMethod.required()); method.ldc(jrubyMethod.required() + jrubyMethod.optional()); method.invokestatic(p(Arity.class), "checkArgumentCount", sig(int.class, Ruby.class, IRubyObject[].class, int.class, int.class)); method.pop();
boolean checkArity = false; if (jrubyMethod.rest()) { if (jrubyMethod.required() > 0) { method.ldc(jrubyMethod.required()); method.if_icmplt(arityError); checkArity = true; if (jrubyMethod.required() > 0) { method.ldc(jrubyMethod.required()); method.if_icmplt(arityError); method.ldc(jrubyMethod.required() + jrubyMethod.optional()); method.if_icmpgt(arityError); checkArity = true; method.ldc(jrubyMethod.required()); method.if_icmpne(arityError); checkArity = true; method.invokevirtual(p(ThreadContext.class), "getRuntime", sig(Ruby.class)); method.aload(ARGS_INDEX); method.ldc(jrubyMethod.required()); method.ldc(jrubyMethod.required() + jrubyMethod.optional()); method.invokestatic(p(Arity.class), "checkArgumentCount", sig(int.class, Ruby.class, IRubyObject[].class, int.class, int.class)); method.pop();
boolean checkArity = false; if (jrubyMethod.rest()) { if (jrubyMethod.required() > 0) { method.ldc(jrubyMethod.required()); method.if_icmplt(arityError); checkArity = true; if (jrubyMethod.required() > 0) { method.ldc(jrubyMethod.required()); method.if_icmplt(arityError); method.ldc(jrubyMethod.required() + jrubyMethod.optional()); method.if_icmpgt(arityError); checkArity = true; method.ldc(jrubyMethod.required()); method.if_icmpne(arityError); checkArity = true; method.invokevirtual(p(ThreadContext.class), "getRuntime", sig(Ruby.class)); method.aload(ARGS_INDEX); method.ldc(jrubyMethod.required()); method.ldc(jrubyMethod.required() + jrubyMethod.optional()); method.invokestatic(p(Arity.class), "checkArgumentCount", sig(int.class, Ruby.class, IRubyObject[].class, int.class, int.class)); method.pop();
boolean checkArity = false; if (jrubyMethod.rest()) { if (jrubyMethod.required() > 0) { method.ldc(jrubyMethod.required()); method.if_icmplt(arityError); checkArity = true; if (jrubyMethod.required() > 0) { method.ldc(jrubyMethod.required()); method.if_icmplt(arityError); method.ldc(jrubyMethod.required() + jrubyMethod.optional()); method.if_icmpgt(arityError); checkArity = true; method.ldc(jrubyMethod.required()); method.if_icmpne(arityError); checkArity = true; method.invokevirtual(p(ThreadContext.class), "getRuntime", sig(Ruby.class)); method.aload(ARGS_INDEX); method.ldc(jrubyMethod.required()); method.ldc(jrubyMethod.required() + jrubyMethod.optional()); method.invokestatic(p(Arity.class), "checkArgumentCount", sig(int.class, Ruby.class, IRubyObject[].class, int.class, int.class)); method.pop();
JRubyMethod annotation = reflected.getAnnotation(JRubyMethod.class); int required = annotation.required(); int optional = annotation.optional(); boolean rest = annotation.rest();
JRubyMethod annotation = reflected.getAnnotation(JRubyMethod.class); int required = annotation.required(); int optional = annotation.optional(); boolean rest = annotation.rest();