2940 if (!tklass) tklass = TypeKlassPtr::OBJECT; |
2940 if (!tklass) tklass = TypeKlassPtr::OBJECT; |
2941 const TypeOopPtr* oop_type = tklass->as_instance_type(); |
2941 const TypeOopPtr* oop_type = tklass->as_instance_type(); |
2942 |
2942 |
2943 // Now generate allocation code |
2943 // Now generate allocation code |
2944 |
2944 |
2945 // With escape analysis, the entire memory state is needed to be able to |
2945 // The entire memory state is needed for slow path of the allocation |
2946 // eliminate the allocation. If the allocations cannot be eliminated, this |
2946 // since GC and deoptimization can happened. |
2947 // will be optimized to the raw slice when the allocation is expanded. |
2947 Node *mem = reset_memory(); |
2948 Node *mem; |
2948 set_all_memory(mem); // Create new memory state |
2949 if (C->do_escape_analysis()) { |
|
2950 mem = reset_memory(); |
|
2951 set_all_memory(mem); |
|
2952 } else { |
|
2953 mem = memory(Compile::AliasIdxRaw); |
|
2954 } |
|
2955 |
2949 |
2956 AllocateNode* alloc |
2950 AllocateNode* alloc |
2957 = new (C, AllocateNode::ParmLimit) |
2951 = new (C, AllocateNode::ParmLimit) |
2958 AllocateNode(C, AllocateNode::alloc_type(), |
2952 AllocateNode(C, AllocateNode::alloc_type(), |
2959 control(), mem, i_o(), |
2953 control(), mem, i_o(), |
3086 (*return_size_val) = size; |
3080 (*return_size_val) = size; |
3087 } |
3081 } |
3088 |
3082 |
3089 // Now generate allocation code |
3083 // Now generate allocation code |
3090 |
3084 |
3091 // With escape analysis, the entire memory state is needed to be able to |
3085 // The entire memory state is needed for slow path of the allocation |
3092 // eliminate the allocation. If the allocations cannot be eliminated, this |
3086 // since GC and deoptimization can happened. |
3093 // will be optimized to the raw slice when the allocation is expanded. |
3087 Node *mem = reset_memory(); |
3094 Node *mem; |
3088 set_all_memory(mem); // Create new memory state |
3095 if (C->do_escape_analysis()) { |
|
3096 mem = reset_memory(); |
|
3097 set_all_memory(mem); |
|
3098 } else { |
|
3099 mem = memory(Compile::AliasIdxRaw); |
|
3100 } |
|
3101 |
3089 |
3102 // Create the AllocateArrayNode and its result projections |
3090 // Create the AllocateArrayNode and its result projections |
3103 AllocateArrayNode* alloc |
3091 AllocateArrayNode* alloc |
3104 = new (C, AllocateArrayNode::ParmLimit) |
3092 = new (C, AllocateArrayNode::ParmLimit) |
3105 AllocateArrayNode(C, AllocateArrayNode::alloc_type(), |
3093 AllocateArrayNode(C, AllocateArrayNode::alloc_type(), |