19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 #include "precompiled.hpp" 25 26 #include "aot/aotCodeHeap.hpp" 27 #include "aot/aotLoader.hpp" 28 #include "aot/compiledIC_aot.hpp" 29 #include "code/codeCache.hpp" 30 #include "code/compiledIC.hpp" 31 #include "code/nativeInst.hpp" 32 #include "compiler/compilerOracle.hpp" 33 #include "gc/shared/cardTableBarrierSet.hpp" 34 #include "gc/shared/collectedHeap.hpp" 35 #include "gc/shared/gcLocker.hpp" 36 #include "jvmci/compilerRuntime.hpp" 37 #include "jvmci/jvmciRuntime.hpp" 38 #include "oops/method.inline.hpp" 39 #include "runtime/handles.inline.hpp" 40 #include "runtime/java.hpp" 41 #include "runtime/os.hpp" 42 #include "runtime/sharedRuntime.hpp" 43 #include "utilities/xmlstream.hpp" 44 45 #include <stdio.h> 46 47 #if 0 48 static void metadata_oops_do(Metadata** metadata_begin, Metadata **metadata_end, OopClosure* f) { 49 // Visit the metadata/oops section 50 for (Metadata** p = metadata_begin; p < metadata_end; p++) { 51 Metadata* m = *p; 52 53 intptr_t meta = (intptr_t)m; 54 if ((meta & 1) == 1) { 55 // already resolved 56 m = (Metadata*)(meta & ~1); 57 } else { 58 continue; 59 } 60 assert(Metaspace::contains(m), ""); 61 if (m->is_method()) { 62 m = ((Method*)m)->method_holder(); 63 } 64 assert(m->is_klass(), "must be"); 65 oop o = ((Klass*)m)->klass_holder(); 66 if (o != NULL) { 67 f->do_oop(&o); 68 } 69 } 70 } 71 #endif 72 73 bool AOTCompiledMethod::do_unloading_oops(address low_boundary, BoolObjectClosure* is_alive, bool unloading_occurred) { 74 return false; 75 } 76 77 oop AOTCompiledMethod::oop_at(int index) const { 78 if (index == 0) { // 0 is reserved 79 return NULL; 80 } 81 Metadata** entry = _metadata_got + (index - 1); 82 intptr_t meta = (intptr_t)*entry; 83 if ((meta & 1) == 1) { 84 // already resolved 85 Klass* k = (Klass*)(meta & ~1); 86 return k->java_mirror(); 87 } 88 // The entry is string which we need to resolve. 89 const char* meta_name = _heap->get_name_at((int)meta); 90 int klass_len = build_u2_from((address)meta_name); 91 const char* klass_name = meta_name + 2; | 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 #include "precompiled.hpp" 25 26 #include "aot/aotCodeHeap.hpp" 27 #include "aot/aotLoader.hpp" 28 #include "aot/compiledIC_aot.hpp" 29 #include "code/codeCache.hpp" 30 #include "code/compiledIC.hpp" 31 #include "code/nativeInst.hpp" 32 #include "compiler/compilerOracle.hpp" 33 #include "gc/shared/cardTableBarrierSet.hpp" 34 #include "gc/shared/collectedHeap.hpp" 35 #include "gc/shared/gcLocker.hpp" 36 #include "jvmci/compilerRuntime.hpp" 37 #include "jvmci/jvmciRuntime.hpp" 38 #include "oops/method.inline.hpp" 39 #include "runtime/frame.inline.hpp" 40 #include "runtime/handles.inline.hpp" 41 #include "runtime/java.hpp" 42 #include "runtime/os.hpp" 43 #include "runtime/sharedRuntime.hpp" 44 #include "utilities/xmlstream.hpp" 45 46 #include <stdio.h> 47 48 #if 0 49 static void metadata_oops_do(Metadata** metadata_begin, Metadata **metadata_end, OopClosure* f) { 50 // Visit the metadata/oops section 51 for (Metadata** p = metadata_begin; p < metadata_end; p++) { 52 Metadata* m = *p; 53 54 intptr_t meta = (intptr_t)m; 55 if ((meta & 1) == 1) { 56 // already resolved 57 m = (Metadata*)(meta & ~1); 58 } else { 59 continue; 60 } 61 assert(Metaspace::contains(m), ""); 62 if (m->is_method()) { 63 m = ((Method*)m)->method_holder(); 64 } 65 assert(m->is_klass(), "must be"); 66 oop o = ((Klass*)m)->klass_holder(); 67 if (o != NULL) { 68 f->do_oop(&o); 69 } 70 } 71 } 72 #endif 73 74 address* AOTCompiledMethod::orig_pc_addr(const frame* fr) { 75 return (address*) ((address)fr->unextended_sp() + _meta->orig_pc_offset()); 76 } 77 78 bool AOTCompiledMethod::do_unloading_oops(address low_boundary, BoolObjectClosure* is_alive, bool unloading_occurred) { 79 return false; 80 } 81 82 oop AOTCompiledMethod::oop_at(int index) const { 83 if (index == 0) { // 0 is reserved 84 return NULL; 85 } 86 Metadata** entry = _metadata_got + (index - 1); 87 intptr_t meta = (intptr_t)*entry; 88 if ((meta & 1) == 1) { 89 // already resolved 90 Klass* k = (Klass*)(meta & ~1); 91 return k->java_mirror(); 92 } 93 // The entry is string which we need to resolve. 94 const char* meta_name = _heap->get_name_at((int)meta); 95 int klass_len = build_u2_from((address)meta_name); 96 const char* klass_name = meta_name + 2; |