src/share/vm/ci/ciSymbol.hpp

changeset 1573
dd57230ba8fe
parent 435
a61af66fc99e
child 1862
cd5dbf694d45
     1.1 --- a/src/share/vm/ci/ciSymbol.hpp	Tue Jan 05 13:05:58 2010 +0100
     1.2 +++ b/src/share/vm/ci/ciSymbol.hpp	Tue Jan 05 15:21:25 2010 +0100
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright 1999-2001 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 + * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -28,6 +28,7 @@
    1.11  // machine.
    1.12  class ciSymbol : public ciObject {
    1.13    CI_PACKAGE_ACCESS
    1.14 +  // These friends all make direct use of get_symbolOop:
    1.15    friend class ciEnv;
    1.16    friend class ciInstanceKlass;
    1.17    friend class ciSignature;
    1.18 @@ -38,13 +39,13 @@
    1.19    ciSymbol(symbolOop s) : ciObject(s) {}
    1.20    ciSymbol(symbolHandle s);   // for use with vmSymbolHandles
    1.21  
    1.22 -  symbolOop get_symbolOop() { return (symbolOop)get_oop(); }
    1.23 +  symbolOop get_symbolOop() const { return (symbolOop)get_oop(); }
    1.24  
    1.25    const char* type_string() { return "ciSymbol"; }
    1.26  
    1.27    void print_impl(outputStream* st);
    1.28  
    1.29 -  int         byte_at(int i);
    1.30 +  // This is public in symbolOop but private here, because the base can move:
    1.31    jbyte*      base();
    1.32  
    1.33    // Make a ciSymbol from a C string (implementation).
    1.34 @@ -55,6 +56,15 @@
    1.35    const char* as_utf8();
    1.36    int         utf8_length();
    1.37  
    1.38 +  // Return the i-th utf8 byte, where i < utf8_length
    1.39 +  int         byte_at(int i);
    1.40 +
    1.41 +  // Tests if the symbol starts with the given prefix.
    1.42 +  bool starts_with(const char* prefix, int len) const;
    1.43 +
    1.44 +  // Determines where the symbol contains the given substring.
    1.45 +  int index_of_at(int i, const char* str, int len) const;
    1.46 +
    1.47    // What kind of ciObject is this?
    1.48    bool is_symbol() { return true; }
    1.49  

mercurial