Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp @ 6948:e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 12 Nov 2012 23:14:12 +0100 |
parents | da91efe96a93 |
children | 4c1b88a53c74 |
comparison
equal
deleted
inserted
replaced
6711:ae13cc658b80 | 6948:e522a00b91aa |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 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 | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP | 25 #ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP |
26 #define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP | 26 #define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP |
27 | 27 |
28 #include "gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp" | 28 #include "gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp" |
29 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp" | 29 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp" |
30 #include "oops/oop.inline.hpp" | |
30 | 31 |
31 // Trim our work_queue so its length is below max at return | 32 // Trim our work_queue so its length is below max at return |
32 inline void Par_MarkRefsIntoAndScanClosure::trim_queue(uint max) { | 33 inline void Par_MarkRefsIntoAndScanClosure::trim_queue(uint max) { |
33 while (_work_queue->size() > max) { | 34 while (_work_queue->size() > max) { |
34 oop newOop; | 35 oop newOop; |
41 newOop->oop_iterate(&_par_pushAndMarkClosure); | 42 newOop->oop_iterate(&_par_pushAndMarkClosure); |
42 } | 43 } |
43 } | 44 } |
44 } | 45 } |
45 | 46 |
46 #ifndef PRODUCT | 47 // CMSOopClosure and CMSoopsInGenClosure are duplicated, |
47 void KlassRememberingOopClosure::check_remember_klasses() const { | 48 // until we get rid of OopsInGenClosure. |
48 assert(_should_remember_klasses == must_remember_klasses(), | 49 |
49 "Should remember klasses in this context."); | 50 inline void CMSOopClosure::do_klass(Klass* k) { do_klass_nv(k); } |
51 inline void CMSOopsInGenClosure::do_klass(Klass* k) { do_klass_nv(k); } | |
52 | |
53 inline void CMSOopClosure::do_klass_nv(Klass* k) { | |
54 ClassLoaderData* cld = k->class_loader_data(); | |
55 do_class_loader_data(cld); | |
50 } | 56 } |
51 #endif | 57 inline void CMSOopsInGenClosure::do_klass_nv(Klass* k) { |
52 | 58 ClassLoaderData* cld = k->class_loader_data(); |
53 void KlassRememberingOopClosure::remember_klass(Klass* k) { | 59 do_class_loader_data(cld); |
54 if (!_revisit_stack->push(oop(k))) { | |
55 fatal("Revisit stack overflow in PushOrMarkClosure"); | |
56 } | |
57 check_remember_klasses(); | |
58 } | 60 } |
59 | 61 |
60 inline void PushOrMarkClosure::remember_mdo(DataLayout* v) { | 62 inline void CMSOopClosure::do_class_loader_data(ClassLoaderData* cld) { |
61 // TBD | 63 assert(_klass_closure._oop_closure == this, "Must be"); |
64 | |
65 bool claim = true; // Must claim the class loader data before processing. | |
66 cld->oops_do(_klass_closure._oop_closure, &_klass_closure, claim); | |
67 } | |
68 inline void CMSOopsInGenClosure::do_class_loader_data(ClassLoaderData* cld) { | |
69 assert(_klass_closure._oop_closure == this, "Must be"); | |
70 | |
71 bool claim = true; // Must claim the class loader data before processing. | |
72 cld->oops_do(_klass_closure._oop_closure, &_klass_closure, claim); | |
62 } | 73 } |
63 | 74 |
64 | 75 |
65 void Par_KlassRememberingOopClosure::remember_klass(Klass* k) { | |
66 if (!_revisit_stack->par_push(oop(k))) { | |
67 fatal("Revisit stack overflow in Par_KlassRememberingOopClosure"); | |
68 } | |
69 check_remember_klasses(); | |
70 } | |
71 | |
72 inline void Par_PushOrMarkClosure::remember_mdo(DataLayout* v) { | |
73 // TBD | |
74 } | |
75 | |
76 inline void PushOrMarkClosure::do_yield_check() { | |
77 _parent->do_yield_check(); | |
78 } | |
79 | |
80 inline void Par_PushOrMarkClosure::do_yield_check() { | |
81 _parent->do_yield_check(); | |
82 } | |
83 | |
84 #endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP | 76 #endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP |