Merge
This commit is contained in:
commit
15ba5cbef1
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -39,7 +39,7 @@ class ciInstance : public ciObject {
|
||||
|
||||
protected:
|
||||
ciInstance(instanceHandle h_i) : ciObject(h_i) {
|
||||
assert(h_i()->is_instance(), "wrong type");
|
||||
assert(h_i()->is_instance_noinline(), "wrong type");
|
||||
}
|
||||
|
||||
ciInstance(ciKlass* klass) : ciObject(klass) {}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -43,6 +43,7 @@
|
||||
#include "memory/universe.inline.hpp"
|
||||
#include "oops/instanceKlass.hpp"
|
||||
#include "oops/instanceRefKlass.hpp"
|
||||
#include "oops/objArrayOop.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/symbol.hpp"
|
||||
#include "prims/jvm_misc.hpp"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -275,9 +275,7 @@ class ClassLoaderData : public CHeapObj<mtClass> {
|
||||
// Used to make sure that this CLD is not unloaded.
|
||||
void set_keep_alive(bool value) { _keep_alive = value; }
|
||||
|
||||
unsigned int identity_hash() const {
|
||||
return _class_loader == NULL ? 0 : _class_loader->identity_hash();
|
||||
}
|
||||
inline unsigned int identity_hash() const;
|
||||
|
||||
// Used when tracing from klasses.
|
||||
void oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -24,6 +24,11 @@
|
||||
|
||||
#include "classfile/classLoaderData.hpp"
|
||||
#include "classfile/javaClasses.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
|
||||
unsigned int ClassLoaderData::identity_hash() const {
|
||||
return _class_loader == NULL ? 0 : _class_loader->identity_hash();
|
||||
}
|
||||
|
||||
inline ClassLoaderData* ClassLoaderData::class_loader_data_or_null(oop loader) {
|
||||
if (loader == NULL) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "classfile/classLoaderData.inline.hpp"
|
||||
#include "classfile/sharedClassUtil.hpp"
|
||||
#include "classfile/dictionary.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
@ -500,6 +501,15 @@ void Dictionary::reorder_dictionary() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
unsigned int ProtectionDomainCacheTable::compute_hash(oop protection_domain) {
|
||||
return (unsigned int)(protection_domain->identity_hash());
|
||||
}
|
||||
|
||||
int ProtectionDomainCacheTable::index_for(oop protection_domain) {
|
||||
return hash_to_index(compute_hash(protection_domain));
|
||||
}
|
||||
|
||||
ProtectionDomainCacheTable::ProtectionDomainCacheTable(int table_size)
|
||||
: Hashtable<oop, mtClass>(table_size, sizeof(ProtectionDomainCacheEntry))
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -196,14 +196,9 @@ private:
|
||||
return entry;
|
||||
}
|
||||
|
||||
static unsigned int compute_hash(oop protection_domain) {
|
||||
return (unsigned int)(protection_domain->identity_hash());
|
||||
}
|
||||
|
||||
int index_for(oop protection_domain) {
|
||||
return hash_to_index(compute_hash(protection_domain));
|
||||
}
|
||||
static unsigned int compute_hash(oop protection_domain);
|
||||
|
||||
int index_for(oop protection_domain);
|
||||
ProtectionDomainCacheEntry* add_entry(int index, unsigned int hash, oop protection_domain);
|
||||
ProtectionDomainCacheEntry* find_entry(int index, oop protection_domain);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -29,6 +29,7 @@
|
||||
#include "classfile/vmSymbols.hpp"
|
||||
#include "memory/allocation.inline.hpp"
|
||||
#include "memory/oopFactory.hpp"
|
||||
#include "oops/objArrayOop.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -60,12 +60,7 @@ class java_lang_String : AllStatic {
|
||||
|
||||
static Handle basic_create(int length, bool byte_arr, TRAPS);
|
||||
|
||||
static void set_coder(oop string, jbyte coder) {
|
||||
assert(initialized, "Must be initialized");
|
||||
if (coder_offset > 0) {
|
||||
string->byte_field_put(coder_offset, coder);
|
||||
}
|
||||
}
|
||||
static inline void set_coder(oop string, jbyte coder);
|
||||
|
||||
public:
|
||||
|
||||
@ -110,55 +105,15 @@ class java_lang_String : AllStatic {
|
||||
return coder_offset;
|
||||
}
|
||||
|
||||
static void set_value_raw(oop string, typeArrayOop buffer) {
|
||||
assert(initialized, "Must be initialized");
|
||||
string->obj_field_put_raw(value_offset, buffer);
|
||||
}
|
||||
static void set_value(oop string, typeArrayOop buffer) {
|
||||
assert(initialized && (value_offset > 0), "Must be initialized");
|
||||
string->obj_field_put(value_offset, (oop)buffer);
|
||||
}
|
||||
static void set_hash(oop string, unsigned int hash) {
|
||||
assert(initialized && (hash_offset > 0), "Must be initialized");
|
||||
string->int_field_put(hash_offset, hash);
|
||||
}
|
||||
static inline void set_value_raw(oop string, typeArrayOop buffer);
|
||||
static inline void set_value(oop string, typeArrayOop buffer);
|
||||
static inline void set_hash(oop string, unsigned int hash);
|
||||
|
||||
// Accessors
|
||||
static typeArrayOop value(oop java_string) {
|
||||
assert(initialized && (value_offset > 0), "Must be initialized");
|
||||
assert(is_instance(java_string), "must be java_string");
|
||||
return (typeArrayOop) java_string->obj_field(value_offset);
|
||||
}
|
||||
static unsigned int hash(oop java_string) {
|
||||
assert(initialized && (hash_offset > 0), "Must be initialized");
|
||||
assert(is_instance(java_string), "must be java_string");
|
||||
return java_string->int_field(hash_offset);
|
||||
}
|
||||
static bool is_latin1(oop java_string) {
|
||||
assert(initialized, "Must be initialized");
|
||||
assert(is_instance(java_string), "must be java_string");
|
||||
if (coder_offset > 0) {
|
||||
jbyte coder = java_string->byte_field(coder_offset);
|
||||
assert(CompactStrings || coder == CODER_UTF16, "Must be UTF16 without CompactStrings");
|
||||
return coder == CODER_LATIN1;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
static int length(oop java_string) {
|
||||
assert(initialized, "Must be initialized");
|
||||
assert(is_instance(java_string), "must be java_string");
|
||||
typeArrayOop value_array = ((typeArrayOop)java_string->obj_field(value_offset));
|
||||
if (value_array == NULL) {
|
||||
return 0;
|
||||
}
|
||||
int arr_length = value_array->length();
|
||||
if (!is_latin1(java_string)) {
|
||||
assert((arr_length & 1) == 0, "should be even for UTF16 string");
|
||||
arr_length >>= 1; // convert number of bytes to number of elements
|
||||
}
|
||||
return arr_length;
|
||||
}
|
||||
static inline typeArrayOop value(oop java_string);
|
||||
static inline unsigned int hash(oop java_string);
|
||||
static inline bool is_latin1(oop java_string);
|
||||
static inline int length(oop java_string);
|
||||
static int utf8_length(oop java_string);
|
||||
|
||||
// String converters
|
||||
@ -219,7 +174,7 @@ class java_lang_String : AllStatic {
|
||||
|
||||
// Testers
|
||||
static bool is_instance(oop obj);
|
||||
static bool is_instance_inlined(oop obj);
|
||||
static inline bool is_instance_inlined(oop obj);
|
||||
|
||||
// Debugging
|
||||
static void print(oop java_string, outputStream* st);
|
||||
@ -910,42 +865,19 @@ class java_lang_ref_Reference: AllStatic {
|
||||
static int number_of_fake_oop_fields;
|
||||
|
||||
// Accessors
|
||||
static oop referent(oop ref) {
|
||||
return ref->obj_field(referent_offset);
|
||||
}
|
||||
static void set_referent(oop ref, oop value) {
|
||||
ref->obj_field_put(referent_offset, value);
|
||||
}
|
||||
static void set_referent_raw(oop ref, oop value) {
|
||||
ref->obj_field_put_raw(referent_offset, value);
|
||||
}
|
||||
static HeapWord* referent_addr(oop ref) {
|
||||
return ref->obj_field_addr<HeapWord>(referent_offset);
|
||||
}
|
||||
static oop next(oop ref) {
|
||||
return ref->obj_field(next_offset);
|
||||
}
|
||||
static void set_next(oop ref, oop value) {
|
||||
ref->obj_field_put(next_offset, value);
|
||||
}
|
||||
static void set_next_raw(oop ref, oop value) {
|
||||
ref->obj_field_put_raw(next_offset, value);
|
||||
}
|
||||
static HeapWord* next_addr(oop ref) {
|
||||
return ref->obj_field_addr<HeapWord>(next_offset);
|
||||
}
|
||||
static oop discovered(oop ref) {
|
||||
return ref->obj_field(discovered_offset);
|
||||
}
|
||||
static void set_discovered(oop ref, oop value) {
|
||||
ref->obj_field_put(discovered_offset, value);
|
||||
}
|
||||
static void set_discovered_raw(oop ref, oop value) {
|
||||
ref->obj_field_put_raw(discovered_offset, value);
|
||||
}
|
||||
static HeapWord* discovered_addr(oop ref) {
|
||||
return ref->obj_field_addr<HeapWord>(discovered_offset);
|
||||
}
|
||||
static inline oop referent(oop ref);
|
||||
static inline void set_referent(oop ref, oop value);
|
||||
static inline void set_referent_raw(oop ref, oop value);
|
||||
static inline HeapWord* referent_addr(oop ref);
|
||||
static inline oop next(oop ref);
|
||||
static inline void set_next(oop ref, oop value);
|
||||
static inline void set_next_raw(oop ref, oop value);
|
||||
static inline HeapWord* next_addr(oop ref);
|
||||
static inline oop discovered(oop ref);
|
||||
static inline void set_discovered(oop ref, oop value);
|
||||
static inline void set_discovered_raw(oop ref, oop value);
|
||||
static inline HeapWord* discovered_addr(oop ref);
|
||||
|
||||
// Accessors for statics
|
||||
static oop pending_list_lock();
|
||||
static oop pending_list();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -29,6 +29,105 @@
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/oopsHierarchy.hpp"
|
||||
|
||||
void java_lang_String::set_coder(oop string, jbyte coder) {
|
||||
assert(initialized, "Must be initialized");
|
||||
if (coder_offset > 0) {
|
||||
string->byte_field_put(coder_offset, coder);
|
||||
}
|
||||
}
|
||||
|
||||
void java_lang_String::set_value_raw(oop string, typeArrayOop buffer) {
|
||||
assert(initialized, "Must be initialized");
|
||||
string->obj_field_put_raw(value_offset, buffer);
|
||||
}
|
||||
void java_lang_String::set_value(oop string, typeArrayOop buffer) {
|
||||
assert(initialized && (value_offset > 0), "Must be initialized");
|
||||
string->obj_field_put(value_offset, (oop)buffer);
|
||||
}
|
||||
void java_lang_String::set_hash(oop string, unsigned int hash) {
|
||||
assert(initialized && (hash_offset > 0), "Must be initialized");
|
||||
string->int_field_put(hash_offset, hash);
|
||||
}
|
||||
|
||||
// Accessors
|
||||
typeArrayOop java_lang_String::value(oop java_string) {
|
||||
assert(initialized && (value_offset > 0), "Must be initialized");
|
||||
assert(is_instance(java_string), "must be java_string");
|
||||
return (typeArrayOop) java_string->obj_field(value_offset);
|
||||
}
|
||||
unsigned int java_lang_String::hash(oop java_string) {
|
||||
assert(initialized && (hash_offset > 0), "Must be initialized");
|
||||
assert(is_instance(java_string), "must be java_string");
|
||||
return java_string->int_field(hash_offset);
|
||||
}
|
||||
bool java_lang_String::is_latin1(oop java_string) {
|
||||
assert(initialized, "Must be initialized");
|
||||
assert(is_instance(java_string), "must be java_string");
|
||||
if (coder_offset > 0) {
|
||||
jbyte coder = java_string->byte_field(coder_offset);
|
||||
assert(CompactStrings || coder == CODER_UTF16, "Must be UTF16 without CompactStrings");
|
||||
return coder == CODER_LATIN1;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
int java_lang_String::length(oop java_string) {
|
||||
assert(initialized, "Must be initialized");
|
||||
assert(is_instance(java_string), "must be java_string");
|
||||
typeArrayOop value_array = ((typeArrayOop)java_string->obj_field(value_offset));
|
||||
if (value_array == NULL) {
|
||||
return 0;
|
||||
}
|
||||
int arr_length = value_array->length();
|
||||
if (!is_latin1(java_string)) {
|
||||
assert((arr_length & 1) == 0, "should be even for UTF16 string");
|
||||
arr_length >>= 1; // convert number of bytes to number of elements
|
||||
}
|
||||
return arr_length;
|
||||
}
|
||||
|
||||
bool java_lang_String::is_instance_inlined(oop obj) {
|
||||
return obj != NULL && obj->klass() == SystemDictionary::String_klass();
|
||||
}
|
||||
|
||||
// Accessors
|
||||
oop java_lang_ref_Reference::referent(oop ref) {
|
||||
return ref->obj_field(referent_offset);
|
||||
}
|
||||
void java_lang_ref_Reference::set_referent(oop ref, oop value) {
|
||||
ref->obj_field_put(referent_offset, value);
|
||||
}
|
||||
void java_lang_ref_Reference::set_referent_raw(oop ref, oop value) {
|
||||
ref->obj_field_put_raw(referent_offset, value);
|
||||
}
|
||||
HeapWord* java_lang_ref_Reference::referent_addr(oop ref) {
|
||||
return ref->obj_field_addr<HeapWord>(referent_offset);
|
||||
}
|
||||
oop java_lang_ref_Reference::next(oop ref) {
|
||||
return ref->obj_field(next_offset);
|
||||
}
|
||||
void java_lang_ref_Reference::set_next(oop ref, oop value) {
|
||||
ref->obj_field_put(next_offset, value);
|
||||
}
|
||||
void java_lang_ref_Reference::set_next_raw(oop ref, oop value) {
|
||||
ref->obj_field_put_raw(next_offset, value);
|
||||
}
|
||||
HeapWord* java_lang_ref_Reference::next_addr(oop ref) {
|
||||
return ref->obj_field_addr<HeapWord>(next_offset);
|
||||
}
|
||||
oop java_lang_ref_Reference::discovered(oop ref) {
|
||||
return ref->obj_field(discovered_offset);
|
||||
}
|
||||
void java_lang_ref_Reference::set_discovered(oop ref, oop value) {
|
||||
ref->obj_field_put(discovered_offset, value);
|
||||
}
|
||||
void java_lang_ref_Reference::set_discovered_raw(oop ref, oop value) {
|
||||
ref->obj_field_put_raw(discovered_offset, value);
|
||||
}
|
||||
HeapWord* java_lang_ref_Reference::discovered_addr(oop ref) {
|
||||
return ref->obj_field_addr<HeapWord>(discovered_offset);
|
||||
}
|
||||
|
||||
inline void java_lang_invoke_CallSite::set_target_volatile(oop site, oop target) {
|
||||
site->obj_field_put_volatile(_target_offset, target);
|
||||
}
|
||||
@ -41,10 +140,6 @@ inline void java_lang_invoke_CallSite::set_target(oop site, oop target) {
|
||||
site->obj_field_put(_target_offset, target);
|
||||
}
|
||||
|
||||
inline bool java_lang_String::is_instance_inlined(oop obj) {
|
||||
return obj != NULL && obj->klass() == SystemDictionary::String_klass();
|
||||
}
|
||||
|
||||
inline bool java_lang_invoke_CallSite::is_instance(oop obj) {
|
||||
return obj != NULL && is_subclass(obj->klass());
|
||||
}
|
||||
@ -73,6 +168,9 @@ inline bool java_lang_invoke_DirectMethodHandle::is_instance(oop obj) {
|
||||
return obj != NULL && is_subclass(obj->klass());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
inline int Backtrace::merge_bci_and_version(int bci, int version) {
|
||||
// only store u2 for version, checking for overflow.
|
||||
if (version > USHRT_MAX || version < 0) version = USHRT_MAX;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -25,7 +25,7 @@
|
||||
#include "precompiled.hpp"
|
||||
#include "classfile/altHashing.hpp"
|
||||
#include "classfile/compactHashtable.inline.hpp"
|
||||
#include "classfile/javaClasses.hpp"
|
||||
#include "classfile/javaClasses.inline.hpp"
|
||||
#include "classfile/stringTable.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#include "gc/shared/collectedHeap.inline.hpp"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -1949,3 +1949,10 @@ void Dependencies::print_statistics() {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
CallSiteDepChange::CallSiteDepChange(Handle call_site, Handle method_handle) :
|
||||
_call_site(call_site),
|
||||
_method_handle(method_handle) {
|
||||
assert(_call_site()->is_a(SystemDictionary::CallSite_klass()), "must be");
|
||||
assert(_method_handle.is_null() || _method_handle()->is_a(SystemDictionary::MethodHandle_klass()), "must be");
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -767,13 +767,7 @@ class CallSiteDepChange : public DepChange {
|
||||
Handle _method_handle;
|
||||
|
||||
public:
|
||||
CallSiteDepChange(Handle call_site, Handle method_handle)
|
||||
: _call_site(call_site),
|
||||
_method_handle(method_handle)
|
||||
{
|
||||
assert(_call_site() ->is_a(SystemDictionary::CallSite_klass()), "must be");
|
||||
assert(_method_handle.is_null() || _method_handle()->is_a(SystemDictionary::MethodHandle_klass()), "must be");
|
||||
}
|
||||
CallSiteDepChange(Handle call_site, Handle method_handle);
|
||||
|
||||
// What kind of DepChange is this?
|
||||
virtual bool is_call_site_change() const { return true; }
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/objArrayKlass.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/typeArrayOop.inline.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
#include "utilities/stack.inline.hpp"
|
||||
#if INCLUDE_ALL_GCS
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "classfile/javaClasses.hpp"
|
||||
#include "classfile/javaClasses.inline.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#include "gc/shared/collectedHeap.hpp"
|
||||
#include "gc/shared/collectedHeap.inline.hpp"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "classfile/javaClasses.inline.hpp"
|
||||
#include "code/codeCache.hpp"
|
||||
#include "code/scopeDesc.hpp"
|
||||
#include "interpreter/linkResolver.hpp"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,6 +26,7 @@
|
||||
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#include "oops/instanceMirrorKlass.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
|
||||
class JVMCIJavaClasses : AllStatic {
|
||||
public:
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,6 +23,7 @@
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "asm/codeBuffer.hpp"
|
||||
#include "classfile/javaClasses.inline.hpp"
|
||||
#include "code/codeCache.hpp"
|
||||
#include "compiler/compileBroker.hpp"
|
||||
#include "compiler/disassembler.hpp"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -186,6 +186,10 @@ int ConstantPool::cp_to_object_index(int cp_index) {
|
||||
return (i < 0) ? _no_index_sentinel : i;
|
||||
}
|
||||
|
||||
void ConstantPool::string_at_put(int which, int obj_index, oop str) {
|
||||
resolved_references()->obj_at_put(obj_index, str);
|
||||
}
|
||||
|
||||
void ConstantPool::trace_class_resolution(const constantPoolHandle& this_cp, KlassHandle k) {
|
||||
ResourceMark rm;
|
||||
int line_number = -1;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -303,9 +303,7 @@ class ConstantPool : public Metadata {
|
||||
*symbol_at_addr(which) = s;
|
||||
}
|
||||
|
||||
void string_at_put(int which, int obj_index, oop str) {
|
||||
resolved_references()->obj_at_put(obj_index, str);
|
||||
}
|
||||
void string_at_put(int which, int obj_index, oop str);
|
||||
|
||||
// For temporary use while constructing constant pool
|
||||
void string_index_at_put(int which, int string_index) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -25,7 +25,7 @@
|
||||
#ifndef SHARE_VM_OOPS_INSTANCEREFKLASS_INLINE_HPP
|
||||
#define SHARE_VM_OOPS_INSTANCEREFKLASS_INLINE_HPP
|
||||
|
||||
#include "classfile/javaClasses.hpp"
|
||||
#include "classfile/javaClasses.inline.hpp"
|
||||
#include "gc/shared/referenceProcessor.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "oops/instanceKlass.inline.hpp"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -41,6 +41,7 @@
|
||||
#include "oops/constMethod.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/objArrayOop.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/symbol.hpp"
|
||||
#include "prims/jvmtiExport.hpp"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -81,13 +81,7 @@ private:
|
||||
// Accessing
|
||||
oop obj_at(int index) const;
|
||||
|
||||
void obj_at_put(int index, oop value) {
|
||||
if (UseCompressedOops) {
|
||||
oop_store(obj_at_addr<narrowOop>(index), value);
|
||||
} else {
|
||||
oop_store(obj_at_addr<oop>(index), value);
|
||||
}
|
||||
}
|
||||
void /*inline*/ obj_at_put(int index, oop value);
|
||||
|
||||
oop atomic_compare_exchange_oop(int index, oop exchange_value, oop compare_value);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -39,4 +39,12 @@ inline oop objArrayOopDesc::obj_at(int index) const {
|
||||
}
|
||||
}
|
||||
|
||||
inline void objArrayOopDesc::obj_at_put(int index, oop value) {
|
||||
if (UseCompressedOops) {
|
||||
oop_store(obj_at_addr<narrowOop>(index), value);
|
||||
} else {
|
||||
oop_store(obj_at_addr<oop>(index), value);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -32,7 +32,7 @@
|
||||
#include "utilities/macros.hpp"
|
||||
#include "utilities/top.hpp"
|
||||
|
||||
// oopDesc is the top baseclass for objects classes. The {name}Desc classes describe
|
||||
// oopDesc is the top baseclass for objects classes. The {name}Desc classes describe
|
||||
// the format of Java objects so the fields can be accessed from C++.
|
||||
// oopDesc is abstract.
|
||||
// (see oopHierarchy for complete oop class hierarchy)
|
||||
@ -40,8 +40,8 @@
|
||||
// no virtual functions allowed
|
||||
|
||||
// store into oop with store check
|
||||
template <class T> void oop_store(T* p, oop v);
|
||||
template <class T> void oop_store(volatile T* p, oop v);
|
||||
template <class T> inline void oop_store(T* p, oop v);
|
||||
template <class T> inline void oop_store(volatile T* p, oop v);
|
||||
|
||||
extern bool always_do_update_barrier;
|
||||
|
||||
@ -60,60 +60,60 @@ class oopDesc {
|
||||
friend class VMStructs;
|
||||
friend class JVMCIVMStructs;
|
||||
private:
|
||||
volatile markOop _mark;
|
||||
volatile markOop _mark;
|
||||
union _metadata {
|
||||
Klass* _klass;
|
||||
narrowKlass _compressed_klass;
|
||||
} _metadata;
|
||||
|
||||
// Fast access to barrier set. Must be initialized.
|
||||
// Fast access to barrier set. Must be initialized.
|
||||
static BarrierSet* _bs;
|
||||
|
||||
public:
|
||||
markOop mark() const { return _mark; }
|
||||
markOop* mark_addr() const { return (markOop*) &_mark; }
|
||||
markOop mark() const { return _mark; }
|
||||
markOop* mark_addr() const { return (markOop*) &_mark; }
|
||||
|
||||
void set_mark(volatile markOop m) { _mark = m; }
|
||||
void set_mark(volatile markOop m) { _mark = m; }
|
||||
|
||||
void release_set_mark(markOop m);
|
||||
markOop cas_set_mark(markOop new_mark, markOop old_mark);
|
||||
inline void release_set_mark(markOop m);
|
||||
inline markOop cas_set_mark(markOop new_mark, markOop old_mark);
|
||||
|
||||
// Used only to re-initialize the mark word (e.g., of promoted
|
||||
// objects during a GC) -- requires a valid klass pointer
|
||||
void init_mark();
|
||||
inline void init_mark();
|
||||
|
||||
Klass* klass() const;
|
||||
Klass* klass_or_null() const volatile;
|
||||
Klass** klass_addr();
|
||||
narrowKlass* compressed_klass_addr();
|
||||
/*inline*/ Klass* klass() const;
|
||||
inline Klass* klass_or_null() const volatile;
|
||||
inline Klass** klass_addr();
|
||||
inline narrowKlass* compressed_klass_addr();
|
||||
|
||||
void set_klass(Klass* k);
|
||||
/*inline*/ void set_klass(Klass* k);
|
||||
|
||||
// For klass field compression
|
||||
int klass_gap() const;
|
||||
void set_klass_gap(int z);
|
||||
inline int klass_gap() const;
|
||||
/*inline*/ void set_klass_gap(int z);
|
||||
// For when the klass pointer is being used as a linked list "next" field.
|
||||
void set_klass_to_list_ptr(oop k);
|
||||
oop list_ptr_from_klass();
|
||||
inline void set_klass_to_list_ptr(oop k);
|
||||
inline oop list_ptr_from_klass();
|
||||
|
||||
// size of object header, aligned to platform wordSize
|
||||
static int header_size() { return sizeof(oopDesc)/HeapWordSize; }
|
||||
static int header_size() { return sizeof(oopDesc)/HeapWordSize; }
|
||||
|
||||
// Returns whether this is an instance of k or an instance of a subclass of k
|
||||
bool is_a(Klass* k) const;
|
||||
inline bool is_a(Klass* k) const;
|
||||
|
||||
// Returns the actual oop size of the object
|
||||
int size();
|
||||
/*inline*/ int size();
|
||||
|
||||
// Sometimes (for complicated concurrency-related reasons), it is useful
|
||||
// to be able to figure out the size of an object knowing its klass.
|
||||
int size_given_klass(Klass* klass);
|
||||
inline int size_given_klass(Klass* klass);
|
||||
|
||||
// type test operations (inlined in oop.inline.hpp)
|
||||
bool is_instance() const;
|
||||
bool is_array() const;
|
||||
bool is_objArray() const;
|
||||
bool is_typeArray() const;
|
||||
inline bool is_instance() const;
|
||||
/*inline*/ bool is_array() const;
|
||||
inline bool is_objArray() const;
|
||||
inline bool is_typeArray() const;
|
||||
|
||||
// type test operations that don't require inclusion of oop.inline.hpp.
|
||||
bool is_instance_noinline() const;
|
||||
@ -123,141 +123,142 @@ class oopDesc {
|
||||
|
||||
private:
|
||||
// field addresses in oop
|
||||
void* field_base(int offset) const;
|
||||
inline void* field_base(int offset) const;
|
||||
|
||||
jbyte* byte_field_addr(int offset) const;
|
||||
jchar* char_field_addr(int offset) const;
|
||||
jboolean* bool_field_addr(int offset) const;
|
||||
jint* int_field_addr(int offset) const;
|
||||
jshort* short_field_addr(int offset) const;
|
||||
jlong* long_field_addr(int offset) const;
|
||||
jfloat* float_field_addr(int offset) const;
|
||||
jdouble* double_field_addr(int offset) const;
|
||||
Metadata** metadata_field_addr(int offset) const;
|
||||
inline jbyte* byte_field_addr(int offset) const;
|
||||
inline jchar* char_field_addr(int offset) const;
|
||||
inline jboolean* bool_field_addr(int offset) const;
|
||||
inline jint* int_field_addr(int offset) const;
|
||||
inline jshort* short_field_addr(int offset) const;
|
||||
inline jlong* long_field_addr(int offset) const;
|
||||
inline jfloat* float_field_addr(int offset) const;
|
||||
inline jdouble* double_field_addr(int offset) const;
|
||||
inline Metadata** metadata_field_addr(int offset) const;
|
||||
|
||||
public:
|
||||
// Need this as public for garbage collection.
|
||||
template <class T> T* obj_field_addr(int offset) const;
|
||||
template <class T> inline T* obj_field_addr(int offset) const;
|
||||
|
||||
// Needed for javaClasses
|
||||
address* address_field_addr(int offset) const;
|
||||
inline address* address_field_addr(int offset) const;
|
||||
|
||||
static bool is_null(oop obj);
|
||||
static bool is_null(narrowOop obj);
|
||||
inline static bool is_null(oop obj) { return obj == NULL; }
|
||||
inline static bool is_null(narrowOop obj) { return obj == 0; }
|
||||
|
||||
// Decode an oop pointer from a narrowOop if compressed.
|
||||
// These are overloaded for oop and narrowOop as are the other functions
|
||||
// below so that they can be called in template functions.
|
||||
static oop decode_heap_oop_not_null(oop v);
|
||||
static oop decode_heap_oop_not_null(narrowOop v);
|
||||
static oop decode_heap_oop(oop v);
|
||||
static oop decode_heap_oop(narrowOop v);
|
||||
static inline oop decode_heap_oop_not_null(oop v) { return v; }
|
||||
static /*inline*/ oop decode_heap_oop_not_null(narrowOop v);
|
||||
static inline oop decode_heap_oop(oop v) { return v; }
|
||||
static /*inline*/ oop decode_heap_oop(narrowOop v);
|
||||
|
||||
// Encode an oop pointer to a narrow oop. The or_null versions accept
|
||||
// Encode an oop pointer to a narrow oop. The or_null versions accept
|
||||
// null oop pointer, others do not in order to eliminate the
|
||||
// null checking branches.
|
||||
static narrowOop encode_heap_oop_not_null(oop v);
|
||||
static narrowOop encode_heap_oop(oop v);
|
||||
static inline narrowOop encode_heap_oop_not_null(oop v);
|
||||
static /*inline*/ narrowOop encode_heap_oop(oop v);
|
||||
|
||||
// Load an oop out of the Java heap
|
||||
static narrowOop load_heap_oop(narrowOop* p);
|
||||
static oop load_heap_oop(oop* p);
|
||||
// Load an oop out of the Java heap as is without decoding.
|
||||
// Called by GC to check for null before decoding.
|
||||
static inline narrowOop load_heap_oop(narrowOop* p) { return *p; }
|
||||
static inline oop load_heap_oop(oop* p) { return *p; }
|
||||
|
||||
// Load an oop out of Java heap and decode it to an uncompressed oop.
|
||||
static oop load_decode_heap_oop_not_null(narrowOop* p);
|
||||
static oop load_decode_heap_oop_not_null(oop* p);
|
||||
static oop load_decode_heap_oop(narrowOop* p);
|
||||
static oop load_decode_heap_oop(oop* p);
|
||||
static inline oop load_decode_heap_oop_not_null(narrowOop* p);
|
||||
static inline oop load_decode_heap_oop_not_null(oop* p) { return *p; }
|
||||
static inline oop load_decode_heap_oop(narrowOop* p);
|
||||
static inline oop load_decode_heap_oop(oop* p) { return *p; }
|
||||
|
||||
// Store an oop into the heap.
|
||||
static void store_heap_oop(narrowOop* p, narrowOop v);
|
||||
static void store_heap_oop(oop* p, oop v);
|
||||
// Store already encoded heap oop into the heap.
|
||||
static inline void store_heap_oop(narrowOop* p, narrowOop v) { *p = v; }
|
||||
static inline void store_heap_oop(oop* p, oop v) { *p = v; }
|
||||
|
||||
// Encode oop if UseCompressedOops and store into the heap.
|
||||
static void encode_store_heap_oop_not_null(narrowOop* p, oop v);
|
||||
static void encode_store_heap_oop_not_null(oop* p, oop v);
|
||||
static void encode_store_heap_oop(narrowOop* p, oop v);
|
||||
static void encode_store_heap_oop(oop* p, oop v);
|
||||
static inline void encode_store_heap_oop_not_null(narrowOop* p, oop v);
|
||||
static inline void encode_store_heap_oop_not_null(oop* p, oop v) { *p = v; }
|
||||
static inline void encode_store_heap_oop(narrowOop* p, oop v);
|
||||
static inline void encode_store_heap_oop(oop* p, oop v) { *p = v; }
|
||||
|
||||
static void release_store_heap_oop(volatile narrowOop* p, narrowOop v);
|
||||
static void release_store_heap_oop(volatile oop* p, oop v);
|
||||
static inline void release_store_heap_oop(volatile narrowOop* p, narrowOop v);
|
||||
static inline void release_store_heap_oop(volatile oop* p, oop v);
|
||||
|
||||
static void release_encode_store_heap_oop_not_null(volatile narrowOop* p, oop v);
|
||||
static void release_encode_store_heap_oop_not_null(volatile oop* p, oop v);
|
||||
static void release_encode_store_heap_oop(volatile narrowOop* p, oop v);
|
||||
static void release_encode_store_heap_oop(volatile oop* p, oop v);
|
||||
static inline void release_encode_store_heap_oop_not_null(volatile narrowOop* p, oop v);
|
||||
static inline void release_encode_store_heap_oop_not_null(volatile oop* p, oop v);
|
||||
static inline void release_encode_store_heap_oop(volatile narrowOop* p, oop v);
|
||||
static inline void release_encode_store_heap_oop(volatile oop* p, oop v);
|
||||
|
||||
static oop atomic_exchange_oop(oop exchange_value, volatile HeapWord *dest);
|
||||
static oop atomic_compare_exchange_oop(oop exchange_value,
|
||||
volatile HeapWord *dest,
|
||||
oop compare_value,
|
||||
bool prebarrier = false);
|
||||
static inline oop atomic_exchange_oop(oop exchange_value, volatile HeapWord *dest);
|
||||
static inline oop atomic_compare_exchange_oop(oop exchange_value,
|
||||
volatile HeapWord *dest,
|
||||
oop compare_value,
|
||||
bool prebarrier = false);
|
||||
|
||||
// Access to fields in a instanceOop through these methods.
|
||||
oop obj_field(int offset) const;
|
||||
void obj_field_put(int offset, oop value);
|
||||
void obj_field_put_raw(int offset, oop value);
|
||||
void obj_field_put_volatile(int offset, oop value);
|
||||
inline oop obj_field(int offset) const;
|
||||
inline void obj_field_put(int offset, oop value);
|
||||
inline void obj_field_put_raw(int offset, oop value);
|
||||
inline void obj_field_put_volatile(int offset, oop value);
|
||||
|
||||
Metadata* metadata_field(int offset) const;
|
||||
void metadata_field_put(int offset, Metadata* value);
|
||||
inline Metadata* metadata_field(int offset) const;
|
||||
inline void metadata_field_put(int offset, Metadata* value);
|
||||
|
||||
jbyte byte_field(int offset) const;
|
||||
void byte_field_put(int offset, jbyte contents);
|
||||
inline jbyte byte_field(int offset) const;
|
||||
inline void byte_field_put(int offset, jbyte contents);
|
||||
|
||||
jchar char_field(int offset) const;
|
||||
void char_field_put(int offset, jchar contents);
|
||||
inline jchar char_field(int offset) const;
|
||||
inline void char_field_put(int offset, jchar contents);
|
||||
|
||||
jboolean bool_field(int offset) const;
|
||||
void bool_field_put(int offset, jboolean contents);
|
||||
inline jboolean bool_field(int offset) const;
|
||||
inline void bool_field_put(int offset, jboolean contents);
|
||||
|
||||
jint int_field(int offset) const;
|
||||
void int_field_put(int offset, jint contents);
|
||||
inline jint int_field(int offset) const;
|
||||
inline void int_field_put(int offset, jint contents);
|
||||
|
||||
jshort short_field(int offset) const;
|
||||
void short_field_put(int offset, jshort contents);
|
||||
inline jshort short_field(int offset) const;
|
||||
inline void short_field_put(int offset, jshort contents);
|
||||
|
||||
jlong long_field(int offset) const;
|
||||
void long_field_put(int offset, jlong contents);
|
||||
inline jlong long_field(int offset) const;
|
||||
inline void long_field_put(int offset, jlong contents);
|
||||
|
||||
jfloat float_field(int offset) const;
|
||||
void float_field_put(int offset, jfloat contents);
|
||||
inline jfloat float_field(int offset) const;
|
||||
inline void float_field_put(int offset, jfloat contents);
|
||||
|
||||
jdouble double_field(int offset) const;
|
||||
void double_field_put(int offset, jdouble contents);
|
||||
inline jdouble double_field(int offset) const;
|
||||
inline void double_field_put(int offset, jdouble contents);
|
||||
|
||||
address address_field(int offset) const;
|
||||
void address_field_put(int offset, address contents);
|
||||
inline address address_field(int offset) const;
|
||||
inline void address_field_put(int offset, address contents);
|
||||
|
||||
oop obj_field_acquire(int offset) const;
|
||||
void release_obj_field_put(int offset, oop value);
|
||||
inline oop obj_field_acquire(int offset) const;
|
||||
inline void release_obj_field_put(int offset, oop value);
|
||||
|
||||
jbyte byte_field_acquire(int offset) const;
|
||||
void release_byte_field_put(int offset, jbyte contents);
|
||||
inline jbyte byte_field_acquire(int offset) const;
|
||||
inline void release_byte_field_put(int offset, jbyte contents);
|
||||
|
||||
jchar char_field_acquire(int offset) const;
|
||||
void release_char_field_put(int offset, jchar contents);
|
||||
inline jchar char_field_acquire(int offset) const;
|
||||
inline void release_char_field_put(int offset, jchar contents);
|
||||
|
||||
jboolean bool_field_acquire(int offset) const;
|
||||
void release_bool_field_put(int offset, jboolean contents);
|
||||
inline jboolean bool_field_acquire(int offset) const;
|
||||
inline void release_bool_field_put(int offset, jboolean contents);
|
||||
|
||||
jint int_field_acquire(int offset) const;
|
||||
void release_int_field_put(int offset, jint contents);
|
||||
inline jint int_field_acquire(int offset) const;
|
||||
inline void release_int_field_put(int offset, jint contents);
|
||||
|
||||
jshort short_field_acquire(int offset) const;
|
||||
void release_short_field_put(int offset, jshort contents);
|
||||
inline jshort short_field_acquire(int offset) const;
|
||||
inline void release_short_field_put(int offset, jshort contents);
|
||||
|
||||
jlong long_field_acquire(int offset) const;
|
||||
void release_long_field_put(int offset, jlong contents);
|
||||
inline jlong long_field_acquire(int offset) const;
|
||||
inline void release_long_field_put(int offset, jlong contents);
|
||||
|
||||
jfloat float_field_acquire(int offset) const;
|
||||
void release_float_field_put(int offset, jfloat contents);
|
||||
inline jfloat float_field_acquire(int offset) const;
|
||||
inline void release_float_field_put(int offset, jfloat contents);
|
||||
|
||||
jdouble double_field_acquire(int offset) const;
|
||||
void release_double_field_put(int offset, jdouble contents);
|
||||
inline jdouble double_field_acquire(int offset) const;
|
||||
inline void release_double_field_put(int offset, jdouble contents);
|
||||
|
||||
address address_field_acquire(int offset) const;
|
||||
void release_address_field_put(int offset, address contents);
|
||||
inline address address_field_acquire(int offset) const;
|
||||
inline void release_address_field_put(int offset, address contents);
|
||||
|
||||
// printing functions for VM debugging
|
||||
void print_on(outputStream* st) const; // First level print
|
||||
@ -278,42 +279,41 @@ class oopDesc {
|
||||
void verify();
|
||||
|
||||
// locking operations
|
||||
bool is_locked() const;
|
||||
bool is_unlocked() const;
|
||||
bool has_bias_pattern() const;
|
||||
inline bool is_locked() const;
|
||||
inline bool is_unlocked() const;
|
||||
inline bool has_bias_pattern() const;
|
||||
|
||||
// asserts
|
||||
bool is_oop(bool ignore_mark_word = false) const;
|
||||
bool is_oop_or_null(bool ignore_mark_word = false) const;
|
||||
/*inline*/ bool is_oop(bool ignore_mark_word = false) const;
|
||||
/*inline*/ bool is_oop_or_null(bool ignore_mark_word = false) const;
|
||||
#ifndef PRODUCT
|
||||
bool is_unlocked_oop() const;
|
||||
inline bool is_unlocked_oop() const;
|
||||
#endif
|
||||
|
||||
// garbage collection
|
||||
bool is_gc_marked() const;
|
||||
inline bool is_gc_marked() const;
|
||||
|
||||
bool is_scavengable() const;
|
||||
inline bool is_scavengable() const;
|
||||
|
||||
// Forward pointer operations for scavenge
|
||||
bool is_forwarded() const;
|
||||
inline bool is_forwarded() const;
|
||||
|
||||
void forward_to(oop p);
|
||||
bool cas_forward_to(oop p, markOop compare);
|
||||
inline void forward_to(oop p);
|
||||
inline bool cas_forward_to(oop p, markOop compare);
|
||||
|
||||
#if INCLUDE_ALL_GCS
|
||||
// Like "forward_to", but inserts the forwarding pointer atomically.
|
||||
// Exactly one thread succeeds in inserting the forwarding pointer, and
|
||||
// this call returns "NULL" for that thread; any other thread has the
|
||||
// value of the forwarding pointer returned and does not modify "this".
|
||||
oop forward_to_atomic(oop p);
|
||||
inline oop forward_to_atomic(oop p);
|
||||
#endif // INCLUDE_ALL_GCS
|
||||
|
||||
oop forwardee() const;
|
||||
inline oop forwardee() const;
|
||||
|
||||
// Age of object during scavenge
|
||||
uint age() const;
|
||||
void incr_age();
|
||||
|
||||
/*inline*/ uint age() const;
|
||||
inline void incr_age();
|
||||
|
||||
// mark-sweep support
|
||||
void follow_body(int begin, int end);
|
||||
@ -326,28 +326,28 @@ class oopDesc {
|
||||
|
||||
// Mark Sweep
|
||||
// Adjust all pointers in this object to point at it's forwarded location and
|
||||
// return the size of this oop. This is used by the MarkSweep collector.
|
||||
int ms_adjust_pointers();
|
||||
// return the size of this oop. This is used by the MarkSweep collector.
|
||||
inline int ms_adjust_pointers();
|
||||
#if INCLUDE_ALL_GCS
|
||||
// Parallel Compact
|
||||
void pc_follow_contents(ParCompactionManager* pc);
|
||||
void pc_update_contents();
|
||||
inline void pc_follow_contents(ParCompactionManager* pc);
|
||||
inline void pc_update_contents();
|
||||
// Parallel Scavenge
|
||||
void ps_push_contents(PSPromotionManager* pm);
|
||||
inline void ps_push_contents(PSPromotionManager* pm);
|
||||
#endif
|
||||
|
||||
|
||||
// iterators, returns size of object
|
||||
#define OOP_ITERATE_DECL(OopClosureType, nv_suffix) \
|
||||
void oop_iterate(OopClosureType* blk); \
|
||||
void oop_iterate(OopClosureType* blk, MemRegion mr); // Only in mr.
|
||||
inline void oop_iterate(OopClosureType* blk); \
|
||||
inline void oop_iterate(OopClosureType* blk, MemRegion mr); // Only in mr.
|
||||
|
||||
ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_DECL)
|
||||
ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_DECL)
|
||||
|
||||
#define OOP_ITERATE_SIZE_DECL(OopClosureType, nv_suffix) \
|
||||
int oop_iterate_size(OopClosureType* blk); \
|
||||
int oop_iterate_size(OopClosureType* blk, MemRegion mr); // Only in mr.
|
||||
#define OOP_ITERATE_SIZE_DECL(OopClosureType, nv_suffix) \
|
||||
inline int oop_iterate_size(OopClosureType* blk); \
|
||||
inline int oop_iterate_size(OopClosureType* blk, MemRegion mr); // Only in mr.
|
||||
|
||||
ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_SIZE_DECL)
|
||||
ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_SIZE_DECL)
|
||||
@ -356,28 +356,29 @@ class oopDesc {
|
||||
#if INCLUDE_ALL_GCS
|
||||
|
||||
#define OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \
|
||||
void oop_iterate_backwards(OopClosureType* blk);
|
||||
inline void oop_iterate_backwards(OopClosureType* blk);
|
||||
|
||||
ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_BACKWARDS_DECL)
|
||||
ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_BACKWARDS_DECL)
|
||||
#endif
|
||||
|
||||
int oop_iterate_no_header(OopClosure* bk);
|
||||
int oop_iterate_no_header(OopClosure* bk, MemRegion mr);
|
||||
#endif // INCLUDE_ALL_GCS
|
||||
|
||||
inline int oop_iterate_no_header(OopClosure* bk);
|
||||
inline int oop_iterate_no_header(OopClosure* bk, MemRegion mr);
|
||||
|
||||
// identity hash; returns the identity hash key (computes it if necessary)
|
||||
// NOTE with the introduction of UseBiasedLocking that identity_hash() might reach a
|
||||
// safepoint if called on a biased object. Calling code must be aware of that.
|
||||
intptr_t identity_hash();
|
||||
inline intptr_t identity_hash();
|
||||
intptr_t slow_identity_hash();
|
||||
|
||||
// Alternate hashing code if string table is rehashed
|
||||
unsigned int new_hash(juint seed);
|
||||
|
||||
// marks are forwarded to stack when object is locked
|
||||
bool has_displaced_mark() const;
|
||||
markOop displaced_mark() const;
|
||||
void set_displaced_mark(markOop m);
|
||||
inline bool has_displaced_mark() const;
|
||||
inline markOop displaced_mark() const;
|
||||
inline void set_displaced_mark(markOop m);
|
||||
|
||||
static bool has_klass_gap();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -41,17 +41,65 @@
|
||||
#include "runtime/os.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
||||
inline void update_barrier_set(void* p, oop v, bool release = false) {
|
||||
assert(oopDesc::bs() != NULL, "Uninitialized bs in oop!");
|
||||
oopDesc::bs()->write_ref_field(p, v, release);
|
||||
}
|
||||
|
||||
template <class T> inline void update_barrier_set_pre(T* p, oop v) {
|
||||
oopDesc::bs()->write_ref_field_pre(p, v);
|
||||
}
|
||||
|
||||
template <class T> void oop_store(T* p, oop v) {
|
||||
if (always_do_update_barrier) {
|
||||
oop_store((volatile T*)p, v);
|
||||
} else {
|
||||
update_barrier_set_pre(p, v);
|
||||
oopDesc::encode_store_heap_oop(p, v);
|
||||
// always_do_update_barrier == false =>
|
||||
// Either we are at a safepoint (in GC) or CMS is not used. In both
|
||||
// cases it's unnecessary to mark the card as dirty with release sematics.
|
||||
update_barrier_set((void*)p, v, false /* release */); // cast away type
|
||||
}
|
||||
}
|
||||
|
||||
template <class T> void oop_store(volatile T* p, oop v) {
|
||||
update_barrier_set_pre((T*)p, v); // cast away volatile
|
||||
// Used by release_obj_field_put, so use release_store_ptr.
|
||||
oopDesc::release_encode_store_heap_oop(p, v);
|
||||
// When using CMS we must mark the card corresponding to p as dirty
|
||||
// with release sematics to prevent that CMS sees the dirty card but
|
||||
// not the new value v at p due to reordering of the two
|
||||
// stores. Note that CMS has a concurrent precleaning phase, where
|
||||
// it reads the card table while the Java threads are running.
|
||||
update_barrier_set((void*)p, v, true /* release */); // cast away type
|
||||
}
|
||||
|
||||
// Should replace *addr = oop assignments where addr type depends on UseCompressedOops
|
||||
// (without having to remember the function name this calls).
|
||||
inline void oop_store_raw(HeapWord* addr, oop value) {
|
||||
if (UseCompressedOops) {
|
||||
oopDesc::encode_store_heap_oop((narrowOop*)addr, value);
|
||||
} else {
|
||||
oopDesc::encode_store_heap_oop((oop*)addr, value);
|
||||
}
|
||||
}
|
||||
|
||||
// Implementation of all inlined member functions defined in oop.hpp
|
||||
// We need a separate file to avoid circular references
|
||||
|
||||
inline void oopDesc::release_set_mark(markOop m) {
|
||||
void oopDesc::release_set_mark(markOop m) {
|
||||
OrderAccess::release_store_ptr(&_mark, m);
|
||||
}
|
||||
|
||||
inline markOop oopDesc::cas_set_mark(markOop new_mark, markOop old_mark) {
|
||||
markOop oopDesc::cas_set_mark(markOop new_mark, markOop old_mark) {
|
||||
return (markOop) Atomic::cmpxchg_ptr(new_mark, &_mark, old_mark);
|
||||
}
|
||||
|
||||
void oopDesc::init_mark() {
|
||||
set_mark(markOopDesc::prototype_for_object(this));
|
||||
}
|
||||
|
||||
inline Klass* oopDesc::klass() const {
|
||||
if (UseCompressedClassPointers) {
|
||||
return Klass::decode_klass_not_null(_metadata._compressed_klass);
|
||||
@ -60,7 +108,7 @@ inline Klass* oopDesc::klass() const {
|
||||
}
|
||||
}
|
||||
|
||||
inline Klass* oopDesc::klass_or_null() const volatile {
|
||||
Klass* oopDesc::klass_or_null() const volatile {
|
||||
// can be NULL in CMS
|
||||
if (UseCompressedClassPointers) {
|
||||
return Klass::decode_klass(_metadata._compressed_klass);
|
||||
@ -69,14 +117,14 @@ inline Klass* oopDesc::klass_or_null() const volatile {
|
||||
}
|
||||
}
|
||||
|
||||
inline Klass** oopDesc::klass_addr() {
|
||||
Klass** oopDesc::klass_addr() {
|
||||
// Only used internally and with CMS and will not work with
|
||||
// UseCompressedOops
|
||||
assert(!UseCompressedClassPointers, "only supported with uncompressed klass pointers");
|
||||
return (Klass**) &_metadata._klass;
|
||||
}
|
||||
|
||||
inline narrowKlass* oopDesc::compressed_klass_addr() {
|
||||
narrowKlass* oopDesc::compressed_klass_addr() {
|
||||
assert(UseCompressedClassPointers, "only called by compressed klass pointers");
|
||||
return &_metadata._compressed_klass;
|
||||
}
|
||||
@ -92,7 +140,7 @@ inline void oopDesc::set_klass(Klass* k) {
|
||||
}
|
||||
}
|
||||
|
||||
inline int oopDesc::klass_gap() const {
|
||||
int oopDesc::klass_gap() const {
|
||||
return *(int*)(((intptr_t)this) + klass_gap_offset_in_bytes());
|
||||
}
|
||||
|
||||
@ -102,7 +150,7 @@ inline void oopDesc::set_klass_gap(int v) {
|
||||
}
|
||||
}
|
||||
|
||||
inline void oopDesc::set_klass_to_list_ptr(oop k) {
|
||||
void oopDesc::set_klass_to_list_ptr(oop k) {
|
||||
// This is only to be used during GC, for from-space objects, so no
|
||||
// barrier is needed.
|
||||
if (UseCompressedClassPointers) {
|
||||
@ -112,7 +160,7 @@ inline void oopDesc::set_klass_to_list_ptr(oop k) {
|
||||
}
|
||||
}
|
||||
|
||||
inline oop oopDesc::list_ptr_from_klass() {
|
||||
oop oopDesc::list_ptr_from_klass() {
|
||||
// This is only to be used during GC, for from-space objects.
|
||||
if (UseCompressedClassPointers) {
|
||||
return decode_heap_oop((narrowOop)_metadata._compressed_klass);
|
||||
@ -122,261 +170,15 @@ inline oop oopDesc::list_ptr_from_klass() {
|
||||
}
|
||||
}
|
||||
|
||||
inline void oopDesc::init_mark() { set_mark(markOopDesc::prototype_for_object(this)); }
|
||||
|
||||
inline bool oopDesc::is_a(Klass* k) const { return klass()->is_subtype_of(k); }
|
||||
|
||||
inline bool oopDesc::is_instance() const {
|
||||
return klass()->is_instance_klass();
|
||||
bool oopDesc::is_a(Klass* k) const {
|
||||
return klass()->is_subtype_of(k);
|
||||
}
|
||||
|
||||
inline bool oopDesc::is_array() const { return klass()->is_array_klass(); }
|
||||
inline bool oopDesc::is_objArray() const { return klass()->is_objArray_klass(); }
|
||||
inline bool oopDesc::is_typeArray() const { return klass()->is_typeArray_klass(); }
|
||||
|
||||
inline void* oopDesc::field_base(int offset) const { return (void*)&((char*)this)[offset]; }
|
||||
|
||||
template <class T> inline T* oopDesc::obj_field_addr(int offset) const { return (T*)field_base(offset); }
|
||||
inline Metadata** oopDesc::metadata_field_addr(int offset) const { return (Metadata**)field_base(offset); }
|
||||
inline jbyte* oopDesc::byte_field_addr(int offset) const { return (jbyte*) field_base(offset); }
|
||||
inline jchar* oopDesc::char_field_addr(int offset) const { return (jchar*) field_base(offset); }
|
||||
inline jboolean* oopDesc::bool_field_addr(int offset) const { return (jboolean*)field_base(offset); }
|
||||
inline jint* oopDesc::int_field_addr(int offset) const { return (jint*) field_base(offset); }
|
||||
inline jshort* oopDesc::short_field_addr(int offset) const { return (jshort*) field_base(offset); }
|
||||
inline jlong* oopDesc::long_field_addr(int offset) const { return (jlong*) field_base(offset); }
|
||||
inline jfloat* oopDesc::float_field_addr(int offset) const { return (jfloat*) field_base(offset); }
|
||||
inline jdouble* oopDesc::double_field_addr(int offset) const { return (jdouble*) field_base(offset); }
|
||||
inline address* oopDesc::address_field_addr(int offset) const { return (address*) field_base(offset); }
|
||||
|
||||
|
||||
// Functions for getting and setting oops within instance objects.
|
||||
// If the oops are compressed, the type passed to these overloaded functions
|
||||
// is narrowOop. All functions are overloaded so they can be called by
|
||||
// template functions without conditionals (the compiler instantiates via
|
||||
// the right type and inlines the appopriate code).
|
||||
|
||||
inline bool oopDesc::is_null(oop obj) { return obj == NULL; }
|
||||
inline bool oopDesc::is_null(narrowOop obj) { return obj == 0; }
|
||||
|
||||
// Algorithm for encoding and decoding oops from 64 bit pointers to 32 bit
|
||||
// offset from the heap base. Saving the check for null can save instructions
|
||||
// in inner GC loops so these are separated.
|
||||
|
||||
inline bool check_obj_alignment(oop obj) {
|
||||
return cast_from_oop<intptr_t>(obj) % MinObjAlignmentInBytes == 0;
|
||||
inline int oopDesc::size() {
|
||||
return size_given_klass(klass());
|
||||
}
|
||||
|
||||
inline narrowOop oopDesc::encode_heap_oop_not_null(oop v) {
|
||||
assert(!is_null(v), "oop value can never be zero");
|
||||
assert(check_obj_alignment(v), "Address not aligned");
|
||||
assert(Universe::heap()->is_in_reserved(v), "Address not in heap");
|
||||
address base = Universe::narrow_oop_base();
|
||||
int shift = Universe::narrow_oop_shift();
|
||||
uint64_t pd = (uint64_t)(pointer_delta((void*)v, (void*)base, 1));
|
||||
assert(OopEncodingHeapMax > pd, "change encoding max if new encoding");
|
||||
uint64_t result = pd >> shift;
|
||||
assert((result & CONST64(0xffffffff00000000)) == 0, "narrow oop overflow");
|
||||
assert(decode_heap_oop(result) == v, "reversibility");
|
||||
return (narrowOop)result;
|
||||
}
|
||||
|
||||
inline narrowOop oopDesc::encode_heap_oop(oop v) {
|
||||
return (is_null(v)) ? (narrowOop)0 : encode_heap_oop_not_null(v);
|
||||
}
|
||||
|
||||
inline oop oopDesc::decode_heap_oop_not_null(narrowOop v) {
|
||||
assert(!is_null(v), "narrow oop value can never be zero");
|
||||
address base = Universe::narrow_oop_base();
|
||||
int shift = Universe::narrow_oop_shift();
|
||||
oop result = (oop)(void*)((uintptr_t)base + ((uintptr_t)v << shift));
|
||||
assert(check_obj_alignment(result), "address not aligned: " INTPTR_FORMAT, p2i((void*) result));
|
||||
return result;
|
||||
}
|
||||
|
||||
inline oop oopDesc::decode_heap_oop(narrowOop v) {
|
||||
return is_null(v) ? (oop)NULL : decode_heap_oop_not_null(v);
|
||||
}
|
||||
|
||||
inline oop oopDesc::decode_heap_oop_not_null(oop v) { return v; }
|
||||
inline oop oopDesc::decode_heap_oop(oop v) { return v; }
|
||||
|
||||
// Load an oop out of the Java heap as is without decoding.
|
||||
// Called by GC to check for null before decoding.
|
||||
inline oop oopDesc::load_heap_oop(oop* p) { return *p; }
|
||||
inline narrowOop oopDesc::load_heap_oop(narrowOop* p) { return *p; }
|
||||
|
||||
// Load and decode an oop out of the Java heap into a wide oop.
|
||||
inline oop oopDesc::load_decode_heap_oop_not_null(oop* p) { return *p; }
|
||||
inline oop oopDesc::load_decode_heap_oop_not_null(narrowOop* p) {
|
||||
return decode_heap_oop_not_null(*p);
|
||||
}
|
||||
|
||||
// Load and decode an oop out of the heap accepting null
|
||||
inline oop oopDesc::load_decode_heap_oop(oop* p) { return *p; }
|
||||
inline oop oopDesc::load_decode_heap_oop(narrowOop* p) {
|
||||
return decode_heap_oop(*p);
|
||||
}
|
||||
|
||||
// Store already encoded heap oop into the heap.
|
||||
inline void oopDesc::store_heap_oop(oop* p, oop v) { *p = v; }
|
||||
inline void oopDesc::store_heap_oop(narrowOop* p, narrowOop v) { *p = v; }
|
||||
|
||||
// Encode and store a heap oop.
|
||||
inline void oopDesc::encode_store_heap_oop_not_null(narrowOop* p, oop v) {
|
||||
*p = encode_heap_oop_not_null(v);
|
||||
}
|
||||
inline void oopDesc::encode_store_heap_oop_not_null(oop* p, oop v) { *p = v; }
|
||||
|
||||
// Encode and store a heap oop allowing for null.
|
||||
inline void oopDesc::encode_store_heap_oop(narrowOop* p, oop v) {
|
||||
*p = encode_heap_oop(v);
|
||||
}
|
||||
inline void oopDesc::encode_store_heap_oop(oop* p, oop v) { *p = v; }
|
||||
|
||||
// Store heap oop as is for volatile fields.
|
||||
inline void oopDesc::release_store_heap_oop(volatile oop* p, oop v) {
|
||||
OrderAccess::release_store_ptr(p, v);
|
||||
}
|
||||
inline void oopDesc::release_store_heap_oop(volatile narrowOop* p,
|
||||
narrowOop v) {
|
||||
OrderAccess::release_store(p, v);
|
||||
}
|
||||
|
||||
inline void oopDesc::release_encode_store_heap_oop_not_null(
|
||||
volatile narrowOop* p, oop v) {
|
||||
// heap oop is not pointer sized.
|
||||
OrderAccess::release_store(p, encode_heap_oop_not_null(v));
|
||||
}
|
||||
|
||||
inline void oopDesc::release_encode_store_heap_oop_not_null(
|
||||
volatile oop* p, oop v) {
|
||||
OrderAccess::release_store_ptr(p, v);
|
||||
}
|
||||
|
||||
inline void oopDesc::release_encode_store_heap_oop(volatile oop* p,
|
||||
oop v) {
|
||||
OrderAccess::release_store_ptr(p, v);
|
||||
}
|
||||
inline void oopDesc::release_encode_store_heap_oop(
|
||||
volatile narrowOop* p, oop v) {
|
||||
OrderAccess::release_store(p, encode_heap_oop(v));
|
||||
}
|
||||
|
||||
|
||||
// These functions are only used to exchange oop fields in instances,
|
||||
// not headers.
|
||||
inline oop oopDesc::atomic_exchange_oop(oop exchange_value, volatile HeapWord *dest) {
|
||||
if (UseCompressedOops) {
|
||||
// encode exchange value from oop to T
|
||||
narrowOop val = encode_heap_oop(exchange_value);
|
||||
narrowOop old = (narrowOop)Atomic::xchg(val, (narrowOop*)dest);
|
||||
// decode old from T to oop
|
||||
return decode_heap_oop(old);
|
||||
} else {
|
||||
return (oop)Atomic::xchg_ptr(exchange_value, (oop*)dest);
|
||||
}
|
||||
}
|
||||
|
||||
// In order to put or get a field out of an instance, must first check
|
||||
// if the field has been compressed and uncompress it.
|
||||
inline oop oopDesc::obj_field(int offset) const {
|
||||
return UseCompressedOops ?
|
||||
load_decode_heap_oop(obj_field_addr<narrowOop>(offset)) :
|
||||
load_decode_heap_oop(obj_field_addr<oop>(offset));
|
||||
}
|
||||
|
||||
inline void oopDesc::obj_field_put(int offset, oop value) {
|
||||
UseCompressedOops ? oop_store(obj_field_addr<narrowOop>(offset), value) :
|
||||
oop_store(obj_field_addr<oop>(offset), value);
|
||||
}
|
||||
|
||||
inline Metadata* oopDesc::metadata_field(int offset) const {
|
||||
return *metadata_field_addr(offset);
|
||||
}
|
||||
|
||||
inline void oopDesc::metadata_field_put(int offset, Metadata* value) {
|
||||
*metadata_field_addr(offset) = value;
|
||||
}
|
||||
|
||||
inline void oopDesc::obj_field_put_raw(int offset, oop value) {
|
||||
UseCompressedOops ?
|
||||
encode_store_heap_oop(obj_field_addr<narrowOop>(offset), value) :
|
||||
encode_store_heap_oop(obj_field_addr<oop>(offset), value);
|
||||
}
|
||||
inline void oopDesc::obj_field_put_volatile(int offset, oop value) {
|
||||
OrderAccess::release();
|
||||
obj_field_put(offset, value);
|
||||
OrderAccess::fence();
|
||||
}
|
||||
|
||||
inline jbyte oopDesc::byte_field(int offset) const { return (jbyte) *byte_field_addr(offset); }
|
||||
inline void oopDesc::byte_field_put(int offset, jbyte contents) { *byte_field_addr(offset) = (jint) contents; }
|
||||
|
||||
inline jboolean oopDesc::bool_field(int offset) const { return (jboolean) *bool_field_addr(offset); }
|
||||
inline void oopDesc::bool_field_put(int offset, jboolean contents) { *bool_field_addr(offset) = (jint) contents; }
|
||||
|
||||
inline jchar oopDesc::char_field(int offset) const { return (jchar) *char_field_addr(offset); }
|
||||
inline void oopDesc::char_field_put(int offset, jchar contents) { *char_field_addr(offset) = (jint) contents; }
|
||||
|
||||
inline jint oopDesc::int_field(int offset) const { return *int_field_addr(offset); }
|
||||
inline void oopDesc::int_field_put(int offset, jint contents) { *int_field_addr(offset) = contents; }
|
||||
|
||||
inline jshort oopDesc::short_field(int offset) const { return (jshort) *short_field_addr(offset); }
|
||||
inline void oopDesc::short_field_put(int offset, jshort contents) { *short_field_addr(offset) = (jint) contents;}
|
||||
|
||||
inline jlong oopDesc::long_field(int offset) const { return *long_field_addr(offset); }
|
||||
inline void oopDesc::long_field_put(int offset, jlong contents) { *long_field_addr(offset) = contents; }
|
||||
|
||||
inline jfloat oopDesc::float_field(int offset) const { return *float_field_addr(offset); }
|
||||
inline void oopDesc::float_field_put(int offset, jfloat contents) { *float_field_addr(offset) = contents; }
|
||||
|
||||
inline jdouble oopDesc::double_field(int offset) const { return *double_field_addr(offset); }
|
||||
inline void oopDesc::double_field_put(int offset, jdouble contents) { *double_field_addr(offset) = contents; }
|
||||
|
||||
inline address oopDesc::address_field(int offset) const { return *address_field_addr(offset); }
|
||||
inline void oopDesc::address_field_put(int offset, address contents) { *address_field_addr(offset) = contents; }
|
||||
|
||||
inline oop oopDesc::obj_field_acquire(int offset) const {
|
||||
return UseCompressedOops ?
|
||||
decode_heap_oop((narrowOop)
|
||||
OrderAccess::load_acquire(obj_field_addr<narrowOop>(offset)))
|
||||
: decode_heap_oop((oop)
|
||||
OrderAccess::load_ptr_acquire(obj_field_addr<oop>(offset)));
|
||||
}
|
||||
inline void oopDesc::release_obj_field_put(int offset, oop value) {
|
||||
UseCompressedOops ?
|
||||
oop_store((volatile narrowOop*)obj_field_addr<narrowOop>(offset), value) :
|
||||
oop_store((volatile oop*) obj_field_addr<oop>(offset), value);
|
||||
}
|
||||
|
||||
inline jbyte oopDesc::byte_field_acquire(int offset) const { return OrderAccess::load_acquire(byte_field_addr(offset)); }
|
||||
inline void oopDesc::release_byte_field_put(int offset, jbyte contents) { OrderAccess::release_store(byte_field_addr(offset), contents); }
|
||||
|
||||
inline jboolean oopDesc::bool_field_acquire(int offset) const { return OrderAccess::load_acquire(bool_field_addr(offset)); }
|
||||
inline void oopDesc::release_bool_field_put(int offset, jboolean contents) { OrderAccess::release_store(bool_field_addr(offset), contents); }
|
||||
|
||||
inline jchar oopDesc::char_field_acquire(int offset) const { return OrderAccess::load_acquire(char_field_addr(offset)); }
|
||||
inline void oopDesc::release_char_field_put(int offset, jchar contents) { OrderAccess::release_store(char_field_addr(offset), contents); }
|
||||
|
||||
inline jint oopDesc::int_field_acquire(int offset) const { return OrderAccess::load_acquire(int_field_addr(offset)); }
|
||||
inline void oopDesc::release_int_field_put(int offset, jint contents) { OrderAccess::release_store(int_field_addr(offset), contents); }
|
||||
|
||||
inline jshort oopDesc::short_field_acquire(int offset) const { return (jshort)OrderAccess::load_acquire(short_field_addr(offset)); }
|
||||
inline void oopDesc::release_short_field_put(int offset, jshort contents) { OrderAccess::release_store(short_field_addr(offset), contents); }
|
||||
|
||||
inline jlong oopDesc::long_field_acquire(int offset) const { return OrderAccess::load_acquire(long_field_addr(offset)); }
|
||||
inline void oopDesc::release_long_field_put(int offset, jlong contents) { OrderAccess::release_store(long_field_addr(offset), contents); }
|
||||
|
||||
inline jfloat oopDesc::float_field_acquire(int offset) const { return OrderAccess::load_acquire(float_field_addr(offset)); }
|
||||
inline void oopDesc::release_float_field_put(int offset, jfloat contents) { OrderAccess::release_store(float_field_addr(offset), contents); }
|
||||
|
||||
inline jdouble oopDesc::double_field_acquire(int offset) const { return OrderAccess::load_acquire(double_field_addr(offset)); }
|
||||
inline void oopDesc::release_double_field_put(int offset, jdouble contents) { OrderAccess::release_store(double_field_addr(offset), contents); }
|
||||
|
||||
inline address oopDesc::address_field_acquire(int offset) const { return (address) OrderAccess::load_ptr_acquire(address_field_addr(offset)); }
|
||||
inline void oopDesc::release_address_field_put(int offset, address contents) { OrderAccess::release_store_ptr(address_field_addr(offset), contents); }
|
||||
|
||||
inline int oopDesc::size_given_klass(Klass* klass) {
|
||||
int oopDesc::size_given_klass(Klass* klass) {
|
||||
int lh = klass->layout_helper();
|
||||
int s;
|
||||
|
||||
@ -461,59 +263,133 @@ inline int oopDesc::size_given_klass(Klass* klass) {
|
||||
return s;
|
||||
}
|
||||
|
||||
bool oopDesc::is_instance() const { return klass()->is_instance_klass(); }
|
||||
inline bool oopDesc::is_array() const { return klass()->is_array_klass(); }
|
||||
bool oopDesc::is_objArray() const { return klass()->is_objArray_klass(); }
|
||||
bool oopDesc::is_typeArray() const { return klass()->is_typeArray_klass(); }
|
||||
|
||||
inline int oopDesc::size() {
|
||||
return size_given_klass(klass());
|
||||
void* oopDesc::field_base(int offset) const { return (void*)&((char*)this)[offset]; }
|
||||
|
||||
jbyte* oopDesc::byte_field_addr(int offset) const { return (jbyte*) field_base(offset); }
|
||||
jchar* oopDesc::char_field_addr(int offset) const { return (jchar*) field_base(offset); }
|
||||
jboolean* oopDesc::bool_field_addr(int offset) const { return (jboolean*) field_base(offset); }
|
||||
jint* oopDesc::int_field_addr(int offset) const { return (jint*) field_base(offset); }
|
||||
jshort* oopDesc::short_field_addr(int offset) const { return (jshort*) field_base(offset); }
|
||||
jlong* oopDesc::long_field_addr(int offset) const { return (jlong*) field_base(offset); }
|
||||
jfloat* oopDesc::float_field_addr(int offset) const { return (jfloat*) field_base(offset); }
|
||||
jdouble* oopDesc::double_field_addr(int offset) const { return (jdouble*) field_base(offset); }
|
||||
Metadata** oopDesc::metadata_field_addr(int offset) const { return (Metadata**)field_base(offset); }
|
||||
|
||||
template <class T> T* oopDesc::obj_field_addr(int offset) const { return (T*) field_base(offset); }
|
||||
address* oopDesc::address_field_addr(int offset) const { return (address*) field_base(offset); }
|
||||
|
||||
|
||||
// Functions for getting and setting oops within instance objects.
|
||||
// If the oops are compressed, the type passed to these overloaded functions
|
||||
// is narrowOop. All functions are overloaded so they can be called by
|
||||
// template functions without conditionals (the compiler instantiates via
|
||||
// the right type and inlines the appopriate code).
|
||||
|
||||
// Algorithm for encoding and decoding oops from 64 bit pointers to 32 bit
|
||||
// offset from the heap base. Saving the check for null can save instructions
|
||||
// in inner GC loops so these are separated.
|
||||
|
||||
inline bool check_obj_alignment(oop obj) {
|
||||
return cast_from_oop<intptr_t>(obj) % MinObjAlignmentInBytes == 0;
|
||||
}
|
||||
|
||||
inline void update_barrier_set(void* p, oop v, bool release = false) {
|
||||
assert(oopDesc::bs() != NULL, "Uninitialized bs in oop!");
|
||||
oopDesc::bs()->write_ref_field(p, v, release);
|
||||
inline oop oopDesc::decode_heap_oop_not_null(narrowOop v) {
|
||||
assert(!is_null(v), "narrow oop value can never be zero");
|
||||
address base = Universe::narrow_oop_base();
|
||||
int shift = Universe::narrow_oop_shift();
|
||||
oop result = (oop)(void*)((uintptr_t)base + ((uintptr_t)v << shift));
|
||||
assert(check_obj_alignment(result), "address not aligned: " INTPTR_FORMAT, p2i((void*) result));
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class T> inline void update_barrier_set_pre(T* p, oop v) {
|
||||
oopDesc::bs()->write_ref_field_pre(p, v);
|
||||
inline oop oopDesc::decode_heap_oop(narrowOop v) {
|
||||
return is_null(v) ? (oop)NULL : decode_heap_oop_not_null(v);
|
||||
}
|
||||
|
||||
template <class T> inline void oop_store(T* p, oop v) {
|
||||
if (always_do_update_barrier) {
|
||||
oop_store((volatile T*)p, v);
|
||||
} else {
|
||||
update_barrier_set_pre(p, v);
|
||||
oopDesc::encode_store_heap_oop(p, v);
|
||||
// always_do_update_barrier == false =>
|
||||
// Either we are at a safepoint (in GC) or CMS is not used. In both
|
||||
// cases it's unnecessary to mark the card as dirty with release sematics.
|
||||
update_barrier_set((void*)p, v, false /* release */); // cast away type
|
||||
}
|
||||
narrowOop oopDesc::encode_heap_oop_not_null(oop v) {
|
||||
assert(!is_null(v), "oop value can never be zero");
|
||||
assert(check_obj_alignment(v), "Address not aligned");
|
||||
assert(Universe::heap()->is_in_reserved(v), "Address not in heap");
|
||||
address base = Universe::narrow_oop_base();
|
||||
int shift = Universe::narrow_oop_shift();
|
||||
uint64_t pd = (uint64_t)(pointer_delta((void*)v, (void*)base, 1));
|
||||
assert(OopEncodingHeapMax > pd, "change encoding max if new encoding");
|
||||
uint64_t result = pd >> shift;
|
||||
assert((result & CONST64(0xffffffff00000000)) == 0, "narrow oop overflow");
|
||||
assert(decode_heap_oop(result) == v, "reversibility");
|
||||
return (narrowOop)result;
|
||||
}
|
||||
|
||||
template <class T> inline void oop_store(volatile T* p, oop v) {
|
||||
update_barrier_set_pre((T*)p, v); // cast away volatile
|
||||
// Used by release_obj_field_put, so use release_store_ptr.
|
||||
oopDesc::release_encode_store_heap_oop(p, v);
|
||||
// When using CMS we must mark the card corresponding to p as dirty
|
||||
// with release sematics to prevent that CMS sees the dirty card but
|
||||
// not the new value v at p due to reordering of the two
|
||||
// stores. Note that CMS has a concurrent precleaning phase, where
|
||||
// it reads the card table while the Java threads are running.
|
||||
update_barrier_set((void*)p, v, true /* release */); // cast away type
|
||||
inline narrowOop oopDesc::encode_heap_oop(oop v) {
|
||||
return (is_null(v)) ? (narrowOop)0 : encode_heap_oop_not_null(v);
|
||||
}
|
||||
|
||||
// Should replace *addr = oop assignments where addr type depends on UseCompressedOops
|
||||
// (without having to remember the function name this calls).
|
||||
inline void oop_store_raw(HeapWord* addr, oop value) {
|
||||
// Load and decode an oop out of the Java heap into a wide oop.
|
||||
oop oopDesc::load_decode_heap_oop_not_null(narrowOop* p) {
|
||||
return decode_heap_oop_not_null(*p);
|
||||
}
|
||||
|
||||
// Load and decode an oop out of the heap accepting null
|
||||
oop oopDesc::load_decode_heap_oop(narrowOop* p) {
|
||||
return decode_heap_oop(*p);
|
||||
}
|
||||
|
||||
// Encode and store a heap oop.
|
||||
void oopDesc::encode_store_heap_oop_not_null(narrowOop* p, oop v) {
|
||||
*p = encode_heap_oop_not_null(v);
|
||||
}
|
||||
|
||||
// Encode and store a heap oop allowing for null.
|
||||
void oopDesc::encode_store_heap_oop(narrowOop* p, oop v) {
|
||||
*p = encode_heap_oop(v);
|
||||
}
|
||||
|
||||
// Store heap oop as is for volatile fields.
|
||||
void oopDesc::release_store_heap_oop(volatile oop* p, oop v) {
|
||||
OrderAccess::release_store_ptr(p, v);
|
||||
}
|
||||
void oopDesc::release_store_heap_oop(volatile narrowOop* p, narrowOop v) {
|
||||
OrderAccess::release_store(p, v);
|
||||
}
|
||||
|
||||
void oopDesc::release_encode_store_heap_oop_not_null(volatile narrowOop* p, oop v) {
|
||||
// heap oop is not pointer sized.
|
||||
OrderAccess::release_store(p, encode_heap_oop_not_null(v));
|
||||
}
|
||||
void oopDesc::release_encode_store_heap_oop_not_null(volatile oop* p, oop v) {
|
||||
OrderAccess::release_store_ptr(p, v);
|
||||
}
|
||||
|
||||
void oopDesc::release_encode_store_heap_oop(volatile oop* p, oop v) {
|
||||
OrderAccess::release_store_ptr(p, v);
|
||||
}
|
||||
void oopDesc::release_encode_store_heap_oop(volatile narrowOop* p, oop v) {
|
||||
OrderAccess::release_store(p, encode_heap_oop(v));
|
||||
}
|
||||
|
||||
// These functions are only used to exchange oop fields in instances,
|
||||
// not headers.
|
||||
oop oopDesc::atomic_exchange_oop(oop exchange_value, volatile HeapWord *dest) {
|
||||
if (UseCompressedOops) {
|
||||
oopDesc::encode_store_heap_oop((narrowOop*)addr, value);
|
||||
// encode exchange value from oop to T
|
||||
narrowOop val = encode_heap_oop(exchange_value);
|
||||
narrowOop old = (narrowOop)Atomic::xchg(val, (narrowOop*)dest);
|
||||
// decode old from T to oop
|
||||
return decode_heap_oop(old);
|
||||
} else {
|
||||
oopDesc::encode_store_heap_oop((oop*)addr, value);
|
||||
return (oop)Atomic::xchg_ptr(exchange_value, (oop*)dest);
|
||||
}
|
||||
}
|
||||
|
||||
inline oop oopDesc::atomic_compare_exchange_oop(oop exchange_value,
|
||||
volatile HeapWord *dest,
|
||||
oop compare_value,
|
||||
bool prebarrier) {
|
||||
oop oopDesc::atomic_compare_exchange_oop(oop exchange_value,
|
||||
volatile HeapWord *dest,
|
||||
oop compare_value,
|
||||
bool prebarrier) {
|
||||
if (UseCompressedOops) {
|
||||
if (prebarrier) {
|
||||
update_barrier_set_pre((narrowOop*)dest, exchange_value);
|
||||
@ -533,24 +409,112 @@ inline oop oopDesc::atomic_compare_exchange_oop(oop exchange_value,
|
||||
}
|
||||
}
|
||||
|
||||
// Used only for markSweep, scavenging
|
||||
inline bool oopDesc::is_gc_marked() const {
|
||||
return mark()->is_marked();
|
||||
// In order to put or get a field out of an instance, must first check
|
||||
// if the field has been compressed and uncompress it.
|
||||
oop oopDesc::obj_field(int offset) const {
|
||||
return UseCompressedOops ?
|
||||
load_decode_heap_oop(obj_field_addr<narrowOop>(offset)) :
|
||||
load_decode_heap_oop(obj_field_addr<oop>(offset));
|
||||
}
|
||||
|
||||
inline bool oopDesc::is_locked() const {
|
||||
void oopDesc::obj_field_put(int offset, oop value) {
|
||||
UseCompressedOops ? oop_store(obj_field_addr<narrowOop>(offset), value) :
|
||||
oop_store(obj_field_addr<oop>(offset), value);
|
||||
}
|
||||
|
||||
void oopDesc::obj_field_put_raw(int offset, oop value) {
|
||||
UseCompressedOops ?
|
||||
encode_store_heap_oop(obj_field_addr<narrowOop>(offset), value) :
|
||||
encode_store_heap_oop(obj_field_addr<oop>(offset), value);
|
||||
}
|
||||
void oopDesc::obj_field_put_volatile(int offset, oop value) {
|
||||
OrderAccess::release();
|
||||
obj_field_put(offset, value);
|
||||
OrderAccess::fence();
|
||||
}
|
||||
|
||||
Metadata* oopDesc::metadata_field(int offset) const { return *metadata_field_addr(offset); }
|
||||
void oopDesc::metadata_field_put(int offset, Metadata* value) { *metadata_field_addr(offset) = value; }
|
||||
|
||||
jbyte oopDesc::byte_field(int offset) const { return (jbyte) *byte_field_addr(offset); }
|
||||
void oopDesc::byte_field_put(int offset, jbyte contents) { *byte_field_addr(offset) = (jint) contents; }
|
||||
|
||||
jchar oopDesc::char_field(int offset) const { return (jchar) *char_field_addr(offset); }
|
||||
void oopDesc::char_field_put(int offset, jchar contents) { *char_field_addr(offset) = (jint) contents; }
|
||||
|
||||
jboolean oopDesc::bool_field(int offset) const { return (jboolean) *bool_field_addr(offset); }
|
||||
void oopDesc::bool_field_put(int offset, jboolean contents) { *bool_field_addr(offset) = (jint) contents; }
|
||||
|
||||
jint oopDesc::int_field(int offset) const { return *int_field_addr(offset); }
|
||||
void oopDesc::int_field_put(int offset, jint contents) { *int_field_addr(offset) = contents; }
|
||||
|
||||
jshort oopDesc::short_field(int offset) const { return (jshort) *short_field_addr(offset); }
|
||||
void oopDesc::short_field_put(int offset, jshort contents) { *short_field_addr(offset) = (jint) contents;}
|
||||
|
||||
jlong oopDesc::long_field(int offset) const { return *long_field_addr(offset); }
|
||||
void oopDesc::long_field_put(int offset, jlong contents) { *long_field_addr(offset) = contents; }
|
||||
|
||||
jfloat oopDesc::float_field(int offset) const { return *float_field_addr(offset); }
|
||||
void oopDesc::float_field_put(int offset, jfloat contents) { *float_field_addr(offset) = contents; }
|
||||
|
||||
jdouble oopDesc::double_field(int offset) const { return *double_field_addr(offset); }
|
||||
void oopDesc::double_field_put(int offset, jdouble contents) { *double_field_addr(offset) = contents; }
|
||||
|
||||
address oopDesc::address_field(int offset) const { return *address_field_addr(offset); }
|
||||
void oopDesc::address_field_put(int offset, address contents) { *address_field_addr(offset) = contents; }
|
||||
|
||||
oop oopDesc::obj_field_acquire(int offset) const {
|
||||
return UseCompressedOops ?
|
||||
decode_heap_oop((narrowOop)
|
||||
OrderAccess::load_acquire(obj_field_addr<narrowOop>(offset)))
|
||||
: decode_heap_oop((oop)
|
||||
OrderAccess::load_ptr_acquire(obj_field_addr<oop>(offset)));
|
||||
}
|
||||
void oopDesc::release_obj_field_put(int offset, oop value) {
|
||||
UseCompressedOops ?
|
||||
oop_store((volatile narrowOop*)obj_field_addr<narrowOop>(offset), value) :
|
||||
oop_store((volatile oop*) obj_field_addr<oop>(offset), value);
|
||||
}
|
||||
|
||||
jbyte oopDesc::byte_field_acquire(int offset) const { return OrderAccess::load_acquire(byte_field_addr(offset)); }
|
||||
void oopDesc::release_byte_field_put(int offset, jbyte contents) { OrderAccess::release_store(byte_field_addr(offset), contents); }
|
||||
|
||||
jchar oopDesc::char_field_acquire(int offset) const { return OrderAccess::load_acquire(char_field_addr(offset)); }
|
||||
void oopDesc::release_char_field_put(int offset, jchar contents) { OrderAccess::release_store(char_field_addr(offset), contents); }
|
||||
|
||||
jboolean oopDesc::bool_field_acquire(int offset) const { return OrderAccess::load_acquire(bool_field_addr(offset)); }
|
||||
void oopDesc::release_bool_field_put(int offset, jboolean contents) { OrderAccess::release_store(bool_field_addr(offset), contents); }
|
||||
|
||||
jint oopDesc::int_field_acquire(int offset) const { return OrderAccess::load_acquire(int_field_addr(offset)); }
|
||||
void oopDesc::release_int_field_put(int offset, jint contents) { OrderAccess::release_store(int_field_addr(offset), contents); }
|
||||
|
||||
jshort oopDesc::short_field_acquire(int offset) const { return (jshort)OrderAccess::load_acquire(short_field_addr(offset)); }
|
||||
void oopDesc::release_short_field_put(int offset, jshort contents) { OrderAccess::release_store(short_field_addr(offset), contents); }
|
||||
|
||||
jlong oopDesc::long_field_acquire(int offset) const { return OrderAccess::load_acquire(long_field_addr(offset)); }
|
||||
void oopDesc::release_long_field_put(int offset, jlong contents) { OrderAccess::release_store(long_field_addr(offset), contents); }
|
||||
|
||||
jfloat oopDesc::float_field_acquire(int offset) const { return OrderAccess::load_acquire(float_field_addr(offset)); }
|
||||
void oopDesc::release_float_field_put(int offset, jfloat contents) { OrderAccess::release_store(float_field_addr(offset), contents); }
|
||||
|
||||
jdouble oopDesc::double_field_acquire(int offset) const { return OrderAccess::load_acquire(double_field_addr(offset)); }
|
||||
void oopDesc::release_double_field_put(int offset, jdouble contents) { OrderAccess::release_store(double_field_addr(offset), contents); }
|
||||
|
||||
address oopDesc::address_field_acquire(int offset) const { return (address) OrderAccess::load_ptr_acquire(address_field_addr(offset)); }
|
||||
void oopDesc::release_address_field_put(int offset, address contents) { OrderAccess::release_store_ptr(address_field_addr(offset), contents); }
|
||||
|
||||
bool oopDesc::is_locked() const {
|
||||
return mark()->is_locked();
|
||||
}
|
||||
|
||||
inline bool oopDesc::is_unlocked() const {
|
||||
bool oopDesc::is_unlocked() const {
|
||||
return mark()->is_unlocked();
|
||||
}
|
||||
|
||||
inline bool oopDesc::has_bias_pattern() const {
|
||||
bool oopDesc::has_bias_pattern() const {
|
||||
return mark()->has_bias_pattern();
|
||||
}
|
||||
|
||||
|
||||
// used only for asserts
|
||||
inline bool oopDesc::is_oop(bool ignore_mark_word) const {
|
||||
oop obj = (oop) this;
|
||||
@ -580,25 +544,30 @@ inline bool oopDesc::is_oop_or_null(bool ignore_mark_word) const {
|
||||
|
||||
#ifndef PRODUCT
|
||||
// used only for asserts
|
||||
inline bool oopDesc::is_unlocked_oop() const {
|
||||
bool oopDesc::is_unlocked_oop() const {
|
||||
if (!Universe::heap()->is_in_reserved(this)) return false;
|
||||
return mark()->is_unlocked();
|
||||
}
|
||||
#endif // PRODUCT
|
||||
|
||||
inline bool oopDesc::is_scavengable() const {
|
||||
// Used only for markSweep, scavenging
|
||||
bool oopDesc::is_gc_marked() const {
|
||||
return mark()->is_marked();
|
||||
}
|
||||
|
||||
bool oopDesc::is_scavengable() const {
|
||||
return Universe::heap()->is_scavengable(this);
|
||||
}
|
||||
|
||||
// Used by scavengers
|
||||
inline bool oopDesc::is_forwarded() const {
|
||||
bool oopDesc::is_forwarded() const {
|
||||
// The extra heap check is needed since the obj might be locked, in which case the
|
||||
// mark would point to a stack location and have the sentinel bit cleared
|
||||
return mark()->is_marked();
|
||||
}
|
||||
|
||||
// Used by scavengers
|
||||
inline void oopDesc::forward_to(oop p) {
|
||||
void oopDesc::forward_to(oop p) {
|
||||
assert(check_obj_alignment(p),
|
||||
"forwarding to something not aligned");
|
||||
assert(Universe::heap()->is_in_reserved(p),
|
||||
@ -609,7 +578,7 @@ inline void oopDesc::forward_to(oop p) {
|
||||
}
|
||||
|
||||
// Used by parallel scavengers
|
||||
inline bool oopDesc::cas_forward_to(oop p, markOop compare) {
|
||||
bool oopDesc::cas_forward_to(oop p, markOop compare) {
|
||||
assert(check_obj_alignment(p),
|
||||
"forwarding to something not aligned");
|
||||
assert(Universe::heap()->is_in_reserved(p),
|
||||
@ -620,7 +589,7 @@ inline bool oopDesc::cas_forward_to(oop p, markOop compare) {
|
||||
}
|
||||
|
||||
#if INCLUDE_ALL_GCS
|
||||
inline oop oopDesc::forward_to_atomic(oop p) {
|
||||
oop oopDesc::forward_to_atomic(oop p) {
|
||||
markOop oldMark = mark();
|
||||
markOop forwardPtrMark = markOopDesc::encode_pointer_as_mark(p);
|
||||
markOop curMark;
|
||||
@ -646,22 +615,10 @@ inline oop oopDesc::forward_to_atomic(oop p) {
|
||||
// Note that the forwardee is not the same thing as the displaced_mark.
|
||||
// The forwardee is used when copying during scavenge and mark-sweep.
|
||||
// It does need to clear the low two locking- and GC-related bits.
|
||||
inline oop oopDesc::forwardee() const {
|
||||
oop oopDesc::forwardee() const {
|
||||
return (oop) mark()->decode_pointer();
|
||||
}
|
||||
|
||||
inline bool oopDesc::has_displaced_mark() const {
|
||||
return mark()->has_displaced_mark_helper();
|
||||
}
|
||||
|
||||
inline markOop oopDesc::displaced_mark() const {
|
||||
return mark()->displaced_mark_helper();
|
||||
}
|
||||
|
||||
inline void oopDesc::set_displaced_mark(markOop m) {
|
||||
mark()->set_displaced_mark_helper(m);
|
||||
}
|
||||
|
||||
// The following method needs to be MT safe.
|
||||
inline uint oopDesc::age() const {
|
||||
assert(!is_forwarded(), "Attempt to read age from forwarded mark");
|
||||
@ -672,7 +629,7 @@ inline uint oopDesc::age() const {
|
||||
}
|
||||
}
|
||||
|
||||
inline void oopDesc::incr_age() {
|
||||
void oopDesc::incr_age() {
|
||||
assert(!is_forwarded(), "Attempt to increment age of forwarded mark");
|
||||
if (has_displaced_mark()) {
|
||||
set_displaced_mark(displaced_mark()->incr_age());
|
||||
@ -681,21 +638,7 @@ inline void oopDesc::incr_age() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline intptr_t oopDesc::identity_hash() {
|
||||
// Fast case; if the object is unlocked and the hash value is set, no locking is needed
|
||||
// Note: The mark must be read into local variable to avoid concurrent updates.
|
||||
markOop mrk = mark();
|
||||
if (mrk->is_unlocked() && !mrk->has_no_hash()) {
|
||||
return mrk->hash();
|
||||
} else if (mrk->is_marked()) {
|
||||
return mrk->hash();
|
||||
} else {
|
||||
return slow_identity_hash();
|
||||
}
|
||||
}
|
||||
|
||||
inline int oopDesc::ms_adjust_pointers() {
|
||||
int oopDesc::ms_adjust_pointers() {
|
||||
debug_only(int check_size = size());
|
||||
int s = klass()->oop_ms_adjust_pointers(this);
|
||||
assert(s == check_size, "should be the same");
|
||||
@ -703,11 +646,11 @@ inline int oopDesc::ms_adjust_pointers() {
|
||||
}
|
||||
|
||||
#if INCLUDE_ALL_GCS
|
||||
inline void oopDesc::pc_follow_contents(ParCompactionManager* cm) {
|
||||
void oopDesc::pc_follow_contents(ParCompactionManager* cm) {
|
||||
klass()->oop_pc_follow_contents(this, cm);
|
||||
}
|
||||
|
||||
inline void oopDesc::pc_update_contents() {
|
||||
void oopDesc::pc_update_contents() {
|
||||
Klass* k = klass();
|
||||
if (!k->is_typeArray_klass()) {
|
||||
// It might contain oops beyond the header, so take the virtual call.
|
||||
@ -716,7 +659,7 @@ inline void oopDesc::pc_update_contents() {
|
||||
// Else skip it. The TypeArrayKlass in the header never needs scavenging.
|
||||
}
|
||||
|
||||
inline void oopDesc::ps_push_contents(PSPromotionManager* pm) {
|
||||
void oopDesc::ps_push_contents(PSPromotionManager* pm) {
|
||||
Klass* k = klass();
|
||||
if (!k->is_typeArray_klass()) {
|
||||
// It might contain oops beyond the header, so take the virtual call.
|
||||
@ -724,43 +667,42 @@ inline void oopDesc::ps_push_contents(PSPromotionManager* pm) {
|
||||
}
|
||||
// Else skip it. The TypeArrayKlass in the header never needs scavenging.
|
||||
}
|
||||
#endif
|
||||
#endif // INCLUDE_ALL_GCS
|
||||
|
||||
#define OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \
|
||||
\
|
||||
inline void oopDesc::oop_iterate(OopClosureType* blk) { \
|
||||
klass()->oop_oop_iterate##nv_suffix(this, blk); \
|
||||
} \
|
||||
\
|
||||
inline void oopDesc::oop_iterate(OopClosureType* blk, MemRegion mr) { \
|
||||
klass()->oop_oop_iterate_bounded##nv_suffix(this, blk, mr); \
|
||||
#define OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \
|
||||
\
|
||||
void oopDesc::oop_iterate(OopClosureType* blk) { \
|
||||
klass()->oop_oop_iterate##nv_suffix(this, blk); \
|
||||
} \
|
||||
\
|
||||
void oopDesc::oop_iterate(OopClosureType* blk, MemRegion mr) { \
|
||||
klass()->oop_oop_iterate_bounded##nv_suffix(this, blk, mr); \
|
||||
}
|
||||
|
||||
#define OOP_ITERATE_SIZE_DEFN(OopClosureType, nv_suffix) \
|
||||
\
|
||||
inline int oopDesc::oop_iterate_size(OopClosureType* blk) { \
|
||||
Klass* k = klass(); \
|
||||
int size = size_given_klass(k); \
|
||||
k->oop_oop_iterate##nv_suffix(this, blk); \
|
||||
return size; \
|
||||
} \
|
||||
\
|
||||
inline int oopDesc::oop_iterate_size(OopClosureType* blk, \
|
||||
MemRegion mr) { \
|
||||
Klass* k = klass(); \
|
||||
int size = size_given_klass(k); \
|
||||
k->oop_oop_iterate_bounded##nv_suffix(this, blk, mr); \
|
||||
return size; \
|
||||
#define OOP_ITERATE_SIZE_DEFN(OopClosureType, nv_suffix) \
|
||||
\
|
||||
int oopDesc::oop_iterate_size(OopClosureType* blk) { \
|
||||
Klass* k = klass(); \
|
||||
int size = size_given_klass(k); \
|
||||
k->oop_oop_iterate##nv_suffix(this, blk); \
|
||||
return size; \
|
||||
} \
|
||||
\
|
||||
int oopDesc::oop_iterate_size(OopClosureType* blk, MemRegion mr) { \
|
||||
Klass* k = klass(); \
|
||||
int size = size_given_klass(k); \
|
||||
k->oop_oop_iterate_bounded##nv_suffix(this, blk, mr); \
|
||||
return size; \
|
||||
}
|
||||
|
||||
inline int oopDesc::oop_iterate_no_header(OopClosure* blk) {
|
||||
int oopDesc::oop_iterate_no_header(OopClosure* blk) {
|
||||
// The NoHeaderExtendedOopClosure wraps the OopClosure and proxies all
|
||||
// the do_oop calls, but turns off all other features in ExtendedOopClosure.
|
||||
NoHeaderExtendedOopClosure cl(blk);
|
||||
return oop_iterate_size(&cl);
|
||||
}
|
||||
|
||||
inline int oopDesc::oop_iterate_no_header(OopClosure* blk, MemRegion mr) {
|
||||
int oopDesc::oop_iterate_no_header(OopClosure* blk, MemRegion mr) {
|
||||
NoHeaderExtendedOopClosure cl(blk);
|
||||
return oop_iterate_size(&cl, mr);
|
||||
}
|
||||
@ -773,7 +715,7 @@ inline void oopDesc::oop_iterate_backwards(OopClosureType* blk) { \
|
||||
}
|
||||
#else
|
||||
#define OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix)
|
||||
#endif
|
||||
#endif // INCLUDE_ALL_GCS
|
||||
|
||||
#define ALL_OOPDESC_OOP_ITERATE(OopClosureType, nv_suffix) \
|
||||
OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \
|
||||
@ -783,4 +725,29 @@ inline void oopDesc::oop_iterate_backwards(OopClosureType* blk) { \
|
||||
ALL_OOP_OOP_ITERATE_CLOSURES_1(ALL_OOPDESC_OOP_ITERATE)
|
||||
ALL_OOP_OOP_ITERATE_CLOSURES_2(ALL_OOPDESC_OOP_ITERATE)
|
||||
|
||||
intptr_t oopDesc::identity_hash() {
|
||||
// Fast case; if the object is unlocked and the hash value is set, no locking is needed
|
||||
// Note: The mark must be read into local variable to avoid concurrent updates.
|
||||
markOop mrk = mark();
|
||||
if (mrk->is_unlocked() && !mrk->has_no_hash()) {
|
||||
return mrk->hash();
|
||||
} else if (mrk->is_marked()) {
|
||||
return mrk->hash();
|
||||
} else {
|
||||
return slow_identity_hash();
|
||||
}
|
||||
}
|
||||
|
||||
bool oopDesc::has_displaced_mark() const {
|
||||
return mark()->has_displaced_mark_helper();
|
||||
}
|
||||
|
||||
markOop oopDesc::displaced_mark() const {
|
||||
return mark()->displaced_mark_helper();
|
||||
}
|
||||
|
||||
void oopDesc::set_displaced_mark(markOop m) {
|
||||
mark()->set_displaced_mark_helper(m);
|
||||
}
|
||||
|
||||
#endif // SHARE_VM_OOPS_OOP_INLINE_HPP
|
||||
|
@ -37,7 +37,7 @@
|
||||
#include "oops/objArrayKlass.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/typeArrayKlass.inline.hpp"
|
||||
#include "oops/typeArrayOop.hpp"
|
||||
#include "oops/typeArrayOop.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/orderAccess.inline.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -160,10 +160,7 @@ class typeArrayOopDesc : public arrayOopDesc {
|
||||
}
|
||||
|
||||
public:
|
||||
int object_size() {
|
||||
TypeArrayKlass* tk = TypeArrayKlass::cast(klass());
|
||||
return object_size(tk->layout_helper(), length());
|
||||
}
|
||||
inline int object_size();
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_OOPS_TYPEARRAYOOP_HPP
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -22,8 +22,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#ifndef SHARE_VM_OOPS_TYPEARRAYOOP_INLINE_HPP
|
||||
#define SHARE_VM_OOPS_TYPEARRAYOOP_INLINE_HPP
|
||||
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/typeArrayOop.hpp"
|
||||
|
||||
// <<this page is intentionally left blank>>
|
||||
int typeArrayOopDesc::object_size() {
|
||||
TypeArrayKlass* tk = TypeArrayKlass::cast(klass());
|
||||
return object_size(tk->layout_helper(), length());
|
||||
}
|
||||
|
||||
#endif // SHARE_VM_OOPS_TYPEARRAYOOP_INLINE_HPP
|
@ -46,6 +46,7 @@
|
||||
#include "memory/oopFactory.hpp"
|
||||
#include "oops/objArrayKlass.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/typeArrayOop.inline.hpp"
|
||||
#include "opto/ad.hpp"
|
||||
#include "opto/addnode.hpp"
|
||||
#include "opto/callnode.hpp"
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "classfile/altHashing.hpp"
|
||||
#include "classfile/classFileStream.hpp"
|
||||
#include "classfile/classLoader.hpp"
|
||||
#include "classfile/javaClasses.hpp"
|
||||
#include "classfile/javaClasses.inline.hpp"
|
||||
#include "classfile/symbolTable.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#include "classfile/vmSymbols.hpp"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "classfile/javaClasses.inline.hpp"
|
||||
#include "classfile/symbolTable.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#include "classfile/vmSymbols.hpp"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -36,6 +36,7 @@
|
||||
#include "memory/oopFactory.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "oops/objArrayOop.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/fieldStreams.hpp"
|
||||
#include "oops/verifyOopClosure.hpp"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -25,6 +25,7 @@
|
||||
#include "precompiled.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#include "classfile/vmSymbols.hpp"
|
||||
#include "oops/objArrayOop.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/interfaceSupport.hpp"
|
||||
#include "runtime/java.hpp"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -27,6 +27,7 @@
|
||||
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#include "oops/objArrayOop.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
|
||||
//
|
||||
// Serviceability utility functions.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,6 +28,7 @@
|
||||
#include "memory/heapInspection.hpp"
|
||||
#include "memory/oopFactory.hpp"
|
||||
#include "oops/instanceKlass.hpp"
|
||||
#include "oops/objArrayOop.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/atomic.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "classfile/altHashing.hpp"
|
||||
#include "classfile/javaClasses.hpp"
|
||||
#include "classfile/javaClasses.inline.hpp"
|
||||
#include "classfile/stringTable.hpp"
|
||||
#include "memory/allocation.inline.hpp"
|
||||
#include "memory/filemap.hpp"
|
||||
|
Loading…
Reference in New Issue
Block a user