< prev index next >

src/hotspot/share/aot/aotCompiledMethod.cpp

Print this page




  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 address* AOTCompiledMethod::orig_pc_addr(const frame* fr) {
  74   return (address*) ((address)fr->unextended_sp() + _meta->orig_pc_offset());
  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 = Bytes::get_Java_u2((address)meta_name);
  91   const char* klass_name = meta_name + 2;
  92   // Quick check the current method's holder.
  93   Klass* k = _method->method_holder();
  94 
  95   ResourceMark rm; // for signature_name()
  96   if (strncmp(k->signature_name(), klass_name, klass_len) != 0) { // Does not match?




  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 oop AOTCompiledMethod::oop_at(int index) const {
  74   if (index == 0) { // 0 is reserved
  75     return NULL;
  76   }
  77   Metadata** entry = _metadata_got + (index - 1);
  78   intptr_t meta = (intptr_t)*entry;
  79   if ((meta & 1) == 1) {
  80     // already resolved
  81     Klass* k = (Klass*)(meta & ~1);
  82     return k->java_mirror();
  83   }
  84   // The entry is string which we need to resolve.
  85   const char* meta_name = _heap->get_name_at((int)meta);
  86   int klass_len = Bytes::get_Java_u2((address)meta_name);
  87   const char* klass_name = meta_name + 2;
  88   // Quick check the current method's holder.
  89   Klass* k = _method->method_holder();
  90 
  91   ResourceMark rm; // for signature_name()
  92   if (strncmp(k->signature_name(), klass_name, klass_len) != 0) { // Does not match?


< prev index next >