src/share/vm/c1/c1_GraphBuilder.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/c1/c1_GraphBuilder.cpp Fri Nov 7 15:05:13 2008
--- new/src/share/vm/c1/c1_GraphBuilder.cpp Fri Nov 7 15:05:12 2008
*** 674,698 ****
--- 674,683 ----
_max_inline_size = MaxTrivialSize;
}
}
void GraphBuilder::kill_field(ciField* field) {
if (UseLocalValueNumbering) {
vmap()->kill_field(field);
}
}
void GraphBuilder::kill_array(Value value) {
if (UseLocalValueNumbering) {
vmap()->kill_array(value->type());
}
_memory->store_value(value);
}
void GraphBuilder::kill_all() {
if (UseLocalValueNumbering) {
vmap()->kill_all();
}
_memory->kill();
*** 985,996 ****
--- 970,981 ----
(array->as_AccessField() && array->as_AccessField()->field()->is_constant()) ||
(array->as_NewArray() && array->as_NewArray()->length() && array->as_NewArray()->length()->type()->is_constant())) {
length = append(new ArrayLength(array, lock_stack()));
}
StoreIndexed* result = new StoreIndexed(array, index, length, type, value, lock_stack());
kill_array(value); // invalidate all CSEs that are memory accesses of the same type
append(result);
+ _memory->store_value(value);
}
void GraphBuilder::stack_op(Bytecodes::Code code) {
switch (code) {
*** 1476,1489 ****
--- 1461,1471 ----
break;
}
case Bytecodes::_putstatic:
{ Value val = pop(type);
append(new StoreField(append(obj), offset, field, val, true, lock_stack(), state_copy, is_loaded, is_initialized));
if (UseLocalValueNumbering) {
vmap()->kill_field(field); // invalidate all CSEs that are memory accesses
}
}
break;
case Bytecodes::_getfield :
{
LoadField* load = new LoadField(apop(), offset, field, false, lock_stack(), state_copy, is_loaded, true);
Value replacement = is_loaded ? _memory->load(load) : load;
*** 1501,1511 ****
--- 1483,1492 ----
{ Value val = pop(type);
StoreField* store = new StoreField(apop(), offset, field, val, false, lock_stack(), state_copy, is_loaded, true);
if (is_loaded) store = _memory->store(store);
if (store != NULL) {
append(store);
kill_field(field); // invalidate all CSEs that are accesses of this field
}
}
break;
default :
ShouldNotReachHere();
*** 1898,1907 ****
--- 1879,1890 ----
if (i2 != i1) {
// found an entry in the value map, so just return it.
assert(i2->bci() != -1, "should already be linked");
return i2;
}
+ ValueNumberingEffects vne(vmap());
+ i1->visit(&vne);
}
if (i1->as_Phi() == NULL && i1->as_Local() == NULL) {
// i1 was not eliminated => append it
assert(i1->next() == NULL, "shouldn't already be linked");
*** 1924,1941 ****
--- 1907,1918 ----
}
#endif
assert(_last == i1, "adjust code below");
StateSplit* s = i1->as_StateSplit();
if (s != NULL && i1->as_BlockEnd() == NULL) {
// Continue CSE across certain intrinsics
Intrinsic* intrinsic = s->as_Intrinsic();
if (UseLocalValueNumbering) {
if (intrinsic == NULL || !intrinsic->preserves_state()) {
vmap()->kill_all(); // for now, hopefully we need this only for calls eventually
}
}
if (EliminateFieldAccess) {
+ Intrinsic* intrinsic = s->as_Intrinsic();
if (s->as_Invoke() != NULL || (intrinsic && !intrinsic->preserves_state())) {
_memory->kill();
}
}
s->set_state(state()->copy());
src/share/vm/c1/c1_GraphBuilder.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File