334 |
334 |
335 bool SignatureStream::is_array() const { |
335 bool SignatureStream::is_array() const { |
336 return _type == T_ARRAY; |
336 return _type == T_ARRAY; |
337 } |
337 } |
338 |
338 |
339 Symbol* SignatureStream::as_symbol(TRAPS) { |
339 Symbol* SignatureStream::as_symbol() { |
340 // Create a symbol from for string _begin _end |
340 // Create a symbol from for string _begin _end |
341 int begin = _begin; |
341 int begin = _begin; |
342 int end = _end; |
342 int end = _end; |
343 |
343 |
344 if ( _signature->char_at(_begin) == 'L' |
344 if ( _signature->char_at(_begin) == 'L' |
366 return name; |
366 return name; |
367 } |
367 } |
368 |
368 |
369 // Save names for cleaning up reference count at the end of |
369 // Save names for cleaning up reference count at the end of |
370 // SignatureStream scope. |
370 // SignatureStream scope. |
371 name = SymbolTable::new_symbol(symbol_chars, len, CHECK_NULL); |
371 name = SymbolTable::new_symbol(symbol_chars, len); |
372 if (!name->is_permanent()) { |
372 if (!name->is_permanent()) { |
373 if (_names == NULL) { |
373 if (_names == NULL) { |
374 _names = new GrowableArray<Symbol*>(10); |
374 _names = new GrowableArray<Symbol*>(10); |
375 } |
375 } |
376 _names->push(name); // save new symbol for decrementing later |
376 _names->push(name); // save new symbol for decrementing later |
378 _previous_name = name; |
378 _previous_name = name; |
379 return name; |
379 return name; |
380 } |
380 } |
381 |
381 |
382 Klass* SignatureStream::as_klass(Handle class_loader, Handle protection_domain, |
382 Klass* SignatureStream::as_klass(Handle class_loader, Handle protection_domain, |
383 FailureMode failure_mode, TRAPS) { |
383 FailureMode failure_mode, TRAPS) { |
384 if (!is_object()) return NULL; |
384 if (!is_object()) return NULL; |
385 Symbol* name = as_symbol(CHECK_NULL); |
385 Symbol* name = as_symbol(); |
386 if (failure_mode == ReturnNull) { |
386 if (failure_mode == ReturnNull) { |
387 return SystemDictionary::resolve_or_null(name, class_loader, protection_domain, THREAD); |
387 return SystemDictionary::resolve_or_null(name, class_loader, protection_domain, THREAD); |
388 } else { |
388 } else { |
389 bool throw_error = (failure_mode == NCDFError); |
389 bool throw_error = (failure_mode == NCDFError); |
390 return SystemDictionary::resolve_or_fail(name, class_loader, protection_domain, throw_error, THREAD); |
390 return SystemDictionary::resolve_or_fail(name, class_loader, protection_domain, throw_error, THREAD); |