< prev index next >
src/share/vm/opto/graphKit.cpp
Print this page
*** 1450,1460 ****
//
// 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) {
assert(adr_idx != Compile::AliasIdxTop, "use other make_load factory" );
const TypePtr* adr_type = NULL; // debug-mode-only argument
debug_only(adr_type = C->get_adr_type(adr_idx));
Node* mem = memory(adr_idx);
Node* ld;
--- 1450,1464 ----
//
// 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) {
assert(adr_idx != Compile::AliasIdxTop, "use other make_load factory" );
const TypePtr* adr_type = NULL; // debug-mode-only argument
debug_only(adr_type = C->get_adr_type(adr_idx));
Node* mem = memory(adr_idx);
Node* ld;
*** 1463,1472 ****
--- 1467,1482 ----
} else if (require_atomic_access && bt == T_DOUBLE) {
ld = LoadDNode::make_atomic(C, ctl, mem, adr, adr_type, t, mo, control_dependency);
} else {
ld = LoadNode::make(_gvn, ctl, mem, adr, adr_type, t, bt, mo, control_dependency);
}
+ if (unaligned) {
+ ld->as_Load()->set_unaligned_access();
+ }
+ if (mismatched) {
+ ld->as_Load()->set_mismatched_access();
+ }
ld = _gvn.transform(ld);
if ((bt == T_OBJECT) && C->do_escape_analysis() || C->eliminate_boxing()) {
// Improve graph before escape analysis and boxing elimination.
record_for_igvn(ld);
}
*** 1474,1484 ****
}
Node* GraphKit::store_to_memory(Node* ctl, Node* adr, Node *val, BasicType bt,
int adr_idx,
MemNode::MemOrd mo,
! bool require_atomic_access) {
assert(adr_idx != Compile::AliasIdxTop, "use other store_to_memory factory" );
const TypePtr* adr_type = NULL;
debug_only(adr_type = C->get_adr_type(adr_idx));
Node *mem = memory(adr_idx);
Node* st;
--- 1484,1496 ----
}
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) {
assert(adr_idx != Compile::AliasIdxTop, "use other store_to_memory factory" );
const TypePtr* adr_type = NULL;
debug_only(adr_type = C->get_adr_type(adr_idx));
Node *mem = memory(adr_idx);
Node* st;
*** 1487,1496 ****
--- 1499,1514 ----
} else if (require_atomic_access && bt == T_DOUBLE) {
st = StoreDNode::make_atomic(C, ctl, mem, adr, adr_type, val, mo);
} else {
st = StoreNode::make(_gvn, ctl, mem, adr, adr_type, val, bt, mo);
}
+ if (unaligned) {
+ st->as_Store()->set_unaligned_access();
+ }
+ if (mismatched) {
+ st->as_Store()->set_mismatched_access();
+ }
st = _gvn.transform(st);
set_memory(st, adr_idx);
// Back-to-back stores can only remove intermediate store with DU info
// so push on worklist for optimizer.
if (mem->req() > MemNode::Address && adr == mem->in(MemNode::Address))
*** 1586,1596 ****
const TypePtr* adr_type,
Node* val,
const TypeOopPtr* val_type,
BasicType bt,
bool use_precise,
! MemNode::MemOrd mo) {
// Transformation of a value which could be NULL pointer (CastPP #NULL)
// could be delayed during Parse (for example, in adjust_map_after_if()).
// Execute transformation here to avoid barrier generation in such case.
if (_gvn.type(val) == TypePtr::NULL_PTR)
val = _gvn.makecon(TypePtr::NULL_PTR);
--- 1604,1615 ----
const TypePtr* adr_type,
Node* val,
const TypeOopPtr* val_type,
BasicType bt,
bool use_precise,
! MemNode::MemOrd mo,
! bool mismatched) {
// Transformation of a value which could be NULL pointer (CastPP #NULL)
// could be delayed during Parse (for example, in adjust_map_after_if()).
// Execute transformation here to avoid barrier generation in such case.
if (_gvn.type(val) == TypePtr::NULL_PTR)
val = _gvn.makecon(TypePtr::NULL_PTR);
*** 1606,1616 ****
pre_barrier(true /* do_load */,
control(), obj, adr, adr_idx, val, val_type,
NULL /* pre_val */,
bt);
! Node* store = store_to_memory(control(), adr, val, bt, adr_idx, mo);
post_barrier(control(), store, obj, adr, adr_idx, val, bt, use_precise);
return store;
}
// Could be an array or object we don't know at compile time (unsafe ref.)
--- 1625,1635 ----
pre_barrier(true /* do_load */,
control(), obj, adr, adr_idx, val, val_type,
NULL /* pre_val */,
bt);
! Node* store = store_to_memory(control(), adr, val, bt, adr_idx, mo, mismatched);
post_barrier(control(), store, obj, adr, adr_idx, val, bt, use_precise);
return store;
}
// Could be an array or object we don't know at compile time (unsafe ref.)
*** 1618,1628 ****
Node* obj, // containing obj
Node* adr, // actual adress to store val at
const TypePtr* adr_type,
Node* val,
BasicType bt,
! MemNode::MemOrd mo) {
Compile::AliasType* at = C->alias_type(adr_type);
const TypeOopPtr* val_type = NULL;
if (adr_type->isa_instptr()) {
if (at->field() != NULL) {
// known field. This code is a copy of the do_put_xxx logic.
--- 1637,1648 ----
Node* obj, // containing obj
Node* adr, // actual adress to store val at
const TypePtr* adr_type,
Node* val,
BasicType bt,
! MemNode::MemOrd mo,
! bool mismatched) {
Compile::AliasType* at = C->alias_type(adr_type);
const TypeOopPtr* val_type = NULL;
if (adr_type->isa_instptr()) {
if (at->field() != NULL) {
// known field. This code is a copy of the do_put_xxx logic.
*** 1637,1647 ****
val_type = adr_type->is_aryptr()->elem()->make_oopptr();
}
if (val_type == NULL) {
val_type = TypeInstPtr::BOTTOM;
}
! return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, true, mo);
}
//-------------------------array_element_address-------------------------
Node* GraphKit::array_element_address(Node* ary, Node* idx, BasicType elembt,
--- 1657,1667 ----
val_type = adr_type->is_aryptr()->elem()->make_oopptr();
}
if (val_type == NULL) {
val_type = TypeInstPtr::BOTTOM;
}
! return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, true, mo, mismatched);
}
//-------------------------array_element_address-------------------------
Node* GraphKit::array_element_address(Node* ary, Node* idx, BasicType elembt,
< prev index next >