3892 // Helper function for inline_native_clone. |
3892 // Helper function for inline_native_clone. |
3893 void LibraryCallKit::copy_to_clone(Node* obj, Node* alloc_obj, Node* obj_size, bool is_array, bool card_mark) { |
3893 void LibraryCallKit::copy_to_clone(Node* obj, Node* alloc_obj, Node* obj_size, bool is_array, bool card_mark) { |
3894 assert(obj_size != NULL, ""); |
3894 assert(obj_size != NULL, ""); |
3895 Node* raw_obj = alloc_obj->in(1); |
3895 Node* raw_obj = alloc_obj->in(1); |
3896 assert(alloc_obj->is_CheckCastPP() && raw_obj->is_Proj() && raw_obj->in(0)->is_Allocate(), ""); |
3896 assert(alloc_obj->is_CheckCastPP() && raw_obj->is_Proj() && raw_obj->in(0)->is_Allocate(), ""); |
|
3897 assert(alloc_obj->as_CheckCastPP()->type() != TypeInstPtr::NOTNULL, "should be more precise than Object"); |
3897 |
3898 |
3898 if (ReduceBulkZeroing) { |
3899 if (ReduceBulkZeroing) { |
3899 // We will be completely responsible for initializing this object - |
3900 // We will be completely responsible for initializing this object - |
3900 // mark Initialize node as complete. |
3901 // mark Initialize node as complete. |
3901 AllocateNode* alloc = AllocateNode::Ideal_allocation(alloc_obj, &_gvn); |
3902 AllocateNode* alloc = AllocateNode::Ideal_allocation(alloc_obj, &_gvn); |
4445 && alloc->maybe_set_complete(&_gvn)) { |
4446 && alloc->maybe_set_complete(&_gvn)) { |
4446 // "You break it, you buy it." |
4447 // "You break it, you buy it." |
4447 InitializeNode* init = alloc->initialization(); |
4448 InitializeNode* init = alloc->initialization(); |
4448 assert(init->is_complete(), "we just did this"); |
4449 assert(init->is_complete(), "we just did this"); |
4449 assert(dest->is_CheckCastPP(), "sanity"); |
4450 assert(dest->is_CheckCastPP(), "sanity"); |
|
4451 assert(dest->as_CheckCastPP()->type() != TypeInstPtr::NOTNULL, "type should be more precise than Object"); |
4450 assert(dest->in(0)->in(0) == init, "dest pinned"); |
4452 assert(dest->in(0)->in(0) == init, "dest pinned"); |
4451 |
4453 |
4452 // Cast to Object for arraycopy. |
4454 // Cast to Object for arraycopy. |
4453 // We can't use the original CheckCastPP since it should be moved |
4455 // We can't use the original CheckCastPP since it should be moved |
4454 // after the arraycopy to prevent stores flowing above it. |
4456 // after the arraycopy to prevent stores flowing above it. |