Skip to content
Permalink
Browse files
Merge
  • Loading branch information
prsadhuk committed Jun 10, 2020
2 parents 41c5a07 + 07e6b75 commit a6df9ae23a0d388348aa234fef57f6b711ce231b
Showing 66 changed files with 1,507 additions and 381 deletions.
@@ -426,7 +426,10 @@ var getJibProfilesProfiles = function (input, common, data) {
target_cpu: "x64",
dependencies: ["devkit", "gtest", "pandoc", "graalunit_lib"],
configure_args: concat(common.configure_args_64bit, "--with-zlib=system",
"--with-macosx-version-max=10.9.0"),
"--with-macosx-version-max=10.9.0",
// Use system SetFile instead of the one in the devkit as the
// devkit one may not work on Catalina.
"SETFILE=/usr/bin/SetFile"),
},

"windows-x64": {
@@ -56,6 +56,6 @@ const bool CCallingConventionRequiresIntsAsLongs = false;

#define SUPPORT_RESERVED_STACK_AREA

#define COMPRESSED_CLASS_POINTERS_DEPENDS_ON_COMPRESSED_OOPS true
#define COMPRESSED_CLASS_POINTERS_DEPENDS_ON_COMPRESSED_OOPS false

#endif // CPU_AARCH64_GLOBALDEFINITIONS_AARCH64_HPP
@@ -93,4 +93,6 @@
return byte_offset_of(JavaFrameAnchor, _last_Java_fp);
}

void set_last_Java_sp(intptr_t* sp) { _last_Java_sp = sp; }

