Skip to content

Commit 8af304c

Browse files
theoweidmannoracleTobiHartmann
authored andcommitted
8341411: C2: remove slice parameter from GraphKit::make_load() and GraphKit::store_to_memory()
Reviewed-by: thartmann, roland
1 parent b72fe75 commit 8af304c

File tree

10 files changed

+51
-85
lines changed

10 files changed

+51
-85
lines changed

src/hotspot/share/gc/shared/c2/barrierSetC2.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ Node* BarrierSetC2::store_at_resolved(C2Access& access, C2AccessValue& val) cons
156156
}
157157

158158
store = kit->store_to_memory(kit->control(), access.addr().node(), val.node(), bt,
159-
access.addr().type(), mo, requires_atomic_access, unaligned,
160-
mismatched, unsafe, access.barrier_data());
159+
mo, requires_atomic_access, unaligned, mismatched,
160+
unsafe, access.barrier_data());
161161
} else {
162162
assert(access.is_opt_access(), "either parse or opt access");
163163
C2OptAccess& opt_access = static_cast<C2OptAccess&>(access);
@@ -217,7 +217,7 @@ Node* BarrierSetC2::load_at_resolved(C2Access& access, const Type* val_type) con
217217
unaligned, mismatched, unsafe, access.barrier_data());
218218
load = kit->gvn().transform(load);
219219
} else {
220-
load = kit->make_load(control, adr, val_type, access.type(), adr_type, mo,
220+
load = kit->make_load(control, adr, val_type, access.type(), mo,
221221
dep, requires_atomic_access, unaligned, mismatched, unsafe,
222222
access.barrier_data());
223223
}

src/hotspot/share/opto/arraycopynode.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ Node* ArrayCopyNode::try_clone_instance(PhaseGVN *phase, bool can_reshape, int c
220220
Node* off = phase->MakeConX(field->offset_in_bytes());
221221
Node* next_src = phase->transform(new AddPNode(base_src,base_src,off));
222222
Node* next_dest = phase->transform(new AddPNode(base_dest,base_dest,off));
223+
assert(phase->C->get_alias_index(adr_type) == phase->C->get_alias_index(phase->type(next_src)->isa_ptr()),
224+
"slice of address and input slice don't match");
225+
assert(phase->C->get_alias_index(adr_type) == phase->C->get_alias_index(phase->type(next_dest)->isa_ptr()),
226+
"slice of address and input slice don't match");
223227
BasicType bt = field->layout_type();
224228

225229
const Type *type;

src/hotspot/share/opto/generateOptoStub.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void GraphKit::gen_stub(address C_function,
101101
//
102102
Node *adr_sp = basic_plus_adr(top(), thread, in_bytes(JavaThread::last_Java_sp_offset()));
103103
Node *last_sp = frameptr();
104-
store_to_memory(control(), adr_sp, last_sp, T_ADDRESS, NoAlias, MemNode::unordered);
104+
store_to_memory(control(), adr_sp, last_sp, T_ADDRESS, MemNode::unordered);
105105

106106
// Set _thread_in_native
107107
// The order of stores into TLS is critical! Setting _thread_in_native MUST
@@ -221,29 +221,29 @@ void GraphKit::gen_stub(address C_function,
221221
//-----------------------------
222222

223223
// Clear last_Java_sp
224-
store_to_memory(control(), adr_sp, null(), T_ADDRESS, NoAlias, MemNode::unordered);
224+
store_to_memory(control(), adr_sp, null(), T_ADDRESS, MemNode::unordered);
225225
// Clear last_Java_pc
226-
store_to_memory(control(), adr_last_Java_pc, null(), T_ADDRESS, NoAlias, MemNode::unordered);
226+
store_to_memory(control(), adr_last_Java_pc, null(), T_ADDRESS, MemNode::unordered);
227227
#if (defined(IA64) && !defined(AIX))
228228
Node* adr_last_Java_fp = basic_plus_adr(top(), thread, in_bytes(JavaThread::last_Java_fp_offset()));
229-
store_to_memory(control(), adr_last_Java_fp, null(), T_ADDRESS, NoAlias, MemNode::unordered);
229+
store_to_memory(control(), adr_last_Java_fp, null(), T_ADDRESS, MemNode::unordered);
230230
#endif
231231

232232
// For is-fancy-jump, the C-return value is also the branch target
233233
Node* target = map()->in(TypeFunc::Parms);
234234
// Runtime call returning oop in TLS? Fetch it out
235235
if( pass_tls ) {
236236
Node* adr = basic_plus_adr(top(), thread, in_bytes(JavaThread::vm_result_offset()));
237-
Node* vm_result = make_load(nullptr, adr, TypeOopPtr::BOTTOM, T_OBJECT, NoAlias, MemNode::unordered);
237+
Node* vm_result = make_load(nullptr, adr, TypeOopPtr::BOTTOM, T_OBJECT, MemNode::unordered);
238238
map()->set_req(TypeFunc::Parms, vm_result); // vm_result passed as result
239239
// clear thread-local-storage(tls)
240-
store_to_memory(control(), adr, null(), T_ADDRESS, NoAlias, MemNode::unordered);
240+
store_to_memory(control(), adr, null(), T_ADDRESS, MemNode::unordered);
241241
}
242242

243243
//-----------------------------
244244
// check exception
245245
Node* adr = basic_plus_adr(top(), thread, in_bytes(Thread::pending_exception_offset()));
246-
Node* pending = make_load(nullptr, adr, TypeOopPtr::BOTTOM, T_OBJECT, NoAlias, MemNode::unordered);
246+
Node* pending = make_load(nullptr, adr, TypeOopPtr::BOTTOM, T_OBJECT, MemNode::unordered);
247247

248248
Node* exit_memory = reset_memory();
249249

src/hotspot/share/opto/graphKit.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ void GraphKit::uncommon_trap_if_should_post_on_exceptions(Deoptimization::DeoptR
510510
// first must access the should_post_on_exceptions_flag in this thread's JavaThread
511511
Node* jthread = _gvn.transform(new ThreadLocalNode());
512512
Node* adr = basic_plus_adr(top(), jthread, in_bytes(JavaThread::should_post_on_exceptions_flag_offset()));
513-
Node* should_post_flag = make_load(control(), adr, TypeInt::INT, T_INT, Compile::AliasIdxRaw, MemNode::unordered);
513+
Node* should_post_flag = make_load(control(), adr, TypeInt::INT, T_INT, MemNode::unordered);
514514

515515
// Test the should_post_on_exceptions_flag vs. 0
516516
Node* chk = _gvn.transform( new CmpINode(should_post_flag, intcon(0)) );
@@ -1550,15 +1550,14 @@ void GraphKit::set_all_memory_call(Node* call, bool separate_io_proj) {
15501550

15511551
// factory methods in "int adr_idx"
15521552
Node* GraphKit::make_load(Node* ctl, Node* adr, const Type* t, BasicType bt,
1553-
int adr_idx,
15541553
MemNode::MemOrd mo,
15551554
LoadNode::ControlDependency control_dependency,
15561555
bool require_atomic_access,
15571556
bool unaligned,
15581557
bool mismatched,
15591558
bool unsafe,
15601559
uint8_t barrier_data) {
1561-
assert(adr_idx == C->get_alias_index(_gvn.type(adr)->isa_ptr()), "slice of address and input slice don't match");
1560+
int adr_idx = C->get_alias_index(_gvn.type(adr)->isa_ptr());
15621561
assert(adr_idx != Compile::AliasIdxTop, "use other make_load factory" );
15631562
const TypePtr* adr_type = nullptr; // debug-mode-only argument
15641563
debug_only(adr_type = C->get_adr_type(adr_idx));
@@ -1580,15 +1579,14 @@ Node* GraphKit::make_load(Node* ctl, Node* adr, const Type* t, BasicType bt,
15801579
}
15811580

15821581
Node* GraphKit::store_to_memory(Node* ctl, Node* adr, Node *val, BasicType bt,
1583-
int adr_idx,
15841582
MemNode::MemOrd mo,
15851583
bool require_atomic_access,
15861584
bool unaligned,
15871585
bool mismatched,
15881586
bool unsafe,
15891587
int barrier_data) {
1588+
int adr_idx = C->get_alias_index(_gvn.type(adr)->isa_ptr());
15901589
assert(adr_idx != Compile::AliasIdxTop, "use other store_to_memory factory" );
1591-
assert(adr_idx == C->get_alias_index(_gvn.type(adr)->isa_ptr()), "slice of address and input slice don't match");
15921590
const TypePtr* adr_type = nullptr;
15931591
debug_only(adr_type = C->get_adr_type(adr_idx));
15941592
Node *mem = memory(adr_idx);
@@ -2044,11 +2042,10 @@ void GraphKit::increment_counter(address counter_addr) {
20442042
}
20452043

20462044
void GraphKit::increment_counter(Node* counter_addr) {
2047-
int adr_type = Compile::AliasIdxRaw;
20482045
Node* ctrl = control();
2049-
Node* cnt = make_load(ctrl, counter_addr, TypeLong::LONG, T_LONG, adr_type, MemNode::unordered);
2046+
Node* cnt = make_load(ctrl, counter_addr, TypeLong::LONG, T_LONG, MemNode::unordered);
20502047
Node* incr = _gvn.transform(new AddLNode(cnt, _gvn.longcon(1)));
2051-
store_to_memory(ctrl, counter_addr, incr, T_LONG, adr_type, MemNode::unordered);
2048+
store_to_memory(ctrl, counter_addr, incr, T_LONG, MemNode::unordered);
20522049
}
20532050

20542051

@@ -4240,8 +4237,8 @@ void GraphKit::inflate_string_slow(Node* src, Node* dst, Node* start, Node* coun
42404237
set_memory(mem, TypeAryPtr::BYTES);
42414238
Node* ch = load_array_element(src, i_byte, TypeAryPtr::BYTES, /* set_ctrl */ true);
42424239
Node* st = store_to_memory(control(), array_element_address(dst, i_char, T_BYTE),
4243-
AndI(ch, intcon(0xff)), T_CHAR, TypeAryPtr::BYTES, MemNode::unordered,
4244-
false, false, true /* mismatched */);
4240+
AndI(ch, intcon(0xff)), T_CHAR, MemNode::unordered, false,
4241+
false, true /* mismatched */);
42454242

42464243
IfNode* iff = create_and_map_if(head, Bool(CmpI(i_byte, count), BoolTest::lt), PROB_FAIR, COUNT_UNKNOWN);
42474244
head->init_req(2, IfTrue(iff));

src/hotspot/share/opto/graphKit.hpp

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -540,26 +540,6 @@ class GraphKit : public Phase {
540540
// adapted the `do_put_xxx' and `do_get_xxx' procedures for the case
541541
// of volatile fields.
542542
Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt,
543-
MemNode::MemOrd mo, LoadNode::ControlDependency control_dependency = LoadNode::DependsOnlyOnTest,
544-
bool require_atomic_access = false, bool unaligned = false,
545-
bool mismatched = false, bool unsafe = false, uint8_t barrier_data = 0) {
546-
// This version computes alias_index from bottom_type
547-
return make_load(ctl, adr, t, bt, adr->bottom_type()->is_ptr(),
548-
mo, control_dependency, require_atomic_access,
549-
unaligned, mismatched, unsafe, barrier_data);
550-
}
551-
Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, const TypePtr* adr_type,
552-
MemNode::MemOrd mo, LoadNode::ControlDependency control_dependency = LoadNode::DependsOnlyOnTest,
553-
bool require_atomic_access = false, bool unaligned = false,
554-
bool mismatched = false, bool unsafe = false, uint8_t barrier_data = 0) {
555-
// This version computes alias_index from an address type
556-
assert(adr_type != nullptr, "use other make_load factory");
557-
return make_load(ctl, adr, t, bt, C->get_alias_index(adr_type),
558-
mo, control_dependency, require_atomic_access,
559-
unaligned, mismatched, unsafe, barrier_data);
560-
}
561-
// This is the base version which is given an alias index.
562-
Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, int adr_idx,
563543
MemNode::MemOrd mo, LoadNode::ControlDependency control_dependency = LoadNode::DependsOnlyOnTest,
564544
bool require_atomic_access = false, bool unaligned = false,
565545
bool mismatched = false, bool unsafe = false, uint8_t barrier_data = 0);
@@ -572,26 +552,8 @@ class GraphKit : public Phase {
572552
// procedure must indicate that the store requires `release'
573553
// semantics, if the stored value is an object reference that might
574554
// point to a new object and may become externally visible.
575-
Node* store_to_memory(Node* ctl, Node* adr, Node* val, BasicType bt,
576-
const TypePtr* adr_type,
577-
MemNode::MemOrd mo,
578-
bool require_atomic_access = false,
579-
bool unaligned = false,
580-
bool mismatched = false,
581-
bool unsafe = false,
582-
int barrier_data = 0) {
583-
// This version computes alias_index from an address type
584-
assert(adr_type != nullptr, "use other store_to_memory factory");
585-
return store_to_memory(ctl, adr, val, bt,
586-
C->get_alias_index(adr_type),
587-
mo, require_atomic_access,
588-
unaligned, mismatched, unsafe,
589-
barrier_data);
590-
}
591-
// This is the base version which is given alias index
592555
// Return the new StoreXNode
593556
Node* store_to_memory(Node* ctl, Node* adr, Node* val, BasicType bt,
594-
int adr_idx,
595557
MemNode::MemOrd,
596558
bool require_atomic_access = false,
597559
bool unaligned = false,

0 commit comments

Comments
 (0)