--- a/src/hotspot/share/c1/c1_GraphBuilder.cpp Thu Oct 17 20:27:44 2019 +0100
+++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp Thu Oct 17 20:53:35 2019 +0100
@@ -33,13 +33,13 @@
#include "ci/ciKlass.hpp"
#include "ci/ciMemberName.hpp"
#include "ci/ciUtilities.inline.hpp"
+#include "compiler/compilationPolicy.hpp"
#include "compiler/compileBroker.hpp"
#include "interpreter/bytecode.hpp"
#include "jfr/jfrEvents.hpp"
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/sharedRuntime.hpp"
-#include "runtime/compilationPolicy.hpp"
#include "runtime/vm_version.hpp"
#include "utilities/bitMap.inline.hpp"
@@ -1467,11 +1467,12 @@
call_register_finalizer();
}
+ // The conditions for a memory barrier are described in Parse::do_exits().
bool need_mem_bar = false;
if (method()->name() == ciSymbol::object_initializer_name() &&
- (scope()->wrote_final() || (AlwaysSafeConstructors && scope()->wrote_fields())
- || (support_IRIW_for_not_multiple_copy_atomic_cpu && scope()->wrote_volatile())
- )){
+ (scope()->wrote_final() ||
+ (AlwaysSafeConstructors && scope()->wrote_fields()) ||
+ (support_IRIW_for_not_multiple_copy_atomic_cpu && scope()->wrote_volatile()))) {
need_mem_bar = true;
}
@@ -1957,12 +1958,11 @@
// number of implementors for decl_interface is 0 or 1. If
// it's 0 then no class implements decl_interface and there's
// no point in inlining.
- ciInstanceKlass* singleton = NULL;
ciInstanceKlass* declared_interface = callee_holder;
- if (declared_interface->nof_implementors() == 1 &&
- (!target->is_default_method() || target->is_overpass()) /* CHA doesn't support default methods yet. */) {
- singleton = declared_interface->implementor();
- assert(singleton != NULL && singleton != declared_interface, "");
+ ciInstanceKlass* singleton = declared_interface->unique_implementor();
+ if (singleton != NULL &&
+ (!target->is_default_method() || target->is_overpass()) /* CHA doesn't support default methods yet. */ ) {
+ assert(singleton != declared_interface, "not a unique implementor");
cha_monomorphic_target = target->find_monomorphic_target(calling_klass, declared_interface, singleton);
if (cha_monomorphic_target != NULL) {
if (cha_monomorphic_target->holder() != compilation()->env()->Object_klass()) {
@@ -3168,7 +3168,7 @@
ciType* type = sig->type_at(i);
BasicType basic_type = type->basic_type();
// don't allow T_ARRAY to propagate into locals types
- if (basic_type == T_ARRAY) basic_type = T_OBJECT;
+ if (is_reference_type(basic_type)) basic_type = T_OBJECT;
ValueType* vt = as_ValueType(basic_type);
state->store_local(idx, new Local(type, vt, idx, false));
idx += type->size();