223 void SignatureIterator::iterate_returntype() { |
223 void SignatureIterator::iterate_returntype() { |
224 // Ignore parameters |
224 // Ignore parameters |
225 _index = 0; |
225 _index = 0; |
226 expect('('); |
226 expect('('); |
227 Symbol* sig = _signature; |
227 Symbol* sig = _signature; |
228 while (sig->byte_at(_index) != ')') _index++; |
228 // Need to skip over each type in the signature's argument list until a |
|
229 // closing ')' is found., then get the return type. We cannot just scan |
|
230 // for the first ')' because ')' is a legal character in a type name. |
|
231 while (sig->byte_at(_index) != ')') { |
|
232 switch(sig->byte_at(_index)) { |
|
233 case 'B': |
|
234 case 'C': |
|
235 case 'D': |
|
236 case 'F': |
|
237 case 'I': |
|
238 case 'J': |
|
239 case 'S': |
|
240 case 'Z': |
|
241 case 'V': |
|
242 { |
|
243 _index++; |
|
244 } |
|
245 break; |
|
246 case 'L': |
|
247 { |
|
248 while (sig->byte_at(_index++) != ';') ; |
|
249 } |
|
250 break; |
|
251 case '[': |
|
252 { |
|
253 int begin = ++_index; |
|
254 skip_optional_size(); |
|
255 while (sig->byte_at(_index) == '[') { |
|
256 _index++; |
|
257 skip_optional_size(); |
|
258 } |
|
259 if (sig->byte_at(_index) == 'L') { |
|
260 while (sig->byte_at(_index++) != ';') ; |
|
261 } else { |
|
262 _index++; |
|
263 } |
|
264 } |
|
265 break; |
|
266 default: |
|
267 ShouldNotReachHere(); |
|
268 break; |
|
269 } |
|
270 } |
229 expect(')'); |
271 expect(')'); |
230 // Parse return type |
272 // Parse return type |
231 _parameter_index = -1; |
273 _parameter_index = -1; |
232 parse_type(); |
274 parse_type(); |
233 check_signature_end(); |
275 check_signature_end(); |