Mercurial > hg > graal-jvmci-8
comparison src/share/vm/c1/c1_LIRGenerator.cpp @ 8001:db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
Summary: Rename INCLUDE_ALTERNATE_GCS to INCLUDE_ALL_GCS and replace SERIALGC with INCLUDE_ALL_GCS.
Reviewed-by: coleenp, stefank
author | jprovino |
---|---|
date | Wed, 23 Jan 2013 13:02:39 -0500 |
parents | 1e41b0bc58a0 |
children | 5fc51c1ecdeb 46f6f063b272 cc32ccaaf47f |
comparison
equal
deleted
inserted
replaced
7619:46e60405583b | 8001:db9981fd3124 |
---|---|
33 #include "ci/ciInstance.hpp" | 33 #include "ci/ciInstance.hpp" |
34 #include "ci/ciObjArray.hpp" | 34 #include "ci/ciObjArray.hpp" |
35 #include "runtime/sharedRuntime.hpp" | 35 #include "runtime/sharedRuntime.hpp" |
36 #include "runtime/stubRoutines.hpp" | 36 #include "runtime/stubRoutines.hpp" |
37 #include "utilities/bitMap.inline.hpp" | 37 #include "utilities/bitMap.inline.hpp" |
38 #ifndef SERIALGC | 38 #include "utilities/macros.hpp" |
39 #if INCLUDE_ALL_GCS | |
39 #include "gc_implementation/g1/heapRegion.hpp" | 40 #include "gc_implementation/g1/heapRegion.hpp" |
40 #endif | 41 #endif // INCLUDE_ALL_GCS |
41 | 42 |
42 #ifdef ASSERT | 43 #ifdef ASSERT |
43 #define __ gen()->lir(__FILE__, __LINE__)-> | 44 #define __ gen()->lir(__FILE__, __LINE__)-> |
44 #else | 45 #else |
45 #define __ gen()->lir()-> | 46 #define __ gen()->lir()-> |
1415 | 1416 |
1416 void LIRGenerator::pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val, | 1417 void LIRGenerator::pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val, |
1417 bool do_load, bool patch, CodeEmitInfo* info) { | 1418 bool do_load, bool patch, CodeEmitInfo* info) { |
1418 // Do the pre-write barrier, if any. | 1419 // Do the pre-write barrier, if any. |
1419 switch (_bs->kind()) { | 1420 switch (_bs->kind()) { |
1420 #ifndef SERIALGC | 1421 #if INCLUDE_ALL_GCS |
1421 case BarrierSet::G1SATBCT: | 1422 case BarrierSet::G1SATBCT: |
1422 case BarrierSet::G1SATBCTLogging: | 1423 case BarrierSet::G1SATBCTLogging: |
1423 G1SATBCardTableModRef_pre_barrier(addr_opr, pre_val, do_load, patch, info); | 1424 G1SATBCardTableModRef_pre_barrier(addr_opr, pre_val, do_load, patch, info); |
1424 break; | 1425 break; |
1425 #endif // SERIALGC | 1426 #endif // INCLUDE_ALL_GCS |
1426 case BarrierSet::CardTableModRef: | 1427 case BarrierSet::CardTableModRef: |
1427 case BarrierSet::CardTableExtension: | 1428 case BarrierSet::CardTableExtension: |
1428 // No pre barriers | 1429 // No pre barriers |
1429 break; | 1430 break; |
1430 case BarrierSet::ModRef: | 1431 case BarrierSet::ModRef: |
1437 } | 1438 } |
1438 } | 1439 } |
1439 | 1440 |
1440 void LIRGenerator::post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) { | 1441 void LIRGenerator::post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) { |
1441 switch (_bs->kind()) { | 1442 switch (_bs->kind()) { |
1442 #ifndef SERIALGC | 1443 #if INCLUDE_ALL_GCS |
1443 case BarrierSet::G1SATBCT: | 1444 case BarrierSet::G1SATBCT: |
1444 case BarrierSet::G1SATBCTLogging: | 1445 case BarrierSet::G1SATBCTLogging: |
1445 G1SATBCardTableModRef_post_barrier(addr, new_val); | 1446 G1SATBCardTableModRef_post_barrier(addr, new_val); |
1446 break; | 1447 break; |
1447 #endif // SERIALGC | 1448 #endif // INCLUDE_ALL_GCS |
1448 case BarrierSet::CardTableModRef: | 1449 case BarrierSet::CardTableModRef: |
1449 case BarrierSet::CardTableExtension: | 1450 case BarrierSet::CardTableExtension: |
1450 CardTableModRef_post_barrier(addr, new_val); | 1451 CardTableModRef_post_barrier(addr, new_val); |
1451 break; | 1452 break; |
1452 case BarrierSet::ModRef: | 1453 case BarrierSet::ModRef: |
1457 ShouldNotReachHere(); | 1458 ShouldNotReachHere(); |
1458 } | 1459 } |
1459 } | 1460 } |
1460 | 1461 |
1461 //////////////////////////////////////////////////////////////////////// | 1462 //////////////////////////////////////////////////////////////////////// |
1462 #ifndef SERIALGC | 1463 #if INCLUDE_ALL_GCS |
1463 | 1464 |
1464 void LIRGenerator::G1SATBCardTableModRef_pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val, | 1465 void LIRGenerator::G1SATBCardTableModRef_pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val, |
1465 bool do_load, bool patch, CodeEmitInfo* info) { | 1466 bool do_load, bool patch, CodeEmitInfo* info) { |
1466 // First we test whether marking is in progress. | 1467 // First we test whether marking is in progress. |
1467 BasicType flag_type; | 1468 BasicType flag_type; |
1573 CodeStub* slow = new G1PostBarrierStub(addr, new_val); | 1574 CodeStub* slow = new G1PostBarrierStub(addr, new_val); |
1574 __ branch(lir_cond_notEqual, LP64_ONLY(T_LONG) NOT_LP64(T_INT), slow); | 1575 __ branch(lir_cond_notEqual, LP64_ONLY(T_LONG) NOT_LP64(T_INT), slow); |
1575 __ branch_destination(slow->continuation()); | 1576 __ branch_destination(slow->continuation()); |
1576 } | 1577 } |
1577 | 1578 |
1578 #endif // SERIALGC | 1579 #endif // INCLUDE_ALL_GCS |
1579 //////////////////////////////////////////////////////////////////////// | 1580 //////////////////////////////////////////////////////////////////////// |
1580 | 1581 |
1581 void LIRGenerator::CardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) { | 1582 void LIRGenerator::CardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) { |
1582 | 1583 |
1583 assert(sizeof(*((CardTableModRefBS*)_bs)->byte_map_base) == sizeof(jbyte), "adjust this code"); | 1584 assert(sizeof(*((CardTableModRefBS*)_bs)->byte_map_base) == sizeof(jbyte), "adjust this code"); |
2179 | 2180 |
2180 LIR_Opr value = rlock_result(x, x->basic_type()); | 2181 LIR_Opr value = rlock_result(x, x->basic_type()); |
2181 | 2182 |
2182 get_Object_unsafe(value, src.result(), off.result(), type, x->is_volatile()); | 2183 get_Object_unsafe(value, src.result(), off.result(), type, x->is_volatile()); |
2183 | 2184 |
2184 #ifndef SERIALGC | 2185 #if INCLUDE_ALL_GCS |
2185 // We might be reading the value of the referent field of a | 2186 // We might be reading the value of the referent field of a |
2186 // Reference object in order to attach it back to the live | 2187 // Reference object in order to attach it back to the live |
2187 // object graph. If G1 is enabled then we need to record | 2188 // object graph. If G1 is enabled then we need to record |
2188 // the value that is being returned in an SATB log buffer. | 2189 // the value that is being returned in an SATB log buffer. |
2189 // | 2190 // |
2309 NULL /* info */); | 2310 NULL /* info */); |
2310 } | 2311 } |
2311 __ branch_destination(Lcont->label()); | 2312 __ branch_destination(Lcont->label()); |
2312 } | 2313 } |
2313 } | 2314 } |
2314 #endif // SERIALGC | 2315 #endif // INCLUDE_ALL_GCS |
2315 | 2316 |
2316 if (x->is_volatile() && os::is_MP()) __ membar_acquire(); | 2317 if (x->is_volatile() && os::is_MP()) __ membar_acquire(); |
2317 } | 2318 } |
2318 | 2319 |
2319 | 2320 |