1745 transform_later(rawmem);
1746 }
1747 }
1748
1749 // Helper for PhaseMacroExpand::expand_allocate_common.
1750 // Initializes the newly-allocated storage.
1751 Node*
1752 PhaseMacroExpand::initialize_object(AllocateNode* alloc,
1753 Node* control, Node* rawmem, Node* object,
1754 Node* klass_node, Node* length,
1755 Node* size_in_bytes) {
1756 InitializeNode* init = alloc->initialization();
1757 // Store the klass & mark bits
1758 Node* mark_node = alloc->make_ideal_mark(&_igvn, control, rawmem);
1759 if (!mark_node->is_Con()) {
1760 transform_later(mark_node);
1761 }
1762 rawmem = make_store_raw(control, rawmem, object, oopDesc::mark_offset_in_bytes(), mark_node, TypeX_X->basic_type());
1763
1764 if (!UseCompactObjectHeaders) {
1765 rawmem = make_store_raw(control, rawmem, object, oopDesc::klass_offset_in_bytes(), klass_node, T_METADATA);
1766 }
1767 int header_size = alloc->minimum_header_size(); // conservatively small
1768
1769 // Array length
1770 if (length != nullptr) { // Arrays need length field
1771 rawmem = make_store_raw(control, rawmem, object, arrayOopDesc::length_offset_in_bytes(), length, T_INT);
1772 // conservatively small header size:
1773 header_size = arrayOopDesc::base_offset_in_bytes(T_BYTE);
1774 if (_igvn.type(klass_node)->isa_aryklassptr()) { // we know the exact header size in most cases:
1775 BasicType elem = _igvn.type(klass_node)->is_klassptr()->as_instance_type()->isa_aryptr()->elem()->array_element_basic_type();
1776 if (is_reference_type(elem, true)) {
1777 elem = T_OBJECT;
1778 }
1779 header_size = Klass::layout_helper_header_size(Klass::array_layout_helper(elem));
1780 }
1781 }
1782
1783 // Clear the object body, if necessary.
1784 if (init == nullptr) {
1785 // The init has somehow disappeared; be cautious and clear everything.
2370 Node* superklass = check->in(SubTypeCheckNode::SuperKlass);
2371 assert(bol->is_Bool() && bol->as_Bool()->_test._test == BoolTest::ne, "unexpected bool node");
2372
2373 for (DUIterator_Last imin, i = bol->last_outs(imin); i >= imin; --i) {
2374 Node* iff = bol->last_out(i);
2375 assert(iff->is_If(), "where's the if?");
2376
2377 if (iff->in(0)->is_top()) {
2378 _igvn.replace_input_of(iff, 1, C->top());
2379 continue;
2380 }
2381
2382 IfTrueNode* iftrue = iff->as_If()->true_proj();
2383 IfFalseNode* iffalse = iff->as_If()->false_proj();
2384 Node* ctrl = iff->in(0);
2385
2386 Node* subklass = nullptr;
2387 if (_igvn.type(obj_or_subklass)->isa_klassptr()) {
2388 subklass = obj_or_subklass;
2389 } else {
2390 Node* k_adr = basic_plus_adr(obj_or_subklass, oopDesc::klass_offset_in_bytes());
2391 subklass = _igvn.transform(LoadKlassNode::make(_igvn, C->immutable_memory(), k_adr, TypeInstPtr::KLASS));
2392 }
2393
2394 Node* not_subtype_ctrl = Phase::gen_subtype_check(subklass, superklass, &ctrl, nullptr, _igvn, check->method(), check->bci());
2395
2396 _igvn.replace_input_of(iff, 0, C->top());
2397 _igvn.replace_node(iftrue, not_subtype_ctrl);
2398 _igvn.replace_node(iffalse, ctrl);
2399 }
2400 _igvn.replace_node(check, C->top());
2401 }
2402
2403 // Perform refining of strip mined loop nodes in the macro nodes list.
2404 void PhaseMacroExpand::refine_strip_mined_loop_macro_nodes() {
2405 for (int i = C->macro_count(); i > 0; i--) {
2406 Node* n = C->macro_node(i - 1);
2407 if (n->is_OuterStripMinedLoop()) {
2408 n->as_OuterStripMinedLoop()->adjust_strip_mined_loop(&_igvn);
2409 }
2410 }
|
1745 transform_later(rawmem);
1746 }
1747 }
1748
1749 // Helper for PhaseMacroExpand::expand_allocate_common.
1750 // Initializes the newly-allocated storage.
1751 Node*
1752 PhaseMacroExpand::initialize_object(AllocateNode* alloc,
1753 Node* control, Node* rawmem, Node* object,
1754 Node* klass_node, Node* length,
1755 Node* size_in_bytes) {
1756 InitializeNode* init = alloc->initialization();
1757 // Store the klass & mark bits
1758 Node* mark_node = alloc->make_ideal_mark(&_igvn, control, rawmem);
1759 if (!mark_node->is_Con()) {
1760 transform_later(mark_node);
1761 }
1762 rawmem = make_store_raw(control, rawmem, object, oopDesc::mark_offset_in_bytes(), mark_node, TypeX_X->basic_type());
1763
1764 if (!UseCompactObjectHeaders) {
1765 rawmem = make_store_raw(control, rawmem, object, Type::klass_offset(), klass_node, T_METADATA);
1766 }
1767 int header_size = alloc->minimum_header_size(); // conservatively small
1768
1769 // Array length
1770 if (length != nullptr) { // Arrays need length field
1771 rawmem = make_store_raw(control, rawmem, object, arrayOopDesc::length_offset_in_bytes(), length, T_INT);
1772 // conservatively small header size:
1773 header_size = arrayOopDesc::base_offset_in_bytes(T_BYTE);
1774 if (_igvn.type(klass_node)->isa_aryklassptr()) { // we know the exact header size in most cases:
1775 BasicType elem = _igvn.type(klass_node)->is_klassptr()->as_instance_type()->isa_aryptr()->elem()->array_element_basic_type();
1776 if (is_reference_type(elem, true)) {
1777 elem = T_OBJECT;
1778 }
1779 header_size = Klass::layout_helper_header_size(Klass::array_layout_helper(elem));
1780 }
1781 }
1782
1783 // Clear the object body, if necessary.
1784 if (init == nullptr) {
1785 // The init has somehow disappeared; be cautious and clear everything.
2370 Node* superklass = check->in(SubTypeCheckNode::SuperKlass);
2371 assert(bol->is_Bool() && bol->as_Bool()->_test._test == BoolTest::ne, "unexpected bool node");
2372
2373 for (DUIterator_Last imin, i = bol->last_outs(imin); i >= imin; --i) {
2374 Node* iff = bol->last_out(i);
2375 assert(iff->is_If(), "where's the if?");
2376
2377 if (iff->in(0)->is_top()) {
2378 _igvn.replace_input_of(iff, 1, C->top());
2379 continue;
2380 }
2381
2382 IfTrueNode* iftrue = iff->as_If()->true_proj();
2383 IfFalseNode* iffalse = iff->as_If()->false_proj();
2384 Node* ctrl = iff->in(0);
2385
2386 Node* subklass = nullptr;
2387 if (_igvn.type(obj_or_subklass)->isa_klassptr()) {
2388 subklass = obj_or_subklass;
2389 } else {
2390 Node* k_adr = basic_plus_adr(obj_or_subklass, Type::klass_offset());
2391 subklass = _igvn.transform(LoadKlassNode::make(_igvn, C->immutable_memory(), k_adr, TypeInstPtr::KLASS));
2392 }
2393
2394 Node* not_subtype_ctrl = Phase::gen_subtype_check(subklass, superklass, &ctrl, nullptr, _igvn, check->method(), check->bci());
2395
2396 _igvn.replace_input_of(iff, 0, C->top());
2397 _igvn.replace_node(iftrue, not_subtype_ctrl);
2398 _igvn.replace_node(iffalse, ctrl);
2399 }
2400 _igvn.replace_node(check, C->top());
2401 }
2402
2403 // Perform refining of strip mined loop nodes in the macro nodes list.
2404 void PhaseMacroExpand::refine_strip_mined_loop_macro_nodes() {
2405 for (int i = C->macro_count(); i > 0; i--) {
2406 Node* n = C->macro_node(i - 1);
2407 if (n->is_OuterStripMinedLoop()) {
2408 n->as_OuterStripMinedLoop()->adjust_strip_mined_loop(&_igvn);
2409 }
2410 }
|