src/cpu/sparc/vm/c1_Runtime1_sparc.cpp

changeset 1162
6b2273dd6fa9
parent 1079
c517646eef23
child 1730
3cf667df43ef
equal deleted inserted replaced
1160:928912ce8438 1162:6b2273dd6fa9
1 /* 1 /*
2 * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 1999-2009 Sun Microsystems, Inc. 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.
55 restore_thread(L7_thread_cache); 55 restore_thread(L7_thread_cache);
56 reset_last_Java_frame(); 56 reset_last_Java_frame();
57 57
58 // check for pending exceptions 58 // check for pending exceptions
59 { Label L; 59 { Label L;
60 Address exception_addr(G2_thread, 0, in_bytes(Thread::pending_exception_offset())); 60 Address exception_addr(G2_thread, Thread::pending_exception_offset());
61 ld_ptr(exception_addr, Gtemp); 61 ld_ptr(exception_addr, Gtemp);
62 br_null(Gtemp, false, pt, L); 62 br_null(Gtemp, false, pt, L);
63 delayed()->nop(); 63 delayed()->nop();
64 Address vm_result_addr(G2_thread, 0, in_bytes(JavaThread::vm_result_offset())); 64 Address vm_result_addr(G2_thread, JavaThread::vm_result_offset());
65 st_ptr(G0, vm_result_addr); 65 st_ptr(G0, vm_result_addr);
66 Address vm_result_addr_2(G2_thread, 0, in_bytes(JavaThread::vm_result_2_offset())); 66 Address vm_result_addr_2(G2_thread, JavaThread::vm_result_2_offset());
67 st_ptr(G0, vm_result_addr_2); 67 st_ptr(G0, vm_result_addr_2);
68 68
69 if (frame_size() == no_frame_size) { 69 if (frame_size() == no_frame_size) {
70 // we use O7 linkage so that forward_exception_entry has the issuing PC 70 // we use O7 linkage so that forward_exception_entry has the issuing PC
71 call(StubRoutines::forward_exception_entry(), relocInfo::runtime_call_type); 71 call(StubRoutines::forward_exception_entry(), relocInfo::runtime_call_type);
72 delayed()->restore(); 72 delayed()->restore();
73 } else if (_stub_id == Runtime1::forward_exception_id) { 73 } else if (_stub_id == Runtime1::forward_exception_id) {
74 should_not_reach_here(); 74 should_not_reach_here();
75 } else { 75 } else {
76 Address exc(G4, Runtime1::entry_for(Runtime1::forward_exception_id)); 76 AddressLiteral exc(Runtime1::entry_for(Runtime1::forward_exception_id));
77 jump_to(exc, 0); 77 jump_to(exc, G4);
78 delayed()->nop(); 78 delayed()->nop();
79 } 79 }
80 bind(L); 80 bind(L);
81 } 81 }
82 82
83 // get oop result if there is one and reset the value in the thread 83 // get oop result if there is one and reset the value in the thread
84 if (oop_result1->is_valid()) { // get oop result if there is one and reset it in the thread 84 if (oop_result1->is_valid()) { // get oop result if there is one and reset it in the thread
85 get_vm_result (oop_result1); 85 get_vm_result (oop_result1);
86 } else { 86 } else {
87 // be a little paranoid and clear the result 87 // be a little paranoid and clear the result
88 Address vm_result_addr(G2_thread, 0, in_bytes(JavaThread::vm_result_offset())); 88 Address vm_result_addr(G2_thread, JavaThread::vm_result_offset());
89 st_ptr(G0, vm_result_addr); 89 st_ptr(G0, vm_result_addr);
90 } 90 }
91 91
92 if (oop_result2->is_valid()) { 92 if (oop_result2->is_valid()) {
93 get_vm_result_2(oop_result2); 93 get_vm_result_2(oop_result2);
94 } else { 94 } else {
95 // be a little paranoid and clear the result 95 // be a little paranoid and clear the result
96 Address vm_result_addr_2(G2_thread, 0, in_bytes(JavaThread::vm_result_2_offset())); 96 Address vm_result_addr_2(G2_thread, JavaThread::vm_result_2_offset());
97 st_ptr(G0, vm_result_addr_2); 97 st_ptr(G0, vm_result_addr_2);
98 } 98 }
99 99
100 return call_offset; 100 return call_offset;
101 } 101 }
477 { 477 {
478 Register G5_klass = G5; // Incoming 478 Register G5_klass = G5; // Incoming
479 Register G4_length = G4; // Incoming 479 Register G4_length = G4; // Incoming
480 Register O0_obj = O0; // Outgoing 480 Register O0_obj = O0; // Outgoing
481 481
482 Address klass_lh(G5_klass, 0, ((klassOopDesc::header_size() * HeapWordSize) 482 Address klass_lh(G5_klass, ((klassOopDesc::header_size() * HeapWordSize)
483 + Klass::layout_helper_offset_in_bytes())); 483 + Klass::layout_helper_offset_in_bytes()));
484 assert(Klass::_lh_header_size_shift % BitsPerByte == 0, "bytewise"); 484 assert(Klass::_lh_header_size_shift % BitsPerByte == 0, "bytewise");
485 assert(Klass::_lh_header_size_mask == 0xFF, "bytewise"); 485 assert(Klass::_lh_header_size_mask == 0xFF, "bytewise");
486 // Use this offset to pick out an individual byte of the layout_helper: 486 // Use this offset to pick out an individual byte of the layout_helper:
487 const int klass_lh_header_size_offset = ((BytesPerInt - 1) // 3 - 2 selects byte {0,1,0,0} 487 const int klass_lh_header_size_offset = ((BytesPerInt - 1) // 3 - 2 selects byte {0,1,0,0}
488 - Klass::_lh_header_size_shift / BitsPerByte); 488 - Klass::_lh_header_size_shift / BitsPerByte);
900 __ srlx(addr, CardTableModRefBS::card_shift, addr); 900 __ srlx(addr, CardTableModRefBS::card_shift, addr);
901 #else 901 #else
902 __ srl(addr, CardTableModRefBS::card_shift, addr); 902 __ srl(addr, CardTableModRefBS::card_shift, addr);
903 #endif 903 #endif
904 904
905 Address rs(cardtable, (address)byte_map_base); 905 AddressLiteral rs(byte_map_base);
906 __ load_address(rs); // cardtable := <card table base> 906 __ set(rs, cardtable); // cardtable := <card table base>
907 __ ldub(addr, cardtable, tmp); // tmp := [addr + cardtable] 907 __ ldub(addr, cardtable, tmp); // tmp := [addr + cardtable]
908 908
909 __ br_on_reg_cond(Assembler::rc_nz, /*annul*/false, Assembler::pt, 909 __ br_on_reg_cond(Assembler::rc_nz, /*annul*/false, Assembler::pt,
910 tmp, not_already_dirty); 910 tmp, not_already_dirty);
911 // Get cardtable + tmp into a reg by itself -- useful in the take-the-branch 911 // Get cardtable + tmp into a reg by itself -- useful in the take-the-branch
1020 __ ld_ptr(G2_thread, in_bytes(JavaThread::exception_oop_offset()), Oexception->after_save()); 1020 __ ld_ptr(G2_thread, in_bytes(JavaThread::exception_oop_offset()), Oexception->after_save());
1021 __ st_ptr(G0, G2_thread, in_bytes(JavaThread::exception_oop_offset())); 1021 __ st_ptr(G0, G2_thread, in_bytes(JavaThread::exception_oop_offset()));
1022 1022
1023 __ restore(); 1023 __ restore();
1024 1024
1025 Address exc(G4, Runtime1::entry_for(Runtime1::unwind_exception_id)); 1025 AddressLiteral exc(Runtime1::entry_for(Runtime1::unwind_exception_id));
1026 __ jump_to(exc, 0); 1026 __ jump_to(exc, G4);
1027 __ delayed()->nop(); 1027 __ delayed()->nop();
1028 1028
1029 1029
1030 oop_maps->add_gc_map(call_offset, oop_map); 1030 oop_maps->add_gc_map(call_offset, oop_map);
1031 } 1031 }

mercurial