aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm
diff options
context:
space:
mode:
authorehelin <none@none>2013-06-28 18:28:17 +0200
committerehelin <none@none>2013-06-28 18:28:17 +0200
commit938373dfa565269de5f4d26a00bd88cb28b67c40 (patch)
tree034fa5d3e5607755942784835e749a40792ba4b6 /src/share/vm
parent4eb6fa26b98471f2e92a89a9d1af6fccea363236 (diff)
parent6454c3b2ff78ea26b74c6470bf34881a0ce669f5 (diff)
Merge
Diffstat (limited to 'src/share/vm')
-rw-r--r--src/share/vm/ci/ciObjectFactory.cpp2
-rw-r--r--src/share/vm/classfile/dictionary.cpp2
-rw-r--r--src/share/vm/code/debugInfo.hpp2
-rw-r--r--src/share/vm/code/dependencies.cpp4
-rw-r--r--src/share/vm/code/nmethod.cpp5
-rw-r--r--src/share/vm/code/relocInfo.cpp145
-rw-r--r--src/share/vm/code/relocInfo.hpp126
-rw-r--r--src/share/vm/gc_implementation/g1/heapRegion.cpp2
-rw-r--r--src/share/vm/interpreter/bytecodeInterpreter.cpp9
-rw-r--r--src/share/vm/memory/allocation.cpp7
-rw-r--r--src/share/vm/memory/allocation.hpp1
-rw-r--r--src/share/vm/memory/heapInspection.cpp1
-rw-r--r--src/share/vm/oops/arrayKlass.cpp4
-rw-r--r--src/share/vm/oops/arrayKlass.hpp2
-rw-r--r--src/share/vm/oops/compiledICHolder.cpp2
-rw-r--r--src/share/vm/oops/constMethod.cpp1
-rw-r--r--src/share/vm/oops/constantPool.cpp4
-rw-r--r--src/share/vm/oops/instanceKlass.cpp27
-rw-r--r--src/share/vm/oops/instanceKlass.hpp2
-rw-r--r--src/share/vm/oops/klass.cpp11
-rw-r--r--src/share/vm/oops/klass.hpp4
-rw-r--r--src/share/vm/oops/method.cpp5
-rw-r--r--src/share/vm/oops/objArrayKlass.cpp6
-rw-r--r--src/share/vm/oops/objArrayKlass.hpp2
-rw-r--r--src/share/vm/oops/symbol.cpp4
-rw-r--r--src/share/vm/oops/symbol.hpp19
-rw-r--r--src/share/vm/opto/memnode.cpp18
-rw-r--r--src/share/vm/runtime/atomic.cpp29
-rw-r--r--src/share/vm/runtime/atomic.hpp22
-rw-r--r--src/share/vm/runtime/frame.cpp4
-rw-r--r--src/share/vm/runtime/globals.cpp6
-rw-r--r--src/share/vm/runtime/sharedRuntime.cpp7
-rw-r--r--src/share/vm/runtime/thread.cpp2
-rw-r--r--src/share/vm/runtime/vmStructs.cpp2
-rw-r--r--src/share/vm/shark/sharkBuilder.cpp2
35 files changed, 125 insertions, 366 deletions
diff --git a/src/share/vm/ci/ciObjectFactory.cpp b/src/share/vm/ci/ciObjectFactory.cpp
index 8fb6e12b7..cc1be034d 100644
--- a/src/share/vm/ci/ciObjectFactory.cpp
+++ b/src/share/vm/ci/ciObjectFactory.cpp
@@ -265,8 +265,6 @@ ciObject* ciObjectFactory::get(oop key) {
ciMetadata* ciObjectFactory::get_metadata(Metadata* key) {
ASSERT_IN_VM;
- assert(key == NULL || key->is_metadata(), "must be");
-
#ifdef ASSERT
if (CIObjectFactoryVerify) {
Metadata* last = NULL;
diff --git a/src/share/vm/classfile/dictionary.cpp b/src/share/vm/classfile/dictionary.cpp
index b79cda74f..26e06c8a0 100644
--- a/src/share/vm/classfile/dictionary.cpp
+++ b/src/share/vm/classfile/dictionary.cpp
@@ -555,7 +555,7 @@ void Dictionary::verify() {
loader_data->class_loader() == NULL ||
loader_data->class_loader()->is_instance(),
"checking type of class_loader");
- e->verify();
+ e->verify(/*check_dictionary*/false);
probe->verify_protection_domain_set();
element_count++;
}
diff --git a/src/share/vm/code/debugInfo.hpp b/src/share/vm/code/debugInfo.hpp
index 3f65652d8..7a4f7e2d4 100644
--- a/src/share/vm/code/debugInfo.hpp
+++ b/src/share/vm/code/debugInfo.hpp
@@ -274,7 +274,7 @@ class DebugInfoReadStream : public CompressedReadStream {
Method* read_method() {
Method* o = (Method*)(code()->metadata_at(read_int()));
assert(o == NULL ||
- o->is_metadata(), "meta data only");
+ o->is_metaspace_object(), "meta data only");
return o;
}
ScopeValue* read_object_value();
diff --git a/src/share/vm/code/dependencies.cpp b/src/share/vm/code/dependencies.cpp
index 4db37819e..df269430e 100644
--- a/src/share/vm/code/dependencies.cpp
+++ b/src/share/vm/code/dependencies.cpp
@@ -655,8 +655,8 @@ inline Metadata* Dependencies::DepStream::recorded_metadata_at(int i) {
} else {
o = _deps->oop_recorder()->metadata_at(i);
}
- assert(o == NULL || o->is_metadata(),
- err_msg("Should be perm " PTR_FORMAT, o));
+ assert(o == NULL || o->is_metaspace_object(),
+ err_msg("Should be metadata " PTR_FORMAT, o));
return o;
}
diff --git a/src/share/vm/code/nmethod.cpp b/src/share/vm/code/nmethod.cpp
index 41eb628fb..1dfc3ba8f 100644
--- a/src/share/vm/code/nmethod.cpp
+++ b/src/share/vm/code/nmethod.cpp
@@ -1081,11 +1081,6 @@ void nmethod::fix_oop_relocations(address begin, address end, bool initialize_im
metadata_Relocation* reloc = iter.metadata_reloc();
reloc->fix_metadata_relocation();
}
-
- // There must not be any interfering patches or breakpoints.
- assert(!(iter.type() == relocInfo::breakpoint_type
- && iter.breakpoint_reloc()->active()),
- "no active breakpoint");
}
}
diff --git a/src/share/vm/code/relocInfo.cpp b/src/share/vm/code/relocInfo.cpp
index 679bc290a..4fe6a2e49 100644
--- a/src/share/vm/code/relocInfo.cpp
+++ b/src/share/vm/code/relocInfo.cpp
@@ -338,31 +338,6 @@ void RelocIterator::set_limit(address limit) {
_limit = limit;
}
-
-void PatchingRelocIterator:: prepass() {
- // turn breakpoints off during patching
- _init_state = (*this); // save cursor
- while (next()) {
- if (type() == relocInfo::breakpoint_type) {
- breakpoint_reloc()->set_active(false);
- }
- }
- (RelocIterator&)(*this) = _init_state; // reset cursor for client
-}
-
-
-void PatchingRelocIterator:: postpass() {
- // turn breakpoints back on after patching
- (RelocIterator&)(*this) = _init_state; // reset cursor again
- while (next()) {
- if (type() == relocInfo::breakpoint_type) {
- breakpoint_Relocation* bpt = breakpoint_reloc();
- bpt->set_active(bpt->enabled());
- }
- }
-}
-
-
// All the strange bit-encodings are in here.
// The idea is to encode relocation data which are small integers
// very efficiently (a single extra halfword). Larger chunks of
@@ -704,51 +679,6 @@ void section_word_Relocation::unpack_data() {
_target = address_from_scaled_offset(offset, base);
}
-
-void breakpoint_Relocation::pack_data_to(CodeSection* dest) {
- short* p = (short*) dest->locs_end();
- address point = dest->locs_point();
-
- *p++ = _bits;
-
- assert(_target != NULL, "sanity");
-
- if (internal()) normalize_address(_target, dest);
-
- jint target_bits =
- (jint)( internal() ? scaled_offset (_target, point)
- : runtime_address_to_index(_target) );
- if (settable()) {
- // save space for set_target later
- p = add_jint(p, target_bits);
- } else {
- p = add_var_int(p, target_bits);
- }
-
- for (int i = 0; i < instrlen(); i++) {
- // put placeholder words until bytes can be saved
- p = add_short(p, (short)0x7777);
- }
-
- dest->set_locs_end((relocInfo*) p);
-}
-
-
-void breakpoint_Relocation::unpack_data() {
- _bits = live_bits();
-
- int targetlen = datalen() - 1 - instrlen();
- jint target_bits = 0;
- if (targetlen == 0) target_bits = 0;
- else if (targetlen == 1) target_bits = *(data()+1);
- else if (targetlen == 2) target_bits = relocInfo::jint_from_data(data()+1);
- else { ShouldNotReachHere(); }
-
- _target = internal() ? address_from_scaled_offset(target_bits, addr())
- : index_to_runtime_address (target_bits);
-}
-
-
//// miscellaneous methods
oop* oop_Relocation::oop_addr() {
int n = _oop_index;
@@ -933,81 +863,6 @@ address internal_word_Relocation::target() {
return target;
}
-
-breakpoint_Relocation::breakpoint_Relocation(int kind, address target, bool internal) {
- bool active = false;
- bool enabled = (kind == initialization);
- bool removable = (kind != safepoint);
- bool settable = (target == NULL);
-
- int bits = kind;
- if (enabled) bits |= enabled_state;
- if (internal) bits |= internal_attr;
- if (removable) bits |= removable_attr;
- if (settable) bits |= settable_attr;
-
- _bits = bits | high_bit;
- _target = target;
-
- assert(this->kind() == kind, "kind encoded");
- assert(this->enabled() == enabled, "enabled encoded");
- assert(this->active() == active, "active encoded");
- assert(this->internal() == internal, "internal encoded");
- assert(this->removable() == removable, "removable encoded");
- assert(this->settable() == settable, "settable encoded");
-}
-
-
-address breakpoint_Relocation::target() const {
- return _target;
-}
-
-
-void breakpoint_Relocation::set_target(address x) {
- assert(settable(), "must be settable");
- jint target_bits =
- (jint)(internal() ? scaled_offset (x, addr())
- : runtime_address_to_index(x));
- short* p = &live_bits() + 1;
- p = add_jint(p, target_bits);
- assert(p == instrs(), "new target must fit");
- _target = x;
-}
-
-
-void breakpoint_Relocation::set_enabled(bool b) {
- if (enabled() == b) return;
-
- if (b) {
- set_bits(bits() | enabled_state);
- } else {
- set_active(false); // remove the actual breakpoint insn, if any
- set_bits(bits() & ~enabled_state);
- }
-}
-
-
-void breakpoint_Relocation::set_active(bool b) {
- assert(!b || enabled(), "cannot activate a disabled breakpoint");
-
- if (active() == b) return;
-
- // %%% should probably seize a lock here (might not be the right lock)
- //MutexLockerEx ml_patch(Patching_lock, true);
- //if (active() == b) return; // recheck state after locking
-
- if (b) {
- set_bits(bits() | active_state);
- if (instrlen() == 0)
- fatal("breakpoints in original code must be undoable");
- pd_swap_in_breakpoint (addr(), instrs(), instrlen());
- } else {
- set_bits(bits() & ~active_state);
- pd_swap_out_breakpoint(addr(), instrs(), instrlen());
- }
-}
-
-
//---------------------------------------------------------------------------------
// Non-product code
diff --git a/src/share/vm/code/relocInfo.hpp b/src/share/vm/code/relocInfo.hpp
index 5585b5df7..68a7f3a58 100644
--- a/src/share/vm/code/relocInfo.hpp
+++ b/src/share/vm/code/relocInfo.hpp
@@ -49,9 +49,6 @@ class NativeMovConstReg;
// RelocIterator
// A StackObj which iterates over the relocations associated with
// a range of code addresses. Can be used to operate a copy of code.
-// PatchingRelocIterator
-// Specialized subtype of RelocIterator which removes breakpoints
-// temporarily during iteration, then restores them.
// BoundRelocation
// An _internal_ type shared by packers and unpackers of relocations.
// It pastes together a RelocationHolder with some pointers into
@@ -204,15 +201,6 @@ class NativeMovConstReg;
// immediate field must not straddle a unit of memory coherence.
// //%note reloc_3
//
-// relocInfo::breakpoint_type -- a conditional breakpoint in the code
-// Value: none
-// Instruction types: any whatsoever
-// Data: [b [T]t i...]
-// The b is a bit-packed word representing the breakpoint's attributes.
-// The t is a target address which the breakpoint calls (when it is enabled).
-// The i... is a place to store one or two instruction words overwritten
-// by a trap, so that the breakpoint may be subsequently removed.
-//
// relocInfo::static_stub_type -- an extra stub for each static_call_type
// Value: none
// Instruction types: a virtual call: { set_oop; jump; }
@@ -271,8 +259,8 @@ class relocInfo VALUE_OBJ_CLASS_SPEC {
section_word_type = 9, // internal, but a cross-section reference
poll_type = 10, // polling instruction for safepoints
poll_return_type = 11, // polling instruction for safepoints at return
- breakpoint_type = 12, // an initialization barrier or safepoint
- metadata_type = 13, // metadata that used to be oops
+ metadata_type = 12, // metadata that used to be oops
+ yet_unused_type_1 = 13, // Still unused
yet_unused_type_2 = 14, // Still unused
data_prefix_tag = 15, // tag for a prefix (carries data arguments)
type_mask = 15 // A mask which selects only the above values
@@ -312,7 +300,6 @@ class relocInfo VALUE_OBJ_CLASS_SPEC {
visitor(internal_word) \
visitor(poll) \
visitor(poll_return) \
- visitor(breakpoint) \
visitor(section_word) \
@@ -454,7 +441,7 @@ class relocInfo VALUE_OBJ_CLASS_SPEC {
public:
enum {
// Conservatively large estimate of maximum length (in shorts)
- // of any relocation record (probably breakpoints are largest).
+ // of any relocation record.
// Extended format is length prefix, data words, and tag/offset suffix.
length_limit = 1 + 1 + (3*BytesPerWord/BytesPerShort) + 1,
have_format = format_width > 0
@@ -571,8 +558,6 @@ class RelocIterator : public StackObj {
void initialize(nmethod* nm, address begin, address limit);
- friend class PatchingRelocIterator;
- // make an uninitialized one, for PatchingRelocIterator:
RelocIterator() { initialize_misc(); }
public:
@@ -779,9 +764,6 @@ class Relocation VALUE_OBJ_CLASS_SPEC {
void pd_verify_data_value (address x, intptr_t off) { pd_set_data_value(x, off, true); }
address pd_call_destination (address orig_addr = NULL);
void pd_set_call_destination (address x);
- void pd_swap_in_breakpoint (address x, short* instrs, int instrlen);
- void pd_swap_out_breakpoint (address x, short* instrs, int instrlen);
- static int pd_breakpoint_size ();
// this extracts the address of an address in the code stream instead of the reloc data
address* pd_address_in_code ();
@@ -1302,87 +1284,6 @@ class poll_return_Relocation : public Relocation {
void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest);
};
-
-class breakpoint_Relocation : public Relocation {
- relocInfo::relocType type() { return relocInfo::breakpoint_type; }
-
- enum {
- // attributes which affect the interpretation of the data:
- removable_attr = 0x0010, // buffer [i...] allows for undoing the trap
- internal_attr = 0x0020, // the target is an internal addr (local stub)
- settable_attr = 0x0040, // the target is settable
-
- // states which can change over time:
- enabled_state = 0x0100, // breakpoint must be active in running code
- active_state = 0x0200, // breakpoint instruction actually in code
-
- kind_mask = 0x000F, // mask for extracting kind
- high_bit = 0x4000 // extra bit which is always set
- };
-
- public:
- enum {
- // kinds:
- initialization = 1,
- safepoint = 2
- };
-
- // If target is NULL, 32 bits are reserved for a later set_target().
- static RelocationHolder spec(int kind, address target = NULL, bool internal_target = false) {
- RelocationHolder rh = newHolder();
- new(rh) breakpoint_Relocation(kind, target, internal_target);
- return rh;
- }
-
- private:
- // We require every bits value to NOT to fit into relocInfo::datalen_width,
- // because we are going to actually store state in the reloc, and so
- // cannot allow it to be compressed (and hence copied by the iterator).
-
- short _bits; // bit-encoded kind, attrs, & state
- address _target;
-
- breakpoint_Relocation(int kind, address target, bool internal_target);
-
- friend class RelocIterator;
- breakpoint_Relocation() { }
-
- short bits() const { return _bits; }
- short& live_bits() const { return data()[0]; }
- short* instrs() const { return data() + datalen() - instrlen(); }
- int instrlen() const { return removable() ? pd_breakpoint_size() : 0; }
-
- void set_bits(short x) {
- assert(live_bits() == _bits, "must be the only mutator of reloc info");
- live_bits() = _bits = x;
- }
-
- public:
- address target() const;
- void set_target(address x);
-
- int kind() const { return bits() & kind_mask; }
- bool enabled() const { return (bits() & enabled_state) != 0; }
- bool active() const { return (bits() & active_state) != 0; }
- bool internal() const { return (bits() & internal_attr) != 0; }
- bool removable() const { return (bits() & removable_attr) != 0; }
- bool settable() const { return (bits() & settable_attr) != 0; }
-
- void set_enabled(bool b); // to activate, you must also say set_active
- void set_active(bool b); // actually inserts bpt (must be enabled 1st)
-
- // data is packed as 16 bits, followed by the target (1 or 2 words), followed
- // if necessary by empty storage for saving away original instruction bytes.
- void pack_data_to(CodeSection* dest);
- void unpack_data();
-
- // during certain operations, breakpoints must be out of the way:
- void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
- assert(!active(), "cannot perform relocation on enabled breakpoints");
- }
-};
-
-
// We know all the xxx_Relocation classes, so now we can define these:
#define EACH_CASE(name) \
inline name##_Relocation* RelocIterator::name##_reloc() { \
@@ -1401,25 +1302,4 @@ inline RelocIterator::RelocIterator(nmethod* nm, address begin, address limit) {
initialize(nm, begin, limit);
}
-// if you are going to patch code, you should use this subclass of
-// RelocIterator
-class PatchingRelocIterator : public RelocIterator {
- private:
- RelocIterator _init_state;
-
- void prepass(); // deactivates all breakpoints
- void postpass(); // reactivates all enabled breakpoints
-
- // do not copy these puppies; it would have unpredictable side effects
- // these are private and have no bodies defined because they should not be called
- PatchingRelocIterator(const RelocIterator&);
- void operator=(const RelocIterator&);
-
- public:
- PatchingRelocIterator(nmethod* nm, address begin = NULL, address limit = NULL)
- : RelocIterator(nm, begin, limit) { prepass(); }
-
- ~PatchingRelocIterator() { postpass(); }
-};
-
#endif // SHARE_VM_CODE_RELOCINFO_HPP
diff --git a/src/share/vm/gc_implementation/g1/heapRegion.cpp b/src/share/vm/gc_implementation/g1/heapRegion.cpp
index 7ef24358e..22c84ec81 100644
--- a/src/share/vm/gc_implementation/g1/heapRegion.cpp
+++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp
@@ -798,7 +798,7 @@ void HeapRegion::verify(VerifyOption vo,
if (!g1->is_obj_dead_cond(obj, this, vo)) {
if (obj->is_oop()) {
Klass* klass = obj->klass();
- if (!klass->is_metadata()) {
+ if (!klass->is_metaspace_object()) {
gclog_or_tty->print_cr("klass "PTR_FORMAT" of object "PTR_FORMAT" "
"not metadata", klass, obj);
*failures = true;
diff --git a/src/share/vm/interpreter/bytecodeInterpreter.cpp b/src/share/vm/interpreter/bytecodeInterpreter.cpp
index 8f0ec849c..b51ba8705 100644
--- a/src/share/vm/interpreter/bytecodeInterpreter.cpp
+++ b/src/share/vm/interpreter/bytecodeInterpreter.cpp
@@ -481,9 +481,9 @@ BytecodeInterpreter::run(interpreterState istate) {
// So we have a second version of the assertion which handles the case where EnableInvokeDynamic was
// switched off because of the wrong classes.
if (EnableInvokeDynamic || FLAG_IS_CMDLINE(EnableInvokeDynamic)) {
- assert(abs(istate->_stack_base - istate->_stack_limit) == (istate->_method->max_stack() + 1), "bad stack limit");
+ assert(labs(istate->_stack_base - istate->_stack_limit) == (istate->_method->max_stack() + 1), "bad stack limit");
} else {
- const int extra_stack_entries = Method::extra_stack_entries_for_indy;
+ const int extra_stack_entries = Method::extra_stack_entries_for_jsr292;
assert(labs(istate->_stack_base - istate->_stack_limit) == (istate->_method->max_stack() + extra_stack_entries
+ 1), "bad stack limit");
}
@@ -2233,7 +2233,7 @@ run:
}
Method* method = cache->f1_as_method();
- VERIFY_OOP(method);
+ if (VerifyOops) method->verify();
if (cache->has_appendix()) {
ConstantPool* constants = METHOD->constants();
@@ -2265,8 +2265,7 @@ run:
}
Method* method = cache->f1_as_method();
-
- VERIFY_OOP(method);
+ if (VerifyOops) method->verify();
if (cache->has_appendix()) {
ConstantPool* constants = METHOD->constants();
diff --git a/src/share/vm/memory/allocation.cpp b/src/share/vm/memory/allocation.cpp
index 6b08c13e5..5d934fa29 100644
--- a/src/share/vm/memory/allocation.cpp
+++ b/src/share/vm/memory/allocation.cpp
@@ -71,13 +71,6 @@ bool MetaspaceObj::is_shared() const {
return MetaspaceShared::is_in_shared_space(this);
}
-bool MetaspaceObj::is_metadata() const {
- // GC Verify checks use this in guarantees.
- // TODO: either replace them with is_metaspace_object() or remove them.
- // is_metaspace_object() is slower than this test. This test doesn't
- // seem very useful for metaspace objects anymore though.
- return !Universe::heap()->is_in_reserved(this);
-}
bool MetaspaceObj::is_metaspace_object() const {
return Metaspace::contains((void*)this);
diff --git a/src/share/vm/memory/allocation.hpp b/src/share/vm/memory/allocation.hpp
index 4f5b7d9f9..011c98068 100644
--- a/src/share/vm/memory/allocation.hpp
+++ b/src/share/vm/memory/allocation.hpp
@@ -264,7 +264,6 @@ class ClassLoaderData;
class MetaspaceObj {
public:
- bool is_metadata() const;
bool is_metaspace_object() const; // more specific test but slower
bool is_shared() const;
void print_address_on(outputStream* st) const; // nonvirtual address printing
diff --git a/src/share/vm/memory/heapInspection.cpp b/src/share/vm/memory/heapInspection.cpp
index 2afecb680..bf65c882c 100644
--- a/src/share/vm/memory/heapInspection.cpp
+++ b/src/share/vm/memory/heapInspection.cpp
@@ -157,7 +157,6 @@ KlassInfoTable::~KlassInfoTable() {
}
uint KlassInfoTable::hash(const Klass* p) {
- assert(p->is_metadata(), "all klasses are metadata");
return (uint)(((uintptr_t)p - (uintptr_t)_ref) >> 2);
}
diff --git a/src/share/vm/oops/arrayKlass.cpp b/src/share/vm/oops/arrayKlass.cpp
index dc2fbe92e..ef1c20e97 100644
--- a/src/share/vm/oops/arrayKlass.cpp
+++ b/src/share/vm/oops/arrayKlass.cpp
@@ -221,8 +221,8 @@ void ArrayKlass::oop_print_on(oop obj, outputStream* st) {
// Verification
-void ArrayKlass::verify_on(outputStream* st) {
- Klass::verify_on(st);
+void ArrayKlass::verify_on(outputStream* st, bool check_dictionary) {
+ Klass::verify_on(st, check_dictionary);
if (component_mirror() != NULL) {
guarantee(component_mirror()->klass() != NULL, "should have a class");
diff --git a/src/share/vm/oops/arrayKlass.hpp b/src/share/vm/oops/arrayKlass.hpp
index f37a4d500..acf920e16 100644
--- a/src/share/vm/oops/arrayKlass.hpp
+++ b/src/share/vm/oops/arrayKlass.hpp
@@ -152,7 +152,7 @@ class ArrayKlass: public Klass {
void oop_print_on(oop obj, outputStream* st);
// Verification
- void verify_on(outputStream* st);
+ void verify_on(outputStream* st, bool check_dictionary);
void oop_verify_on(oop obj, outputStream* st);
};
diff --git a/src/share/vm/oops/compiledICHolder.cpp b/src/share/vm/oops/compiledICHolder.cpp
index c13b7559a..2b2cd2ae6 100644
--- a/src/share/vm/oops/compiledICHolder.cpp
+++ b/src/share/vm/oops/compiledICHolder.cpp
@@ -48,8 +48,6 @@ void CompiledICHolder::print_value_on(outputStream* st) const {
// Verification
void CompiledICHolder::verify_on(outputStream* st) {
- guarantee(holder_method()->is_metadata(), "should be in metaspace");
guarantee(holder_method()->is_method(), "should be method");
- guarantee(holder_klass()->is_metadata(), "should be in metaspace");
guarantee(holder_klass()->is_klass(), "should be klass");
}
diff --git a/src/share/vm/oops/constMethod.cpp b/src/share/vm/oops/constMethod.cpp
index 22f3b87da..4c0720908 100644
--- a/src/share/vm/oops/constMethod.cpp
+++ b/src/share/vm/oops/constMethod.cpp
@@ -440,7 +440,6 @@ void ConstMethod::collect_statistics(KlassSizeStats *sz) const {
void ConstMethod::verify_on(outputStream* st) {
guarantee(is_constMethod(), "object must be constMethod");
- guarantee(is_metadata(), err_msg("Should be metadata " PTR_FORMAT, this));
// Verification can occur during oop construction before the method or
// other fields have been initialized.
diff --git a/src/share/vm/oops/constantPool.cpp b/src/share/vm/oops/constantPool.cpp
index c2879e2d0..8033d7e38 100644
--- a/src/share/vm/oops/constantPool.cpp
+++ b/src/share/vm/oops/constantPool.cpp
@@ -2095,12 +2095,10 @@ void ConstantPool::verify_on(outputStream* st) {
CPSlot entry = slot_at(i);
if (tag.is_klass()) {
if (entry.is_resolved()) {
- guarantee(entry.get_klass()->is_metadata(), "should be metadata");
guarantee(entry.get_klass()->is_klass(), "should be klass");
}
} else if (tag.is_unresolved_klass()) {
if (entry.is_resolved()) {
- guarantee(entry.get_klass()->is_metadata(), "should be metadata");
guarantee(entry.get_klass()->is_klass(), "should be klass");
}
} else if (tag.is_symbol()) {
@@ -2112,13 +2110,11 @@ void ConstantPool::verify_on(outputStream* st) {
if (cache() != NULL) {
// Note: cache() can be NULL before a class is completely setup or
// in temporary constant pools used during constant pool merging
- guarantee(cache()->is_metadata(), "should be metadata");
guarantee(cache()->is_constantPoolCache(), "should be constant pool cache");
}
if (pool_holder() != NULL) {
// Note: pool_holder() can be NULL in temporary constant pools
// used during constant pool merging
- guarantee(pool_holder()->is_metadata(), "should be metadata");
guarantee(pool_holder()->is_klass(), "should be klass");
}
}
diff --git a/src/share/vm/oops/instanceKlass.cpp b/src/share/vm/oops/instanceKlass.cpp
index 84f1cdd3e..886746d6b 100644
--- a/src/share/vm/oops/instanceKlass.cpp
+++ b/src/share/vm/oops/instanceKlass.cpp
@@ -3088,27 +3088,26 @@ class VerifyFieldClosure: public OopClosure {
virtual void do_oop(narrowOop* p) { VerifyFieldClosure::do_oop_work(p); }
};
-void InstanceKlass::verify_on(outputStream* st) {
- Klass::verify_on(st);
- Thread *thread = Thread::current();
-
+void InstanceKlass::verify_on(outputStream* st, bool check_dictionary) {
#ifndef PRODUCT
- // Avoid redundant verifies
+ // Avoid redundant verifies, this really should be in product.
if (_verify_count == Universe::verify_count()) return;
_verify_count = Universe::verify_count();
#endif
- // Verify that klass is present in SystemDictionary
- if (is_loaded() && !is_anonymous()) {
+
+ // Verify Klass
+ Klass::verify_on(st, check_dictionary);
+
+ // Verify that klass is present in SystemDictionary if not already
+ // verifying the SystemDictionary.
+ if (is_loaded() && !is_anonymous() && check_dictionary) {
Symbol* h_name = name();
SystemDictionary::verify_obj_klass_present(h_name, class_loader_data());
}
- // Verify static fields
- VerifyFieldClosure blk;
-
// Verify vtables
if (is_linked()) {
- ResourceMark rm(thread);
+ ResourceMark rm;
// $$$ This used to be done only for m/s collections. Doing it
// always seemed a valid generalization. (DLD -- 6/00)
vtable()->verify(st);
@@ -3116,7 +3115,6 @@ void InstanceKlass::verify_on(outputStream* st) {
// Verify first subklass
if (subklass_oop() != NULL) {
- guarantee(subklass_oop()->is_metadata(), "should be in metaspace");
guarantee(subklass_oop()->is_klass(), "should be klass");
}
@@ -3128,7 +3126,6 @@ void InstanceKlass::verify_on(outputStream* st) {
fatal(err_msg("subclass points to itself " PTR_FORMAT, sib));
}
- guarantee(sib->is_metadata(), "should be in metaspace");
guarantee(sib->is_klass(), "should be klass");
guarantee(sib->super() == super, "siblings should have same superklass");
}
@@ -3164,7 +3161,6 @@ void InstanceKlass::verify_on(outputStream* st) {
if (methods() != NULL) {
Array<Method*>* methods = this->methods();
for (int j = 0; j < methods->length(); j++) {
- guarantee(methods->at(j)->is_metadata(), "should be in metaspace");
guarantee(methods->at(j)->is_method(), "non-method in methods array");
}
for (int j = 0; j < methods->length() - 1; j++) {
@@ -3202,16 +3198,13 @@ void InstanceKlass::verify_on(outputStream* st) {
// Verify other fields
if (array_klasses() != NULL) {
- guarantee(array_klasses()->is_metadata(), "should be in metaspace");
guarantee(array_klasses()->is_klass(), "should be klass");
}
if (constants() != NULL) {
- guarantee(constants()->is_metadata(), "should be in metaspace");
guarantee(constants()->is_constantPool(), "should be constant pool");
}
const Klass* host = host_klass();
if (host != NULL) {
- guarantee(host->is_metadata(), "should be in metaspace");
guarantee(host->is_klass(), "should be klass");
}
}
diff --git a/src/share/vm/oops/instanceKlass.hpp b/src/share/vm/oops/instanceKlass.hpp
index 7d09f8132..6c56a5195 100644
--- a/src/share/vm/oops/instanceKlass.hpp
+++ b/src/share/vm/oops/instanceKlass.hpp
@@ -1050,7 +1050,7 @@ public:
const char* internal_name() const;
// Verification
- void verify_on(outputStream* st);
+ void verify_on(outputStream* st, bool check_dictionary);
void oop_verify_on(oop obj, outputStream* st);
};
diff --git a/src/share/vm/oops/klass.cpp b/src/share/vm/oops/klass.cpp
index 473942556..a719b88bb 100644
--- a/src/share/vm/oops/klass.cpp
+++ b/src/share/vm/oops/klass.cpp
@@ -377,7 +377,6 @@ void Klass::append_to_sibling_list() {
}
bool Klass::is_loader_alive(BoolObjectClosure* is_alive) {
- assert(is_metadata(), "p is not meta-data");
assert(ClassLoaderDataGraph::contains((address)this), "is in the metaspace");
#ifdef ASSERT
@@ -648,27 +647,24 @@ void Klass::collect_statistics(KlassSizeStats *sz) const {
// Verification
-void Klass::verify_on(outputStream* st) {
- guarantee(!Universe::heap()->is_in_reserved(this), "Shouldn't be");
- guarantee(this->is_metadata(), "should be in metaspace");
+void Klass::verify_on(outputStream* st, bool check_dictionary) {
+ // This can be expensive, but it is worth checking that this klass is actually
+ // in the CLD graph but not in production.
assert(ClassLoaderDataGraph::contains((address)this), "Should be");
guarantee(this->is_klass(),"should be klass");
if (super() != NULL) {
- guarantee(super()->is_metadata(), "should be in metaspace");
guarantee(super()->is_klass(), "should be klass");
}
if (secondary_super_cache() != NULL) {
Klass* ko = secondary_super_cache();
- guarantee(ko->is_metadata(), "should be in metaspace");
guarantee(ko->is_klass(), "should be klass");
}
for ( uint i = 0; i < primary_super_limit(); i++ ) {
Klass* ko = _primary_supers[i];
if (ko != NULL) {
- guarantee(ko->is_metadata(), "should be in metaspace");
guarantee(ko->is_klass(), "should be klass");
}
}
@@ -680,7 +676,6 @@ void Klass::verify_on(outputStream* st) {
void Klass::oop_verify_on(oop obj, outputStream* st) {
guarantee(obj->is_oop(), "should be oop");
- guarantee(obj->klass()->is_metadata(), "should not be in Java heap");
guarantee(obj->klass()->is_klass(), "klass field is not a klass");
}
diff --git a/src/share/vm/oops/klass.hpp b/src/share/vm/oops/klass.hpp
index 6b0103abb..5f4094d4f 100644
--- a/src/share/vm/oops/klass.hpp
+++ b/src/share/vm/oops/klass.hpp
@@ -703,8 +703,8 @@ class Klass : public Metadata {
virtual const char* internal_name() const = 0;
// Verification
- virtual void verify_on(outputStream* st);
- void verify() { verify_on(tty); }
+ virtual void verify_on(outputStream* st, bool check_dictionary);
+ void verify(bool check_dictionary = true) { verify_on(tty, check_dictionary); }
#ifndef PRODUCT
void verify_vtable_index(int index);
diff --git a/src/share/vm/oops/method.cpp b/src/share/vm/oops/method.cpp
index 1e8b1c3bb..5941efb3b 100644
--- a/src/share/vm/oops/method.cpp
+++ b/src/share/vm/oops/method.cpp
@@ -1969,14 +1969,9 @@ void Method::collect_statistics(KlassSizeStats *sz) const {
void Method::verify_on(outputStream* st) {
guarantee(is_method(), "object must be method");
- guarantee(is_metadata(), "should be metadata");
guarantee(constants()->is_constantPool(), "should be constant pool");
- guarantee(constants()->is_metadata(), "should be metadata");
guarantee(constMethod()->is_constMethod(), "should be ConstMethod*");
- guarantee(constMethod()->is_metadata(), "should be metadata");
MethodData* md = method_data();
guarantee(md == NULL ||
- md->is_metadata(), "should be metadata");
- guarantee(md == NULL ||
md->is_methodData(), "should be method data");
}
diff --git a/src/share/vm/oops/objArrayKlass.cpp b/src/share/vm/oops/objArrayKlass.cpp
index f04020639..f2f349106 100644
--- a/src/share/vm/oops/objArrayKlass.cpp
+++ b/src/share/vm/oops/objArrayKlass.cpp
@@ -676,11 +676,9 @@ const char* ObjArrayKlass::internal_name() const {
// Verification
-void ObjArrayKlass::verify_on(outputStream* st) {
- ArrayKlass::verify_on(st);
- guarantee(element_klass()->is_metadata(), "should be in metaspace");
+void ObjArrayKlass::verify_on(outputStream* st, bool check_dictionary) {
+ ArrayKlass::verify_on(st, check_dictionary);
guarantee(element_klass()->is_klass(), "should be klass");
- guarantee(bottom_klass()->is_metadata(), "should be in metaspace");
guarantee(bottom_klass()->is_klass(), "should be klass");
Klass* bk = bottom_klass();
guarantee(bk->oop_is_instance() || bk->oop_is_typeArray(), "invalid bottom klass");
diff --git a/src/share/vm/oops/objArrayKlass.hpp b/src/share/vm/oops/objArrayKlass.hpp
index 9905704cc..d56a3de84 100644
--- a/src/share/vm/oops/objArrayKlass.hpp
+++ b/src/share/vm/oops/objArrayKlass.hpp
@@ -151,7 +151,7 @@ class ObjArrayKlass : public ArrayKlass {
const char* internal_name() const;
// Verification
- void verify_on(outputStream* st);
+ void verify_on(outputStream* st, bool check_dictionary);
void oop_verify_on(oop obj, outputStream* st);
};
diff --git a/src/share/vm/oops/symbol.cpp b/src/share/vm/oops/symbol.cpp
index 8ee933bf1..f5fdfec99 100644
--- a/src/share/vm/oops/symbol.cpp
+++ b/src/share/vm/oops/symbol.cpp
@@ -32,7 +32,9 @@
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
-Symbol::Symbol(const u1* name, int length, int refcount) : _refcount(refcount), _length(length) {
+Symbol::Symbol(const u1* name, int length, int refcount) {
+ _refcount = refcount;
+ _length = length;
_identity_hash = os::random();
for (int i = 0; i < _length; i++) {
byte_at_put(i, name[i]);
diff --git a/src/share/vm/oops/symbol.hpp b/src/share/vm/oops/symbol.hpp
index d06edf052..a71bdd454 100644
--- a/src/share/vm/oops/symbol.hpp
+++ b/src/share/vm/oops/symbol.hpp
@@ -27,6 +27,7 @@
#include "utilities/utf8.hpp"
#include "memory/allocation.hpp"
+#include "runtime/atomic.hpp"
// A Symbol is a canonicalized string.
// All Symbols reside in global SymbolTable and are reference counted.
@@ -101,14 +102,22 @@
// type without virtual functions.
class ClassLoaderData;
-class Symbol : public MetaspaceObj {
+// We separate the fields in SymbolBase from Symbol::_body so that
+// Symbol::size(int) can correctly calculate the space needed.
+class SymbolBase : public MetaspaceObj {
+ public:
+ ATOMIC_SHORT_PAIR(
+ volatile short _refcount, // needs atomic operation
+ unsigned short _length // number of UTF8 characters in the symbol (does not need atomic op)
+ );
+ int _identity_hash;
+};
+
+class Symbol : private SymbolBase {
friend class VMStructs;
friend class SymbolTable;
friend class MoveSymbols;
private:
- volatile int _refcount;
- int _identity_hash;
- unsigned short _length; // number of UTF8 characters in the symbol
jbyte _body[1];
enum {
@@ -117,7 +126,7 @@ class Symbol : public MetaspaceObj {
};
static int size(int length) {
- size_t sz = heap_word_size(sizeof(Symbol) + (length > 0 ? length - 1 : 0));
+ size_t sz = heap_word_size(sizeof(SymbolBase) + (length > 0 ? length : 0));
return align_object_size(sz);
}
diff --git a/src/share/vm/opto/memnode.cpp b/src/share/vm/opto/memnode.cpp
index 30acf3513..aa03b5ff6 100644
--- a/src/share/vm/opto/memnode.cpp
+++ b/src/share/vm/opto/memnode.cpp
@@ -2943,11 +2943,19 @@ Node *MemBarNode::Ideal(PhaseGVN *phase, bool can_reshape) {
Node* my_mem = in(MemBarNode::Precedent);
// The MembarAquire may keep an unused LoadNode alive through the Precedent edge
if ((my_mem != NULL) && (opc == Op_MemBarAcquire) && (my_mem->outcnt() == 1)) {
- assert(my_mem->unique_out() == this, "sanity");
- phase->hash_delete(this);
- del_req(Precedent);
- phase->is_IterGVN()->_worklist.push(my_mem); // remove dead node later
- my_mem = NULL;
+ // if the Precedent is a decodeN and its input (a Load) is used at more than one place,
+ // replace this Precedent (decodeN) with the Load instead.
+ if ((my_mem->Opcode() == Op_DecodeN) && (my_mem->in(1)->outcnt() > 1)) {
+ Node* load_node = my_mem->in(1);
+ set_req(MemBarNode::Precedent, load_node);
+ phase->is_IterGVN()->_worklist.push(my_mem);
+ my_mem = load_node;
+ } else {
+ assert(my_mem->unique_out() == this, "sanity");
+ del_req(Precedent);
+ phase->is_IterGVN()->_worklist.push(my_mem); // remove dead node later
+ my_mem = NULL;
+ }
}
if (my_mem != NULL && my_mem->is_Mem()) {
const TypeOopPtr* t_oop = my_mem->in(MemNode::Address)->bottom_type()->isa_oopptr();
diff --git a/src/share/vm/runtime/atomic.cpp b/src/share/vm/runtime/atomic.cpp
index dbb66b2f6..87c80ad33 100644
--- a/src/share/vm/runtime/atomic.cpp
+++ b/src/share/vm/runtime/atomic.cpp
@@ -80,3 +80,32 @@ jlong Atomic::add(jlong add_value, volatile jlong* dest) {
}
return old;
}
+
+void Atomic::inc(volatile short* dest) {
+ // Most platforms do not support atomic increment on a 2-byte value. However,
+ // if the value occupies the most significant 16 bits of an aligned 32-bit
+ // word, then we can do this with an atomic add of 0x10000 to the 32-bit word.
+ //
+ // The least significant parts of this 32-bit word will never be affected, even
+ // in case of overflow/underflow.
+ //
+ // Use the ATOMIC_SHORT_PAIR macro to get the desired alignment.
+#ifdef VM_LITTLE_ENDIAN
+ assert((intx(dest) & 0x03) == 0x02, "wrong alignment");
+ (void)Atomic::add(0x10000, (volatile int*)(dest-1));
+#else
+ assert((intx(dest) & 0x03) == 0x00, "wrong alignment");
+ (void)Atomic::add(0x10000, (volatile int*)(dest));
+#endif
+}
+
+void Atomic::dec(volatile short* dest) {
+#ifdef VM_LITTLE_ENDIAN
+ assert((intx(dest) & 0x03) == 0x02, "wrong alignment");
+ (void)Atomic::add(-0x10000, (volatile int*)(dest-1));
+#else
+ assert((intx(dest) & 0x03) == 0x00, "wrong alignment");
+ (void)Atomic::add(-0x10000, (volatile int*)(dest));
+#endif
+}
+
diff --git a/src/share/vm/runtime/atomic.hpp b/src/share/vm/runtime/atomic.hpp
index ae40def88..3f35c3de2 100644
--- a/src/share/vm/runtime/atomic.hpp
+++ b/src/share/vm/runtime/atomic.hpp
@@ -64,11 +64,13 @@ class Atomic : AllStatic {
// Atomically increment location
inline static void inc (volatile jint* dest);
+ static void inc (volatile jshort* dest);
inline static void inc_ptr(volatile intptr_t* dest);
inline static void inc_ptr(volatile void* dest);
// Atomically decrement a location
inline static void dec (volatile jint* dest);
+ static void dec (volatile jshort* dest);
inline static void dec_ptr(volatile intptr_t* dest);
inline static void dec_ptr(volatile void* dest);
@@ -95,4 +97,24 @@ class Atomic : AllStatic {
inline static void* cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value);
};
+// To use Atomic::inc(jshort* dest) and Atomic::dec(jshort* dest), the address must be specially
+// aligned, such that (*dest) occupies the upper 16 bits of an aligned 32-bit word. The best way to
+// achieve is to place your short value next to another short value, which doesn't need atomic ops.
+//
+// Example
+// ATOMIC_SHORT_PAIR(
+// volatile short _refcount, // needs atomic operation
+// unsigned short _length // number of UTF8 characters in the symbol (does not need atomic op)
+// );
+
+#ifdef VM_LITTLE_ENDIAN
+#define ATOMIC_SHORT_PAIR(atomic_decl, non_atomic_decl) \
+ non_atomic_decl; \
+ atomic_decl
+#else
+#define ATOMIC_SHORT_PAIR(atomic_decl, non_atomic_decl) \
+ atomic_decl ; \
+ non_atomic_decl
+#endif
+
#endif // SHARE_VM_RUNTIME_ATOMIC_HPP
diff --git a/src/share/vm/runtime/frame.cpp b/src/share/vm/runtime/frame.cpp
index e5caf604d..92af92e92 100644
--- a/src/share/vm/runtime/frame.cpp
+++ b/src/share/vm/runtime/frame.cpp
@@ -387,7 +387,6 @@ void frame::interpreter_frame_set_locals(intptr_t* locs) {
Method* frame::interpreter_frame_method() const {
assert(is_interpreted_frame(), "interpreted frame expected");
Method* m = *interpreter_frame_method_addr();
- assert(m->is_metadata(), "bad Method* in interpreter frame");
assert(m->is_method(), "not a Method*");
return m;
}
@@ -713,7 +712,8 @@ void frame::print_on_error(outputStream* st, char* buf, int buflen, bool verbose
Method* m = ((nmethod *)_cb)->method();
if (m != NULL) {
m->name_and_sig_as_C_string(buf, buflen);
- st->print("J %s", buf);
+ st->print("J %s @ " PTR_FORMAT " [" PTR_FORMAT "+" SIZE_FORMAT "]",
+ buf, _pc, _cb->code_begin(), _pc - _cb->code_begin());
} else {
st->print("J " PTR_FORMAT, pc());
}
diff --git a/src/share/vm/runtime/globals.cpp b/src/share/vm/runtime/globals.cpp
index 9d0b938fa..b45e15c95 100644
--- a/src/share/vm/runtime/globals.cpp
+++ b/src/share/vm/runtime/globals.cpp
@@ -73,12 +73,6 @@ bool Flag::is_unlocked() const {
strcmp(kind, "{C2 diagnostic}") == 0 ||
strcmp(kind, "{ARCH diagnostic}") == 0 ||
strcmp(kind, "{Shark diagnostic}") == 0) {
- if (strcmp(name, "EnableInvokeDynamic") == 0 && UnlockExperimentalVMOptions && !UnlockDiagnosticVMOptions) {
- // transitional logic to allow tests to run until they are changed
- static int warned;
- if (++warned == 1) warning("Use -XX:+UnlockDiagnosticVMOptions before EnableInvokeDynamic flag");
- return true;
- }
return UnlockDiagnosticVMOptions;
} else if (strcmp(kind, "{experimental}") == 0 ||
strcmp(kind, "{C2 experimental}") == 0 ||
diff --git a/src/share/vm/runtime/sharedRuntime.cpp b/src/share/vm/runtime/sharedRuntime.cpp
index c9f37f4e2..874f59391 100644
--- a/src/share/vm/runtime/sharedRuntime.cpp
+++ b/src/share/vm/runtime/sharedRuntime.cpp
@@ -813,8 +813,11 @@ address SharedRuntime::continuation_for_implicit_exception(JavaThread* thread,
// 3. Implict null exception in nmethod
if (!cb->is_nmethod()) {
- guarantee(cb->is_adapter_blob() || cb->is_method_handles_adapter_blob(),
- "exception happened outside interpreter, nmethods and vtable stubs (1)");
+ bool is_in_blob = cb->is_adapter_blob() || cb->is_method_handles_adapter_blob();
+ if (!is_in_blob) {
+ cb->print();
+ fatal(err_msg("exception happened outside interpreter, nmethods and vtable stubs at pc " INTPTR_FORMAT, pc));
+ }
Events::log_exception(thread, "NullPointerException in code blob at " INTPTR_FORMAT, pc);
// There is no handler here, so we will simply unwind.
return StubRoutines::throw_NullPointerException_at_call_entry();
diff --git a/src/share/vm/runtime/thread.cpp b/src/share/vm/runtime/thread.cpp
index 79642c2e4..eb2e256b1 100644
--- a/src/share/vm/runtime/thread.cpp
+++ b/src/share/vm/runtime/thread.cpp
@@ -220,7 +220,7 @@ Thread::Thread() {
set_osthread(NULL);
set_resource_area(new (mtThread)ResourceArea());
set_handle_area(new (mtThread) HandleArea(NULL));
- set_metadata_handles(new (ResourceObj::C_HEAP, mtClass) GrowableArray<Metadata*>(300, true));
+ set_metadata_handles(new (ResourceObj::C_HEAP, mtClass) GrowableArray<Metadata*>(30, true));
set_active_handles(NULL);
set_free_handle_block(NULL);
set_last_handle_mark(NULL);
diff --git a/src/share/vm/runtime/vmStructs.cpp b/src/share/vm/runtime/vmStructs.cpp
index dff270f16..caf785a2c 100644
--- a/src/share/vm/runtime/vmStructs.cpp
+++ b/src/share/vm/runtime/vmStructs.cpp
@@ -379,7 +379,7 @@ typedef BinaryTreeDictionary<Metablock, FreeList> MetablockTreeDictionary;
nonstatic_field(ConstMethod, _size_of_parameters, u2) \
nonstatic_field(ObjArrayKlass, _element_klass, Klass*) \
nonstatic_field(ObjArrayKlass, _bottom_klass, Klass*) \
- volatile_nonstatic_field(Symbol, _refcount, int) \
+ volatile_nonstatic_field(Symbol, _refcount, short) \
nonstatic_field(Symbol, _identity_hash, int) \
nonstatic_field(Symbol, _length, unsigned short) \
unchecked_nonstatic_field(Symbol, _body, sizeof(jbyte)) /* NOTE: no type */ \
diff --git a/src/share/vm/shark/sharkBuilder.cpp b/src/share/vm/shark/sharkBuilder.cpp
index f9c22bd16..8e83dd18e 100644
--- a/src/share/vm/shark/sharkBuilder.cpp
+++ b/src/share/vm/shark/sharkBuilder.cpp
@@ -471,7 +471,7 @@ Value* SharkBuilder::CreateInlineOop(jobject object, const char* name) {
Value* SharkBuilder::CreateInlineMetadata(Metadata* metadata, llvm::PointerType* type, const char* name) {
assert(metadata != NULL, "inlined metadata must not be NULL");
- assert(metadata->is_metadata(), "sanity check");
+ assert(metadata->is_metaspace_object(), "sanity check");
return CreateLoad(
CreateIntToPtr(
code_buffer_address(code_buffer()->inline_Metadata(metadata)),