src/share/vm/ci/ciSymbol.hpp

Fri, 25 Jul 2008 11:32:56 -0700

author
never
date
Fri, 25 Jul 2008 11:32:56 -0700
changeset 685
6ca61c728c2d
parent 435
a61af66fc99e
child 1573
dd57230ba8fe
permissions
-rw-r--r--

6712835: Server compiler fails with assertion (loop_count < K,"infinite loop in PhaseIterGVN::transform")
Reviewed-by: kvn

duke@435 1 /*
duke@435 2 * Copyright 1999-2001 Sun Microsystems, Inc. All Rights Reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
duke@435 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@435 20 * CA 95054 USA or visit www.sun.com if you need additional information or
duke@435 21 * have any questions.
duke@435 22 *
duke@435 23 */
duke@435 24
duke@435 25 // ciSymbol
duke@435 26 //
duke@435 27 // This class represents a symbolOop in the HotSpot virtual
duke@435 28 // machine.
duke@435 29 class ciSymbol : public ciObject {
duke@435 30 CI_PACKAGE_ACCESS
duke@435 31 friend class ciEnv;
duke@435 32 friend class ciInstanceKlass;
duke@435 33 friend class ciSignature;
duke@435 34 friend class ciMethod;
duke@435 35 friend class ciObjArrayKlass;
duke@435 36
duke@435 37 private:
duke@435 38 ciSymbol(symbolOop s) : ciObject(s) {}
duke@435 39 ciSymbol(symbolHandle s); // for use with vmSymbolHandles
duke@435 40
duke@435 41 symbolOop get_symbolOop() { return (symbolOop)get_oop(); }
duke@435 42
duke@435 43 const char* type_string() { return "ciSymbol"; }
duke@435 44
duke@435 45 void print_impl(outputStream* st);
duke@435 46
duke@435 47 int byte_at(int i);
duke@435 48 jbyte* base();
duke@435 49
duke@435 50 // Make a ciSymbol from a C string (implementation).
duke@435 51 static ciSymbol* make_impl(const char* s);
duke@435 52
duke@435 53 public:
duke@435 54 // The text of the symbol as a null-terminated utf8 string.
duke@435 55 const char* as_utf8();
duke@435 56 int utf8_length();
duke@435 57
duke@435 58 // What kind of ciObject is this?
duke@435 59 bool is_symbol() { return true; }
duke@435 60
duke@435 61 void print_symbol_on(outputStream* st);
duke@435 62 void print_symbol() {
duke@435 63 print_symbol_on(tty);
duke@435 64 }
duke@435 65
duke@435 66 // Make a ciSymbol from a C string.
duke@435 67 // Consider adding to vmSymbols.hpp instead of using this constructor.
duke@435 68 // (Your code will be less subject to typographical bugs.)
duke@435 69 static ciSymbol* make(const char* s);
duke@435 70
duke@435 71 #define CI_SYMBOL_DECLARE(name, ignore_def) \
duke@435 72 static ciSymbol* name() { return ciObjectFactory::vm_symbol_at(vmSymbols::VM_SYMBOL_ENUM_NAME(name)); }
duke@435 73 VM_SYMBOLS_DO(CI_SYMBOL_DECLARE, CI_SYMBOL_DECLARE)
duke@435 74 #undef CI_SYMBOL_DECLARE
duke@435 75 };

mercurial