< prev index next >

src/share/vm/ci/ciReplay.cpp

Print this page




1023   Threads::destroy_vm();
1024 
1025   vm_exit(exit_code);
1026 }
1027 
1028 void* ciReplay::load_inline_data(ciMethod* method, int entry_bci, int comp_level) {
1029   if (FLAG_IS_DEFAULT(InlineDataFile)) {
1030     tty->print_cr("ERROR: no inline replay data file specified (use -XX:InlineDataFile=inline_pid12345.txt).");
1031     return NULL;
1032   }
1033 
1034   VM_ENTRY_MARK;
1035   // Load and parse the replay data
1036   CompileReplay rp(InlineDataFile, THREAD);
1037   if (!rp.can_replay()) {
1038     tty->print_cr("ciReplay: !rp.can_replay()");
1039     return NULL;
1040   }
1041   void* data = rp.process_inline(method, method->get_Method(), entry_bci, comp_level, THREAD);
1042   if (HAS_PENDING_EXCEPTION) {
1043     oop throwable = PENDING_EXCEPTION;
1044     CLEAR_PENDING_EXCEPTION;
1045     java_lang_Throwable::print(throwable, tty);
1046     tty->cr();
1047     java_lang_Throwable::print_stack_trace(throwable, tty);
1048     tty->cr();
1049     return NULL;
1050   }
1051 
1052   if (rp.had_error()) {
1053     tty->print_cr("ciReplay: Failed on %s", rp.error_message());
1054     return NULL;
1055   }
1056   return data;
1057 }
1058 
1059 int ciReplay::replay_impl(TRAPS) {
1060   HandleMark hm;
1061   ResourceMark rm;
1062   // Make sure we don't run with background compilation
1063   BackgroundCompilation = false;
1064 
1065   if (ReplaySuppressInitializers > 2) {
1066     // ReplaySuppressInitializers > 2 means that we want to allow


1068     // don't allow any intializers to be run.
1069     ReplaySuppressInitializers = 1;
1070   }
1071 
1072   if (FLAG_IS_DEFAULT(ReplayDataFile)) {
1073     tty->print_cr("ERROR: no compiler replay data file specified (use -XX:ReplayDataFile=replay_pid12345.txt).");
1074     return 1;
1075   }
1076 
1077   // Load and parse the replay data
1078   CompileReplay rp(ReplayDataFile, THREAD);
1079   int exit_code = 0;
1080   if (rp.can_replay()) {
1081     rp.process(THREAD);
1082   } else {
1083     exit_code = 1;
1084     return exit_code;
1085   }
1086 
1087   if (HAS_PENDING_EXCEPTION) {
1088     oop throwable = PENDING_EXCEPTION;
1089     CLEAR_PENDING_EXCEPTION;
1090     java_lang_Throwable::print(throwable, tty);
1091     tty->cr();
1092     java_lang_Throwable::print_stack_trace(throwable, tty);
1093     tty->cr();
1094     exit_code = 2;
1095   }
1096 
1097   if (rp.had_error()) {
1098     tty->print_cr("Failed on %s", rp.error_message());
1099     exit_code = 1;
1100   }
1101   return exit_code;
1102 }
1103 
1104 void ciReplay::initialize(ciMethodData* m) {
1105   if (replay_state == NULL) {
1106     return;
1107   }
1108 
1109   ASSERT_IN_VM;
1110   ResourceMark rm;
1111 




1023   Threads::destroy_vm();
1024 
1025   vm_exit(exit_code);
1026 }
1027 
1028 void* ciReplay::load_inline_data(ciMethod* method, int entry_bci, int comp_level) {
1029   if (FLAG_IS_DEFAULT(InlineDataFile)) {
1030     tty->print_cr("ERROR: no inline replay data file specified (use -XX:InlineDataFile=inline_pid12345.txt).");
1031     return NULL;
1032   }
1033 
1034   VM_ENTRY_MARK;
1035   // Load and parse the replay data
1036   CompileReplay rp(InlineDataFile, THREAD);
1037   if (!rp.can_replay()) {
1038     tty->print_cr("ciReplay: !rp.can_replay()");
1039     return NULL;
1040   }
1041   void* data = rp.process_inline(method, method->get_Method(), entry_bci, comp_level, THREAD);
1042   if (HAS_PENDING_EXCEPTION) {
1043     Handle throwable(THREAD, PENDING_EXCEPTION);
1044     CLEAR_PENDING_EXCEPTION;


1045     java_lang_Throwable::print_stack_trace(throwable, tty);
1046     tty->cr();
1047     return NULL;
1048   }
1049 
1050   if (rp.had_error()) {
1051     tty->print_cr("ciReplay: Failed on %s", rp.error_message());
1052     return NULL;
1053   }
1054   return data;
1055 }
1056 
1057 int ciReplay::replay_impl(TRAPS) {
1058   HandleMark hm;
1059   ResourceMark rm;
1060   // Make sure we don't run with background compilation
1061   BackgroundCompilation = false;
1062 
1063   if (ReplaySuppressInitializers > 2) {
1064     // ReplaySuppressInitializers > 2 means that we want to allow


1066     // don't allow any intializers to be run.
1067     ReplaySuppressInitializers = 1;
1068   }
1069 
1070   if (FLAG_IS_DEFAULT(ReplayDataFile)) {
1071     tty->print_cr("ERROR: no compiler replay data file specified (use -XX:ReplayDataFile=replay_pid12345.txt).");
1072     return 1;
1073   }
1074 
1075   // Load and parse the replay data
1076   CompileReplay rp(ReplayDataFile, THREAD);
1077   int exit_code = 0;
1078   if (rp.can_replay()) {
1079     rp.process(THREAD);
1080   } else {
1081     exit_code = 1;
1082     return exit_code;
1083   }
1084 
1085   if (HAS_PENDING_EXCEPTION) {
1086     Handle throwable(THREAD, PENDING_EXCEPTION);
1087     CLEAR_PENDING_EXCEPTION;


1088     java_lang_Throwable::print_stack_trace(throwable, tty);
1089     tty->cr();
1090     exit_code = 2;
1091   }
1092 
1093   if (rp.had_error()) {
1094     tty->print_cr("Failed on %s", rp.error_message());
1095     exit_code = 1;
1096   }
1097   return exit_code;
1098 }
1099 
1100 void ciReplay::initialize(ciMethodData* m) {
1101   if (replay_state == NULL) {
1102     return;
1103   }
1104 
1105   ASSERT_IN_VM;
1106   ResourceMark rm;
1107 


< prev index next >