67 // Make a ciSymbol from a C string (implementation). 68 static ciSymbol* make_impl(const char* s); 69 70 public: 71 // The enumeration ID from vmSymbols, or vmSymbols::NO_SID if none. 72 vmSymbols::SID sid() const { return _sid; } 73 74 // The text of the symbol as a null-terminated utf8 string. 75 const char* as_utf8(); 76 int utf8_length(); 77 78 // The text of the symbol as ascii with all non-printable characters quoted as \u#### 79 const char* as_quoted_ascii(); 80 81 // Return the i-th utf byte as a char, where i < utf8_length 82 char char_at(int i); 83 84 // Tests if the symbol starts with the given prefix. 85 bool starts_with(const char* prefix, int len) const; 86 87 // Determines where the symbol contains the given substring. 88 int index_of_at(int i, const char* str, int len) const; 89 90 void print_symbol_on(outputStream* st); 91 void print_symbol() { 92 print_symbol_on(tty); 93 } 94 const char* as_klass_external_name() const; 95 96 // Make a ciSymbol from a C string. 97 // Consider adding to vmSymbols.hpp instead of using this constructor. 98 // (Your code will be less subject to typographical bugs.) 99 static ciSymbol* make(const char* s); 100 101 #define CI_SYMBOL_DECLARE(name, ignore_def) \ 102 static ciSymbol* name() { return ciObjectFactory::vm_symbol_at(vmSymbols::VM_SYMBOL_ENUM_NAME(name)); } 103 VM_SYMBOLS_DO(CI_SYMBOL_DECLARE, CI_SYMBOL_DECLARE) 104 #undef CI_SYMBOL_DECLARE 105 106 void print() { | 67 // Make a ciSymbol from a C string (implementation). 68 static ciSymbol* make_impl(const char* s); 69 70 public: 71 // The enumeration ID from vmSymbols, or vmSymbols::NO_SID if none. 72 vmSymbols::SID sid() const { return _sid; } 73 74 // The text of the symbol as a null-terminated utf8 string. 75 const char* as_utf8(); 76 int utf8_length(); 77 78 // The text of the symbol as ascii with all non-printable characters quoted as \u#### 79 const char* as_quoted_ascii(); 80 81 // Return the i-th utf byte as a char, where i < utf8_length 82 char char_at(int i); 83 84 // Tests if the symbol starts with the given prefix. 85 bool starts_with(const char* prefix, int len) const; 86 87 bool is_Q_signature(); 88 89 // Determines where the symbol contains the given substring. 90 int index_of_at(int i, const char* str, int len) const; 91 92 void print_symbol_on(outputStream* st); 93 void print_symbol() { 94 print_symbol_on(tty); 95 } 96 const char* as_klass_external_name() const; 97 98 // Make a ciSymbol from a C string. 99 // Consider adding to vmSymbols.hpp instead of using this constructor. 100 // (Your code will be less subject to typographical bugs.) 101 static ciSymbol* make(const char* s); 102 103 #define CI_SYMBOL_DECLARE(name, ignore_def) \ 104 static ciSymbol* name() { return ciObjectFactory::vm_symbol_at(vmSymbols::VM_SYMBOL_ENUM_NAME(name)); } 105 VM_SYMBOLS_DO(CI_SYMBOL_DECLARE, CI_SYMBOL_DECLARE) 106 #undef CI_SYMBOL_DECLARE 107 108 void print() { |