5071 unsigned int length = signature->utf8_length(); 5072 char* nextp; 5073 5074 // The first character must be a '(' 5075 if ((length > 0) && (*p++ == JVM_SIGNATURE_FUNC)) { 5076 length--; 5077 // Skip over legal field signatures 5078 nextp = skip_over_field_signature(p, false, length, CHECK_0); 5079 while ((length > 0) && (nextp != NULL)) { 5080 args_size++; 5081 if (p[0] == 'J' || p[0] == 'D') { 5082 args_size++; 5083 } 5084 length -= nextp - p; 5085 p = nextp; 5086 nextp = skip_over_field_signature(p, false, length, CHECK_0); 5087 } 5088 // The first non-signature thing better be a ')' 5089 if ((length > 0) && (*p++ == JVM_SIGNATURE_ENDFUNC)) { 5090 length--; 5091 if (name->utf8_length() > 0 && name->byte_at(0) == '<') { 5092 // All internal methods must return void 5093 if ((length == 1) && (p[0] == JVM_SIGNATURE_VOID)) { 5094 return args_size; 5095 } 5096 } else { 5097 // Now we better just have a return value 5098 nextp = skip_over_field_signature(p, true, length, CHECK_0); 5099 if (nextp && ((int)length == (nextp - p))) { 5100 return args_size; 5101 } 5102 } 5103 } 5104 } 5105 // Report error 5106 throwIllegalSignature("Method", name, signature, CHECK_0); 5107 return 0; 5108 } 5109 5110 5111 // Unqualified names may not contain the characters '.', ';', '[', or '/'. 5112 // Method names also may not contain the characters '<' or '>', unless <init> | 5071 unsigned int length = signature->utf8_length(); 5072 char* nextp; 5073 5074 // The first character must be a '(' 5075 if ((length > 0) && (*p++ == JVM_SIGNATURE_FUNC)) { 5076 length--; 5077 // Skip over legal field signatures 5078 nextp = skip_over_field_signature(p, false, length, CHECK_0); 5079 while ((length > 0) && (nextp != NULL)) { 5080 args_size++; 5081 if (p[0] == 'J' || p[0] == 'D') { 5082 args_size++; 5083 } 5084 length -= nextp - p; 5085 p = nextp; 5086 nextp = skip_over_field_signature(p, false, length, CHECK_0); 5087 } 5088 // The first non-signature thing better be a ')' 5089 if ((length > 0) && (*p++ == JVM_SIGNATURE_ENDFUNC)) { 5090 length--; 5091 if (name == vmSymbols::object_initializer_name()) { 5092 // All "<init>" methods must return void 5093 if ((length == 1) && (p[0] == JVM_SIGNATURE_VOID)) { 5094 return args_size; 5095 } 5096 } else { 5097 // Now we better just have a return value 5098 nextp = skip_over_field_signature(p, true, length, CHECK_0); 5099 if (nextp && ((int)length == (nextp - p))) { 5100 return args_size; 5101 } 5102 } 5103 } 5104 } 5105 // Report error 5106 throwIllegalSignature("Method", name, signature, CHECK_0); 5107 return 0; 5108 } 5109 5110 5111 // Unqualified names may not contain the characters '.', ';', '[', or '/'. 5112 // Method names also may not contain the characters '<' or '>', unless <init> |