equal
deleted
inserted
replaced
275 // |
275 // |
276 // The class is used to iterate over the elements of a method signature. |
276 // The class is used to iterate over the elements of a method signature. |
277 class ciSignatureStream : public StackObj { |
277 class ciSignatureStream : public StackObj { |
278 private: |
278 private: |
279 ciSignature* _sig; |
279 ciSignature* _sig; |
280 int _pos; |
280 int _pos; |
|
281 // holder is a method's holder |
|
282 ciKlass* _holder; |
281 public: |
283 public: |
282 ciSignatureStream(ciSignature* signature) { |
284 ciSignatureStream(ciSignature* signature, ciKlass* holder = NULL) { |
283 _sig = signature; |
285 _sig = signature; |
284 _pos = 0; |
286 _pos = 0; |
|
287 _holder = holder; |
285 } |
288 } |
286 |
289 |
287 bool at_return_type() { return _pos == _sig->count(); } |
290 bool at_return_type() { return _pos == _sig->count(); } |
288 |
291 |
289 bool is_done() { return _pos > _sig->count(); } |
292 bool is_done() { return _pos > _sig->count(); } |
298 if (at_return_type()) { |
301 if (at_return_type()) { |
299 return _sig->return_type(); |
302 return _sig->return_type(); |
300 } else { |
303 } else { |
301 return _sig->type_at(_pos); |
304 return _sig->type_at(_pos); |
302 } |
305 } |
|
306 } |
|
307 |
|
308 // next klass in the signature |
|
309 ciKlass* next_klass() { |
|
310 ciKlass* sig_k; |
|
311 if (_holder != NULL) { |
|
312 sig_k = _holder; |
|
313 _holder = NULL; |
|
314 } else { |
|
315 while (!type()->is_klass()) { |
|
316 next(); |
|
317 } |
|
318 assert(!at_return_type(), "passed end of signature"); |
|
319 sig_k = type()->as_klass(); |
|
320 next(); |
|
321 } |
|
322 return sig_k; |
303 } |
323 } |
304 }; |
324 }; |
305 |
325 |
306 |
326 |
307 // ciExceptionHandlerStream |
327 // ciExceptionHandlerStream |