< prev index next >

src/hotspot/share/oops/symbol.cpp

Print this page


 114   return utf8_length() > 2 && char_at(0) == 'Q' && ends_with(';');
 115 }
 116 
 117 bool Symbol::is_Q_array_signature() const {
 118   int l = utf8_length();
 119   if (l < 2 || char_at(0) != '[' || char_at(l - 1) != ';') {
 120     return false;
 121   }
 122   for (int i = 1; i < (l - 2); i++) {
 123     char c = char_at(i);
 124     if (c == 'Q') {
 125       return true;
 126     }
 127     if (c != '[') {
 128       return false;
 129     }
 130   }
 131   return false;
 132 }
 133 













 134 bool Symbol::is_Q_singledim_array_signature() const {
 135   return utf8_length() > 3 && char_at(0) == '[' && char_at(1) == 'Q' && ends_with(';');
 136 }
 137 
 138 Symbol* Symbol::fundamental_name(TRAPS) {
 139   if ((char_at(0) == 'Q' || char_at(0) == 'L') && ends_with(';')) {
 140     return SymbolTable::new_symbol(this, 1, utf8_length() - 1);
 141   } else {
 142     // reference count is incremented to be consistent with the behavior with
 143     // the SymbolTable::new_symbol() call above
 144     this->increment_refcount();
 145     return this;
 146   }
 147 }
 148 
 149 bool Symbol::is_same_fundamental_type(Symbol* s) const {
 150   if (this == s) return true;
 151   if (utf8_length() < 3) return false;
 152   int offset1, offset2, len;
 153   if (ends_with(';')) {




 114   return utf8_length() > 2 && char_at(0) == 'Q' && ends_with(';');
 115 }
 116 
 117 bool Symbol::is_Q_array_signature() const {
 118   int l = utf8_length();
 119   if (l < 2 || char_at(0) != '[' || char_at(l - 1) != ';') {
 120     return false;
 121   }
 122   for (int i = 1; i < (l - 2); i++) {
 123     char c = char_at(i);
 124     if (c == 'Q') {
 125       return true;
 126     }
 127     if (c != '[') {
 128       return false;
 129     }
 130   }
 131   return false;
 132 }
 133 
 134 bool Symbol::is_Q_method_signature() const {
 135   assert(SignatureVerifier::is_valid_method_signature(this), "must be");
 136   int len = utf8_length();
 137   if (len > 4 && char_at(0) == '(') {
 138     for (int i=1; i<len-3; i++) { // Must end with ")Qx;", where x is at least one character or more.
 139       if (char_at(i) == ')' && char_at(i+1) == 'Q') {
 140         return true;
 141       }
 142     }
 143   }
 144   return false;
 145 }
 146 
 147 bool Symbol::is_Q_singledim_array_signature() const {
 148   return utf8_length() > 3 && char_at(0) == '[' && char_at(1) == 'Q' && ends_with(';');
 149 }
 150 
 151 Symbol* Symbol::fundamental_name(TRAPS) {
 152   if ((char_at(0) == 'Q' || char_at(0) == 'L') && ends_with(';')) {
 153     return SymbolTable::new_symbol(this, 1, utf8_length() - 1);
 154   } else {
 155     // reference count is incremented to be consistent with the behavior with
 156     // the SymbolTable::new_symbol() call above
 157     this->increment_refcount();
 158     return this;
 159   }
 160 }
 161 
 162 bool Symbol::is_same_fundamental_type(Symbol* s) const {
 163   if (this == s) return true;
 164   if (utf8_length() < 3) return false;
 165   int offset1, offset2, len;
 166   if (ends_with(';')) {


< prev index next >