< prev index next >

src/hotspot/cpu/sparc/macroAssembler_sparc.cpp

8199604_cardtablemodrefbs_rename

9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or                                                             
10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License                                                             
11  * version 2 for more details (a copy is included in the LICENSE file that                                                           
12  * accompanied this code).                                                                                                           
13  *                                                                                                                                   
14  * You should have received a copy of the GNU General Public License version                                                         
15  * 2 along with this work; if not, write to the Free Software Foundation,                                                            
16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.                                                                     
17  *                                                                                                                                   
18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA                                                           
19  * or visit www.oracle.com if you need additional information or have any                                                            
20  * questions.                                                                                                                        
21  *                                                                                                                                   
22  */                                                                                                                                  
23 
24 #include "precompiled.hpp"                                                                                                           
25 #include "jvm.h"                                                                                                                     
26 #include "asm/macroAssembler.inline.hpp"                                                                                             
27 #include "compiler/disassembler.hpp"                                                                                                 
28 #include "gc/shared/cardTable.hpp"                                                                                                   
29 #include "gc/shared/cardTableModRefBS.hpp"                                                                                           
30 #include "gc/shared/collectedHeap.inline.hpp"                                                                                        
31 #include "interpreter/interpreter.hpp"                                                                                               
32 #include "memory/resourceArea.hpp"                                                                                                   
33 #include "memory/universe.hpp"                                                                                                       
34 #include "oops/klass.inline.hpp"                                                                                                     
35 #include "prims/methodHandles.hpp"                                                                                                   
36 #include "runtime/biasedLocking.hpp"                                                                                                 
37 #include "runtime/interfaceSupport.hpp"                                                                                              
38 #include "runtime/jniHandles.inline.hpp"                                                                                             
39 #include "runtime/objectMonitor.hpp"                                                                                                 
40 #include "runtime/os.inline.hpp"                                                                                                     
41 #include "runtime/safepoint.hpp"                                                                                                     
42 #include "runtime/safepointMechanism.hpp"                                                                                            
43 #include "runtime/sharedRuntime.hpp"                                                                                                 
44 #include "runtime/stubRoutines.hpp"                                                                                                  
45 #include "utilities/align.hpp"                                                                                                       
46 #include "utilities/macros.hpp"                                                                                                      
47 #if INCLUDE_ALL_GCS                                                                                                                  
48 #include "gc/g1/g1BarrierSet.hpp"                                                                                                    

9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
11  * version 2 for more details (a copy is included in the LICENSE file that
12  * accompanied this code).
13  *
14  * You should have received a copy of the GNU General Public License version
15  * 2 along with this work; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17  *
18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19  * or visit www.oracle.com if you need additional information or have any
20  * questions.
21  *
22  */
23 
24 #include "precompiled.hpp"
25 #include "jvm.h"
26 #include "asm/macroAssembler.inline.hpp"
27 #include "compiler/disassembler.hpp"
28 #include "gc/shared/cardTable.hpp"
29 #include "gc/shared/cardTableBarrierSet.hpp"
30 #include "gc/shared/collectedHeap.inline.hpp"
31 #include "interpreter/interpreter.hpp"
32 #include "memory/resourceArea.hpp"
33 #include "memory/universe.hpp"
34 #include "oops/klass.inline.hpp"
35 #include "prims/methodHandles.hpp"
36 #include "runtime/biasedLocking.hpp"
37 #include "runtime/interfaceSupport.hpp"
38 #include "runtime/jniHandles.inline.hpp"
39 #include "runtime/objectMonitor.hpp"
40 #include "runtime/os.inline.hpp"
41 #include "runtime/safepoint.hpp"
42 #include "runtime/safepointMechanism.hpp"
43 #include "runtime/sharedRuntime.hpp"
44 #include "runtime/stubRoutines.hpp"
45 #include "utilities/align.hpp"
46 #include "utilities/macros.hpp"
47 #if INCLUDE_ALL_GCS
48 #include "gc/g1/g1BarrierSet.hpp"

