hotspot/src/share/vm/ci/ciObject.cpp
author coleenp
Wed, 15 Feb 2017 22:59:57 -0500
changeset 46271 979ebd346ecf
parent 30764 fec48bf5a827
permissions -rw-r--r--
8169881: Remove implicit Handle conversions oop->Handle Summary: Pass THREAD to Handle as argument instead of implicit Thread::current() call. Reviewed-by: dholmes, sspitsyn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
46271
979ebd346ecf 8169881: Remove implicit Handle conversions oop->Handle
coleenp
parents: 30764
diff changeset
     2
 * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
1
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
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3908
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3908
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3908
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#include "precompiled.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#include "ci/ciObject.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
#include "ci/ciUtilities.hpp"
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29081
diff changeset
    28
#include "gc/shared/collectedHeap.inline.hpp"
29081
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents: 24424
diff changeset
    29
#include "oops/oop.inline.hpp"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
// ciObject
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
// This class represents an oop in the HotSpot virtual machine.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
// Its subclasses are structured in a hierarchy which mirrors
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
// an aggregate of the VM's oop and klass hierarchies (see
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
// oopHierarchy.hpp).  Each instance of ciObject holds a handle
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
// to a corresponding oop on the VM side and provides routines
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
// for accessing the information in its oop.  By using the ciObject
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
// hierarchy for accessing oops in the VM, the compiler ensures
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
// that it is safe with respect to garbage collection; that is,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
// GC and compilation can proceed independently without
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
// interference.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
// Within the VM, the oop and klass hierarchies are separate.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
// The compiler interface does not preserve this separation --
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 10514
diff changeset
    46
