Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/library_call.cpp @ 420:a1980da045cc
6462850: generate biased locking code in C2 ideal graph
Summary: Inline biased locking code in C2 ideal graph during macro nodes expansion
Reviewed-by: never
author | kvn |
---|---|
date | Fri, 07 Nov 2008 09:29:38 -0800 |
parents | 9c2ecc2ffb12 |
children | 98cb887364d3 |
comparison
equal
deleted
inserted
replaced
419:0bf25c4807f9 | 420:a1980da045cc |
---|---|
3483 | 3483 |
3484 Node *adr = basic_plus_adr(obj, obj, value_field_offset); | 3484 Node *adr = basic_plus_adr(obj, obj, value_field_offset); |
3485 const TypePtr *adr_type = _gvn.type(adr)->is_ptr(); | 3485 const TypePtr *adr_type = _gvn.type(adr)->is_ptr(); |
3486 int alias_idx = C->get_alias_index(adr_type); | 3486 int alias_idx = C->get_alias_index(adr_type); |
3487 | 3487 |
3488 Node *result = _gvn.transform(new (C, 5) StoreLConditionalNode(control(), memory(alias_idx), adr, newVal, oldVal)); | 3488 Node *cas = _gvn.transform(new (C, 5) StoreLConditionalNode(control(), memory(alias_idx), adr, newVal, oldVal)); |
3489 Node *store_proj = _gvn.transform( new (C, 1) SCMemProjNode(result)); | 3489 Node *store_proj = _gvn.transform( new (C, 1) SCMemProjNode(cas)); |
3490 set_memory(store_proj, alias_idx); | 3490 set_memory(store_proj, alias_idx); |
3491 | 3491 Node *bol = _gvn.transform( new (C, 2) BoolNode( cas, BoolTest::eq ) ); |
3492 push(result); | 3492 |
3493 Node *result; | |
3494 // CMove node is not used to be able fold a possible check code | |
3495 // after attemptUpdate() call. This code could be transformed | |
3496 // into CMove node by loop optimizations. | |
3497 { | |
3498 RegionNode *r = new (C, 3) RegionNode(3); | |
3499 result = new (C, 3) PhiNode(r, TypeInt::BOOL); | |
3500 | |
3501 Node *iff = create_and_xform_if(control(), bol, PROB_FAIR, COUNT_UNKNOWN); | |
3502 Node *iftrue = opt_iff(r, iff); | |
3503 r->init_req(1, iftrue); | |
3504 result->init_req(1, intcon(1)); | |
3505 result->init_req(2, intcon(0)); | |
3506 | |
3507 set_control(_gvn.transform(r)); | |
3508 record_for_igvn(r); | |
3509 | |
3510 C->set_has_split_ifs(true); // Has chance for split-if optimization | |
3511 } | |
3512 | |
3513 push(_gvn.transform(result)); | |
3493 return true; | 3514 return true; |
3494 } | 3515 } |
3495 | 3516 |
3496 bool LibraryCallKit::inline_fp_conversions(vmIntrinsics::ID id) { | 3517 bool LibraryCallKit::inline_fp_conversions(vmIntrinsics::ID id) { |
3497 // restore the arguments | 3518 // restore the arguments |