comparison src/share/vm/oops/instanceKlass.cpp @ 342:37f87013dfd8

6711316: Open source the Garbage-First garbage collector Summary: First mercurial integration of the code for the Garbage-First garbage collector. Reviewed-by: apetrusenko, iveresov, jmasa, sgoldman, tonyp, ysr
author ysr
date Thu, 05 Jun 2008 15:57:56 -0700
parents ba764ed4b6f2
children 1ee8caae33af
comparison
equal deleted inserted replaced
189:0b27f3512f9e 342:37f87013dfd8
1513 #endif // SERIALGC 1513 #endif // SERIALGC
1514 1514
1515 // closure's do_header() method dicates whether the given closure should be 1515 // closure's do_header() method dicates whether the given closure should be
1516 // applied to the klass ptr in the object header. 1516 // applied to the klass ptr in the object header.
1517 1517
1518 #define InstanceKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ 1518 #define InstanceKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \
1519 \ 1519 \
1520 int instanceKlass::oop_oop_iterate##nv_suffix(oop obj, \ 1520 int instanceKlass::oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \
1521 OopClosureType* closure) {\
1522 SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::ik);\ 1521 SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::ik);\
1523 /* header */ \ 1522 /* header */ \
1524 if (closure->do_header()) { \ 1523 if (closure->do_header()) { \
1525 obj->oop_iterate_header(closure); \ 1524 obj->oop_iterate_header(closure); \
1526 } \ 1525 } \
1530 record_do_oop_call##nv_suffix(SpecializationStats::ik); \ 1529 record_do_oop_call##nv_suffix(SpecializationStats::ik); \
1531 (closure)->do_oop##nv_suffix(p), \ 1530 (closure)->do_oop##nv_suffix(p), \
1532 assert_is_in_closed_subset) \ 1531 assert_is_in_closed_subset) \
1533 return size_helper(); \ 1532 return size_helper(); \
1534 } 1533 }
1534
1535 #ifndef SERIALGC
1536 #define InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \
1537 \
1538 int instanceKlass::oop_oop_iterate_backwards##nv_suffix(oop obj, \
1539 OopClosureType* closure) { \
1540 SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::ik); \
1541 /* header */ \
1542 if (closure->do_header()) { \
1543 obj->oop_iterate_header(closure); \
1544 } \
1545 /* instance variables */ \
1546 InstanceKlass_OOP_MAP_REVERSE_ITERATE( \
1547 obj, \
1548 SpecializationStats::record_do_oop_call##nv_suffix(SpecializationStats::ik);\
1549 (closure)->do_oop##nv_suffix(p), \
1550 assert_is_in_closed_subset) \
1551 return size_helper(); \
1552 }
1553 #endif // !SERIALGC
1535 1554
1536 #define InstanceKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \ 1555 #define InstanceKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \
1537 \ 1556 \
1538 int instanceKlass::oop_oop_iterate##nv_suffix##_m(oop obj, \ 1557 int instanceKlass::oop_oop_iterate##nv_suffix##_m(oop obj, \
1539 OopClosureType* closure, \ 1558 OopClosureType* closure, \
1548 assert_is_in_closed_subset) \ 1567 assert_is_in_closed_subset) \
1549 return size_helper(); \ 1568 return size_helper(); \
1550 } 1569 }
1551 1570
1552 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_DEFN) 1571 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_DEFN)
1553 ALL_OOP_OOP_ITERATE_CLOSURES_3(InstanceKlass_OOP_OOP_ITERATE_DEFN) 1572 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_DEFN)
1554 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_DEFN_m) 1573 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_DEFN_m)
1555 ALL_OOP_OOP_ITERATE_CLOSURES_3(InstanceKlass_OOP_OOP_ITERATE_DEFN_m) 1574 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_DEFN_m)
1575 #ifndef SERIALGC
1576 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN)
1577 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN)
1578 #endif // !SERIALGC
1556 1579
1557 void instanceKlass::iterate_static_fields(OopClosure* closure) { 1580 void instanceKlass::iterate_static_fields(OopClosure* closure) {
1558 InstanceKlass_OOP_ITERATE( \ 1581 InstanceKlass_OOP_ITERATE( \
1559 start_of_static_fields(), static_oop_field_size(), \ 1582 start_of_static_fields(), static_oop_field_size(), \
1560 closure->do_oop(p), \ 1583 closure->do_oop(p), \