src/share/vm/opto/graphKit.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File valhalla Sdiff src/share/vm/opto

src/share/vm/opto/graphKit.cpp

Print this page




3480 
3481     // Clear the low bits to extract layout_helper_size_in_bytes:
3482     assert((int)Klass::_lh_instance_slow_path_bit < BytesPerLong, "clear bit");
3483     Node* mask = MakeConX(~ (intptr_t)right_n_bits(LogBytesPerLong));
3484     size = _gvn.transform( new AndXNode(size, mask) );
3485   }
3486   if (return_size_val != NULL) {
3487     (*return_size_val) = size;
3488   }
3489 
3490   // This is a precise notnull oop of the klass.
3491   // (Actually, it need not be precise if this is a reflective allocation.)
3492   // It's what we cast the result to.
3493   const TypeKlassPtr* tklass = _gvn.type(klass_node)->isa_klassptr();
3494   if (!tklass)  tklass = TypeKlassPtr::OBJECT;
3495   const TypeOopPtr* oop_type = tklass->as_instance_type();
3496 
3497   // Now generate allocation code
3498 
3499   // The entire memory state is needed for slow path of the allocation
3500   // since GC and deoptimization can happened.
3501   Node *mem = reset_memory();
3502   set_all_memory(mem); // Create new memory state
3503 
3504   AllocateNode* alloc = new AllocateNode(C, AllocateNode::alloc_type(Type::TOP),
3505                                          control(), mem, i_o(),
3506                                          size, klass_node,
3507                                          initial_slow_test);
3508 
3509   return set_output_for_allocation(alloc, oop_type, deoptimize_on_exception);
3510 }
3511 
3512 //-------------------------------new_array-------------------------------------
3513 // helper for both newarray and anewarray
3514 // The 'length' parameter is (obviously) the length of the array.
3515 // See comments on new_instance for the meaning of the other arguments.
3516 Node* GraphKit::new_array(Node* klass_node,     // array klass (maybe variable)
3517                           Node* length,         // number of array elements
3518                           int   nargs,          // number of arguments to push back for uncommon trap
3519                           Node* *return_size_val,
3520                           bool deoptimize_on_exception) {




3480 
3481     // Clear the low bits to extract layout_helper_size_in_bytes:
3482     assert((int)Klass::_lh_instance_slow_path_bit < BytesPerLong, "clear bit");
3483     Node* mask = MakeConX(~ (intptr_t)right_n_bits(LogBytesPerLong));
3484     size = _gvn.transform( new AndXNode(size, mask) );
3485   }
3486   if (return_size_val != NULL) {
3487     (*return_size_val) = size;
3488   }
3489 
3490   // This is a precise notnull oop of the klass.
3491   // (Actually, it need not be precise if this is a reflective allocation.)
3492   // It's what we cast the result to.
3493   const TypeKlassPtr* tklass = _gvn.type(klass_node)->isa_klassptr();
3494   if (!tklass)  tklass = TypeKlassPtr::OBJECT;
3495   const TypeOopPtr* oop_type = tklass->as_instance_type();
3496 
3497   // Now generate allocation code
3498 
3499   // The entire memory state is needed for slow path of the allocation
3500   // since GC and deoptimization can happen.
3501   Node *mem = reset_memory();
3502   set_all_memory(mem); // Create new memory state
3503 
3504   AllocateNode* alloc = new AllocateNode(C, AllocateNode::alloc_type(Type::TOP),
3505                                          control(), mem, i_o(),
3506                                          size, klass_node,
3507                                          initial_slow_test);
3508 
3509   return set_output_for_allocation(alloc, oop_type, deoptimize_on_exception);
3510 }
3511 
3512 //-------------------------------new_array-------------------------------------
3513 // helper for both newarray and anewarray
3514 // The 'length' parameter is (obviously) the length of the array.
3515 // See comments on new_instance for the meaning of the other arguments.
3516 Node* GraphKit::new_array(Node* klass_node,     // array klass (maybe variable)
3517                           Node* length,         // number of array elements
3518                           int   nargs,          // number of arguments to push back for uncommon trap
3519                           Node* *return_size_val,
3520                           bool deoptimize_on_exception) {


src/share/vm/opto/graphKit.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File