442 // }
443
444 /** Report the return type. */
445 BasicType returnType() {
446 if (result < 0) return V_TYPE;
447 Name n = names[result];
448 return n.type;
449 }
450
451 /** Report the N-th argument type. */
452 BasicType parameterType(int n) {
453 assert(n < arity);
454 return names[n].type;
455 }
456
457 /** Report the arity. */
458 int arity() {
459 return arity;
460 }
461
462 /** Return the method type corresponding to my basic type signature. */
463 MethodType methodType() {
464 return signatureType(basicTypeSignature());
465 }
466 /** Return ABC_Z, where the ABC are parameter type characters, and Z is the return type character. */
467 final String basicTypeSignature() {
468 StringBuilder buf = new StringBuilder(arity() + 3);
469 for (int i = 0, a = arity(); i < a; i++)
470 buf.append(parameterType(i).basicTypeChar());
471 return buf.append('_').append(returnType().basicTypeChar()).toString();
472 }
473 static int signatureArity(String sig) {
474 assert(isValidSignature(sig));
475 return sig.indexOf('_');
476 }
477 static BasicType signatureReturn(String sig) {
478 return basicType(sig.charAt(signatureArity(sig) + 1));
479 }
480 static boolean isValidSignature(String sig) {
481 int arity = sig.indexOf('_');
|
442 // }
443
444 /** Report the return type. */
445 BasicType returnType() {
446 if (result < 0) return V_TYPE;
447 Name n = names[result];
448 return n.type;
449 }
450
451 /** Report the N-th argument type. */
452 BasicType parameterType(int n) {
453 assert(n < arity);
454 return names[n].type;
455 }
456
457 /** Report the arity. */
458 int arity() {
459 return arity;
460 }
461
462 /** Report the number of expressions (non-parameter names). */
463 int expressionCount() {
464 return names.length - arity;
465 }
466
467 /** Return the method type corresponding to my basic type signature. */
468 MethodType methodType() {
469 return signatureType(basicTypeSignature());
470 }
471 /** Return ABC_Z, where the ABC are parameter type characters, and Z is the return type character. */
472 final String basicTypeSignature() {
473 StringBuilder buf = new StringBuilder(arity() + 3);
474 for (int i = 0, a = arity(); i < a; i++)
475 buf.append(parameterType(i).basicTypeChar());
476 return buf.append('_').append(returnType().basicTypeChar()).toString();
477 }
478 static int signatureArity(String sig) {
479 assert(isValidSignature(sig));
480 return sig.indexOf('_');
481 }
482 static BasicType signatureReturn(String sig) {
483 return basicType(sig.charAt(signatureArity(sig) + 1));
484 }
485 static boolean isValidSignature(String sig) {
486 int arity = sig.indexOf('_');
|