3711       generate_dirty_card_log_enqueue(ct->byte_map_base());                                                                          
3712       assert(dirty_card_log_enqueue != 0, "postcondition.");                                                                         
3713     }                                                                                                                                
3714     if (satb_log_enqueue_with_frame == 0) {                                                                                          
3715       generate_satb_log_enqueue(true);                                                                                               
3716       assert(satb_log_enqueue_with_frame != 0, "postcondition.");                                                                    
3717     }                                                                                                                                
3718     if (satb_log_enqueue_frameless == 0) {                                                                                           
3719       generate_satb_log_enqueue(false);                                                                                              
3720       assert(satb_log_enqueue_frameless != 0, "postcondition.");                                                                     
3721     }                                                                                                                                
3722   }                                                                                                                                  
3723 }                                                                                                                                    
3724 
3725 #endif // INCLUDE_ALL_GCS                                                                                                            
3726 ///////////////////////////////////////////////////////////////////////////////////                                                  
3727 
3728 void MacroAssembler::card_write_barrier_post(Register store_addr, Register new_val, Register tmp) {                                  
3729   // If we're writing constant NULL, we can skip the write barrier.                                                                  
3730   if (new_val == G0) return;                                                                                                         
3731   CardTableModRefBS* bs =                                                                                                            
3732     barrier_set_cast<CardTableModRefBS>(Universe::heap()->barrier_set());                                                            
3733   CardTable* ct = bs->card_table();                                                                                                  
3734 
3735   assert(bs->kind() == BarrierSet::CardTableModRef, "wrong barrier");                                                                
3736   card_table_write(ct->byte_map_base(), tmp, store_addr);                                                                            
3737 }                                                                                                                                    
3738 
3739 // ((OopHandle)result).resolve();                                                                                                    
3740 void MacroAssembler::resolve_oop_handle(Register result) {                                                                           
3741   // OopHandle::resolve is an indirection.                                                                                           
3742   ld_ptr(result, 0, result);                                                                                                         
3743 }                                                                                                                                    
3744 
3745 void MacroAssembler::load_mirror(Register mirror, Register method) {                                                                 
3746   const int mirror_offset = in_bytes(Klass::java_mirror_offset());                                                                   
3747   ld_ptr(method, in_bytes(Method::const_offset()), mirror);                                                                          
3748   ld_ptr(mirror, in_bytes(ConstMethod::constants_offset()), mirror);                                                                 
3749   ld_ptr(mirror, ConstantPool::pool_holder_offset_in_bytes(), mirror);                                                               
3750   ld_ptr(mirror, mirror_offset, mirror);                                                                                             
3751   resolve_oop_handle(mirror);                                                                                                        
3752 }                                                                                                                                    
3753 
3754 void MacroAssembler::load_klass(Register src_oop, Register klass) {                                                                  

3711       generate_dirty_card_log_enqueue(ct->byte_map_base());
3712       assert(dirty_card_log_enqueue != 0, "postcondition.");
3713     }
3714     if (satb_log_enqueue_with_frame == 0) {
3715       generate_satb_log_enqueue(true);
3716       assert(satb_log_enqueue_with_frame != 0, "postcondition.");
3717     }
3718     if (satb_log_enqueue_frameless == 0) {
3719       generate_satb_log_enqueue(false);
3720       assert(satb_log_enqueue_frameless != 0, "postcondition.");
3721     }
3722   }
3723 }
3724 
3725 #endif // INCLUDE_ALL_GCS
3726 ///////////////////////////////////////////////////////////////////////////////////
3727 
3728 void MacroAssembler::card_write_barrier_post(Register store_addr, Register new_val, Register tmp) {
3729   // If we're writing constant NULL, we can skip the write barrier.
3730   if (new_val == G0) return;
3731   CardTableBarrierSet* bs =
3732     barrier_set_cast<CardTableBarrierSet>(Universe::heap()->barrier_set());
3733   CardTable* ct = bs->card_table();
3734 
3735   assert(bs->kind() == BarrierSet::CardTableBarrierSet, "wrong barrier");
3736   card_table_write(ct->byte_map_base(), tmp, store_addr);
3737 }
3738 
3739 // ((OopHandle)result).resolve();
3740 void MacroAssembler::resolve_oop_handle(Register result) {
3741   // OopHandle::resolve is an indirection.
3742   ld_ptr(result, 0, result);
3743 }
3744 
3745 void MacroAssembler::load_mirror(Register mirror, Register method) {
3746   const int mirror_offset = in_bytes(Klass::java_mirror_offset());
3747   ld_ptr(method, in_bytes(Method::const_offset()), mirror);
3748   ld_ptr(mirror, in_bytes(ConstMethod::constants_offset()), mirror);
3749   ld_ptr(mirror, ConstantPool::pool_holder_offset_in_bytes(), mirror);
3750   ld_ptr(mirror, mirror_offset, mirror);
3751   resolve_oop_handle(mirror);
3752 }
3753 
3754 void MacroAssembler::load_klass(Register src_oop, Register klass) {
< prev index next >