#endif // CPU_ZERO_JAVAFRAMEANCHOR_ZERO_HPP
@@ -487,7 +487,7 @@ void ClassLoaderData::add_class(Klass* k, bool publicize /* true */) {
void ClassLoaderData::initialize_holder(Handle loader_or_mirror) {
if (loader_or_mirror() != NULL) {
assert(_holder.is_null(), "never replace holders");
_holder = WeakHandle<vm_class_loader_data>::create(loader_or_mirror);
_holder = WeakHandle<vm_weak_data>::create(loader_or_mirror);
}
}

@@ -109,9 +109,9 @@ class ClassLoaderData : public CHeapObj<mtClass> {

static ClassLoaderData * _the_null_class_loader_data;

WeakHandle<vm_class_loader_data> _holder; // The oop that determines lifetime of this class loader
OopHandle _class_loader; // The instance of java/lang/ClassLoader associated with
// this ClassLoaderData
WeakHandle<vm_weak_data> _holder; // The oop that determines lifetime of this class loader
OopHandle _class_loader; // The instance of java/lang/ClassLoader associated with
// this ClassLoaderData

ClassLoaderMetaspace * volatile _metaspace; // Meta-space where meta-data defined by the
// classes in the class loader are allocated.
@@ -45,7 +45,7 @@ int ProtectionDomainCacheTable::index_for(Handle protection_domain) {
}

ProtectionDomainCacheTable::ProtectionDomainCacheTable(int table_size)
: Hashtable<WeakHandle<vm_class_loader_data>, mtClass>(table_size, sizeof(ProtectionDomainCacheEntry))
: Hashtable<WeakHandle<vm_weak_data>, mtClass>(table_size, sizeof(ProtectionDomainCacheEntry))
{ _dead_entries = false;
_total_oops_removed = 0;
}
@@ -180,8 +180,8 @@ ProtectionDomainCacheEntry* ProtectionDomainCacheTable::add_entry(int index, uns
protection_domain->print_value_on(&ls);
ls.cr();
}
WeakHandle<vm_class_loader_data> w = WeakHandle<vm_class_loader_data>::create(protection_domain);
WeakHandle<vm_weak_data> w = WeakHandle<vm_weak_data>::create(protection_domain);
ProtectionDomainCacheEntry* p = new_entry(hash, w);
Hashtable<WeakHandle<vm_class_loader_data>, mtClass>::add_entry(index, p);
Hashtable<WeakHandle<vm_weak_data>, mtClass>::add_entry(index, p);
return p;
}
@@ -35,18 +35,18 @@
// to dictionary.hpp pd_set for more information about how protection domain entries
// are used.
// This table is walked during GC, rather than the class loader data graph dictionaries.
class ProtectionDomainCacheEntry : public HashtableEntry<WeakHandle<vm_class_loader_data>, mtClass> {
class ProtectionDomainCacheEntry : public HashtableEntry<WeakHandle<vm_weak_data>, mtClass> {
friend class VMStructs;
public:
oop object();
oop object_no_keepalive();

ProtectionDomainCacheEntry* next() {
return (ProtectionDomainCacheEntry*)HashtableEntry<WeakHandle<vm_class_loader_data>, mtClass>::next();
return (ProtectionDomainCacheEntry*)HashtableEntry<WeakHandle<vm_weak_data>, mtClass>::next();
}

ProtectionDomainCacheEntry** next_addr() {
return (ProtectionDomainCacheEntry**)HashtableEntry<WeakHandle<vm_class_loader_data>, mtClass>::next_addr();
return (ProtectionDomainCacheEntry**)HashtableEntry<WeakHandle<vm_weak_data>, mtClass>::next_addr();
}

void verify();
@@ -61,21 +61,21 @@ class ProtectionDomainCacheEntry : public HashtableEntry<WeakHandle<vm_class_loa
// we only need to iterate over this set.
// The amount of different protection domains used is typically magnitudes smaller
// than the number of system dictionary entries (loaded classes).
class ProtectionDomainCacheTable : public Hashtable<WeakHandle<vm_class_loader_data>, mtClass> {
class ProtectionDomainCacheTable : public Hashtable<WeakHandle<vm_weak_data>, mtClass> {
friend class VMStructs;
private:
ProtectionDomainCacheEntry* bucket(int i) const {
return (ProtectionDomainCacheEntry*) Hashtable<WeakHandle<vm_class_loader_data>, mtClass>::bucket(i);
return (ProtectionDomainCacheEntry*) Hashtable<WeakHandle<vm_weak_data>, mtClass>::bucket(i);
}

// The following method is not MT-safe and must be done under lock.
ProtectionDomainCacheEntry** bucket_addr(int i) {
return (ProtectionDomainCacheEntry**) Hashtable<WeakHandle<vm_class_loader_data>, mtClass>::bucket_addr(i);
return (ProtectionDomainCacheEntry**) Hashtable<WeakHandle<vm_weak_data>, mtClass>::bucket_addr(i);
}

ProtectionDomainCacheEntry* new_entry(unsigned int hash, WeakHandle<vm_class_loader_data> protection_domain) {
ProtectionDomainCacheEntry* new_entry(unsigned int hash, WeakHandle<vm_weak_data> protection_domain) {
ProtectionDomainCacheEntry* entry = (ProtectionDomainCacheEntry*)
Hashtable<WeakHandle<vm_class_loader_data>, mtClass>::new_entry(hash, protection_domain);
Hashtable<WeakHandle<vm_weak_data>, mtClass>::new_entry(hash, protection_domain);
return entry;
}

@@ -99,7 +99,6 @@ class PSPromotionManager {
static MutableSpace* young_space() { return _young_space; }

inline static PSPromotionManager* manager_array(uint index);
template <class T> inline void claim_or_forward_internal_depth(T* p);

template <class T> void process_array_chunk_work(oop obj,
int start, int end);
@@ -36,6 +36,7 @@
#include "memory/iterator.inline.hpp"
#include "oops/access.inline.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/prefetch.inline.hpp"

inline PSPromotionManager* PSPromotionManager::manager_array(uint index) {
assert(_manager_array != NULL, "access of NULL manager_array");
@@ -47,29 +48,13 @@ inline void PSPromotionManager::push_depth(ScannerTask task) {
claimed_stack_depth()->push(task);
}

template <class T>
inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) {
if (p != NULL) { // XXX: error if p != NULL here
oop o = RawAccess<IS_NOT_NULL>::oop_load(p);
if (o->is_forwarded()) {
o = o->forwardee();
// Card mark
if (PSScavenge::is_obj_in_young(o)) {
PSScavenge::card_table()->inline_write_ref_field_gc(p, o);
}
RawAccess<IS_NOT_NULL>::oop_store(p, o);
} else {
push_depth(ScannerTask(p));
}
}
}

template <class T>
inline void PSPromotionManager::claim_or_forward_depth(T* p) {
assert(should_scavenge(p, true), "revisiting object?");
assert(ParallelScavengeHeap::heap()->is_in(p), "pointer outside heap");

claim_or_forward_internal_depth(p);
oop obj = RawAccess<IS_NOT_NULL>::oop_load(p);
Prefetch::write(obj->mark_addr_raw(), 0);
push_depth(ScannerTask(p));
}

inline void PSPromotionManager::promotion_trace_event(oop new_obj, oop old_obj,
@@ -31,7 +31,7 @@
#include "utilities/debug.hpp"
#include "utilities/ostream.hpp"

template <> OopStorage* WeakHandle<vm_class_loader_data>::get_storage() {
template <> OopStorage* WeakHandle<vm_weak_data>::get_storage() {
return OopStorageSet::vm_weak();
}

@@ -77,6 +77,6 @@ void WeakHandle<T>::print_on(outputStream* st) const {
}

// Provide instantiation.
template class WeakHandle<vm_class_loader_data>;
template class WeakHandle<vm_weak_data>;
template class WeakHandle<vm_string_table_data>;
template class WeakHandle<vm_resolved_method_table_data>;
@@ -39,7 +39,11 @@ class OopStorage;
// This is the vm version of jweak but has different GC lifetimes and policies,
// depending on the type.

enum WeakHandleType { vm_class_loader_data, vm_string_table_data, vm_resolved_method_table_data };
enum WeakHandleType {
vm_weak_data,
vm_string_table_data,
vm_resolved_method_table_data
};

template <WeakHandleType T>
class WeakHandle {
@@ -664,9 +664,17 @@ JRT_LEAF(BasicType, Deoptimization::unpack_frames(JavaThread* thread, int exec_m

UnrollBlock* info = array->unroll_block();

// We set the last_Java frame. But the stack isn't really parsable here. So we
// clear it to make sure JFR understands not to try and walk stacks from events
// in here.
intptr_t* sp = thread->frame_anchor()->last_Java_sp();
thread->frame_anchor()->set_last_Java_sp(NULL);

// Unpack the interpreter frames and any adapter frame (c2 only) we might create.
array->unpack_to_stack(stub_frame, exec_mode, info->caller_actual_parameters());

thread->frame_anchor()->set_last_Java_sp(sp);

BasicType bt = info->return_type();

// If we have an exception pending, claim that the return type is an oop
@@ -802,7 +810,6 @@ JRT_LEAF(BasicType, Deoptimization::unpack_frames(JavaThread* thread, int exec_m
}
#endif /* !PRODUCT */


return bt;
JRT_END

@@ -322,7 +322,7 @@ void mutex_init() {
def(JfrMsg_lock , PaddedMonitor, leaf, true, _safepoint_check_always);
def(JfrBuffer_lock , PaddedMutex , leaf, true, _safepoint_check_never);
def(JfrStream_lock , PaddedMutex , nonleaf + 1, false, _safepoint_check_never);
def(JfrStacktrace_lock , PaddedMutex , special, true, _safepoint_check_never);
def(JfrStacktrace_lock , PaddedMutex , special - 1, true, _safepoint_check_never);
def(JfrThreadSampler_lock , PaddedMonitor, leaf, true, _safepoint_check_never);
#endif

@@ -128,7 +128,7 @@ static int literal_size(oop obj) {
}
}

static int literal_size(WeakHandle<vm_class_loader_data> v) {
static int literal_size(WeakHandle<vm_weak_data> v) {
return literal_size(v.peek());
}

@@ -223,7 +223,7 @@ template <class T> void print_literal(T l) {
l->print();
}

static void print_literal(WeakHandle<vm_class_loader_data> l) {
static void print_literal(WeakHandle<vm_weak_data> l) {
l.print();
}

@@ -287,14 +287,14 @@ template class Hashtable<ConstantPool*, mtClass>;
template class Hashtable<Symbol*, mtSymbol>;
template class Hashtable<Klass*, mtClass>;
template class Hashtable<InstanceKlass*, mtClass>;
template class Hashtable<WeakHandle<vm_class_loader_data>, mtClass>;
template class Hashtable<WeakHandle<vm_weak_data>, mtClass>;
template class Hashtable<Symbol*, mtModule>;
template class Hashtable<oop, mtSymbol>;
template class Hashtable<Symbol*, mtClass>;
template class HashtableEntry<Symbol*, mtSymbol>;
template class HashtableEntry<Symbol*, mtClass>;
template class HashtableEntry<oop, mtSymbol>;
template class HashtableEntry<WeakHandle<vm_class_loader_data>, mtClass>;
template class HashtableEntry<WeakHandle<vm_weak_data>, mtClass>;
template class HashtableBucket<mtClass>;
template class BasicHashtableEntry<mtSymbol>;
template class BasicHashtableEntry<mtCode>;
@@ -2659,7 +2659,7 @@ public static double scalb(double d, int scaleFactor) {
* round it away to zero. This is done by first multiplying
* by 2 ^ (scaleFactor % n) and then multiplying several
* times by 2^n as needed where n is the exponent of number
* that is a covenient power of two. In this way, at most one
* that is a convenient power of two. In this way, at most one
* real rounding error occurs. If the double value set is
* being used exclusively, the rounding will occur on a
* multiply. If the double-extended-exponent value set is
@@ -46,20 +46,21 @@
* record components are declared in the record header. The list of record
* components declared in the record header form the <em>record descriptor</em>.
*
* <p>A record class has the following mandated members: a public <em>canonical
* constructor</em>, whose descriptor is the same as the record descriptor;
* <p>A record class has the following mandated members: a <em>canonical
* constructor</em>, which must provide at least as much access as the record
* class and whose descriptor is the same as the record descriptor;
* a private final field corresponding to each component, whose name and
* type are the same as that of the component; a public accessor method
* corresponding to each component, whose name and return type are the same as
* that of the component. If not explicitly declared in the body of the record,
* implicit implementations for these members are provided.
*
* <p>The implicit declaration of the canonical constructor initializes the
* component fields from the corresponding constructor arguments. The implicit
* declaration of the accessor methods returns the value of the corresponding
* component field. The implicit declaration of the {@link Object#equals(Object)},
* {@link Object#hashCode()}, and {@link Object#toString()} methods are derived
* from all of the component fields.
* <p>The implicit declaration of the canonical constructor has the same accessibility
* as the record class and initializes the component fields from the corresponding
* constructor arguments. The implicit declaration of the accessor methods returns
* the value of the corresponding component field. The implicit declaration of the
* {@link Object#equals(Object)}, {@link Object#hashCode()}, and {@link Object#toString()}
* methods are derived from all of the component fields.
*
* <p>The primary reasons to provide an explicit declaration for the
* canonical constructor or accessor methods are to validate constructor
@@ -1046,7 +1046,7 @@ public static Version parse(String s) {
} else {
if (optional.isPresent() && !pre.isPresent()) {
throw new IllegalArgumentException("optional component"
+ " must be preceeded by a pre-release component"
+ " must be preceded by a pre-release component"
+ " or '+': '" + s + "'");
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, 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
@@ -237,7 +237,7 @@ private void close() {
final R walk() {
checkState(NEW);
try {
// VM will need to stablize the stack before walking. It will invoke
// VM will need to stabilize the stack before walking. It will invoke
// the AbstractStackWalker::doStackWalk method once it fetches the first batch.
// the callback will be invoked within the scope of the callStackWalk frame.
return beginStackWalk();
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2020, 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
@@ -351,7 +351,7 @@ private final MethodType transformHelperType(int whichtm) {
* You can override this to return null or throw if there are no transforms.
* This method exists so that the transforms can be "grown" lazily.
* This is necessary if the transform *adds* a field to an instance,
* which sometimtes requires the creation, on the fly, of an extended species.
* which sometimes requires the creation, on the fly, of an extended species.
* This method is only called once for any particular parameter.
* The species caches the result in a private array.
*
@@ -35,7 +35,7 @@
/**
* An indirect var handle can be thought of as an aggregate of the method handles implementing its supported access modes.
* Its varform contains no method name table (given that some of the method handles composing a bound var handle might
* not be direct). The set of method handles constituting an inditrect var handle are retrieved lazily, to minimize
* not be direct). The set of method handles constituting an indirect var handle are retrieved lazily, to minimize
* code spinning (since not all the access modes will be used anyway).
* Indirect var handles are useful when constructing var handle adapters - that is, an adapter var handle
* can be constructed by extracting the method handles constituting the target var handle, adapting them
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2020, 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
@@ -801,7 +801,7 @@ boolean isLoop(int pos) {
* (a) redundant compilation work and (b) extra I$ pressure.
* To control repeated versions, we need to be ready to
* erase details from LFs and move them into MH data,
* whevener those details are not relevant to significant
* whenever those details are not relevant to significant
* optimization. "Significant" means optimization of
* code that is actually hot.
*
@@ -895,7 +895,7 @@ void compileToBytecode() {
private static boolean argumentTypesMatch(String sig, Object[] av) {
int arity = signatureArity(sig);
assert(av.length == arity) : "av.length == arity: av.length=" + av.length + ", arity=" + arity;
assert(av[0] instanceof MethodHandle) : "av[0] not instace of MethodHandle: " + av[0];
assert(av[0] instanceof MethodHandle) : "av[0] not instance of MethodHandle: " + av[0];
MethodHandle mh = (MethodHandle) av[0];
MethodType mt = mh.type();
assert(mt.parameterCount() == arity-1);
@@ -1685,7 +1685,7 @@ MethodHandle withInternalMemberName(MemberName member, boolean isInvokeSpecial)
if (member != null) {
return MethodHandleImpl.makeWrappedMember(this, member, isInvokeSpecial);
} else if (internalMemberName() == null) {
// The required internaMemberName is null, and this MH (like most) doesn't have one.
// The required internalMemberName is null, and this MH (like most) doesn't have one.
return this;
} else {
// The following case is rare. Mask the internalMemberName by wrapping the MH in a BMH.
@@ -33,7 +33,7 @@

/**
* A symbolic reference obtained by cracking a direct method handle
* into its consitutent symbolic parts.
* into its constituent symbolic parts.
* To crack a direct method handle, call {@link Lookup#revealDirect Lookup.revealDirect}.
* <h2><a id="directmh"></a>Direct Method Handles</h2>
* A <em>direct method handle</em> represents a method, constructor, or field without

0 comments on commit a6df9ae

Please sign in to comment.