hotspot/src/share/vm/opto/parse2.cpp
changeset 5882 6b2aecc4f7d8
parent 5702 201c5cde25bb
child 6416 d49b65c9425a
equal deleted inserted replaced
5708:e92b3d8118f1 5882:6b2aecc4f7d8
  1322   case Bytecodes::_aconst_null: push(null());  break;
  1322   case Bytecodes::_aconst_null: push(null());  break;
  1323   case Bytecodes::_ldc:
  1323   case Bytecodes::_ldc:
  1324   case Bytecodes::_ldc_w:
  1324   case Bytecodes::_ldc_w:
  1325   case Bytecodes::_ldc2_w:
  1325   case Bytecodes::_ldc2_w:
  1326     // If the constant is unresolved, run this BC once in the interpreter.
  1326     // If the constant is unresolved, run this BC once in the interpreter.
  1327     if (iter().is_unresolved_string()) {
  1327     {
  1328       uncommon_trap(Deoptimization::make_trap_request
       
  1329                     (Deoptimization::Reason_unloaded,
       
  1330                      Deoptimization::Action_reinterpret,
       
  1331                      iter().get_constant_index()),
       
  1332                     NULL, "unresolved_string");
       
  1333       break;
       
  1334     } else {
       
  1335       ciConstant constant = iter().get_constant();
  1328       ciConstant constant = iter().get_constant();
  1336       if (constant.basic_type() == T_OBJECT) {
  1329       if (constant.basic_type() == T_OBJECT &&
  1337         ciObject* c = constant.as_object();
  1330           !constant.as_object()->is_loaded()) {
  1338         if (c->is_klass()) {
  1331         int index = iter().get_constant_pool_index();
  1339           // The constant returned for a klass is the ciKlass for the
  1332         constantTag tag = iter().get_constant_pool_tag(index);
  1340           // entry.  We want the java_mirror so get it.
  1333         uncommon_trap(Deoptimization::make_trap_request
  1341           ciKlass* klass = c->as_klass();
  1334                       (Deoptimization::Reason_unloaded,
  1342           if (klass->is_loaded()) {
  1335                        Deoptimization::Action_reinterpret,
  1343             constant = ciConstant(T_OBJECT, klass->java_mirror());
  1336                        index),
  1344           } else {
  1337                       NULL, tag.internal_name());
  1345             uncommon_trap(Deoptimization::make_trap_request
  1338         break;
  1346                           (Deoptimization::Reason_unloaded,
       
  1347                            Deoptimization::Action_reinterpret,
       
  1348                            iter().get_constant_index()),
       
  1349                           NULL, "unresolved_klass");
       
  1350             break;
       
  1351           }
       
  1352         }
       
  1353       }
  1339       }
       
  1340       assert(constant.basic_type() != T_OBJECT || !constant.as_object()->is_klass(),
       
  1341              "must be java_mirror of klass");
  1354       bool pushed = push_constant(constant, true);
  1342       bool pushed = push_constant(constant, true);
  1355       guarantee(pushed, "must be possible to push this constant");
  1343       guarantee(pushed, "must be possible to push this constant");
  1356     }
  1344     }
  1357 
  1345 
  1358     break;
  1346     break;