Mercurial > hg > truffle
comparison src/share/vm/opto/divnode.cpp @ 305:ab075d07f1ba
6736417: Fastdebug C2 crashes in StoreBNode::Ideal
Summary: The result of step_through_mergemem() and remove_dead_region() is not checked in some cases.
Reviewed-by: never
author | kvn |
---|---|
date | Wed, 27 Aug 2008 09:15:46 -0700 |
parents | 616a07a75c3c |
children | cc80376deb0c |
comparison
equal
deleted
inserted
replaced
304:dc7f315e41f7 | 305:ab075d07f1ba |
---|---|
400 | 400 |
401 //------------------------------Idealize--------------------------------------- | 401 //------------------------------Idealize--------------------------------------- |
402 // Divides can be changed to multiplies and/or shifts | 402 // Divides can be changed to multiplies and/or shifts |
403 Node *DivINode::Ideal(PhaseGVN *phase, bool can_reshape) { | 403 Node *DivINode::Ideal(PhaseGVN *phase, bool can_reshape) { |
404 if (in(0) && remove_dead_region(phase, can_reshape)) return this; | 404 if (in(0) && remove_dead_region(phase, can_reshape)) return this; |
405 // Don't bother trying to transform a dead node | |
406 if( in(0) && in(0)->is_top() ) return NULL; | |
405 | 407 |
406 const Type *t = phase->type( in(2) ); | 408 const Type *t = phase->type( in(2) ); |
407 if( t == TypeInt::ONE ) // Identity? | 409 if( t == TypeInt::ONE ) // Identity? |
408 return NULL; // Skip it | 410 return NULL; // Skip it |
409 | 411 |
497 | 499 |
498 //------------------------------Idealize--------------------------------------- | 500 //------------------------------Idealize--------------------------------------- |
499 // Dividing by a power of 2 is a shift. | 501 // Dividing by a power of 2 is a shift. |
500 Node *DivLNode::Ideal( PhaseGVN *phase, bool can_reshape) { | 502 Node *DivLNode::Ideal( PhaseGVN *phase, bool can_reshape) { |
501 if (in(0) && remove_dead_region(phase, can_reshape)) return this; | 503 if (in(0) && remove_dead_region(phase, can_reshape)) return this; |
504 // Don't bother trying to transform a dead node | |
505 if( in(0) && in(0)->is_top() ) return NULL; | |
502 | 506 |
503 const Type *t = phase->type( in(2) ); | 507 const Type *t = phase->type( in(2) ); |
504 if( t == TypeLong::ONE ) // Identity? | 508 if( t == TypeLong::ONE ) // Identity? |
505 return NULL; // Skip it | 509 return NULL; // Skip it |
506 | 510 |
638 | 642 |
639 | 643 |
640 //------------------------------Idealize--------------------------------------- | 644 //------------------------------Idealize--------------------------------------- |
641 Node *DivFNode::Ideal(PhaseGVN *phase, bool can_reshape) { | 645 Node *DivFNode::Ideal(PhaseGVN *phase, bool can_reshape) { |
642 if (in(0) && remove_dead_region(phase, can_reshape)) return this; | 646 if (in(0) && remove_dead_region(phase, can_reshape)) return this; |
647 // Don't bother trying to transform a dead node | |
648 if( in(0) && in(0)->is_top() ) return NULL; | |
643 | 649 |
644 const Type *t2 = phase->type( in(2) ); | 650 const Type *t2 = phase->type( in(2) ); |
645 if( t2 == TypeF::ONE ) // Identity? | 651 if( t2 == TypeF::ONE ) // Identity? |
646 return NULL; // Skip it | 652 return NULL; // Skip it |
647 | 653 |
723 } | 729 } |
724 | 730 |
725 //------------------------------Idealize--------------------------------------- | 731 //------------------------------Idealize--------------------------------------- |
726 Node *DivDNode::Ideal(PhaseGVN *phase, bool can_reshape) { | 732 Node *DivDNode::Ideal(PhaseGVN *phase, bool can_reshape) { |
727 if (in(0) && remove_dead_region(phase, can_reshape)) return this; | 733 if (in(0) && remove_dead_region(phase, can_reshape)) return this; |
734 // Don't bother trying to transform a dead node | |
735 if( in(0) && in(0)->is_top() ) return NULL; | |
728 | 736 |
729 const Type *t2 = phase->type( in(2) ); | 737 const Type *t2 = phase->type( in(2) ); |
730 if( t2 == TypeD::ONE ) // Identity? | 738 if( t2 == TypeD::ONE ) // Identity? |
731 return NULL; // Skip it | 739 return NULL; // Skip it |
732 | 740 |
758 | 766 |
759 //============================================================================= | 767 //============================================================================= |
760 //------------------------------Idealize--------------------------------------- | 768 //------------------------------Idealize--------------------------------------- |
761 Node *ModINode::Ideal(PhaseGVN *phase, bool can_reshape) { | 769 Node *ModINode::Ideal(PhaseGVN *phase, bool can_reshape) { |
762 // Check for dead control input | 770 // Check for dead control input |
763 if( remove_dead_region(phase, can_reshape) ) return this; | 771 if( in(0) && remove_dead_region(phase, can_reshape) ) return this; |
772 // Don't bother trying to transform a dead node | |
773 if( in(0) && in(0)->is_top() ) return NULL; | |
764 | 774 |
765 // Get the modulus | 775 // Get the modulus |
766 const Type *t = phase->type( in(2) ); | 776 const Type *t = phase->type( in(2) ); |
767 if( t == Type::TOP ) return NULL; | 777 if( t == Type::TOP ) return NULL; |
768 const TypeInt *ti = t->is_int(); | 778 const TypeInt *ti = t->is_int(); |
927 | 937 |
928 //============================================================================= | 938 //============================================================================= |
929 //------------------------------Idealize--------------------------------------- | 939 //------------------------------Idealize--------------------------------------- |
930 Node *ModLNode::Ideal(PhaseGVN *phase, bool can_reshape) { | 940 Node *ModLNode::Ideal(PhaseGVN *phase, bool can_reshape) { |
931 // Check for dead control input | 941 // Check for dead control input |
932 if( remove_dead_region(phase, can_reshape) ) return this; | 942 if( in(0) && remove_dead_region(phase, can_reshape) ) return this; |
943 // Don't bother trying to transform a dead node | |
944 if( in(0) && in(0)->is_top() ) return NULL; | |
933 | 945 |
934 // Get the modulus | 946 // Get the modulus |
935 const Type *t = phase->type( in(2) ); | 947 const Type *t = phase->type( in(2) ); |
936 if( t == Type::TOP ) return NULL; | 948 if( t == Type::TOP ) return NULL; |
937 const TypeLong *tl = t->is_long(); | 949 const TypeLong *tl = t->is_long(); |