< prev index next >

src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp

Print this page

   1 /*
   2  * Copyright (c) 2015, 2021, Red Hat, Inc. All rights reserved.
   3  * Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.

   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *

1466     }
1467 
1468     Node* init_ctrl = ctrl;
1469     IdealLoopTree* loop = phase->get_loop(ctrl);
1470     Node* raw_mem = fixer.find_mem(ctrl, barrier);
1471     Node* init_raw_mem = raw_mem;
1472     Node* raw_mem_for_ctrl = fixer.find_mem(ctrl, nullptr);
1473     Node* heap_stable_ctrl = nullptr;
1474     Node* null_ctrl = nullptr;
1475     uint last = phase->C->unique();
1476 
1477     enum { _heap_stable = 1, _heap_unstable, PATH_LIMIT };
1478     Node* region = new RegionNode(PATH_LIMIT);
1479     Node* phi = PhiNode::make(region, raw_mem, Type::MEMORY, TypeRawPtr::BOTTOM);
1480 
1481     enum { _fast_path = 1, _slow_path, _null_path, PATH_LIMIT2 };
1482     Node* region2 = new RegionNode(PATH_LIMIT2);
1483     Node* phi2 = PhiNode::make(region2, raw_mem, Type::MEMORY, TypeRawPtr::BOTTOM);
1484 
1485     // Stable path.
1486     test_gc_state(ctrl, raw_mem, heap_stable_ctrl, phase, ShenandoahHeap::MARKING);
1487     region->init_req(_heap_stable, heap_stable_ctrl);
1488     phi->init_req(_heap_stable, raw_mem);
1489 
1490     // Null path
1491     Node* reg2_ctrl = nullptr;
1492     test_null(ctrl, pre_val, null_ctrl, phase);
1493     if (null_ctrl != nullptr) {
1494       reg2_ctrl = null_ctrl->in(0);
1495       region2->init_req(_null_path, null_ctrl);
1496       phi2->init_req(_null_path, raw_mem);
1497     } else {
1498       region2->del_req(_null_path);
1499       phi2->del_req(_null_path);
1500     }
1501 
1502     const int index_offset = in_bytes(ShenandoahThreadLocalData::satb_mark_queue_index_offset());
1503     const int buffer_offset = in_bytes(ShenandoahThreadLocalData::satb_mark_queue_buffer_offset());
1504     Node* thread = new ThreadLocalNode();
1505     phase->register_new_node(thread, ctrl);
1506     Node* buffer_adr = new AddPNode(phase->C->top(), thread, phase->igvn().MakeConX(buffer_offset));

   1 /*
   2  * Copyright (c) 2015, 2021, Red Hat, Inc. All rights reserved.
   3  * Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
   4  * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
   5  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   6  *
   7  * This code is free software; you can redistribute it and/or modify it
   8  * under the terms of the GNU General Public License version 2 only, as
   9  * published by the Free Software Foundation.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  *

1467     }
1468 
1469     Node* init_ctrl = ctrl;
1470     IdealLoopTree* loop = phase->get_loop(ctrl);
1471     Node* raw_mem = fixer.find_mem(ctrl, barrier);
1472     Node* init_raw_mem = raw_mem;
1473     Node* raw_mem_for_ctrl = fixer.find_mem(ctrl, nullptr);
1474     Node* heap_stable_ctrl = nullptr;
1475     Node* null_ctrl = nullptr;
1476     uint last = phase->C->unique();
1477 
1478     enum { _heap_stable = 1, _heap_unstable, PATH_LIMIT };
1479     Node* region = new RegionNode(PATH_LIMIT);
1480     Node* phi = PhiNode::make(region, raw_mem, Type::MEMORY, TypeRawPtr::BOTTOM);
1481 
1482     enum { _fast_path = 1, _slow_path, _null_path, PATH_LIMIT2 };
1483     Node* region2 = new RegionNode(PATH_LIMIT2);
1484     Node* phi2 = PhiNode::make(region2, raw_mem, Type::MEMORY, TypeRawPtr::BOTTOM);
1485 
1486     // Stable path.
1487     test_gc_state(ctrl, raw_mem, heap_stable_ctrl, phase, (ShenandoahHeap::YOUNG_MARKING | ShenandoahHeap::OLD_MARKING));
1488     region->init_req(_heap_stable, heap_stable_ctrl);
1489     phi->init_req(_heap_stable, raw_mem);
1490 
1491     // Null path
1492     Node* reg2_ctrl = nullptr;
1493     test_null(ctrl, pre_val, null_ctrl, phase);
1494     if (null_ctrl != nullptr) {
1495       reg2_ctrl = null_ctrl->in(0);
1496       region2->init_req(_null_path, null_ctrl);
1497       phi2->init_req(_null_path, raw_mem);
1498     } else {
1499       region2->del_req(_null_path);
1500       phi2->del_req(_null_path);
1501     }
1502 
1503     const int index_offset = in_bytes(ShenandoahThreadLocalData::satb_mark_queue_index_offset());
1504     const int buffer_offset = in_bytes(ShenandoahThreadLocalData::satb_mark_queue_buffer_offset());
1505     Node* thread = new ThreadLocalNode();
1506     phase->register_new_node(thread, ctrl);
1507     Node* buffer_adr = new AddPNode(phase->C->top(), thread, phase->igvn().MakeConX(buffer_offset));
< prev index next >