comparison src/share/vm/opto/library_call.cpp @ 29:d5fc211aea19

6633953: type2aelembytes{T_ADDRESS} should be 8 bytes in 64 bit VM Summary: T_ADDRESS size is defined as 'int' size (4 bytes) but C2 use it for raw pointers and as memory type for StoreP and LoadP nodes. Reviewed-by: jrose
author kvn
date Mon, 25 Feb 2008 15:05:44 -0800
parents a61af66fc99e
children 545c277a3ecf
comparison
equal deleted inserted replaced
28:67914967a4b5 29:d5fc211aea19
2095 2095
2096 // number of stack slots per value argument (1 or 2) 2096 // number of stack slots per value argument (1 or 2)
2097 int type_words = type2size[type]; 2097 int type_words = type2size[type];
2098 2098
2099 // Cannot inline wide CAS on machines that don't support it natively 2099 // Cannot inline wide CAS on machines that don't support it natively
2100 if (type2aelembytes[type] > BytesPerInt && !VM_Version::supports_cx8()) 2100 if (type2aelembytes(type) > BytesPerInt && !VM_Version::supports_cx8())
2101 return false; 2101 return false;
2102 2102
2103 C->set_has_unsafe_access(true); // Mark eventual nmethod as "unsafe". 2103 C->set_has_unsafe_access(true); // Mark eventual nmethod as "unsafe".
2104 2104
2105 // Argument words: "this" plus oop plus offset plus oldvalue plus newvalue; 2105 // Argument words: "this" plus oop plus offset plus oldvalue plus newvalue;
3973 if (src_offset_inttype != NULL && src_offset_inttype->is_con() && 3973 if (src_offset_inttype != NULL && src_offset_inttype->is_con() &&
3974 dest_offset_inttype != NULL && dest_offset_inttype->is_con()) { 3974 dest_offset_inttype != NULL && dest_offset_inttype->is_con()) {
3975 // both indices are constants 3975 // both indices are constants
3976 int s_offs = src_offset_inttype->get_con(); 3976 int s_offs = src_offset_inttype->get_con();
3977 int d_offs = dest_offset_inttype->get_con(); 3977 int d_offs = dest_offset_inttype->get_con();
3978 int element_size = type2aelembytes[t]; 3978 int element_size = type2aelembytes(t);
3979 aligned = ((arrayOopDesc::base_offset_in_bytes(t) + s_offs * element_size) % HeapWordSize == 0) && 3979 aligned = ((arrayOopDesc::base_offset_in_bytes(t) + s_offs * element_size) % HeapWordSize == 0) &&
3980 ((arrayOopDesc::base_offset_in_bytes(t) + d_offs * element_size) % HeapWordSize == 0); 3980 ((arrayOopDesc::base_offset_in_bytes(t) + d_offs * element_size) % HeapWordSize == 0);
3981 if (s_offs >= d_offs) disjoint = true; 3981 if (s_offs >= d_offs) disjoint = true;
3982 } else if (src_offset == dest_offset && src_offset != NULL) { 3982 } else if (src_offset == dest_offset && src_offset != NULL) {
3983 // This can occur if the offsets are identical non-constants. 3983 // This can occur if the offsets are identical non-constants.
4387 4387
4388 // Let's see if we need card marks: 4388 // Let's see if we need card marks:
4389 if (alloc != NULL && use_ReduceInitialCardMarks()) { 4389 if (alloc != NULL && use_ReduceInitialCardMarks()) {
4390 // If we do not need card marks, copy using the jint or jlong stub. 4390 // If we do not need card marks, copy using the jint or jlong stub.
4391 copy_type = LP64_ONLY(T_LONG) NOT_LP64(T_INT); 4391 copy_type = LP64_ONLY(T_LONG) NOT_LP64(T_INT);
4392 assert(type2aelembytes[basic_elem_type] == type2aelembytes[copy_type], 4392 assert(type2aelembytes(basic_elem_type) == type2aelembytes(copy_type),
4393 "sizes agree"); 4393 "sizes agree");
4394 } 4394 }
4395 } 4395 }
4396 4396
4397 if (!stopped()) { 4397 if (!stopped()) {
4657 4657
4658 // operate on this memory slice: 4658 // operate on this memory slice:
4659 Node* mem = memory(adr_type); // memory slice to operate on 4659 Node* mem = memory(adr_type); // memory slice to operate on
4660 4660
4661 // scaling and rounding of indexes: 4661 // scaling and rounding of indexes:
4662 int scale = exact_log2(type2aelembytes[basic_elem_type]); 4662 int scale = exact_log2(type2aelembytes(basic_elem_type));
4663 int abase = arrayOopDesc::base_offset_in_bytes(basic_elem_type); 4663 int abase = arrayOopDesc::base_offset_in_bytes(basic_elem_type);
4664 int clear_low = (-1 << scale) & (BytesPerInt - 1); 4664 int clear_low = (-1 << scale) & (BytesPerInt - 1);
4665 int bump_bit = (-1 << scale) & BytesPerInt; 4665 int bump_bit = (-1 << scale) & BytesPerInt;
4666 4666
4667 // determine constant starts and ends 4667 // determine constant starts and ends
4751 AllocateNode* alloc, 4751 AllocateNode* alloc,
4752 Node* src, Node* src_offset, 4752 Node* src, Node* src_offset,
4753 Node* dest, Node* dest_offset, 4753 Node* dest, Node* dest_offset,
4754 Node* dest_size) { 4754 Node* dest_size) {
4755 // See if there is an advantage from block transfer. 4755 // See if there is an advantage from block transfer.
4756 int scale = exact_log2(type2aelembytes[basic_elem_type]); 4756 int scale = exact_log2(type2aelembytes(basic_elem_type));
4757 if (scale >= LogBytesPerLong) 4757 if (scale >= LogBytesPerLong)
4758 return false; // it is already a block transfer 4758 return false; // it is already a block transfer
4759 4759
4760 // Look at the alignment of the starting offsets. 4760 // Look at the alignment of the starting offsets.
4761 int abase = arrayOopDesc::base_offset_in_bytes(basic_elem_type); 4761 int abase = arrayOopDesc::base_offset_in_bytes(basic_elem_type);