< prev index next >

src/hotspot/share/compiler/disassembler.cpp

8199604_cardtablemodrefbs_rename

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 "ci/ciUtilities.hpp"                                                                                                        
26 #include "classfile/javaClasses.hpp"                                                                                                 
27 #include "code/codeCache.hpp"                                                                                                        
28 #include "compiler/disassembler.hpp"                                                                                                 
29 #include "gc/shared/cardTable.hpp"                                                                                                   
30 #include "gc/shared/cardTableModRefBS.hpp"                                                                                           
31 #include "gc/shared/collectedHeap.hpp"                                                                                               
32 #include "memory/resourceArea.hpp"                                                                                                   
33 #include "oops/oop.inline.hpp"                                                                                                       
34 #include "runtime/handles.inline.hpp"                                                                                                
35 #include "runtime/os.hpp"                                                                                                            
36 #include "runtime/stubCodeGenerator.hpp"                                                                                             
37 #include "runtime/stubRoutines.hpp"                                                                                                  
38 #include CPU_HEADER(depChecker)                                                                                                      
39 
40 void*       Disassembler::_library               = NULL;                                                                             
41 bool        Disassembler::_tried_to_load_library = false;                                                                            
42 
43 // This routine is in the shared library:                                                                                            
44 Disassembler::decode_func_virtual Disassembler::_decode_instructions_virtual = NULL;                                                 
45 Disassembler::decode_func Disassembler::_decode_instructions = NULL;                                                                 
46 
47 static const char hsdis_library_name[] = "hsdis-" HOTSPOT_LIB_ARCH;                                                                  
48 static const char decode_instructions_virtual_name[] = "decode_instructions_virtual";                                                
49 static const char decode_instructions_name[] = "decode_instructions";                                                                

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 "ci/ciUtilities.hpp"
26 #include "classfile/javaClasses.hpp"
27 #include "code/codeCache.hpp"
28 #include "compiler/disassembler.hpp"
29 #include "gc/shared/cardTable.hpp"
30 #include "gc/shared/cardTableBarrierSet.hpp"
31 #include "gc/shared/collectedHeap.hpp"
32 #include "memory/resourceArea.hpp"
33 #include "oops/oop.inline.hpp"
34 #include "runtime/handles.inline.hpp"
35 #include "runtime/os.hpp"
36 #include "runtime/stubCodeGenerator.hpp"
37 #include "runtime/stubRoutines.hpp"
38 #include CPU_HEADER(depChecker)
39 
40 void*       Disassembler::_library               = NULL;
41 bool        Disassembler::_tried_to_load_library = false;
42 
43 // This routine is in the shared library:
44 Disassembler::decode_func_virtual Disassembler::_decode_instructions_virtual = NULL;
45 Disassembler::decode_func Disassembler::_decode_instructions = NULL;
46 
47 static const char hsdis_library_name[] = "hsdis-" HOTSPOT_LIB_ARCH;
48 static const char decode_instructions_virtual_name[] = "decode_instructions_virtual";
49 static const char decode_instructions_name[] = "decode_instructions";

301   if (Universe::is_fully_initialized()) {                                                                                            
302     if (StubRoutines::contains(adr)) {                                                                                               
303       StubCodeDesc* desc = StubCodeDesc::desc_for(adr);                                                                              
304       if (desc == NULL) {                                                                                                            
305         desc = StubCodeDesc::desc_for(adr + frame::pc_return_offset);                                                                
306       }                                                                                                                              
307       if (desc != NULL) {                                                                                                            
308         st->print("Stub::%s", desc->name());                                                                                         
309         if (desc->begin() != adr) {                                                                                                  
310           st->print(INTX_FORMAT_W(+) " " PTR_FORMAT, adr - desc->begin(), p2i(adr));                                                 
311         } else if (WizardMode) {                                                                                                     
312           st->print(" " PTR_FORMAT, p2i(adr));                                                                                       
313         }                                                                                                                            
314         return;                                                                                                                      
315       }                                                                                                                              
316       st->print("Stub::<unknown> " PTR_FORMAT, p2i(adr));                                                                            
317       return;                                                                                                                        
318     }                                                                                                                                
319 
320     BarrierSet* bs = Universe::heap()->barrier_set();                                                                                
321     if (bs->is_a(BarrierSet::CardTableModRef) &&                                                                                     
322         adr == ci_card_table_address_as<address>()) {                                                                                
323       st->print("word_map_base");                                                                                                    
324       if (WizardMode) st->print(" " INTPTR_FORMAT, p2i(adr));                                                                        
325       return;                                                                                                                        
326     }                                                                                                                                
327   }                                                                                                                                  
328 
329   if (_nm == NULL) {                                                                                                                 
330     // Don't do this for native methods, as the function name will be printed in                                                     
331     // nmethod::reloc_string_for().                                                                                                  
332     ResourceMark rm;                                                                                                                 
333     const int buflen = 1024;                                                                                                         
334     char* buf = NEW_RESOURCE_ARRAY(char, buflen);                                                                                    
335     int offset;                                                                                                                      
336     if (os::dll_address_to_function_name(adr, buf, buflen, &offset)) {                                                               
337       st->print(PTR_FORMAT " = %s",  p2i(adr), buf);                                                                                 
338       if (offset != 0) {                                                                                                             
339         st->print("+%d", offset);                                                                                                    
340       }                                                                                                                              

301   if (Universe::is_fully_initialized()) {
302     if (StubRoutines::contains(adr)) {
303       StubCodeDesc* desc = StubCodeDesc::desc_for(adr);
304       if (desc == NULL) {
305         desc = StubCodeDesc::desc_for(adr + frame::pc_return_offset);
306       }
307       if (desc != NULL) {
308         st->print("Stub::%s", desc->name());
309         if (desc->begin() != adr) {
310           st->print(INTX_FORMAT_W(+) " " PTR_FORMAT, adr - desc->begin(), p2i(adr));
311         } else if (WizardMode) {
312           st->print(" " PTR_FORMAT, p2i(adr));
313         }
314         return;
315       }
316       st->print("Stub::<unknown> " PTR_FORMAT, p2i(adr));
317       return;
318     }
319 
320     BarrierSet* bs = Universe::heap()->barrier_set();
321     if (bs->is_a(BarrierSet::CardTableBarrierSet) &&
322         adr == ci_card_table_address_as<address>()) {
323       st->print("word_map_base");
324       if (WizardMode) st->print(" " INTPTR_FORMAT, p2i(adr));
325       return;
326     }
327   }
328 
329   if (_nm == NULL) {
330     // Don't do this for native methods, as the function name will be printed in
331     // nmethod::reloc_string_for().
332     ResourceMark rm;
333     const int buflen = 1024;
334     char* buf = NEW_RESOURCE_ARRAY(char, buflen);
335     int offset;
336     if (os::dll_address_to_function_name(adr, buf, buflen, &offset)) {
337       st->print(PTR_FORMAT " = %s",  p2i(adr), buf);
338       if (offset != 0) {
339         st->print("+%d", offset);
340       }
< prev index next >