comparison src/share/vm/jvmci/jvmciEnv.cpp @ 22517:0915f5bfdfaa

Adopt some jvmci-9 source changes
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Fri, 04 Sep 2015 00:06:28 -0700
parents 7b4a47fcc4c0
children 02fc27dc1da7
comparison
equal deleted inserted replaced
22516:de39d9372765 22517:0915f5bfdfaa
25 #include "precompiled.hpp" 25 #include "precompiled.hpp"
26 #include "jvmci/jvmciEnv.hpp" 26 #include "jvmci/jvmciEnv.hpp"
27 #include "classfile/javaAssertions.hpp" 27 #include "classfile/javaAssertions.hpp"
28 #include "classfile/systemDictionary.hpp" 28 #include "classfile/systemDictionary.hpp"
29 #include "classfile/vmSymbols.hpp" 29 #include "classfile/vmSymbols.hpp"
30 #include "code/codeCache.hpp"
30 #include "code/scopeDesc.hpp" 31 #include "code/scopeDesc.hpp"
31 #include "runtime/sweeper.hpp" 32 #include "runtime/sweeper.hpp"
32 #include "compiler/compileBroker.hpp" 33 #include "compiler/compileBroker.hpp"
33 #include "compiler/compileLog.hpp" 34 #include "compiler/compileLog.hpp"
34 #include "compiler/compilerOracle.hpp" 35 #include "compiler/compilerOracle.hpp"
36 #include "memory/allocation.inline.hpp" 37 #include "memory/allocation.inline.hpp"
37 #include "memory/oopFactory.hpp" 38 #include "memory/oopFactory.hpp"
38 #include "memory/universe.inline.hpp" 39 #include "memory/universe.inline.hpp"
39 #include "oops/methodData.hpp" 40 #include "oops/methodData.hpp"
40 #include "oops/objArrayKlass.hpp" 41 #include "oops/objArrayKlass.hpp"
42 #include "oops/oop.inline.hpp"
41 #include "prims/jvmtiExport.hpp" 43 #include "prims/jvmtiExport.hpp"
42 #include "runtime/init.hpp" 44 #include "runtime/init.hpp"
43 #include "runtime/reflection.hpp" 45 #include "runtime/reflection.hpp"
44 #include "runtime/sharedRuntime.hpp" 46 #include "runtime/sharedRuntime.hpp"
45 #include "utilities/dtrace.hpp" 47 #include "utilities/dtrace.hpp"
178 KlassHandle& accessor) { 180 KlassHandle& accessor) {
179 JVMCI_EXCEPTION_CONTEXT; 181 JVMCI_EXCEPTION_CONTEXT;
180 KlassHandle klass (THREAD, ConstantPool::klass_at_if_loaded(cpool, index)); 182 KlassHandle klass (THREAD, ConstantPool::klass_at_if_loaded(cpool, index));
181 Symbol* klass_name = NULL; 183 Symbol* klass_name = NULL;
182 if (klass.is_null()) { 184 if (klass.is_null()) {
183 // The klass has not been inserted into the constant pool. 185 klass_name = cpool->klass_name_at(index);
184 // Try to look it up by name.
185 {
186 // We have to lock the cpool to keep the oop from being resolved
187 // while we are accessing it.
188 MonitorLockerEx ml(cpool->lock());
189
190 constantTag tag = cpool->tag_at(index);
191 if (tag.is_klass()) {
192 // The klass has been inserted into the constant pool
193 // very recently.
194 klass = KlassHandle(THREAD, cpool->resolved_klass_at(index));
195 } else if (tag.is_symbol()) {
196 klass_name = cpool->symbol_at(index);
197 } else {
198 assert(cpool->tag_at(index).is_unresolved_klass(), "wrong tag");
199 klass_name = cpool->unresolved_klass_at(index);
200 }
201 }
202 } 186 }
203 187
204 if (klass.is_null()) { 188 if (klass.is_null()) {
205 // Not found in constant pool. Use the name to do the lookup. 189 // Not found in constant pool. Use the name to do the lookup.
206 KlassHandle k = get_klass_by_name_impl(accessor, 190 KlassHandle k = get_klass_by_name_impl(accessor,
536 handler_table, &implicit_tbl, 520 handler_table, &implicit_tbl,
537 compiler, comp_level, installed_code, speculation_log); 521 compiler, comp_level, installed_code, speculation_log);
538 522
539 // Free codeBlobs 523 // Free codeBlobs
540 //code_buffer->free_blob(); 524 //code_buffer->free_blob();
541
542 if (nm == NULL) { 525 if (nm == NULL) {
543 // The CodeCache is full. Print out warning and disable compilation. 526 // The CodeCache is full. Print out warning and disable compilation.
544 { 527 {
545 MutexUnlocker ml(Compile_lock); 528 MutexUnlocker ml(Compile_lock);
546 MutexUnlocker locker(MethodCompileQueue_lock); 529 MutexUnlocker locker(MethodCompileQueue_lock);