1147
1148 // ------------------------------------------------------------------
1149 // ciEnv::record_out_of_memory_failure()
1150 void ciEnv::record_out_of_memory_failure() {
1151 // If memory is low, we stop compiling methods.
1152 record_method_not_compilable("out of memory");
1153 }
1154
1155 ciInstance* ciEnv::unloaded_ciinstance() {
1156 GUARDED_VM_ENTRY(return _factory->get_unloaded_object_constant();)
1157 }
1158
1159 // ------------------------------------------------------------------
1160 // ciEnv::dump_replay_data*
1161
1162 // Don't change thread state and acquire any locks.
1163 // Safe to call from VM error reporter.
1164
1165 void ciEnv::dump_compile_data(outputStream* out) {
1166 CompileTask* task = this->task();
1167 Method* method = task->method();
1168 int entry_bci = task->osr_bci();
1169 int comp_level = task->comp_level();
1170 out->print("compile %s %s %s %d %d",
1171 method->klass_name()->as_quoted_ascii(),
1172 method->name()->as_quoted_ascii(),
1173 method->signature()->as_quoted_ascii(),
1174 entry_bci, comp_level);
1175 if (compiler_data() != NULL) {
1176 if (is_c2_compile(comp_level)) {
1177 #ifdef COMPILER2
1178 // Dump C2 inlining data.
1179 ((Compile*)compiler_data())->dump_inline_data(out);
1180 #endif
1181 } else if (is_c1_compile(comp_level)) {
1182 #ifdef COMPILER1
1183 // Dump C1 inlining data.
1184 ((Compilation*)compiler_data())->dump_inline_data(out);
1185 #endif
1186 }
1187 }
1188 out->cr();
1189 }
1190
1191 void ciEnv::dump_replay_data_unsafe(outputStream* out) {
1192 ResourceMark rm;
1193 #if INCLUDE_JVMTI
1194 out->print_cr("JvmtiExport can_access_local_variables %d", _jvmti_can_access_local_variables);
1195 out->print_cr("JvmtiExport can_hotswap_or_post_breakpoint %d", _jvmti_can_hotswap_or_post_breakpoint);
1196 out->print_cr("JvmtiExport can_post_on_exceptions %d", _jvmti_can_post_on_exceptions);
1197 #endif // INCLUDE_JVMTI
1198
1199 GrowableArray<ciMetadata*>* objects = _factory->get_ci_metadata();
1200 out->print_cr("# %d ciObject found", objects->length());
1201 for (int i = 0; i < objects->length(); i++) {
1202 objects->at(i)->dump_replay_data(out);
1203 }
1204 dump_compile_data(out);
1205 out->flush();
1206 }
1207
1208 void ciEnv::dump_replay_data(outputStream* out) {
|
1147
1148 // ------------------------------------------------------------------
1149 // ciEnv::record_out_of_memory_failure()
1150 void ciEnv::record_out_of_memory_failure() {
1151 // If memory is low, we stop compiling methods.
1152 record_method_not_compilable("out of memory");
1153 }
1154
1155 ciInstance* ciEnv::unloaded_ciinstance() {
1156 GUARDED_VM_ENTRY(return _factory->get_unloaded_object_constant();)
1157 }
1158
1159 // ------------------------------------------------------------------
1160 // ciEnv::dump_replay_data*
1161
1162 // Don't change thread state and acquire any locks.
1163 // Safe to call from VM error reporter.
1164
1165 void ciEnv::dump_compile_data(outputStream* out) {
1166 CompileTask* task = this->task();
1167 if (task) {
1168 Method* method = task->method();
1169 int entry_bci = task->osr_bci();
1170 int comp_level = task->comp_level();
1171 out->print("compile %s %s %s %d %d",
1172 method->klass_name()->as_quoted_ascii(),
1173 method->name()->as_quoted_ascii(),
1174 method->signature()->as_quoted_ascii(),
1175 entry_bci, comp_level);
1176 if (compiler_data() != NULL) {
1177 if (is_c2_compile(comp_level)) {
1178 #ifdef COMPILER2
1179 // Dump C2 inlining data.
1180 ((Compile*)compiler_data())->dump_inline_data(out);
1181 #endif
1182 } else if (is_c1_compile(comp_level)) {
1183 #ifdef COMPILER1
1184 // Dump C1 inlining data.
1185 ((Compilation*)compiler_data())->dump_inline_data(out);
1186 #endif
1187 }
1188 }
1189 out->cr();
1190 }
1191 }
1192
1193 void ciEnv::dump_replay_data_unsafe(outputStream* out) {
1194 ResourceMark rm;
1195 #if INCLUDE_JVMTI
1196 out->print_cr("JvmtiExport can_access_local_variables %d", _jvmti_can_access_local_variables);
1197 out->print_cr("JvmtiExport can_hotswap_or_post_breakpoint %d", _jvmti_can_hotswap_or_post_breakpoint);
1198 out->print_cr("JvmtiExport can_post_on_exceptions %d", _jvmti_can_post_on_exceptions);
1199 #endif // INCLUDE_JVMTI
1200
1201 GrowableArray<ciMetadata*>* objects = _factory->get_ci_metadata();
1202 out->print_cr("# %d ciObject found", objects->length());
1203 for (int i = 0; i < objects->length(); i++) {
1204 objects->at(i)->dump_replay_data(out);
1205 }
1206 dump_compile_data(out);
1207 out->flush();
1208 }
1209
1210 void ciEnv::dump_replay_data(outputStream* out) {
|