hotspot/src/share/vm/ci/ciObject.hpp
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 1 489c9b5090e2
child 3908 24b55ad4c228
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1999-2006 Sun Microsystems, Inc.  All Rights Reserved.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
// ciObject
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
// This class represents an oop in the HotSpot virtual machine.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
// Its subclasses are structured in a hierarchy which mirrors
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
// an aggregate of the VM's oop and klass hierarchies (see
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
// oopHierarchy.hpp).  Each instance of ciObject holds a handle
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
// to a corresponding oop on the VM side and provides routines
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
// for accessing the information in its oop.  By using the ciObject
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
// hierarchy for accessing oops in the VM, the compiler ensures
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
// that it is safe with respect to garbage collection; that is,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
// GC and compilation can proceed independently without
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
// interference.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
// Within the VM, the oop and klass hierarchies are separate.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
// The compiler interface does not preserve this separation --
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
// the distinction between `klassOop' and `Klass' are not
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
// reflected in the interface and instead the Klass hierarchy
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
// is directly modeled as the subclasses of ciKlass.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
class ciObject : public ResourceObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  CI_PACKAGE_ACCESS
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  friend class ciEnv;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  // A JNI handle referring to an oop in the VM.  This
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  // handle may, in a small set of cases, correctly be NULL.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  jobject  _handle;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  ciKlass* _klass;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  uint     _ident;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  enum { FLAG_BITS   = 1};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  enum {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
         PERM_FLAG    = 1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
       };
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
protected:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  ciObject();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  ciObject(oop o);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  ciObject(Handle h);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  ciObject(ciKlass* klass);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  jobject      handle()  const { return _handle; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  // Get the VM oop that this object holds.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  oop get_oop() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
    assert(_handle != NULL, "null oop");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
    return JNIHandles::resolve_non_null(_handle);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  void set_perm() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
    _ident |=  PERM_FLAG;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  // Virtual behavior of the print() method.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  virtual void print_impl(outputStream* st) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  virtual const char* type_string() { return "ciObject"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
  void set_ident(uint id);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  // The klass of this ciObject.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  ciKlass* klass();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  // A number unique to this object.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  uint ident();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  // Are two ciObjects equal?
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  bool equals(ciObject* obj);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  // A hash value for the convenience of compilers.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  int hash();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  // Tells if this oop has an encoding.  (I.e., is it null or perm?)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  // If it does not have an encoding, the compiler is responsible for
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  // making other arrangements for dealing with the oop.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  // See ciEnv::make_perm_array
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
  bool has_encoding();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  // Is this object guaranteed to be in the permanent part of the heap?
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  // If so, CollectedHeap::can_elide_permanent_oop_store_barriers is relevant.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  // If the answer is false, no guarantees are made.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  bool is_perm() { return (_ident & PERM_FLAG) != 0; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  // The address which the compiler should embed into the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  // generated code to represent this oop.  This address
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  // is not the true address of the oop -- it will get patched
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  // during nmethod creation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  // Usage note: no address arithmetic allowed.  Oop must
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  // be registered with the oopRecorder.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  jobject encoding();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  // What kind of ciObject is this?
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  virtual bool is_null_object() const       { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  virtual bool is_instance()                { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  virtual bool is_method()                  { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  virtual bool is_method_data()             { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  virtual bool is_array()                   { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  virtual bool is_obj_array()               { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  virtual bool is_type_array()              { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  virtual bool is_symbol()                  { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  virtual bool is_type()                    { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  virtual bool is_return_address()          { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  virtual bool is_klass()                   { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  virtual bool is_instance_klass()          { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  virtual bool is_method_klass()            { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  virtual bool is_array_klass()             { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  virtual bool is_obj_array_klass()         { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  virtual bool is_type_array_klass()        { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  virtual bool is_symbol_klass()            { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  virtual bool is_klass_klass()             { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  virtual bool is_instance_klass_klass()    { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  virtual bool is_array_klass_klass()       { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  virtual bool is_obj_array_klass_klass()   { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  virtual bool is_type_array_klass_klass()  { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  // Is this a type or value which has no associated class?
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  // It is true of primitive types and null objects.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  virtual bool is_classless() const         { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  // Is this ciObject a Java Language Object?  That is,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
  // is the ciObject an instance or an array
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
  virtual bool is_java_object()             { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  // Does this ciObject represent a Java Language class?
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  // That is, is the ciObject an instanceKlass or arrayKlass?
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
  virtual bool is_java_klass()              { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
  // Is this ciObject the ciInstanceKlass representing
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  // java.lang.Object()?
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  virtual bool is_java_lang_Object()        { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  // Does this ciObject refer to a real oop in the VM?
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
  // Note: some ciObjects refer to oops which have yet to be
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  // created.  We refer to these as "unloaded".  Specifically,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  // there are unloaded ciMethods, ciObjArrayKlasses, and
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  // ciInstanceKlasses.  By convention the ciNullObject is
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  // considered loaded, and primitive types are considered loaded.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  bool is_loaded() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
    return handle() != NULL || is_classless();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
  // Subclass casting with assertions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  ciNullObject*            as_null_object() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
    assert(is_null_object(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
    return (ciNullObject*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
  ciInstance*              as_instance() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
    assert(is_instance(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
    return (ciInstance*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
  ciMethod*                as_method() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
    assert(is_method(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
    return (ciMethod*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
  ciMethodData*            as_method_data() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
    assert(is_method_data(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
    return (ciMethodData*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  ciArray*                 as_array() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
    assert(is_array(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
    return (ciArray*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  ciObjArray*              as_obj_array() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
    assert(is_obj_array(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
    return (ciObjArray*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
  ciTypeArray*             as_type_array() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
    assert(is_type_array(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
    return (ciTypeArray*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
  ciSymbol*                as_symbol() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
    assert(is_symbol(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
    return (ciSymbol*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
  ciType*                  as_type() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
    assert(is_type(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
    return (ciType*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
  ciReturnAddress*         as_return_address() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
    assert(is_return_address(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
    return (ciReturnAddress*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
  ciKlass*                 as_klass() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
    assert(is_klass(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
    return (ciKlass*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
  ciInstanceKlass*         as_instance_klass() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
    assert(is_instance_klass(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
    return (ciInstanceKlass*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
  ciMethodKlass*           as_method_klass() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
    assert(is_method_klass(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
    return (ciMethodKlass*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
  ciArrayKlass*            as_array_klass() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
    assert(is_array_klass(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
    return (ciArrayKlass*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
  ciObjArrayKlass*         as_obj_array_klass() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
    assert(is_obj_array_klass(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
    return (ciObjArrayKlass*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
  ciTypeArrayKlass*        as_type_array_klass() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
    assert(is_type_array_klass(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
    return (ciTypeArrayKlass*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
  ciSymbolKlass*           as_symbol_klass() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
    assert(is_symbol_klass(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
    return (ciSymbolKlass*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  ciKlassKlass*            as_klass_klass() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
    assert(is_klass_klass(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
    return (ciKlassKlass*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
  ciInstanceKlassKlass*    as_instance_klass_klass() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
    assert(is_instance_klass_klass(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
    return (ciInstanceKlassKlass*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
  ciArrayKlassKlass*       as_array_klass_klass() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
    assert(is_array_klass_klass(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
    return (ciArrayKlassKlass*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
  ciObjArrayKlassKlass*    as_obj_array_klass_klass() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
    assert(is_obj_array_klass_klass(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
    return (ciObjArrayKlassKlass*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
  ciTypeArrayKlassKlass*   as_type_array_klass_klass() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
    assert(is_type_array_klass_klass(), "bad cast");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
    return (ciTypeArrayKlassKlass*)this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
  // Print debugging output about this ciObject.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
  void print(outputStream* st = tty);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
  // Print debugging output about the oop this ciObject represents.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
  void print_oop(outputStream* st = tty);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
};