equal
deleted
inserted
replaced
88 |
88 |
89 // Constructors |
89 // Constructors |
90 SignatureIterator(Symbol* signature); |
90 SignatureIterator(Symbol* signature); |
91 |
91 |
92 // Iteration |
92 // Iteration |
93 void dispatch_field(); // dispatches once for field signatures |
|
94 void iterate_parameters(); // iterates over parameters only |
93 void iterate_parameters(); // iterates over parameters only |
95 void iterate_parameters( uint64_t fingerprint ); |
94 void iterate_parameters( uint64_t fingerprint ); |
96 void iterate_returntype(); // iterates over returntype only |
95 void iterate_returntype(); // iterates over returntype only |
97 void iterate(); // iterates over whole signature |
96 void iterate(); // iterates over whole signature |
98 // Returns the word index of the current parameter; |
97 // Returns the word index of the current parameter; |
361 Symbol* _signature; |
360 Symbol* _signature; |
362 int _begin; |
361 int _begin; |
363 int _end; |
362 int _end; |
364 BasicType _type; |
363 BasicType _type; |
365 bool _at_return_type; |
364 bool _at_return_type; |
366 GrowableArray<Symbol*>* _names; // symbols created while parsing signature |
365 Symbol* _previous_name; // cache the previously looked up symbol to avoid lookups |
367 |
366 GrowableArray<Symbol*>* _names; // symbols created while parsing that need to be dereferenced |
368 public: |
367 public: |
369 bool at_return_type() const { return _at_return_type; } |
368 bool at_return_type() const { return _at_return_type; } |
370 bool is_done() const; |
369 bool is_done() const; |
371 void next_non_primitive(int t); |
370 void next_non_primitive(int t); |
372 void next() { |
371 void next() { |
400 |
399 |
401 bool is_object() const; // True if this argument is an object |
400 bool is_object() const; // True if this argument is an object |
402 bool is_array() const; // True if this argument is an array |
401 bool is_array() const; // True if this argument is an array |
403 BasicType type() const { return _type; } |
402 BasicType type() const { return _type; } |
404 Symbol* as_symbol(TRAPS); |
403 Symbol* as_symbol(TRAPS); |
405 enum FailureMode { ReturnNull, CNFException, NCDFError }; |
404 enum FailureMode { ReturnNull, NCDFError }; |
406 Klass* as_klass(Handle class_loader, Handle protection_domain, FailureMode failure_mode, TRAPS); |
405 Klass* as_klass(Handle class_loader, Handle protection_domain, FailureMode failure_mode, TRAPS); |
407 oop as_java_mirror(Handle class_loader, Handle protection_domain, FailureMode failure_mode, TRAPS); |
406 oop as_java_mirror(Handle class_loader, Handle protection_domain, FailureMode failure_mode, TRAPS); |
408 const u1* raw_bytes() { return _signature->bytes() + _begin; } |
407 const u1* raw_bytes() { return _signature->bytes() + _begin; } |
409 int raw_length() { return _end - _begin; } |
408 int raw_length() { return _end - _begin; } |
410 |
409 |
419 class SignatureVerifier : public StackObj { |
418 class SignatureVerifier : public StackObj { |
420 public: |
419 public: |
421 static bool is_valid_method_signature(Symbol* sig); |
420 static bool is_valid_method_signature(Symbol* sig); |
422 static bool is_valid_type_signature(Symbol* sig); |
421 static bool is_valid_type_signature(Symbol* sig); |
423 private: |
422 private: |
424 |
|
425 static ssize_t is_valid_type(const char*, ssize_t); |
423 static ssize_t is_valid_type(const char*, ssize_t); |
426 static bool invalid_name_char(char); |
|
427 }; |
424 }; |
428 #endif |
425 #endif |
429 #endif // SHARE_RUNTIME_SIGNATURE_HPP |
426 #endif // SHARE_RUNTIME_SIGNATURE_HPP |