1440 map()->set_memory(mergemem);
1441 }
1442
1443 //------------------------------set_all_memory_call----------------------------
1444 void GraphKit::set_all_memory_call(Node* call, bool separate_io_proj) {
1445 Node* newmem = _gvn.transform( new ProjNode(call, TypeFunc::Memory, separate_io_proj) );
1446 set_all_memory(newmem);
1447 }
1448
1449 //=============================================================================
1450 //
1451 // parser factory methods for MemNodes
1452 //
1453 // These are layered on top of the factory methods in LoadNode and StoreNode,
1454 // and integrate with the parser's memory state and _gvn engine.
1455 //
1456
1457 // factory methods in "int adr_idx"
1458 Node* GraphKit::make_load(Node* ctl, Node* adr, const Type* t, BasicType bt,
1459 int adr_idx,
1460 MemNode::MemOrd mo, LoadNode::ControlDependency control_dependency, bool require_atomic_access) {
1461 assert(adr_idx != Compile::AliasIdxTop, "use other make_load factory" );
1462 const TypePtr* adr_type = NULL; // debug-mode-only argument
1463 debug_only(adr_type = C->get_adr_type(adr_idx));
1464 Node* mem = memory(adr_idx);
1465 Node* ld;
1466 if (require_atomic_access && bt == T_LONG) {
1467 ld = LoadLNode::make_atomic(ctl, mem, adr, adr_type, t, mo, control_dependency);
1468 } else if (require_atomic_access && bt == T_DOUBLE) {
1469 ld = LoadDNode::make_atomic(ctl, mem, adr, adr_type, t, mo, control_dependency);
1470 } else {
1471 ld = LoadNode::make(_gvn, ctl, mem, adr, adr_type, t, bt, mo, control_dependency);
1472 }
1473 ld = _gvn.transform(ld);
1474 if ((bt == T_OBJECT) && C->do_escape_analysis() || C->eliminate_boxing()) {
1475 // Improve graph before escape analysis and boxing elimination.
1476 record_for_igvn(ld);
1477 }
1478 return ld;
1479 }
1480
1481 Node* GraphKit::store_to_memory(Node* ctl, Node* adr, Node *val, BasicType bt,
1482 int adr_idx,
1483 MemNode::MemOrd mo,
1484 bool require_atomic_access) {
1485 assert(adr_idx != Compile::AliasIdxTop, "use other store_to_memory factory" );
1486 const TypePtr* adr_type = NULL;
1487 debug_only(adr_type = C->get_adr_type(adr_idx));
1488 Node *mem = memory(adr_idx);
1489 Node* st;
1490 if (require_atomic_access && bt == T_LONG) {
1491 st = StoreLNode::make_atomic(ctl, mem, adr, adr_type, val, mo);
1492 } else if (require_atomic_access && bt == T_DOUBLE) {
1493 st = StoreDNode::make_atomic(ctl, mem, adr, adr_type, val, mo);
1494 } else {
1495 st = StoreNode::make(_gvn, ctl, mem, adr, adr_type, val, bt, mo);
1496 }
1497 st = _gvn.transform(st);
1498 set_memory(st, adr_idx);
1499 // Back-to-back stores can only remove intermediate store with DU info
1500 // so push on worklist for optimizer.
1501 if (mem->req() > MemNode::Address && adr == mem->in(MemNode::Address))
1502 record_for_igvn(st);
1503
1504 return st;
1505 }
1506
1507
1508 void GraphKit::pre_barrier(bool do_load,
1509 Node* ctl,
1510 Node* obj,
1511 Node* adr,
1512 uint adr_idx,
1513 Node* val,
1514 const TypeOopPtr* val_type,
1515 Node* pre_val,
|
1440 map()->set_memory(mergemem);
1441 }
1442
1443 //------------------------------set_all_memory_call----------------------------
1444 void GraphKit::set_all_memory_call(Node* call, bool separate_io_proj) {
1445 Node* newmem = _gvn.transform( new ProjNode(call, TypeFunc::Memory, separate_io_proj) );
1446 set_all_memory(newmem);
1447 }
1448
1449 //=============================================================================
1450 //
1451 // parser factory methods for MemNodes
1452 //
1453 // These are layered on top of the factory methods in LoadNode and StoreNode,
1454 // and integrate with the parser's memory state and _gvn engine.
1455 //
1456
1457 // factory methods in "int adr_idx"
1458 Node* GraphKit::make_load(Node* ctl, Node* adr, const Type* t, BasicType bt,
1459 int adr_idx,
1460 MemNode::MemOrd mo, LoadNode::ControlDependency control_dependency,
1461 bool require_atomic_access, bool unaligned) {
1462 assert(adr_idx != Compile::AliasIdxTop, "use other make_load factory" );
1463 const TypePtr* adr_type = NULL; // debug-mode-only argument
1464 debug_only(adr_type = C->get_adr_type(adr_idx));
1465 Node* mem = memory(adr_idx);
1466 Node* ld;
1467 if (require_atomic_access && bt == T_LONG) {
1468 ld = LoadLNode::make_atomic(ctl, mem, adr, adr_type, t, mo, control_dependency);
1469 } else if (require_atomic_access && bt == T_DOUBLE) {
1470 ld = LoadDNode::make_atomic(ctl, mem, adr, adr_type, t, mo, control_dependency);
1471 } else {
1472 ld = LoadNode::make(_gvn, ctl, mem, adr, adr_type, t, bt, mo, control_dependency);
1473 }
1474 if (unaligned) {
1475 ld->as_Load()->set_unaligned();
1476 }
1477 ld = _gvn.transform(ld);
1478 if ((bt == T_OBJECT) && C->do_escape_analysis() || C->eliminate_boxing()) {
1479 // Improve graph before escape analysis and boxing elimination.
1480 record_for_igvn(ld);
1481 }
1482 return ld;
1483 }
1484
1485 Node* GraphKit::store_to_memory(Node* ctl, Node* adr, Node *val, BasicType bt,
1486 int adr_idx,
1487 MemNode::MemOrd mo,
1488 bool require_atomic_access,
1489 bool unaligned) {
1490 assert(adr_idx != Compile::AliasIdxTop, "use other store_to_memory factory" );
1491 const TypePtr* adr_type = NULL;
1492 debug_only(adr_type = C->get_adr_type(adr_idx));
1493 Node *mem = memory(adr_idx);
1494 Node* st;
1495 if (require_atomic_access && bt == T_LONG) {
1496 st = StoreLNode::make_atomic(ctl, mem, adr, adr_type, val, mo);
1497 } else if (require_atomic_access && bt == T_DOUBLE) {
1498 st = StoreDNode::make_atomic(ctl, mem, adr, adr_type, val, mo);
1499 } else {
1500 st = StoreNode::make(_gvn, ctl, mem, adr, adr_type, val, bt, mo);
1501 }
1502 if (unaligned) {
1503 st->as_Store()->set_unaligned();
1504 }
1505 st = _gvn.transform(st);
1506 set_memory(st, adr_idx);
1507 // Back-to-back stores can only remove intermediate store with DU info
1508 // so push on worklist for optimizer.
1509 if (mem->req() > MemNode::Address && adr == mem->in(MemNode::Address))
1510 record_for_igvn(st);
1511
1512 return st;
1513 }
1514
1515
1516 void GraphKit::pre_barrier(bool do_load,
1517 Node* ctl,
1518 Node* obj,
1519 Node* adr,
1520 uint adr_idx,
1521 Node* val,
1522 const TypeOopPtr* val_type,
1523 Node* pre_val,
|