419 // return same as_symbol except allocation of new symbols is avoided. 420 Symbol* as_symbol_or_null(); 421 422 // count the number of references in the signature 423 int reference_parameter_count(); 424 }; 425 426 class SignatureVerifier : public StackObj { 427 public: 428 // Returns true if the symbol is valid method or type signature 429 static bool is_valid_signature(Symbol* sig); 430 431 static bool is_valid_method_signature(Symbol* sig); 432 static bool is_valid_type_signature(Symbol* sig); 433 private: 434 435 static ssize_t is_valid_type(const char*, ssize_t); 436 static bool invalid_name_char(char); 437 }; 438 439 #endif // SHARE_VM_RUNTIME_SIGNATURE_HPP | 419 // return same as_symbol except allocation of new symbols is avoided. 420 Symbol* as_symbol_or_null(); 421 422 // count the number of references in the signature 423 int reference_parameter_count(); 424 }; 425 426 class SignatureVerifier : public StackObj { 427 public: 428 // Returns true if the symbol is valid method or type signature 429 static bool is_valid_signature(Symbol* sig); 430 431 static bool is_valid_method_signature(Symbol* sig); 432 static bool is_valid_type_signature(Symbol* sig); 433 private: 434 435 static ssize_t is_valid_type(const char*, ssize_t); 436 static bool invalid_name_char(char); 437 }; 438 439 // Used for adapter generation. One SigEntry is used per element of 440 // the signature of the method. Value type arguments are treated 441 // specially. See comment for ValueKlass::collect_fields(). 442 class SigEntry VALUE_OBJ_CLASS_SPEC { 443 public: 444 BasicType _bt; 445 int _offset; 446 447 SigEntry() 448 : _bt(T_ILLEGAL), _offset(-1) { 449 } 450 SigEntry(BasicType bt, int offset) 451 : _bt(bt), _offset(offset) {} 452 453 SigEntry(BasicType bt) 454 : _bt(bt), _offset(-1) {} 455 456 static int compare(SigEntry* e1, SigEntry* e2) { 457 if (e1->_offset != e2->_offset) { 458 return e1->_offset - e2->_offset; 459 } 460 assert((e1->_bt == T_LONG && (e2->_bt == T_LONG || e2->_bt == T_VOID)) || 461 (e1->_bt == T_DOUBLE && (e2->_bt == T_DOUBLE || e2->_bt == T_VOID)) || 462 e1->_bt == T_VALUETYPE || e2->_bt == T_VALUETYPE || e1->_bt == T_VOID || e2->_bt == T_VOID, "bad bt"); 463 if (e1->_bt == e2->_bt) { 464 assert(e1->_bt == T_VALUETYPE || e1->_bt == T_VOID, "only ones with duplicate offsets"); 465 return 0; 466 } 467 if (e1->_bt == T_VOID || 468 e2->_bt == T_VALUETYPE) { 469 return 1; 470 } 471 if (e1->_bt == T_VALUETYPE || 472 e2->_bt == T_VOID) { 473 return -1; 474 } 475 ShouldNotReachHere(); 476 return 0; 477 } 478 static int count_fields(const GrowableArray<SigEntry>& sig_extended); 479 static void fill_sig_bt(const GrowableArray<SigEntry>& sig_extended, BasicType* sig_bt_cc, int total_args_passed_cc, bool skip_vt); 480 }; 481 482 #endif // SHARE_VM_RUNTIME_SIGNATURE_HPP |