comparison src/share/vm/ci/ciEnv.cpp @ 6988:2cb439954abf

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author Gilles Duboscq <duboscq@ssw.jku.at>
date Mon, 19 Nov 2012 15:36:13 +0100
parents e522a00b91aa 80e866b1d053
children ce248dc0a656
comparison
equal deleted inserted replaced
6963:dd0dd0321e2a 6988:2cb439954abf
28 #include "ci/ciField.hpp" 28 #include "ci/ciField.hpp"
29 #include "ci/ciInstance.hpp" 29 #include "ci/ciInstance.hpp"
30 #include "ci/ciInstanceKlass.hpp" 30 #include "ci/ciInstanceKlass.hpp"
31 #include "ci/ciMethod.hpp" 31 #include "ci/ciMethod.hpp"
32 #include "ci/ciNullObject.hpp" 32 #include "ci/ciNullObject.hpp"
33 #include "ci/ciReplay.hpp"
33 #include "ci/ciUtilities.hpp" 34 #include "ci/ciUtilities.hpp"
34 #include "classfile/systemDictionary.hpp" 35 #include "classfile/systemDictionary.hpp"
35 #include "classfile/vmSymbols.hpp" 36 #include "classfile/vmSymbols.hpp"
36 #include "code/scopeDesc.hpp" 37 #include "code/scopeDesc.hpp"
37 #include "compiler/compileBroker.hpp" 38 #include "compiler/compileBroker.hpp"
435 if (found_klass() == NULL && !cpool.is_null() && cpool->has_preresolution()) { 436 if (found_klass() == NULL && !cpool.is_null() && cpool->has_preresolution()) {
436 // Look inside the constant pool for pre-resolved class entries. 437 // Look inside the constant pool for pre-resolved class entries.
437 for (int i = cpool->length() - 1; i >= 1; i--) { 438 for (int i = cpool->length() - 1; i >= 1; i--) {
438 if (cpool->tag_at(i).is_klass()) { 439 if (cpool->tag_at(i).is_klass()) {
439 Klass* kls = cpool->resolved_klass_at(i); 440 Klass* kls = cpool->resolved_klass_at(i);
440 if (Klass::cast(kls)->name() == sym) { 441 if (kls->name() == sym) {
441 found_klass = KlassHandle(THREAD, kls); 442 found_klass = KlassHandle(THREAD, kls);
442 break; 443 break;
443 } 444 }
444 } 445 }
445 } 446 }
781 (bc == Bytecodes::_invokestatic 782 (bc == Bytecodes::_invokestatic
782 ? InstanceKlass::cast(m->method_holder())->is_not_initialized() 783 ? InstanceKlass::cast(m->method_holder())->is_not_initialized()
783 : !InstanceKlass::cast(m->method_holder())->is_loaded())) { 784 : !InstanceKlass::cast(m->method_holder())->is_loaded())) {
784 m = NULL; 785 m = NULL;
785 } 786 }
787 #ifdef ASSERT
788 if (m != NULL && ReplayCompiles && !ciReplay::is_loaded(m)) {
789 m = NULL;
790 }
791 #endif
786 if (m != NULL) { 792 if (m != NULL) {
787 // We found the method. 793 // We found the method.
788 return get_method(m); 794 return get_method(m);
789 } 795 }
790 } 796 }
1154 // ciEnv::record_out_of_memory_failure() 1160 // ciEnv::record_out_of_memory_failure()
1155 void ciEnv::record_out_of_memory_failure() { 1161 void ciEnv::record_out_of_memory_failure() {
1156 // If memory is low, we stop compiling methods. 1162 // If memory is low, we stop compiling methods.
1157 record_method_not_compilable("out of memory"); 1163 record_method_not_compilable("out of memory");
1158 } 1164 }
1165
1166 fileStream* ciEnv::_replay_data_stream = NULL;
1167
1168 void ciEnv::dump_replay_data() {
1169 VM_ENTRY_MARK;
1170 MutexLocker ml(Compile_lock);
1171 if (_replay_data_stream == NULL) {
1172 _replay_data_stream = new (ResourceObj::C_HEAP, mtCompiler) fileStream(ReplayDataFile);
1173 if (_replay_data_stream == NULL) {
1174 fatal(err_msg("Can't open %s for replay data", ReplayDataFile));
1175 }
1176 }
1177 dump_replay_data(_replay_data_stream);
1178 }
1179
1180
1181 void ciEnv::dump_replay_data(outputStream* out) {
1182 ASSERT_IN_VM;
1183
1184 #if INCLUDE_JVMTI
1185 out->print_cr("JvmtiExport can_access_local_variables %d", _jvmti_can_access_local_variables);
1186 out->print_cr("JvmtiExport can_hotswap_or_post_breakpoint %d", _jvmti_can_hotswap_or_post_breakpoint);
1187 out->print_cr("JvmtiExport can_post_on_exceptions %d", _jvmti_can_post_on_exceptions);
1188 #endif // INCLUDE_JVMTI
1189
1190 GrowableArray<ciMetadata*>* objects = _factory->get_ci_metadata();
1191 out->print_cr("# %d ciObject found", objects->length());
1192 for (int i = 0; i < objects->length(); i++) {
1193 objects->at(i)->dump_replay_data(out);
1194 }
1195 Method* method = task()->method();
1196 int entry_bci = task()->osr_bci();
1197 // Klass holder = method->method_holder();
1198 out->print_cr("compile %s %s %s %d",
1199 method->klass_name()->as_quoted_ascii(),
1200 method->name()->as_quoted_ascii(),
1201 method->signature()->as_quoted_ascii(),
1202 entry_bci);
1203 out->flush();
1204 }