src/hotspot/share/asm/codeBuffer.cpp
changeset 54010 17fb726e6d8e
parent 51078 fc6cfe40e32a
child 54783 3331dad9cb30
equal deleted inserted replaced
54009:13acb4339895 54010:17fb726e6d8e
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2019, 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.
  1027   }
  1027   }
  1028 }
  1028 }
  1029 
  1029 
  1030 #ifndef PRODUCT
  1030 #ifndef PRODUCT
  1031 
  1031 
  1032 void CodeSection::dump() {
       
  1033   address ptr = start();
       
  1034   for (csize_t step; ptr < end(); ptr += step) {
       
  1035     step = end() - ptr;
       
  1036     if (step > jintSize * 4)  step = jintSize * 4;
       
  1037     tty->print(INTPTR_FORMAT ": ", p2i(ptr));
       
  1038     while (step > 0) {
       
  1039       tty->print(" " PTR32_FORMAT, *(jint*)ptr);
       
  1040       ptr += jintSize;
       
  1041     }
       
  1042     tty->cr();
       
  1043   }
       
  1044 }
       
  1045 
       
  1046 
       
  1047 void CodeSection::decode() {
  1032 void CodeSection::decode() {
  1048   Disassembler::decode(start(), end());
  1033   Disassembler::decode(start(), end());
  1049 }
  1034 }
  1050 
       
  1051 
  1035 
  1052 void CodeBuffer::block_comment(intptr_t offset, const char * comment) {
  1036 void CodeBuffer::block_comment(intptr_t offset, const char * comment) {
  1053   _code_strings.add_comment(offset, comment);
  1037   _code_strings.add_comment(offset, comment);
  1054 }
  1038 }
  1055 
  1039 
  1203   ttyLocker ttyl;
  1187   ttyLocker ttyl;
  1204   Disassembler::decode(decode_begin(), insts_end());
  1188   Disassembler::decode(decode_begin(), insts_end());
  1205   _decode_begin = insts_end();
  1189   _decode_begin = insts_end();
  1206 }
  1190 }
  1207 
  1191 
  1208 
       
  1209 void CodeBuffer::skip_decode() {
       
  1210   _decode_begin = insts_end();
       
  1211 }
       
  1212 
       
  1213 
       
  1214 void CodeBuffer::decode_all() {
       
  1215   ttyLocker ttyl;
       
  1216   for (int n = 0; n < (int)SECT_LIMIT; n++) {
       
  1217     // dump contents of each section
       
  1218     CodeSection* cs = code_section(n);
       
  1219     tty->print_cr("! %s:", code_section_name(n));
       
  1220     if (cs != consts())
       
  1221       cs->decode();
       
  1222     else
       
  1223       cs->dump();
       
  1224   }
       
  1225 }
       
  1226 
       
  1227 
       
  1228 void CodeSection::print(const char* name) {
  1192 void CodeSection::print(const char* name) {
  1229   csize_t locs_size = locs_end() - locs_start();
  1193   csize_t locs_size = locs_end() - locs_start();
  1230   tty->print_cr(" %7s.code = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d)%s",
  1194   tty->print_cr(" %7s.code = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d)%s",
  1231                 name, p2i(start()), p2i(end()), p2i(limit()), size(), capacity(),
  1195                 name, p2i(start()), p2i(end()), p2i(limit()), size(), capacity(),
  1232                 is_frozen()? " [frozen]": "");
  1196                 is_frozen()? " [frozen]": "");