Mercurial > hg > graal-jvmci-8
comparison src/share/vm/c1/c1_LIR.hpp @ 6739:8a02ca5e5576
7195816: NPG: Crash in c1_ValueType - ShouldNotReachHere
Summary: C1 needs knowledge of T_METADATA at the LIR level.
Reviewed-by: kvn, coleenp
author | roland |
---|---|
date | Tue, 11 Sep 2012 16:20:57 +0200 |
parents | da91efe96a93 |
children | 7eca5de9e0b6 |
comparison
equal
deleted
inserted
replaced
6738:ec98e58952b2 | 6739:8a02ca5e5576 |
---|---|
297 , long_type = 2 << type_shift | 297 , long_type = 2 << type_shift |
298 , object_type = 3 << type_shift | 298 , object_type = 3 << type_shift |
299 , address_type = 4 << type_shift | 299 , address_type = 4 << type_shift |
300 , float_type = 5 << type_shift | 300 , float_type = 5 << type_shift |
301 , double_type = 6 << type_shift | 301 , double_type = 6 << type_shift |
302 , metadata_type = 7 << type_shift | |
302 }; | 303 }; |
303 friend OprType as_OprType(BasicType t); | 304 friend OprType as_OprType(BasicType t); |
304 friend BasicType as_BasicType(OprType t); | 305 friend BasicType as_BasicType(OprType t); |
305 | 306 |
306 OprType type_field_valid() const { assert(is_register() || is_stack(), "should not be called otherwise"); return (OprType)(value() & type_mask); } | 307 OprType type_field_valid() const { assert(is_register() || is_stack(), "should not be called otherwise"); return (OprType)(value() & type_mask); } |
320 case T_SHORT: | 321 case T_SHORT: |
321 case T_INT: | 322 case T_INT: |
322 case T_ADDRESS: | 323 case T_ADDRESS: |
323 case T_OBJECT: | 324 case T_OBJECT: |
324 case T_ARRAY: | 325 case T_ARRAY: |
326 case T_METADATA: | |
325 return single_size; | 327 return single_size; |
326 break; | 328 break; |
327 | 329 |
328 default: | 330 default: |
329 ShouldNotReachHere(); | 331 ShouldNotReachHere(); |
472 case T_FLOAT: return LIR_OprDesc::float_type; | 474 case T_FLOAT: return LIR_OprDesc::float_type; |
473 case T_DOUBLE: return LIR_OprDesc::double_type; | 475 case T_DOUBLE: return LIR_OprDesc::double_type; |
474 case T_OBJECT: | 476 case T_OBJECT: |
475 case T_ARRAY: return LIR_OprDesc::object_type; | 477 case T_ARRAY: return LIR_OprDesc::object_type; |
476 case T_ADDRESS: return LIR_OprDesc::address_type; | 478 case T_ADDRESS: return LIR_OprDesc::address_type; |
479 case T_METADATA: return LIR_OprDesc::metadata_type; | |
477 case T_ILLEGAL: // fall through | 480 case T_ILLEGAL: // fall through |
478 default: ShouldNotReachHere(); return LIR_OprDesc::unknown_type; | 481 default: ShouldNotReachHere(); return LIR_OprDesc::unknown_type; |
479 } | 482 } |
480 } | 483 } |
481 | 484 |
485 case LIR_OprDesc::long_type: return T_LONG; | 488 case LIR_OprDesc::long_type: return T_LONG; |
486 case LIR_OprDesc::float_type: return T_FLOAT; | 489 case LIR_OprDesc::float_type: return T_FLOAT; |
487 case LIR_OprDesc::double_type: return T_DOUBLE; | 490 case LIR_OprDesc::double_type: return T_DOUBLE; |
488 case LIR_OprDesc::object_type: return T_OBJECT; | 491 case LIR_OprDesc::object_type: return T_OBJECT; |
489 case LIR_OprDesc::address_type: return T_ADDRESS; | 492 case LIR_OprDesc::address_type: return T_ADDRESS; |
493 case LIR_OprDesc::metadata_type:return T_METADATA; | |
490 case LIR_OprDesc::unknown_type: // fall through | 494 case LIR_OprDesc::unknown_type: // fall through |
491 default: ShouldNotReachHere(); return T_ILLEGAL; | 495 default: ShouldNotReachHere(); return T_ILLEGAL; |
492 } | 496 } |
493 } | 497 } |
494 | 498 |
582 LIR_OprDesc::single_size); | 586 LIR_OprDesc::single_size); |
583 } | 587 } |
584 static LIR_Opr single_cpu_address(int reg) { | 588 static LIR_Opr single_cpu_address(int reg) { |
585 return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | | 589 return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | |
586 LIR_OprDesc::address_type | | 590 LIR_OprDesc::address_type | |
591 LIR_OprDesc::cpu_register | | |
592 LIR_OprDesc::single_size); | |
593 } | |
594 static LIR_Opr single_cpu_metadata(int reg) { | |
595 return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | | |
596 LIR_OprDesc::metadata_type | | |
587 LIR_OprDesc::cpu_register | | 597 LIR_OprDesc::cpu_register | |
588 LIR_OprDesc::single_size); | 598 LIR_OprDesc::single_size); |
589 } | 599 } |
590 static LIR_Opr double_cpu(int reg1, int reg2) { | 600 static LIR_Opr double_cpu(int reg1, int reg2) { |
591 LP64_ONLY(assert(reg1 == reg2, "must be identical")); | 601 LP64_ONLY(assert(reg1 == reg2, "must be identical")); |
658 LIR_OprDesc::cpu_register | | 668 LIR_OprDesc::cpu_register | |
659 LIR_OprDesc::single_size | | 669 LIR_OprDesc::single_size | |
660 LIR_OprDesc::virtual_mask); | 670 LIR_OprDesc::virtual_mask); |
661 break; | 671 break; |
662 | 672 |
673 case T_METADATA: | |
674 res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | | |
675 LIR_OprDesc::metadata_type| | |
676 LIR_OprDesc::cpu_register | | |
677 LIR_OprDesc::single_size | | |
678 LIR_OprDesc::virtual_mask); | |
679 break; | |
680 | |
663 case T_INT: | 681 case T_INT: |
664 res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | | 682 res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | |
665 LIR_OprDesc::int_type | | 683 LIR_OprDesc::int_type | |
666 LIR_OprDesc::cpu_register | | 684 LIR_OprDesc::cpu_register | |
667 LIR_OprDesc::single_size | | 685 LIR_OprDesc::single_size | |
755 LIR_OprDesc::object_type | | 773 LIR_OprDesc::object_type | |
756 LIR_OprDesc::stack_value | | 774 LIR_OprDesc::stack_value | |
757 LIR_OprDesc::single_size); | 775 LIR_OprDesc::single_size); |
758 break; | 776 break; |
759 | 777 |
778 case T_METADATA: | |
779 res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | | |
780 LIR_OprDesc::metadata_type | | |
781 LIR_OprDesc::stack_value | | |
782 LIR_OprDesc::single_size); | |
783 break; | |
760 case T_INT: | 784 case T_INT: |
761 res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | | 785 res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | |
762 LIR_OprDesc::int_type | | 786 LIR_OprDesc::int_type | |
763 LIR_OprDesc::stack_value | | 787 LIR_OprDesc::stack_value | |
764 LIR_OprDesc::single_size); | 788 LIR_OprDesc::single_size); |
2004 move(src, dst, info); | 2028 move(src, dst, info); |
2005 } | 2029 } |
2006 } | 2030 } |
2007 void volatile_move(LIR_Opr src, LIR_Opr dst, BasicType type, CodeEmitInfo* info = NULL, LIR_PatchCode patch_code = lir_patch_none) { append(new LIR_Op1(lir_move, src, dst, type, patch_code, info, lir_move_volatile)); } | 2031 void volatile_move(LIR_Opr src, LIR_Opr dst, BasicType type, CodeEmitInfo* info = NULL, LIR_PatchCode patch_code = lir_patch_none) { append(new LIR_Op1(lir_move, src, dst, type, patch_code, info, lir_move_volatile)); } |
2008 | 2032 |
2009 void oop2reg (jobject o, LIR_Opr reg) { append(new LIR_Op1(lir_move, LIR_OprFact::oopConst(o), reg)); } | 2033 void oop2reg (jobject o, LIR_Opr reg) { assert(reg->type() == T_OBJECT, "bad reg"); append(new LIR_Op1(lir_move, LIR_OprFact::oopConst(o), reg)); } |
2010 void oop2reg_patch(jobject o, LIR_Opr reg, CodeEmitInfo* info); | 2034 void oop2reg_patch(jobject o, LIR_Opr reg, CodeEmitInfo* info); |
2011 | 2035 |
2012 void oop2reg (Metadata* o, LIR_Opr reg) { append(new LIR_Op1(lir_move, LIR_OprFact::metadataConst(o), reg)); } | 2036 void metadata2reg (Metadata* o, LIR_Opr reg) { assert(reg->type() == T_METADATA, "bad reg"); append(new LIR_Op1(lir_move, LIR_OprFact::metadataConst(o), reg)); } |
2013 void klass2reg_patch(Metadata* o, LIR_Opr reg, CodeEmitInfo* info); | 2037 void klass2reg_patch(Metadata* o, LIR_Opr reg, CodeEmitInfo* info); |
2014 | 2038 |
2015 void return_op(LIR_Opr result) { append(new LIR_Op1(lir_return, result)); } | 2039 void return_op(LIR_Opr result) { append(new LIR_Op1(lir_return, result)); } |
2016 | 2040 |
2017 void safepoint(LIR_Opr tmp, CodeEmitInfo* info) { append(new LIR_Op1(lir_safepoint, tmp, info)); } | 2041 void safepoint(LIR_Opr tmp, CodeEmitInfo* info) { append(new LIR_Op1(lir_safepoint, tmp, info)); } |