// the distinction between `Klass*' and `Klass' are not
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
// reflected in the interface and instead the Klass hierarchy
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
// is directly modeled as the subclasses of ciKlass.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
// ------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
// ciObject::ciObject
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
ciObject::ciObject(oop o) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  ASSERT_IN_VM;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  if (ciObjectFactory::is_initialized()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
    _handle = JNIHandles::make_local(o);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  } else {
46271
979ebd346ecf 8169881: Remove implicit Handle conversions oop->Handle
coleenp
parents: 30764
diff changeset
    57
    Handle obj(Thread::current(), o);
979ebd346ecf 8169881: Remove implicit Handle conversions oop->Handle
coleenp
parents: 30764
diff changeset
    58
    _handle = JNIHandles::make_global(obj);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  _klass = NULL;
3908
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1
diff changeset
    61
  init_flags_from(o);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
// ------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
// ciObject::ciObject
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
ciObject::ciObject(Handle h) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  ASSERT_IN_VM;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  if (ciObjectFactory::is_initialized()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
    _handle = JNIHandles::make_local(h());
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
    _handle = JNIHandles::make_global(h);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  _klass = NULL;
3908
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1
diff changeset
    75
  init_flags_from(h());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
// ------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
// ciObject::ciObject
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
// Unloaded klass/method variant.  `klass' is the klass of the unloaded
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
// klass/method, if that makes sense.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
ciObject::ciObject(ciKlass* klass) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  ASSERT_IN_VM;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  assert(klass != NULL, "must supply klass");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  _handle = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  _klass = klass;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
// ------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
// ciObject::ciObject
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
// NULL variant.  Used only by ciNullObject.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
ciObject::ciObject() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  ASSERT_IN_VM;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  _handle = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  _klass = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
// ------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
// ciObject::klass
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
// Get the ciKlass of this ciObject.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
ciKlass* ciObject::klass() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  if (_klass == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
    if (_handle == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
      // When both _klass and _handle are NULL, we are dealing
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
      // with the distinguished instance of ciNullObject.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
      // No one should ask it for its klass.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
      assert(is_null_object(), "must be null object");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
      ShouldNotReachHere();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
      return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
    GUARDED_VM_ENTRY(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
      oop o = get_oop();
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 10514
diff changeset
   117
      _klass = CURRENT_ENV->get_klass(o->klass());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
    );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  return _klass;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
// ------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
// ciObject::equals
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
// Are two ciObjects equal?
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
bool ciObject::equals(ciObject* obj) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  return (this == obj);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
// ------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
// ciObject::hash
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
// A hash value for the convenience of compilers.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
// Implementation note: we use the address of the ciObject as the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
// basis for the hash.  Use the _ident field, which is well-behaved.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
int ciObject::hash() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  return ident() * 31;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
// ------------------------------------------------------------------
3908
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1
diff changeset
   143
// ciObject::constant_encoding
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
// The address which the compiler should embed into the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
// generated code to represent this oop.  This address
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
// is not the true address of the oop -- it will get patched
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
// during nmethod creation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
// Implementation note: we use the handle as the encoding.  The
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
// nmethod constructor resolves the handle and patches in the oop.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
// This method should be changed to return an generified address
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
// to discourage use of the JNI handle.
3908
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1
diff changeset
   157
jobject ciObject::constant_encoding() {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  assert(is_null_object() || handle() != NULL, "cannot embed null pointer");
3908
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1
diff changeset
   159
  assert(can_be_constant(), "oop must be NULL or perm");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  return handle();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
// ------------------------------------------------------------------
3908
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1
diff changeset
   164
// ciObject::can_be_constant
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1
diff changeset
   165
bool ciObject::can_be_constant() {
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1
diff changeset
   166
  if (ScavengeRootsInCode >= 1)  return true;  // now everybody can encode as a constant
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 10514
diff changeset
   167
  return handle() == NULL;
3908
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1
diff changeset
   168
}
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1
diff changeset
   169
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1
diff changeset
   170
// ------------------------------------------------------------------
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1
diff changeset
   171
// ciObject::should_be_constant()
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1
diff changeset
   172
bool ciObject::should_be_constant() {
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1
diff changeset
   173
  if (ScavengeRootsInCode >= 2)  return true;  // force everybody to be a constant
10514
e229a19078cf 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 9959
diff changeset
   174
  if (is_null_object()) return true;
e229a19078cf 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 9959
diff changeset
   175
e229a19078cf 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 9959
diff changeset
   176
  ciEnv* env = CURRENT_ENV;
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 10514
diff changeset
   177
9332
2c0eaca39eb4 7032162: assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr
never
parents: 7397
diff changeset
   178
    // We want Strings and Classes to be embeddable by default since
2c0eaca39eb4 7032162: assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr
never
parents: 7397
diff changeset
   179
    // they used to be in the perm world.  Not all Strings used to be
2c0eaca39eb4 7032162: assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr
never
parents: 7397
diff changeset
   180
    // embeddable but there's no easy way to distinguish the interned
2c0eaca39eb4 7032162: assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr
never
parents: 7397
diff changeset
   181
    // from the regulars ones so just treat them all that way.
2c0eaca39eb4 7032162: assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr
never
parents: 7397
diff changeset
   182
    if (klass() == env->String_klass() || klass() == env->Class_klass()) {
2c0eaca39eb4 7032162: assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr
never
parents: 7397
diff changeset
   183
      return true;
2c0eaca39eb4 7032162: assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr
never
parents: 7397
diff changeset
   184
    }
24322
c2978d1578e3 8036956: remove EnableInvokeDynamic flag
anoll
parents: 13728
diff changeset
   185
  if (klass()->is_subclass_of(env->MethodHandle_klass()) ||
c2978d1578e3 8036956: remove EnableInvokeDynamic flag
anoll
parents: 13728
diff changeset
   186
      klass()->is_subclass_of(env->CallSite_klass())) {
10514
e229a19078cf 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 9959
diff changeset
   187
    assert(ScavengeRootsInCode >= 1, "must be");
e229a19078cf 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 9959
diff changeset
   188
    // We want to treat these aggressively.
e229a19078cf 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 9959
diff changeset
   189
    return true;
e229a19078cf 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 9959
diff changeset
   190
  }
e229a19078cf 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 9959
diff changeset
   191
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 10514
diff changeset
   192
  return handle() == NULL;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 10514
diff changeset
   195
// ------------------------------------------------------------------
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 10514
diff changeset
   196
// ciObject::should_be_constant()
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 10514
diff changeset
   197
void ciObject::init_flags_from(oop x) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 10514
diff changeset
   198
  int flags = 0;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 10514
diff changeset
   199
  if (x != NULL) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 10514
diff changeset
   200
    assert(Universe::heap()->is_in_reserved(x), "must be");
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 10514
diff changeset
   201
    if (x->is_scavengable())
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 10514
diff changeset
   202
      flags |= SCAVENGABLE_FLAG;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 10514
diff changeset
   203
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 10514
diff changeset
   204
  _ident |= flags;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 10514
diff changeset
   205
}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
// ------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
// ciObject::print
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
// Print debugging output about this ciObject.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
// Implementation note: dispatch to the virtual print_impl behavior
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
// for this ciObject.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
void ciObject::print(outputStream* st) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
  st->print("<%s", type_string());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
  GUARDED_VM_ENTRY(print_impl(st);)
24424
2658d7834c6e 8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents: 24322
diff changeset
   217
  st->print(" ident=%d %s address=" INTPTR_FORMAT ">", ident(),
3908
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1
diff changeset
   218
        is_scavengable() ? "SCAVENGABLE" : "",
24424
2658d7834c6e 8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents: 24322
diff changeset
   219
        p2i((address)this));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
// ------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
// ciObject::print_oop
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
// Print debugging output about the oop this ciObject represents.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
void ciObject::print_oop(outputStream* st) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
  if (is_null_object()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
    st->print_cr("NULL");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
  } else if (!is_loaded()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
    st->print_cr("UNLOADED");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
    GUARDED_VM_ENTRY(get_oop()->print_on(st);)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
}