Mercurial > hg > graal-compiler
comparison src/share/vm/c1/c1_Canonicalizer.cpp @ 1819:f02a8bbe6ed4
6986046: C1 valuestack cleanup
Summary: fixes an historical oddity in C1 with inlining where all of the expression stacks are kept in the topmost ValueStack instead of being in their respective ValueStacks.
Reviewed-by: never
Contributed-by: Christian Wimmer <cwimmer@uci.edu>
author | roland |
---|---|
date | Tue, 29 Dec 2009 19:08:54 +0100 |
parents | 3a294e483abc |
children | f95d63e2154a |
comparison
equal
deleted
inserted
replaced
1817:c40600e85311 | 1819:f02a8bbe6ed4 |
---|---|
203 case Bytecodes::_i2c: if (type == T_CHAR || type == T_BYTE) value = conv->value(); break; | 203 case Bytecodes::_i2c: if (type == T_CHAR || type == T_BYTE) value = conv->value(); break; |
204 } | 204 } |
205 // limit this optimization to current block | 205 // limit this optimization to current block |
206 if (value != NULL && in_current_block(conv)) { | 206 if (value != NULL && in_current_block(conv)) { |
207 set_canonical(new StoreField(x->obj(), x->offset(), x->field(), value, x->is_static(), | 207 set_canonical(new StoreField(x->obj(), x->offset(), x->field(), value, x->is_static(), |
208 x->lock_stack(), x->state_before(), x->is_loaded(), x->is_initialized())); | 208 x->state_before(), x->is_loaded(), x->is_initialized())); |
209 return; | 209 return; |
210 } | 210 } |
211 } | 211 } |
212 | 212 |
213 } | 213 } |
254 case Bytecodes::_i2c: if (type == T_CHAR || type == T_BYTE) value = conv->value(); break; | 254 case Bytecodes::_i2c: if (type == T_CHAR || type == T_BYTE) value = conv->value(); break; |
255 } | 255 } |
256 // limit this optimization to current block | 256 // limit this optimization to current block |
257 if (value != NULL && in_current_block(conv)) { | 257 if (value != NULL && in_current_block(conv)) { |
258 set_canonical(new StoreIndexed(x->array(), x->index(), x->length(), | 258 set_canonical(new StoreIndexed(x->array(), x->index(), x->length(), |
259 x->elt_type(), value, x->lock_stack())); | 259 x->elt_type(), value, x->state_before())); |
260 return; | 260 return; |
261 } | 261 } |
262 } | 262 } |
263 | 263 |
264 | 264 |
665 set_canonical(x); | 665 set_canonical(x); |
666 return; | 666 return; |
667 } | 667 } |
668 } | 668 } |
669 set_canonical(canon); | 669 set_canonical(canon); |
670 set_bci(cmp->bci()); | 670 set_bci(cmp->state_before()->bci()); |
671 } | 671 } |
672 } | 672 } |
673 } else if (l->as_InstanceOf() != NULL) { | 673 } else if (l->as_InstanceOf() != NULL) { |
674 // NOTE: Code permanently disabled for now since it leaves the old InstanceOf | 674 // NOTE: Code permanently disabled for now since it leaves the old InstanceOf |
675 // instruction in the graph (it is pinned). Need to fix this at some point. | 675 // instruction in the graph (it is pinned). Need to fix this at some point. |
683 if (is_inst_sux == no_inst_sux && inst->is_loaded()) { | 683 if (is_inst_sux == no_inst_sux && inst->is_loaded()) { |
684 // both successors identical and klass is loaded => simplify to: Goto | 684 // both successors identical and klass is loaded => simplify to: Goto |
685 set_canonical(new Goto(is_inst_sux, x->state_before(), x->is_safepoint())); | 685 set_canonical(new Goto(is_inst_sux, x->state_before(), x->is_safepoint())); |
686 } else { | 686 } else { |
687 // successors differ => simplify to: IfInstanceOf | 687 // successors differ => simplify to: IfInstanceOf |
688 set_canonical(new IfInstanceOf(inst->klass(), inst->obj(), true, inst->bci(), is_inst_sux, no_inst_sux)); | 688 set_canonical(new IfInstanceOf(inst->klass(), inst->obj(), true, inst->state_before()->bci(), is_inst_sux, no_inst_sux)); |
689 } | 689 } |
690 } | 690 } |
691 } else if (rt == objectNull && (l->as_NewInstance() || l->as_NewArray())) { | 691 } else if (rt == objectNull && (l->as_NewInstance() || l->as_NewArray())) { |
692 if (x->cond() == Instruction::eql) { | 692 if (x->cond() == Instruction::eql) { |
693 set_canonical(new Goto(x->fsux(), x->state_before(), x->is_safepoint())); | 693 set_canonical(new Goto(x->fsux(), x->state_before(), x->is_safepoint())); |