1 /*
2 * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
1415 return result;
1416 }
1417
1418 // Various barriers
1419
1420 void LIRGenerator::pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val,
1421 bool do_load, bool patch, CodeEmitInfo* info) {
1422 // Do the pre-write barrier, if any.
1423 switch (_bs->kind()) {
1424 #if INCLUDE_ALL_GCS
1425 case BarrierSet::G1SATBCT:
1426 case BarrierSet::G1SATBCTLogging:
1427 G1SATBCardTableModRef_pre_barrier(addr_opr, pre_val, do_load, patch, info);
1428 break;
1429 #endif // INCLUDE_ALL_GCS
1430 case BarrierSet::CardTableModRef:
1431 case BarrierSet::CardTableExtension:
1432 // No pre barriers
1433 break;
1434 case BarrierSet::ModRef:
1435 case BarrierSet::Other:
1436 // No pre barriers
1437 break;
1438 default :
1439 ShouldNotReachHere();
1440
1441 }
1442 }
1443
1444 void LIRGenerator::post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) {
1445 switch (_bs->kind()) {
1446 #if INCLUDE_ALL_GCS
1447 case BarrierSet::G1SATBCT:
1448 case BarrierSet::G1SATBCTLogging:
1449 G1SATBCardTableModRef_post_barrier(addr, new_val);
1450 break;
1451 #endif // INCLUDE_ALL_GCS
1452 case BarrierSet::CardTableModRef:
1453 case BarrierSet::CardTableExtension:
1454 CardTableModRef_post_barrier(addr, new_val);
1455 break;
1456 case BarrierSet::ModRef:
1457 case BarrierSet::Other:
1458 // No post barriers
1459 break;
1460 default :
1461 ShouldNotReachHere();
1462 }
1463 }
1464
1465 ////////////////////////////////////////////////////////////////////////
1466 #if INCLUDE_ALL_GCS
1467
1468 void LIRGenerator::G1SATBCardTableModRef_pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val,
1469 bool do_load, bool patch, CodeEmitInfo* info) {
1470 // First we test whether marking is in progress.
1471 BasicType flag_type;
1472 if (in_bytes(PtrQueue::byte_width_of_active()) == 4) {
1473 flag_type = T_INT;
1474 } else {
1475 guarantee(in_bytes(PtrQueue::byte_width_of_active()) == 1,
1476 "Assumption");
1477 flag_type = T_BYTE;
|
1 /*
2 * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
1415 return result;
1416 }
1417
1418 // Various barriers
1419
1420 void LIRGenerator::pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val,
1421 bool do_load, bool patch, CodeEmitInfo* info) {
1422 // Do the pre-write barrier, if any.
1423 switch (_bs->kind()) {
1424 #if INCLUDE_ALL_GCS
1425 case BarrierSet::G1SATBCT:
1426 case BarrierSet::G1SATBCTLogging:
1427 G1SATBCardTableModRef_pre_barrier(addr_opr, pre_val, do_load, patch, info);
1428 break;
1429 #endif // INCLUDE_ALL_GCS
1430 case BarrierSet::CardTableModRef:
1431 case BarrierSet::CardTableExtension:
1432 // No pre barriers
1433 break;
1434 case BarrierSet::ModRef:
1435 // No pre barriers
1436 break;
1437 default :
1438 ShouldNotReachHere();
1439
1440 }
1441 }
1442
1443 void LIRGenerator::post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) {
1444 switch (_bs->kind()) {
1445 #if INCLUDE_ALL_GCS
1446 case BarrierSet::G1SATBCT:
1447 case BarrierSet::G1SATBCTLogging:
1448 G1SATBCardTableModRef_post_barrier(addr, new_val);
1449 break;
1450 #endif // INCLUDE_ALL_GCS
1451 case BarrierSet::CardTableModRef:
1452 case BarrierSet::CardTableExtension:
1453 CardTableModRef_post_barrier(addr, new_val);
1454 break;
1455 case BarrierSet::ModRef:
1456 // No post barriers
1457 break;
1458 default :
1459 ShouldNotReachHere();
1460 }
1461 }
1462
1463 ////////////////////////////////////////////////////////////////////////
1464 #if INCLUDE_ALL_GCS
1465
1466 void LIRGenerator::G1SATBCardTableModRef_pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val,
1467 bool do_load, bool patch, CodeEmitInfo* info) {
1468 // First we test whether marking is in progress.
1469 BasicType flag_type;
1470 if (in_bytes(PtrQueue::byte_width_of_active()) == 4) {
1471 flag_type = T_INT;
1472 } else {
1473 guarantee(in_bytes(PtrQueue::byte_width_of_active()) == 1,
1474 "Assumption");
1475 flag_type = T_BYTE;
|