annotate hotspot/src/share/vm/ci/ciSymbol.hpp @ 4761:bdb7375a1fee

6902182: 4/4 Starting with jdwp agent should not incur performance penalty Summary: Rename can_post_exceptions support to can_post_on_exceptions. Add support for should_post_on_exceptions flag to permit per JavaThread optimizations. Reviewed-by: never, kvn, dcubed Contributed-by: tom.deneau@amd.com
author dcubed
date Mon, 01 Feb 2010 17:35:05 -0700
parents 489c9b5090e2
children 586d3988e72b
rev   line source
duke@1 1 /*
twisti@4567 2 * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
duke@1 7 * published by the Free Software Foundation.
duke@1 8 *
duke@1 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 13 * accompanied this code).
duke@1 14 *
duke@1 15 * You should have received a copy of the GNU General Public License version
duke@1 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 18 *
duke@1 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@1 20 * CA 95054 USA or visit www.sun.com if you need additional information or
duke@1 21 * have any questions.
duke@1 22 *
duke@1 23 */
duke@1 24
duke@1 25 // ciSymbol
duke@1 26 //
duke@1 27 // This class represents a symbolOop in the HotSpot virtual
duke@1 28 // machine.
duke@1 29 class ciSymbol : public ciObject {
duke@1 30 CI_PACKAGE_ACCESS
twisti@4567 31 // These friends all make direct use of get_symbolOop:
duke@1 32 friend class ciEnv;
duke@1 33 friend class ciInstanceKlass;
duke@1 34 friend class ciSignature;
duke@1 35 friend class ciMethod;
duke@1 36 friend class ciObjArrayKlass;
duke@1 37
duke@1 38 private:
duke@1 39 ciSymbol(symbolOop s) : ciObject(s) {}
duke@1 40 ciSymbol(symbolHandle s); // for use with vmSymbolHandles
duke@1 41
twisti@4567 42 symbolOop get_symbolOop() const { return (symbolOop)get_oop(); }
duke@1 43
duke@1 44 const char* type_string() { return "ciSymbol"; }
duke@1 45
duke@1 46 void print_impl(outputStream* st);
duke@1 47
twisti@4567 48 // This is public in symbolOop but private here, because the base can move:
duke@1 49 jbyte* base();
duke@1 50
duke@1 51 // Make a ciSymbol from a C string (implementation).
duke@1 52 static ciSymbol* make_impl(const char* s);
duke@1 53
duke@1 54 public:
duke@1 55 // The text of the symbol as a null-terminated utf8 string.
duke@1 56 const char* as_utf8();
duke@1 57 int utf8_length();
duke@1 58
twisti@4567 59 // Return the i-th utf8 byte, where i < utf8_length
twisti@4567 60 int byte_at(int i);
twisti@4567 61
twisti@4567 62 // Tests if the symbol starts with the given prefix.
twisti@4567 63 bool starts_with(const char* prefix, int len) const;
twisti@4567 64
twisti@4567 65 // Determines where the symbol contains the given substring.
twisti@4567 66 int index_of_at(int i, const char* str, int len) const;
twisti@4567 67
duke@1 68 // What kind of ciObject is this?
duke@1 69 bool is_symbol() { return true; }
duke@1 70
duke@1 71 void print_symbol_on(outputStream* st);
duke@1 72 void print_symbol() {
duke@1 73 print_symbol_on(tty);
duke@1 74 }
duke@1 75
duke@1 76 // Make a ciSymbol from a C string.
duke@1 77 // Consider adding to vmSymbols.hpp instead of using this constructor.
duke@1 78 // (Your code will be less subject to typographical bugs.)
duke@1 79 static ciSymbol* make(const char* s);
duke@1 80
duke@1 81 #define CI_SYMBOL_DECLARE(name, ignore_def) \
duke@1 82 static ciSymbol* name() { return ciObjectFactory::vm_symbol_at(vmSymbols::VM_SYMBOL_ENUM_NAME(name)); }
duke@1 83 VM_SYMBOLS_DO(CI_SYMBOL_DECLARE, CI_SYMBOL_DECLARE)
duke@1 84 #undef CI_SYMBOL_DECLARE
duke@1 85 };