557 if (cache_index >= 0) { |
557 if (cache_index >= 0) { |
558 assert(index < 0, "only one kind of index at a time"); |
558 assert(index < 0, "only one kind of index at a time"); |
559 oop obj = cpool->resolved_references()->obj_at(cache_index); |
559 oop obj = cpool->resolved_references()->obj_at(cache_index); |
560 if (obj != NULL) { |
560 if (obj != NULL) { |
561 ciObject* ciobj = get_object(obj); |
561 ciObject* ciobj = get_object(obj); |
562 return ciConstant(T_OBJECT, ciobj); |
562 if (ciobj->is_array()) { |
|
563 return ciConstant(T_ARRAY, ciobj); |
|
564 } else { |
|
565 assert(ciobj->is_instance(), "should be an instance"); |
|
566 return ciConstant(T_OBJECT, ciobj); |
|
567 } |
563 } |
568 } |
564 index = cpool->object_to_cp_index(cache_index); |
569 index = cpool->object_to_cp_index(cache_index); |
565 } |
570 } |
566 constantTag tag = cpool->tag_at(index); |
571 constantTag tag = cpool->tag_at(index); |
567 if (tag.is_int()) { |
572 if (tag.is_int()) { |
584 record_out_of_memory_failure(); |
589 record_out_of_memory_failure(); |
585 return ciConstant(); |
590 return ciConstant(); |
586 } |
591 } |
587 } |
592 } |
588 ciObject* constant = get_object(string); |
593 ciObject* constant = get_object(string); |
589 assert (constant->is_instance(), "must be an instance, or not? "); |
594 if (constant->is_array()) { |
590 return ciConstant(T_OBJECT, constant); |
595 return ciConstant(T_ARRAY, constant); |
|
596 } else { |
|
597 assert (constant->is_instance(), "must be an instance, or not? "); |
|
598 return ciConstant(T_OBJECT, constant); |
|
599 } |
591 } else if (tag.is_klass() || tag.is_unresolved_klass()) { |
600 } else if (tag.is_klass() || tag.is_unresolved_klass()) { |
592 // 4881222: allow ldc to take a class type |
601 // 4881222: allow ldc to take a class type |
593 ciKlass* klass = get_klass_by_index_impl(cpool, index, ignore_will_link, accessor); |
602 ciKlass* klass = get_klass_by_index_impl(cpool, index, ignore_will_link, accessor); |
594 if (HAS_PENDING_EXCEPTION) { |
603 if (HAS_PENDING_EXCEPTION) { |
595 CLEAR_PENDING_EXCEPTION; |
604 CLEAR_PENDING_EXCEPTION; |