Mercurial > hg > truffle
comparison src/share/vm/opto/memnode.cpp @ 1766:02f0a9b6f654
6969586: OptimizeStringConcat: SIGSEGV in LoadNode::Value()
Reviewed-by: kvn
author | never |
---|---|
date | Mon, 30 Aug 2010 17:27:35 -0700 |
parents | 4311f23817fd |
children | 5867d89c129b |
comparison
equal
deleted
inserted
replaced
1765:114e6b93e9e1 | 1766:02f0a9b6f654 |
---|---|
1545 // For oop loads, we expect the _type to be precise | 1545 // For oop loads, we expect the _type to be precise |
1546 if (OptimizeStringConcat && klass == phase->C->env()->String_klass() && | 1546 if (OptimizeStringConcat && klass == phase->C->env()->String_klass() && |
1547 adr->is_AddP() && off != Type::OffsetBot) { | 1547 adr->is_AddP() && off != Type::OffsetBot) { |
1548 // For constant Strings treat the fields as compile time constants. | 1548 // For constant Strings treat the fields as compile time constants. |
1549 Node* base = adr->in(AddPNode::Base); | 1549 Node* base = adr->in(AddPNode::Base); |
1550 if (base->Opcode() == Op_ConP) { | 1550 const TypeOopPtr* t = phase->type(base)->isa_oopptr(); |
1551 const TypeOopPtr* t = phase->type(base)->isa_oopptr(); | 1551 if (t != NULL && t->singleton()) { |
1552 ciObject* string = t->const_oop(); | 1552 ciObject* string = t->const_oop(); |
1553 ciConstant constant = string->as_instance()->field_value_by_offset(off); | 1553 ciConstant constant = string->as_instance()->field_value_by_offset(off); |
1554 if (constant.basic_type() == T_INT) { | 1554 if (constant.basic_type() == T_INT) { |
1555 return TypeInt::make(constant.as_int()); | 1555 return TypeInt::make(constant.as_int()); |
1556 } else if (constant.basic_type() == T_ARRAY) { | 1556 } else if (constant.basic_type() == T_ARRAY) { |