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 *
1405 break;
1406 }
1407 return _reg_for_constants.at(i);
1408 }
1409 }
1410
1411 LIR_Opr result = new_register(t);
1412 __ move((LIR_Opr)c, result);
1413 _constants.append(c);
1414 _reg_for_constants.append(result);
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,
|
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 *
1405 break;
1406 }
1407 return _reg_for_constants.at(i);
1408 }
1409 }
1410
1411 LIR_Opr result = new_register(t);
1412 __ move((LIR_Opr)c, result);
1413 _constants.append(c);
1414 _reg_for_constants.append(result);
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::G1SATBCTLogging:
1426 G1SATBCardTableModRef_pre_barrier(addr_opr, pre_val, do_load, patch, info);
1427 break;
1428 #endif // INCLUDE_ALL_GCS
1429 case BarrierSet::CardTableModRef:
1430 case BarrierSet::CardTableExtension:
1431 // No pre barriers
1432 break;
1433 case BarrierSet::ModRef:
1434 // No pre barriers
1435 break;
1436 default :
1437 ShouldNotReachHere();
1438
1439 }
1440 }
1441
1442 void LIRGenerator::post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) {
1443 switch (_bs->kind()) {
1444 #if INCLUDE_ALL_GCS
1445 case BarrierSet::G1SATBCTLogging:
1446 G1SATBCardTableModRef_post_barrier(addr, new_val);
1447 break;
1448 #endif // INCLUDE_ALL_GCS
1449 case BarrierSet::CardTableModRef:
1450 case BarrierSet::CardTableExtension:
1451 CardTableModRef_post_barrier(addr, new_val);
1452 break;
1453 case BarrierSet::ModRef:
1454 // No post barriers
1455 break;
1456 default :
1457 ShouldNotReachHere();
1458 }
1459 }
1460
1461 ////////////////////////////////////////////////////////////////////////
1462 #if INCLUDE_ALL_GCS
1463
1464 void LIRGenerator::G1SATBCardTableModRef_pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val,
|