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 *
23 */
24
25 #include "precompiled.hpp"
26 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
27 #include "gc_implementation/g1/heapRegion.hpp"
28 #include "gc_implementation/g1/satbQueue.hpp"
29 #include "runtime/mutexLocker.hpp"
30 #include "runtime/thread.hpp"
31 #ifdef TARGET_OS_FAMILY_linux
32 # include "thread_linux.inline.hpp"
33 #endif
34 #ifdef TARGET_OS_FAMILY_solaris
35 # include "thread_solaris.inline.hpp"
36 #endif
37 #ifdef TARGET_OS_FAMILY_windows
38 # include "thread_windows.inline.hpp"
39 #endif
40 #ifdef TARGET_OS_FAMILY_bsd
41 # include "thread_bsd.inline.hpp"
42 #endif
43
44 G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap,
45 int max_covered_regions) :
46 CardTableModRefBSForCTRS(whole_heap, max_covered_regions)
47 {
48 _kind = G1SATBCT;
49 }
50
51
52 void G1SATBCardTableModRefBS::enqueue(oop pre_val) {
53 // Nulls should have been already filtered.
54 assert(pre_val->is_oop(true), "Error");
55
56 if (!JavaThread::satb_mark_queue_set().is_active()) return;
57 Thread* thr = Thread::current();
58 if (thr->is_Java_thread()) {
59 JavaThread* jt = (JavaThread*)thr;
60 jt->satb_mark_queue().enqueue(pre_val);
61 } else {
62 MutexLocker x(Shared_SATB_Q_lock);
|
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 *
23 */
24
25 #include "precompiled.hpp"
26 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
27 #include "gc_implementation/g1/heapRegion.hpp"
28 #include "gc_implementation/g1/satbQueue.hpp"
29 #include "runtime/mutexLocker.hpp"
30 #include "runtime/thread.inline.hpp"
31
32 G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap,
33 int max_covered_regions) :
34 CardTableModRefBSForCTRS(whole_heap, max_covered_regions)
35 {
36 _kind = G1SATBCT;
37 }
38
39
40 void G1SATBCardTableModRefBS::enqueue(oop pre_val) {
41 // Nulls should have been already filtered.
42 assert(pre_val->is_oop(true), "Error");
43
44 if (!JavaThread::satb_mark_queue_set().is_active()) return;
45 Thread* thr = Thread::current();
46 if (thr->is_Java_thread()) {
47 JavaThread* jt = (JavaThread*)thr;
48 jt->satb_mark_queue().enqueue(pre_val);
49 } else {
50 MutexLocker x(Shared_SATB_Q_lock);
|