< prev index next >

src/hotspot/share/jvmci/jvmciEnv.cpp

Print this page




 131   // In either case, if we can find the element type in the system dictionary,
 132   // we must build an array type around it.  The CI requires array klasses
 133   // to be loaded if their element klasses are loaded, except when memory
 134   // is exhausted.
 135   if (sym->char_at(0) == '[' &&
 136       (sym->char_at(1) == '[' || sym->char_at(1) == 'L')) {
 137     // We have an unloaded array.
 138     // Build it on the fly if the element class exists.
 139     TempNewSymbol elem_sym = SymbolTable::new_symbol(sym->as_utf8()+1,
 140                                                  sym->utf8_length()-1,
 141                                                  CHECK_NULL);
 142 
 143     // Get element Klass recursively.
 144     Klass* elem_klass =
 145       get_klass_by_name_impl(accessing_klass,
 146                              cpool,
 147                              elem_sym,
 148                              require_local);
 149     if (elem_klass != NULL) {
 150       // Now make an array for it
 151       return elem_klass->array_klass(CHECK_NULL);

 152     }
 153   }
 154 
 155   if (found_klass == NULL && !cpool.is_null() && cpool->has_preresolution()) {
 156     // Look inside the constant pool for pre-resolved class entries.
 157     for (int i = cpool->length() - 1; i >= 1; i--) {
 158       if (cpool->tag_at(i).is_klass()) {
 159         Klass*  kls = cpool->resolved_klass_at(i);
 160         if (kls->name() == sym) {
 161           return kls;
 162         }
 163       }
 164     }
 165   }
 166 
 167   return found_klass;
 168 }
 169 
 170 // ------------------------------------------------------------------
 171 Klass* JVMCIEnv::get_klass_by_name(Klass* accessing_klass,




 131   // In either case, if we can find the element type in the system dictionary,
 132   // we must build an array type around it.  The CI requires array klasses
 133   // to be loaded if their element klasses are loaded, except when memory
 134   // is exhausted.
 135   if (sym->char_at(0) == '[' &&
 136       (sym->char_at(1) == '[' || sym->char_at(1) == 'L')) {
 137     // We have an unloaded array.
 138     // Build it on the fly if the element class exists.
 139     TempNewSymbol elem_sym = SymbolTable::new_symbol(sym->as_utf8()+1,
 140                                                  sym->utf8_length()-1,
 141                                                  CHECK_NULL);
 142 
 143     // Get element Klass recursively.
 144     Klass* elem_klass =
 145       get_klass_by_name_impl(accessing_klass,
 146                              cpool,
 147                              elem_sym,
 148                              require_local);
 149     if (elem_klass != NULL) {
 150       // Now make an array for it
 151       Klass* arr = elem_klass->array_klass(CHECK_NULL);
 152       return arr;
 153     }
 154   }
 155 
 156   if (found_klass == NULL && !cpool.is_null() && cpool->has_preresolution()) {
 157     // Look inside the constant pool for pre-resolved class entries.
 158     for (int i = cpool->length() - 1; i >= 1; i--) {
 159       if (cpool->tag_at(i).is_klass()) {
 160         Klass*  kls = cpool->resolved_klass_at(i);
 161         if (kls->name() == sym) {
 162           return kls;
 163         }
 164       }
 165     }
 166   }
 167 
 168   return found_klass;
 169 }
 170 
 171 // ------------------------------------------------------------------
 172 Klass* JVMCIEnv::get_klass_by_name(Klass* accessing_klass,


< prev index next >