73 // The text of the symbol as a null-terminated utf8 string.
74 const char* as_utf8();
75 int utf8_length();
76
77 // The text of the symbol as ascii with all non-printable characters quoted as \u####
78 const char* as_quoted_ascii();
79
80 // Return the i-th utf8 byte, where i < utf8_length
81 int byte_at(int i);
82
83 // Tests if the symbol starts with the given prefix.
84 bool starts_with(const char* prefix, int len) const;
85
86 // Determines where the symbol contains the given substring.
87 int index_of_at(int i, const char* str, int len) const;
88
89 void print_symbol_on(outputStream* st);
90 void print_symbol() {
91 print_symbol_on(tty);
92 }
93
94 // Make a ciSymbol from a C string.
95 // Consider adding to vmSymbols.hpp instead of using this constructor.
96 // (Your code will be less subject to typographical bugs.)
97 static ciSymbol* make(const char* s);
98
99 #define CI_SYMBOL_DECLARE(name, ignore_def) \
100 static ciSymbol* name() { return ciObjectFactory::vm_symbol_at(vmSymbols::VM_SYMBOL_ENUM_NAME(name)); }
101 VM_SYMBOLS_DO(CI_SYMBOL_DECLARE, CI_SYMBOL_DECLARE)
102 #undef CI_SYMBOL_DECLARE
103
104 void print() {
105 _symbol->print();
106 }
107
108 virtual bool is_symbol() const { return true; }
109
110 // Are two ciSymbols equal?
111 bool equals(ciSymbol* obj) { return this->_symbol == obj->get_symbol(); }
112
|
73 // The text of the symbol as a null-terminated utf8 string.
74 const char* as_utf8();
75 int utf8_length();
76
77 // The text of the symbol as ascii with all non-printable characters quoted as \u####
78 const char* as_quoted_ascii();
79
80 // Return the i-th utf8 byte, where i < utf8_length
81 int byte_at(int i);
82
83 // Tests if the symbol starts with the given prefix.
84 bool starts_with(const char* prefix, int len) const;
85
86 // Determines where the symbol contains the given substring.
87 int index_of_at(int i, const char* str, int len) const;
88
89 void print_symbol_on(outputStream* st);
90 void print_symbol() {
91 print_symbol_on(tty);
92 }
93 const char* as_klass_external_name() const;
94
95 // Make a ciSymbol from a C string.
96 // Consider adding to vmSymbols.hpp instead of using this constructor.
97 // (Your code will be less subject to typographical bugs.)
98 static ciSymbol* make(const char* s);
99
100 #define CI_SYMBOL_DECLARE(name, ignore_def) \
101 static ciSymbol* name() { return ciObjectFactory::vm_symbol_at(vmSymbols::VM_SYMBOL_ENUM_NAME(name)); }
102 VM_SYMBOLS_DO(CI_SYMBOL_DECLARE, CI_SYMBOL_DECLARE)
103 #undef CI_SYMBOL_DECLARE
104
105 void print() {
106 _symbol->print();
107 }
108
109 virtual bool is_symbol() const { return true; }
110
111 // Are two ciSymbols equal?
112 bool equals(ciSymbol* obj) { return this->_symbol == obj->get_symbol(); }
113
|