< prev index next >

src/share/vm/ci/ciReplay.cpp

Print this page
rev 11747 : [mq]: per.hotspot.patch


  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "ci/ciMethodData.hpp"
  27 #include "ci/ciReplay.hpp"
  28 #include "ci/ciSymbol.hpp"
  29 #include "ci/ciKlass.hpp"
  30 #include "ci/ciUtilities.hpp"
  31 #include "compiler/compileBroker.hpp"
  32 #include "gc/shared/referencePendingListLocker.hpp"
  33 #include "memory/allocation.inline.hpp"
  34 #include "memory/oopFactory.hpp"
  35 #include "memory/resourceArea.hpp"
  36 #include "oops/oop.inline.hpp"
  37 #include "utilities/copy.hpp"
  38 #include "utilities/macros.hpp"
  39 
  40 #ifndef PRODUCT
  41 
  42 // ciReplay
  43 
  44 typedef struct _ciMethodDataRecord {
  45   const char* _klass_name;
  46   const char* _method_name;
  47   const char* _signature;
  48 
  49   int _state;
  50   int _current_mileage;
  51 
  52   intptr_t* _data;


 560 
 561   // ciMethod <klass> <name> <signature> <invocation_counter> <backedge_counter> <interpreter_invocation_count> <interpreter_throwout_count> <instructions_size>
 562   //
 563   //
 564   void process_ciMethod(TRAPS) {
 565     Method* method = parse_method(CHECK);
 566     if (had_error()) return;
 567     ciMethodRecord* rec = new_ciMethod(method);
 568     rec->_invocation_counter = parse_int("invocation_counter");
 569     rec->_backedge_counter = parse_int("backedge_counter");
 570     rec->_interpreter_invocation_count = parse_int("interpreter_invocation_count");
 571     rec->_interpreter_throwout_count = parse_int("interpreter_throwout_count");
 572     rec->_instructions_size = parse_int("instructions_size");
 573   }
 574 
 575   // ciMethodData <klass> <name> <signature> <state> <current mileage> orig <length> # # ... data <length> # # ... oops <length> # ... methods <length>
 576   void process_ciMethodData(TRAPS) {
 577     Method* method = parse_method(CHECK);
 578     if (had_error()) return;
 579     /* just copied from Method, to build interpret data*/
 580     if (ReferencePendingListLocker::is_locked_by_self()) {
 581       return;
 582     }
 583     // To be properly initialized, some profiling in the MDO needs the
 584     // method to be rewritten (number of arguments at a call for
 585     // instance)
 586     method->method_holder()->link_class(CHECK);
 587     // methodOopDesc::build_interpreter_method_data(method, CHECK);
 588     {
 589       // Grab a lock here to prevent multiple
 590       // MethodData*s from being created.
 591       MutexLocker ml(MethodData_lock, THREAD);
 592       if (method->method_data() == NULL) {
 593         ClassLoaderData* loader_data = method->method_holder()->class_loader_data();
 594         MethodData* method_data = MethodData::allocate(loader_data, method, CHECK);
 595         method->set_method_data(method_data);
 596       }
 597     }
 598 
 599     // collect and record all the needed information for later
 600     ciMethodDataRecord* rec = new_ciMethodData(method);
 601     rec->_state = parse_int("state");
 602     rec->_current_mileage = parse_int("current_mileage");




  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "ci/ciMethodData.hpp"
  27 #include "ci/ciReplay.hpp"
  28 #include "ci/ciSymbol.hpp"
  29 #include "ci/ciKlass.hpp"
  30 #include "ci/ciUtilities.hpp"
  31 #include "compiler/compileBroker.hpp"

  32 #include "memory/allocation.inline.hpp"
  33 #include "memory/oopFactory.hpp"
  34 #include "memory/resourceArea.hpp"
  35 #include "oops/oop.inline.hpp"
  36 #include "utilities/copy.hpp"
  37 #include "utilities/macros.hpp"
  38 
  39 #ifndef PRODUCT
  40 
  41 // ciReplay
  42 
  43 typedef struct _ciMethodDataRecord {
  44   const char* _klass_name;
  45   const char* _method_name;
  46   const char* _signature;
  47 
  48   int _state;
  49   int _current_mileage;
  50 
  51   intptr_t* _data;


 559 
 560   // ciMethod <klass> <name> <signature> <invocation_counter> <backedge_counter> <interpreter_invocation_count> <interpreter_throwout_count> <instructions_size>
 561   //
 562   //
 563   void process_ciMethod(TRAPS) {
 564     Method* method = parse_method(CHECK);
 565     if (had_error()) return;
 566     ciMethodRecord* rec = new_ciMethod(method);
 567     rec->_invocation_counter = parse_int("invocation_counter");
 568     rec->_backedge_counter = parse_int("backedge_counter");
 569     rec->_interpreter_invocation_count = parse_int("interpreter_invocation_count");
 570     rec->_interpreter_throwout_count = parse_int("interpreter_throwout_count");
 571     rec->_instructions_size = parse_int("instructions_size");
 572   }
 573 
 574   // ciMethodData <klass> <name> <signature> <state> <current mileage> orig <length> # # ... data <length> # # ... oops <length> # ... methods <length>
 575   void process_ciMethodData(TRAPS) {
 576     Method* method = parse_method(CHECK);
 577     if (had_error()) return;
 578     /* just copied from Method, to build interpret data*/
 579 


 580     // To be properly initialized, some profiling in the MDO needs the
 581     // method to be rewritten (number of arguments at a call for
 582     // instance)
 583     method->method_holder()->link_class(CHECK);
 584     // methodOopDesc::build_interpreter_method_data(method, CHECK);
 585     {
 586       // Grab a lock here to prevent multiple
 587       // MethodData*s from being created.
 588       MutexLocker ml(MethodData_lock, THREAD);
 589       if (method->method_data() == NULL) {
 590         ClassLoaderData* loader_data = method->method_holder()->class_loader_data();
 591         MethodData* method_data = MethodData::allocate(loader_data, method, CHECK);
 592         method->set_method_data(method_data);
 593       }
 594     }
 595 
 596     // collect and record all the needed information for later
 597     ciMethodDataRecord* rec = new_ciMethodData(method);
 598     rec->_state = parse_int("state");
 599     rec->_current_mileage = parse_int("current_mileage");


< prev index next >