68 69 BasicType FieldType::get_array_info(Symbol* signature, FieldArrayInfo& fd, TRAPS) { 70 assert(basic_type(signature) == T_ARRAY, "must be array"); 71 int index = 1; 72 int dim = 1; 73 while (signature->char_at(index) == '[') { 74 index++; 75 dim++; 76 } 77 ResourceMark rm; 78 char *element = signature->as_C_string() + index; 79 BasicType element_type = char2type(element[0]); 80 if (element_type == T_OBJECT || element_type == T_VALUETYPE) { 81 int len = (int)strlen(element); 82 assert(element[len-1] == ';', "last char should be a semicolon"); 83 element[len-1] = '\0'; // chop off semicolon 84 fd._object_key = SymbolTable::new_symbol(element + 1, CHECK_(T_BYTE)); 85 } 86 // Pass dimension back to caller 87 fd._dimension = dim; 88 return element_type; 89 } | 68 69 BasicType FieldType::get_array_info(Symbol* signature, FieldArrayInfo& fd, TRAPS) { 70 assert(basic_type(signature) == T_ARRAY, "must be array"); 71 int index = 1; 72 int dim = 1; 73 while (signature->char_at(index) == '[') { 74 index++; 75 dim++; 76 } 77 ResourceMark rm; 78 char *element = signature->as_C_string() + index; 79 BasicType element_type = char2type(element[0]); 80 if (element_type == T_OBJECT || element_type == T_VALUETYPE) { 81 int len = (int)strlen(element); 82 assert(element[len-1] == ';', "last char should be a semicolon"); 83 element[len-1] = '\0'; // chop off semicolon 84 fd._object_key = SymbolTable::new_symbol(element + 1, CHECK_(T_BYTE)); 85 } 86 // Pass dimension back to caller 87 fd._dimension = dim; 88 fd._storage_props = get_array_storage_properties(signature); 89 return element_type; 90 } 91 92 ArrayStorageProperties FieldType::get_array_storage_properties(Symbol* signature) { 93 return (signature->is_Q_array_signature() || signature->is_Q_signature()) ? ArrayStorageProperties::flattened_and_null_free : ArrayStorageProperties::empty; 94 } |