/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp"
#include "memory/oopFactory.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
#include "oops/typeArrayKlass.hpp"
#include "runtime/signature.hpp"
// Implementation of SignatureIterator
// Signature syntax:
//
// Signature = "(" {Parameter} ")" ReturnType.
// Parameter = FieldType.
// ReturnType = FieldType | "V".
// FieldType = "B" | "C" | "D" | "F" | "I" | "J" | "S" | "Z" | "L" ClassName ";" | "[" FieldType.
// ClassName = string.
_parameter_index = 0;
}
_index++;
}
}
// Note: This function could be simplified by using "return T_XXX_size;"
// instead of the assignment and the break statements. However, it
// seems that the product build for win32_i486 with MS VC++ 6.0 doesn't
// work (stack underflow for some tests) - this seems to be a VC++ 6.0
// compiler bug (was problem - gri 4/27/2000).
case 'L':
}
break;
case '[':
_index++;
}
} else {
_index++;
}
}
size = T_ARRAY_size;
break;
default:
break;
}
return size;
}
}
}
// no '(', just one (field) type
_index = 0;
_parameter_index = 0;
parse_type();
}
// Parse parameters
_index = 0;
_parameter_index = 0;
expect('(');
expect(')');
_parameter_index = 0;
}
// Optimized version of iterat_parameters when fingerprint is known
// Check for too many arguments
return;
}
_parameter_index = 0;
while ( 1 ) {
switch ( fingerprint & parameter_feature_mask ) {
case bool_parm:
do_bool();
break;
case byte_parm:
do_byte();
break;
case char_parm:
do_char();
break;
case short_parm:
do_short();
break;
case int_parm:
do_int();
break;
case obj_parm:
do_object(0, 0);
break;
case long_parm:
do_long();
break;
case float_parm:
do_float();
break;
case double_parm:
do_double();
break;
case done_parm:
return;
break;
default:
break;
}
}
_parameter_index = 0;
}
// Ignore parameters
_index = 0;
expect('(');
expect(')');
// Parse return type
_parameter_index = -1;
parse_type();
_parameter_index = 0;
}
// Parse parameters
_parameter_index = 0;
_index = 0;
expect('(');
expect(')');
// Parse return type
_parameter_index = -1;
parse_type();
_parameter_index = 0;
}
// Implementation of SignatureStream
next();
}
// decrement refcount for names created during signature parsing
}
}
}
switch (t) {
case 'L': {
break;
}
case '[': {
_end++;
}
case 'B':
case 'C':
case 'D':
case 'F':
case 'I':
case 'J':
case 'S':
case 'Z':_end++; break;
default: {
break;
}
}
break;
}
default : ShouldNotReachHere();
}
}
}
}
// Create a symbol from for string _begin _end
begin++;
end--;
}
// Save names for cleaning up reference count at the end of
// SignatureStream scope.
return name;
}
if (failure_mode == ReturnNull) {
} else {
return SystemDictionary::resolve_or_fail(name, class_loader, protection_domain, throw_error, THREAD);
}
}
if (!is_object())
}
// Create a symbol from for string _begin _end
begin++;
end--;
}
}
return result;
}
return false;
} else if (signature[0] == '(') {
return is_valid_method_signature(sig);
} else {
return is_valid_type_signature(sig);
}
}
++index;
if (res == -1) {
return false;
} else {
}
}
// check the return type
++index;
}
}
return false;
}
}
// Checks to see if the type (not to go beyond 'limit') refers to a valid type.
// Returns -1 if it is not, or the index of the next character that is not part
// of the type. The type encoding may end before 'limit' and that's ok.
// Iterate over any number of array dimensions
return -1;
}
case 'B': case 'C': case 'D': case 'F': case 'I':
case 'J': case 'S': case 'Z': case 'V':
return index + 1;
case 'L':
if (c == ';') {
return index + 1;
}
if (invalid_name_char(c)) {
return -1;
}
}
// fall through
default: ; // fall through
}
return -1;
}
switch (c) {
case '\0': case '.': case ';': case '[':
return true;
default:
return false;
}
}