Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/hotspot/share/gc/shared/c2/barrierSetC2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ Node* BarrierSetC2::store_at_resolved(C2Access& access, C2AccessValue& val) cons
}

store = kit->store_to_memory(kit->control(), access.addr().node(), val.node(), bt,
access.addr().type(), mo, requires_atomic_access, unaligned,
mismatched, unsafe, access.barrier_data());
mo, requires_atomic_access, unaligned, mismatched,
unsafe, access.barrier_data());
} else {
assert(access.is_opt_access(), "either parse or opt access");
C2OptAccess& opt_access = static_cast<C2OptAccess&>(access);
Expand Down Expand Up @@ -217,7 +217,7 @@ Node* BarrierSetC2::load_at_resolved(C2Access& access, const Type* val_type) con
unaligned, mismatched, unsafe, access.barrier_data());
load = kit->gvn().transform(load);
} else {
load = kit->make_load(control, adr, val_type, access.type(), adr_type, mo,
load = kit->make_load(control, adr, val_type, access.type(), mo,
dep, requires_atomic_access, unaligned, mismatched, unsafe,
access.barrier_data());
}
Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/share/opto/arraycopynode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ Node* ArrayCopyNode::try_clone_instance(PhaseGVN *phase, bool can_reshape, int c
Node* off = phase->MakeConX(field->offset_in_bytes());
Node* next_src = phase->transform(new AddPNode(base_src,base_src,off));
Node* next_dest = phase->transform(new AddPNode(base_dest,base_dest,off));
assert(phase->C->get_alias_index(adr_type) == phase->C->get_alias_index(phase->type(next_src)->isa_ptr()),
"slice of address and input slice don't match");
assert(phase->C->get_alias_index(adr_type) == phase->C->get_alias_index(phase->type(next_dest)->isa_ptr()),
"slice of address and input slice don't match");
BasicType bt = field->layout_type();

const Type *type;
Expand Down
14 changes: 7 additions & 7 deletions src/hotspot/share/opto/generateOptoStub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void GraphKit::gen_stub(address C_function,
//
Node *adr_sp = basic_plus_adr(top(), thread, in_bytes(JavaThread::last_Java_sp_offset()));
Node *last_sp = frameptr();
store_to_memory(control(), adr_sp, last_sp, T_ADDRESS, NoAlias, MemNode::unordered);
store_to_memory(control(), adr_sp, last_sp, T_ADDRESS, MemNode::unordered);

// Set _thread_in_native
// The order of stores into TLS is critical! Setting _thread_in_native MUST
Expand Down Expand Up @@ -221,29 +221,29 @@ void GraphKit::gen_stub(address C_function,
//-----------------------------

// Clear last_Java_sp
store_to_memory(control(), adr_sp, null(), T_ADDRESS, NoAlias, MemNode::unordered);
store_to_memory(control(), adr_sp, null(), T_ADDRESS, MemNode::unordered);
// Clear last_Java_pc
store_to_memory(control(), adr_last_Java_pc, null(), T_ADDRESS, NoAlias, MemNode::unordered);
store_to_memory(control(), adr_last_Java_pc, null(), T_ADDRESS, MemNode::unordered);
#if (defined(IA64) && !defined(AIX))
Node* adr_last_Java_fp = basic_plus_adr(top(), thread, in_bytes(JavaThread::last_Java_fp_offset()));
store_to_memory(control(), adr_last_Java_fp, null(), T_ADDRESS, NoAlias, MemNode::unordered);
store_to_memory(control(), adr_last_Java_fp, null(), T_ADDRESS, MemNode::unordered);
#endif

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

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

Node* exit_memory = reset_memory();

Expand Down
17 changes: 7 additions & 10 deletions src/hotspot/share/opto/graphKit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ void GraphKit::uncommon_trap_if_should_post_on_exceptions(Deoptimization::DeoptR
// first must access the should_post_on_exceptions_flag in this thread's JavaThread
Node* jthread = _gvn.transform(new ThreadLocalNode());
Node* adr = basic_plus_adr(top(), jthread, in_bytes(JavaThread::should_post_on_exceptions_flag_offset()));
Node* should_post_flag = make_load(control(), adr, TypeInt::INT, T_INT, Compile::AliasIdxRaw, MemNode::unordered);
Node* should_post_flag = make_load(control(), adr, TypeInt::INT, T_INT, MemNode::unordered);

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

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

Node* GraphKit::store_to_memory(Node* ctl, Node* adr, Node *val, BasicType bt,
int adr_idx,
MemNode::MemOrd mo,
bool require_atomic_access,
bool unaligned,
bool mismatched,
bool unsafe,
int barrier_data) {
int adr_idx = C->get_alias_index(_gvn.type(adr)->isa_ptr());
assert(adr_idx != Compile::AliasIdxTop, "use other store_to_memory factory" );
assert(adr_idx == C->get_alias_index(_gvn.type(adr)->isa_ptr()), "slice of address and input slice don't match");
const TypePtr* adr_type = nullptr;
debug_only(adr_type = C->get_adr_type(adr_idx));
Node *mem = memory(adr_idx);
Expand Down Expand Up @@ -2044,11 +2042,10 @@ void GraphKit::increment_counter(address counter_addr) {
}

void GraphKit::increment_counter(Node* counter_addr) {
int adr_type = Compile::AliasIdxRaw;
Node* ctrl = control();
Node* cnt = make_load(ctrl, counter_addr, TypeLong::LONG, T_LONG, adr_type, MemNode::unordered);
Node* cnt = make_load(ctrl, counter_addr, TypeLong::LONG, T_LONG, MemNode::unordered);
Node* incr = _gvn.transform(new AddLNode(cnt, _gvn.longcon(1)));
store_to_memory(ctrl, counter_addr, incr, T_LONG, adr_type, MemNode::unordered);
store_to_memory(ctrl, counter_addr, incr, T_LONG, MemNode::unordered);
}


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

IfNode* iff = create_and_map_if(head, Bool(CmpI(i_byte, count), BoolTest::lt), PROB_FAIR, COUNT_UNKNOWN);
head->init_req(2, IfTrue(iff));
Expand Down
38 changes: 0 additions & 38 deletions src/hotspot/share/opto/graphKit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,26 +540,6 @@ class GraphKit : public Phase {
// adapted the `do_put_xxx' and `do_get_xxx' procedures for the case
// of volatile fields.
Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt,
MemNode::MemOrd mo, LoadNode::ControlDependency control_dependency = LoadNode::DependsOnlyOnTest,
bool require_atomic_access = false, bool unaligned = false,
bool mismatched = false, bool unsafe = false, uint8_t barrier_data = 0) {
// This version computes alias_index from bottom_type
return make_load(ctl, adr, t, bt, adr->bottom_type()->is_ptr(),
mo, control_dependency, require_atomic_access,
unaligned, mismatched, unsafe, barrier_data);
}
Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, const TypePtr* adr_type,
MemNode::MemOrd mo, LoadNode::ControlDependency control_dependency = LoadNode::DependsOnlyOnTest,
bool require_atomic_access = false, bool unaligned = false,
bool mismatched = false, bool unsafe = false, uint8_t barrier_data = 0) {
// This version computes alias_index from an address type
assert(adr_type != nullptr, "use other make_load factory");
return make_load(ctl, adr, t, bt, C->get_alias_index(adr_type),
mo, control_dependency, require_atomic_access,
unaligned, mismatched, unsafe, barrier_data);
}
// This is the base version which is given an alias index.
Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, int adr_idx,
MemNode::MemOrd mo, LoadNode::ControlDependency control_dependency = LoadNode::DependsOnlyOnTest,
bool require_atomic_access = false, bool unaligned = false,
bool mismatched = false, bool unsafe = false, uint8_t barrier_data = 0);
Expand All @@ -572,26 +552,8 @@ class GraphKit : public Phase {
// procedure must indicate that the store requires `release'
// semantics, if the stored value is an object reference that might
// point to a new object and may become externally visible.
Node* store_to_memory(Node* ctl, Node* adr, Node* val, BasicType bt,
const TypePtr* adr_type,
MemNode::MemOrd mo,
bool require_atomic_access = false,
bool unaligned = false,
bool mismatched = false,
bool unsafe = false,
int barrier_data = 0) {
// This version computes alias_index from an address type
assert(adr_type != nullptr, "use other store_to_memory factory");
return store_to_memory(ctl, adr, val, bt,
C->get_alias_index(adr_type),
mo, require_atomic_access,
unaligned, mismatched, unsafe,
barrier_data);
}
// This is the base version which is given alias index
// Return the new StoreXNode
Node* store_to_memory(Node* ctl, Node* adr, Node* val, BasicType bt,
int adr_idx,
MemNode::MemOrd,
bool require_atomic_access = false,
bool unaligned = false,
Expand Down
Loading