Skip to content

Commit 3dd47ae

Browse files
committed
8381276
1 parent 35b7ee2 commit 3dd47ae

6 files changed

Lines changed: 9 additions & 22 deletions

File tree

src/hotspot/share/opto/callnode.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,6 @@ AllocateNode::AllocateNode(Compile* C, const TypeFunc *atype,
19911991
_is_scalar_replaceable = false;
19921992
_is_non_escaping = false;
19931993
_is_allocation_MemBar_redundant = false;
1994-
_larval = false;
19951994
Node *topnode = C->top();
19961995

19971996
init_req( TypeFunc::Control , ctrl );
@@ -2031,19 +2030,12 @@ Node* AllocateNode::make_ideal_mark(PhaseGVN* phase, Node* control, Node* mem) {
20312030
if (UseCompactObjectHeaders || Arguments::is_valhalla_enabled()) {
20322031
Node* klass_node = in(AllocateNode::KlassNode);
20332032
Node* proto_adr = phase->transform(AddPNode::make_with_base(phase->C->top(), klass_node, phase->MakeConX(in_bytes(Klass::prototype_header_offset()))));
2034-
20352033
mark_node = LoadNode::make(*phase, control, mem, proto_adr, phase->type(proto_adr)->is_ptr(), TypeX_X, TypeX_X->basic_type(), MemNode::unordered);
2036-
if (Arguments::is_valhalla_enabled()) {
2037-
mark_node = phase->transform(mark_node);
2038-
// Avoid returning a constant (old node) here because this method is used by LoadNode::Ideal
2039-
// TODO: Could this be removed now that we don't use larval bits
2040-
assert(!_larval, "Larval bits are not in use at the moment");
2041-
mark_node = new OrXNode(mark_node, phase->MakeConX(0));
2042-
}
2043-
return mark_node;
20442034
} else {
2045-
return phase->MakeConX(markWord::prototype().value());
2035+
// For now only enable fast locking for non-array types
2036+
mark_node = phase->MakeConX(markWord::prototype().value());
20462037
}
2038+
return mark_node;
20472039
}
20482040

20492041
// Retrieve the length from the AllocateArrayNode. Narrow the type with a

src/hotspot/share/opto/callnode.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,6 @@ class AllocateNode : public CallNode {
10731073
bool _is_non_escaping;
10741074
// True when MemBar for new is redundant with MemBar at initialzer exit
10751075
bool _is_allocation_MemBar_redundant;
1076-
bool _larval;
10771076

10781077
virtual uint size_of() const; // Size is bigger
10791078
AllocateNode(Compile* C, const TypeFunc *atype, Node *ctrl, Node *mem, Node *abio,

src/hotspot/share/opto/macro.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,9 +1767,6 @@ void PhaseMacroExpand::expand_allocate_common(
17671767
if (init_val != nullptr) {
17681768
call->init_req(TypeFunc::Parms+2, init_val);
17691769
}
1770-
} else {
1771-
// Let the runtime know if this is a larval allocation
1772-
call->init_req(TypeFunc::Parms+1, _igvn.intcon(alloc->_larval));
17731770
}
17741771

17751772
// Copy debug information and adjust JVMState information, then replace

src/hotspot/share/opto/memnode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2470,7 +2470,7 @@ const Type* LoadNode::Value(PhaseGVN* phase) const {
24702470
assert(Opcode() == Op_LoadI, "must load an int from _layout_kind");
24712471
return TypeInt::make(static_cast<jint>(klass->as_flat_array_klass()->layout_kind()));
24722472
}
2473-
if (UseCompactObjectHeaders && tkls->offset() == in_bytes(Klass::prototype_header_offset())) {
2473+
if ((UseCompactObjectHeaders || Arguments::is_valhalla_enabled()) && tkls->offset() == in_bytes(Klass::prototype_header_offset())) {
24742474
// The field is Klass::_prototype_header. Return its (constant) value.
24752475
assert(this->Opcode() == Op_LoadX, "must load a proper type from _prototype_header");
24762476
return TypeX::make(klass->prototype_header());

src/hotspot/share/opto/runtime.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ void OptoRuntime::complete_monitor_locking_C(oopDesc* obj, BasicLock* lock, Java
303303
// and try allocation again.
304304

305305
// object allocation
306-
JRT_BLOCK_ENTRY(void, OptoRuntime::new_instance_C(Klass* klass, bool is_larval, JavaThread* current))
306+
JRT_BLOCK_ENTRY(void, OptoRuntime::new_instance_C(Klass* klass, JavaThread* current))
307307
JRT_BLOCK;
308308
#ifndef PRODUCT
309309
SharedRuntime::_new_instance_ctr++; // new instance requires GC
@@ -323,7 +323,7 @@ JRT_BLOCK_ENTRY(void, OptoRuntime::new_instance_C(Klass* klass, bool is_larval,
323323
if (!HAS_PENDING_EXCEPTION) {
324324
// Scavenge and allocate an instance.
325325
Handle holder(current, klass->klass_holder()); // keep the klass alive
326-
instanceOop result = InstanceKlass::cast(klass)->allocate_instance(THREAD);
326+
oop result = InstanceKlass::cast(klass)->allocate_instance(THREAD);
327327
current->set_vm_result_oop(result);
328328

329329
// Pass oops back through thread local storage. Our apparent type to Java
@@ -587,10 +587,9 @@ JRT_END
587587

588588
static const TypeFunc* make_new_instance_Type() {
589589
// create input type (domain)
590-
const Type **fields = TypeTuple::fields(2);
590+
const Type **fields = TypeTuple::fields(1);
591591
fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // Klass to be allocated
592-
fields[TypeFunc::Parms+1] = TypeInt::BOOL; // is_larval
593-
const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2, fields);
592+
const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+1, fields);
594593

595594
// create result type (range)
596595
fields = TypeTuple::fields(1);

src/hotspot/share/opto/runtime.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class OptoRuntime : public AllStatic {
210210
// =================================
211211

212212
// Allocate storage for a Java instance.
213-
static void new_instance_C(Klass* instance_klass, bool is_larval, JavaThread* current);
213+
static void new_instance_C(Klass* instance_klass, JavaThread* current);
214214

215215
// Allocate storage for a objArray or typeArray
216216
static void new_array_C(Klass* array_klass, int len, oopDesc* init_val, JavaThread* current);

0 commit comments

Comments
 (0)