copy.hpp revision 1879
2362N/A * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// Assembly code for platforms that need it. // Block copy methods have four attributes. We don't define all possibilities. // alignment: aligned to BytesPerLong // arrayof: arraycopy operation with both operands aligned on the same // boundary as the first element of an array of the copy unit. // This is currently a HeapWord boundary on all platforms, except // for long and double arrays, which are aligned on an 8-byte // boundary on all platforms. // arraycopy operations are implicitly atomic on each array element. // overlap: disjoint or conjoint. // copy unit: bytes or words (i.e., HeapWords) or oops (i.e., pointers). // atomicity: atomic or non-atomic on the copy unit. // Names are constructed thusly: // [ 'aligned_' | 'arrayof_' ] // ('conjoint_' | 'disjoint_') // ('words' | 'bytes' | 'jshorts' | 'jints' | 'jlongs' | 'oops') // Except in the arrayof case, whatever the alignment is, we assume we can copy // whole alignment units. E.g., if BytesPerLong is 2x word alignment, an odd // count may copy an extra word. In the arrayof case, we are allowed to copy // only the number of copy units specified. // All callees check count for 0. // Word-aligned words, conjoint, not atomic on each word // Word-aligned words, disjoint, not atomic on each word // Word-aligned words, disjoint, atomic on each word // Object-aligned words, conjoint, not atomic on each word // Object-aligned words, disjoint, not atomic on each word // bytes, jshorts, jints, jlongs, oops // bytes, conjoint, not atomic on each byte (not that it matters) // bytes, conjoint, atomic on each byte (not that it matters) // jshorts, conjoint, atomic on each jshort // jints, conjoint, atomic on each jint // jlongs, conjoint, atomic on each jlong // oops, conjoint, atomic on each oop // overloaded for UseCompressedOops // Copy a span of memory. If the span is an integral number of aligned // longs, words, or ints, copy those units atomically. // The largest atomic transfer unit is 8 bytes, or the largest power // of two which divides all of from, to, and size, whichever is smaller. // bytes, conjoint array, atomic on each byte (not that it matters) // jshorts, conjoint array, atomic on each jshort // jints, conjoint array, atomic on each jint // jlongs, conjoint array, atomic on each jlong // oops, conjoint array, atomic on each oop // Copy word-aligned words from higher to lower addresses, not atomic on each word // byte_count is in bytes to check its alignment // Copy word-aligned words from lower to higher addresses, not atomic on each word // byte_count is in bytes to check its alignment // Fill word-aligned words, not atomic on each word // Fill a span of memory. If the span is an integral number of aligned // longs, words, or ints, store to those units atomically. // The largest atomic transfer unit is 8 bytes, or the largest power // of two which divides both to and size, whichever is smaller. // Zero word-aligned words, not atomic on each word // These methods raise a fatal if they detect a problem. // Platform dependent implementations of the above methods. #
endif // SHARE_VM_UTILITIES_COPY_HPP