Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/graphKit.cpp @ 825:8f5825e0aeaa
6818666: G1: Type lost in g1 pre-barrier
Reviewed-by: kvn
author | never |
---|---|
date | Fri, 26 Jun 2009 13:03:29 -0700 |
parents | c96bf21b756f |
children | bf3489cc0aa0 |
comparison
equal
deleted
inserted
replaced
824:18a08a7e16b5 | 825:8f5825e0aeaa |
---|---|
1376 void GraphKit::pre_barrier(Node* ctl, | 1376 void GraphKit::pre_barrier(Node* ctl, |
1377 Node* obj, | 1377 Node* obj, |
1378 Node* adr, | 1378 Node* adr, |
1379 uint adr_idx, | 1379 uint adr_idx, |
1380 Node *val, | 1380 Node *val, |
1381 const Type* val_type, | 1381 const TypeOopPtr* val_type, |
1382 BasicType bt) { | 1382 BasicType bt) { |
1383 BarrierSet* bs = Universe::heap()->barrier_set(); | 1383 BarrierSet* bs = Universe::heap()->barrier_set(); |
1384 set_control(ctl); | 1384 set_control(ctl); |
1385 switch (bs->kind()) { | 1385 switch (bs->kind()) { |
1386 case BarrierSet::G1SATBCT: | 1386 case BarrierSet::G1SATBCT: |
1434 Node* GraphKit::store_oop_to_object(Node* ctl, | 1434 Node* GraphKit::store_oop_to_object(Node* ctl, |
1435 Node* obj, | 1435 Node* obj, |
1436 Node* adr, | 1436 Node* adr, |
1437 const TypePtr* adr_type, | 1437 const TypePtr* adr_type, |
1438 Node *val, | 1438 Node *val, |
1439 const Type* val_type, | 1439 const TypeOopPtr* val_type, |
1440 BasicType bt) { | 1440 BasicType bt) { |
1441 uint adr_idx = C->get_alias_index(adr_type); | 1441 uint adr_idx = C->get_alias_index(adr_type); |
1442 Node* store; | 1442 Node* store; |
1443 pre_barrier(ctl, obj, adr, adr_idx, val, val_type, bt); | 1443 pre_barrier(ctl, obj, adr, adr_idx, val, val_type, bt); |
1444 store = store_to_memory(control(), adr, val, bt, adr_idx); | 1444 store = store_to_memory(control(), adr, val, bt, adr_idx); |
1449 Node* GraphKit::store_oop_to_array(Node* ctl, | 1449 Node* GraphKit::store_oop_to_array(Node* ctl, |
1450 Node* obj, | 1450 Node* obj, |
1451 Node* adr, | 1451 Node* adr, |
1452 const TypePtr* adr_type, | 1452 const TypePtr* adr_type, |
1453 Node *val, | 1453 Node *val, |
1454 const Type* val_type, | 1454 const TypeOopPtr* val_type, |
1455 BasicType bt) { | 1455 BasicType bt) { |
1456 uint adr_idx = C->get_alias_index(adr_type); | 1456 uint adr_idx = C->get_alias_index(adr_type); |
1457 Node* store; | 1457 Node* store; |
1458 pre_barrier(ctl, obj, adr, adr_idx, val, val_type, bt); | 1458 pre_barrier(ctl, obj, adr, adr_idx, val, val_type, bt); |
1459 store = store_to_memory(control(), adr, val, bt, adr_idx); | 1459 store = store_to_memory(control(), adr, val, bt, adr_idx); |
1464 Node* GraphKit::store_oop_to_unknown(Node* ctl, | 1464 Node* GraphKit::store_oop_to_unknown(Node* ctl, |
1465 Node* obj, | 1465 Node* obj, |
1466 Node* adr, | 1466 Node* adr, |
1467 const TypePtr* adr_type, | 1467 const TypePtr* adr_type, |
1468 Node *val, | 1468 Node *val, |
1469 const Type* val_type, | |
1470 BasicType bt) { | 1469 BasicType bt) { |
1471 uint adr_idx = C->get_alias_index(adr_type); | 1470 Compile::AliasType* at = C->alias_type(adr_type); |
1472 Node* store; | 1471 const TypeOopPtr* val_type = NULL; |
1472 if (adr_type->isa_instptr()) { | |
1473 if (at->field() != NULL) { | |
1474 // known field. This code is a copy of the do_put_xxx logic. | |
1475 ciField* field = at->field(); | |
1476 if (!field->type()->is_loaded()) { | |
1477 val_type = TypeInstPtr::BOTTOM; | |
1478 } else { | |
1479 val_type = TypeOopPtr::make_from_klass(field->type()->as_klass()); | |
1480 } | |
1481 } | |
1482 } else if (adr_type->isa_aryptr()) { | |
1483 val_type = adr_type->is_aryptr()->elem()->isa_oopptr(); | |
1484 } | |
1485 if (val_type == NULL) { | |
1486 val_type = TypeInstPtr::BOTTOM; | |
1487 } | |
1488 | |
1489 uint adr_idx = at->index(); | |
1473 pre_barrier(ctl, obj, adr, adr_idx, val, val_type, bt); | 1490 pre_barrier(ctl, obj, adr, adr_idx, val, val_type, bt); |
1474 store = store_to_memory(control(), adr, val, bt, adr_idx); | 1491 Node* store = store_to_memory(control(), adr, val, bt, adr_idx); |
1475 post_barrier(control(), store, obj, adr, adr_idx, val, bt, true); | 1492 post_barrier(control(), store, obj, adr, adr_idx, val, bt, true); |
1476 return store; | 1493 return store; |
1477 } | 1494 } |
1478 | 1495 |
1479 | 1496 |
3200 | 3217 |
3201 void GraphKit::g1_write_barrier_pre(Node* obj, | 3218 void GraphKit::g1_write_barrier_pre(Node* obj, |
3202 Node* adr, | 3219 Node* adr, |
3203 uint alias_idx, | 3220 uint alias_idx, |
3204 Node* val, | 3221 Node* val, |
3205 const Type* val_type, | 3222 const TypeOopPtr* val_type, |
3206 BasicType bt) { | 3223 BasicType bt) { |
3207 IdealKit ideal(gvn(), control(), merged_memory(), true); | 3224 IdealKit ideal(gvn(), control(), merged_memory(), true); |
3208 #define __ ideal. | 3225 #define __ ideal. |
3209 __ declares_done(); | 3226 __ declares_done(); |
3210 | 3227 |