< prev index next >
src/hotspot/share/opto/macro.cpp
Print this page
@@ -1557,11 +1557,15 @@
call->init_req( TypeFunc::Control, slow_region );
call->init_req( TypeFunc::I_O , top() ) ; // does no i/o
call->init_req( TypeFunc::Memory , slow_mem ); // may gc ptrs
call->init_req( TypeFunc::ReturnAdr, alloc->in(TypeFunc::ReturnAdr) );
call->init_req( TypeFunc::FramePtr, alloc->in(TypeFunc::FramePtr) );
-
+ if (alloc->_larval) {
+ // Tag the klass pointer to let the runtime know that this is a larval allocation
+ klass_node = transform_later(new CastP2XNode(NULL, klass_node));
+ klass_node = transform_later(new OrXNode(klass_node, _igvn.MakeConX(1)));
+ }
call->init_req(TypeFunc::Parms+0, klass_node);
if (length != NULL) {
call->init_req(TypeFunc::Parms+1, length);
}
@@ -1593,65 +1597,39 @@
// An allocate node has separate memory projections for the uses on
// the control and i_o paths. Replace the control memory projection with
// result_phi_rawmem (unless we are only generating a slow call when
// both memory projections are combined)
if (!always_slow && _memproj_fallthrough != NULL) {
- for (DUIterator_Fast imax, i = _memproj_fallthrough->fast_outs(imax); i < imax; i++) {
- Node *use = _memproj_fallthrough->fast_out(i);
- _igvn.rehash_node_delayed(use);
- imax -= replace_input(use, _memproj_fallthrough, result_phi_rawmem);
- // back up iterator
- --i;
- }
+ _igvn.replace_in_uses(_memproj_fallthrough, result_phi_rawmem);
}
// Now change uses of _memproj_catchall to use _memproj_fallthrough and delete
// _memproj_catchall so we end up with a call that has only 1 memory projection.
- if (_memproj_catchall != NULL ) {
+ if (_memproj_catchall != NULL) {
if (_memproj_fallthrough == NULL) {
_memproj_fallthrough = new ProjNode(call, TypeFunc::Memory);
transform_later(_memproj_fallthrough);
}
- for (DUIterator_Fast imax, i = _memproj_catchall->fast_outs(imax); i < imax; i++) {
- Node *use = _memproj_catchall->fast_out(i);
- _igvn.rehash_node_delayed(use);
- imax -= replace_input(use, _memproj_catchall, _memproj_fallthrough);
- // back up iterator
- --i;
- }
- assert(_memproj_catchall->outcnt() == 0, "all uses must be deleted");
+ _igvn.replace_in_uses(_memproj_catchall, _memproj_fallthrough);
_igvn.remove_dead_node(_memproj_catchall);
}
// An allocate node has separate i_o projections for the uses on the control
// and i_o paths. Always replace the control i_o projection with result i_o
// otherwise incoming i_o become dead when only a slow call is generated
// (it is different from memory projections where both projections are
// combined in such case).
if (_ioproj_fallthrough != NULL) {
- for (DUIterator_Fast imax, i = _ioproj_fallthrough->fast_outs(imax); i < imax; i++) {
- Node *use = _ioproj_fallthrough->fast_out(i);
- _igvn.rehash_node_delayed(use);
- imax -= replace_input(use, _ioproj_fallthrough, result_phi_i_o);
- // back up iterator
- --i;
- }
+ _igvn.replace_in_uses(_ioproj_fallthrough, result_phi_i_o);
}
// Now change uses of _ioproj_catchall to use _ioproj_fallthrough and delete
// _ioproj_catchall so we end up with a call that has only 1 i_o projection.
- if (_ioproj_catchall != NULL ) {
+ if (_ioproj_catchall != NULL) {
if (_ioproj_fallthrough == NULL) {
_ioproj_fallthrough = new ProjNode(call, TypeFunc::I_O);
transform_later(_ioproj_fallthrough);
}
- for (DUIterator_Fast imax, i = _ioproj_catchall->fast_outs(imax); i < imax; i++) {
- Node *use = _ioproj_catchall->fast_out(i);
- _igvn.rehash_node_delayed(use);
- imax -= replace_input(use, _ioproj_catchall, _ioproj_fallthrough);
- // back up iterator
- --i;
- }
- assert(_ioproj_catchall->outcnt() == 0, "all uses must be deleted");
+ _igvn.replace_in_uses(_ioproj_catchall, _ioproj_fallthrough);
_igvn.remove_dead_node(_ioproj_catchall);
}
// if we generated only a slow call, we are done
if (always_slow) {
< prev index next >