comparison src/share/vm/ci/ciEnv.cpp @ 10408:836a62f43af9

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author Doug Simon <doug.simon@oracle.com>
date Wed, 19 Jun 2013 10:45:56 +0200
parents b9a918201d47 9ce110b1d14a
children cefad50507d8
comparison
equal deleted inserted replaced
10086:e0fb8a213650 10408:836a62f43af9
481 // The klass has not been inserted into the constant pool. 481 // The klass has not been inserted into the constant pool.
482 // Try to look it up by name. 482 // Try to look it up by name.
483 { 483 {
484 // We have to lock the cpool to keep the oop from being resolved 484 // We have to lock the cpool to keep the oop from being resolved
485 // while we are accessing it. 485 // while we are accessing it.
486 MonitorLockerEx ml(cpool->lock()); 486 oop cplock = cpool->lock();
487 ObjectLocker ol(cplock, THREAD, cplock != NULL);
487 constantTag tag = cpool->tag_at(index); 488 constantTag tag = cpool->tag_at(index);
488 if (tag.is_klass()) { 489 if (tag.is_klass()) {
489 // The klass has been inserted into the constant pool 490 // The klass has been inserted into the constant pool
490 // very recently. 491 // very recently.
491 klass = KlassHandle(THREAD, cpool->resolved_klass_at(index)); 492 klass = KlassHandle(THREAD, cpool->resolved_klass_at(index));
1147 void ciEnv::record_out_of_memory_failure() { 1148 void ciEnv::record_out_of_memory_failure() {
1148 // If memory is low, we stop compiling methods. 1149 // If memory is low, we stop compiling methods.
1149 record_method_not_compilable("out of memory"); 1150 record_method_not_compilable("out of memory");
1150 } 1151 }
1151 1152
1152 fileStream* ciEnv::_replay_data_stream = NULL; 1153 void ciEnv::dump_replay_data(outputStream* out) {
1153
1154 void ciEnv::dump_replay_data() {
1155 VM_ENTRY_MARK; 1154 VM_ENTRY_MARK;
1156 MutexLocker ml(Compile_lock); 1155 MutexLocker ml(Compile_lock);
1157 if (_replay_data_stream == NULL) {
1158 _replay_data_stream = new (ResourceObj::C_HEAP, mtCompiler) fileStream(ReplayDataFile);
1159 if (_replay_data_stream == NULL) {
1160 fatal(err_msg("Can't open %s for replay data", ReplayDataFile));
1161 }
1162 }
1163 dump_replay_data(_replay_data_stream);
1164 }
1165
1166
1167 void ciEnv::dump_replay_data(outputStream* out) {
1168 ASSERT_IN_VM;
1169 ResourceMark rm; 1156 ResourceMark rm;
1170 #if INCLUDE_JVMTI 1157 #if INCLUDE_JVMTI
1171 out->print_cr("JvmtiExport can_access_local_variables %d", _jvmti_can_access_local_variables); 1158 out->print_cr("JvmtiExport can_access_local_variables %d", _jvmti_can_access_local_variables);
1172 out->print_cr("JvmtiExport can_hotswap_or_post_breakpoint %d", _jvmti_can_hotswap_or_post_breakpoint); 1159 out->print_cr("JvmtiExport can_hotswap_or_post_breakpoint %d", _jvmti_can_hotswap_or_post_breakpoint);
1173 out->print_cr("JvmtiExport can_post_on_exceptions %d", _jvmti_can_post_on_exceptions); 1160 out->print_cr("JvmtiExport can_post_on_exceptions %d", _jvmti_can_post_on_exceptions);
1176 GrowableArray<ciMetadata*>* objects = _factory->get_ci_metadata(); 1163 GrowableArray<ciMetadata*>* objects = _factory->get_ci_metadata();
1177 out->print_cr("# %d ciObject found", objects->length()); 1164 out->print_cr("# %d ciObject found", objects->length());
1178 for (int i = 0; i < objects->length(); i++) { 1165 for (int i = 0; i < objects->length(); i++) {
1179 objects->at(i)->dump_replay_data(out); 1166 objects->at(i)->dump_replay_data(out);
1180 } 1167 }
1181 Method* method = task()->method(); 1168 CompileTask* task = this->task();
1182 int entry_bci = task()->osr_bci(); 1169 Method* method = task->method();
1170 int entry_bci = task->osr_bci();
1171 int comp_level = task->comp_level();
1183 // Klass holder = method->method_holder(); 1172 // Klass holder = method->method_holder();
1184 out->print_cr("compile %s %s %s %d", 1173 out->print_cr("compile %s %s %s %d %d",
1185 method->klass_name()->as_quoted_ascii(), 1174 method->klass_name()->as_quoted_ascii(),
1186 method->name()->as_quoted_ascii(), 1175 method->name()->as_quoted_ascii(),
1187 method->signature()->as_quoted_ascii(), 1176 method->signature()->as_quoted_ascii(),
1188 entry_bci); 1177 entry_bci, comp_level);
1189 out->flush(); 1178 out->flush();
1190 } 1179 }