Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/cpu/x86/vm/copy_x86.hpp
32285 views
/*1* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef CPU_X86_VM_COPY_X86_HPP25#define CPU_X86_VM_COPY_X86_HPP2627// Inline functions for memory copy and fill.2829// Contains inline asm implementations30#ifdef TARGET_OS_ARCH_linux_x8631# include "copy_linux_x86.inline.hpp"32#endif33#ifdef TARGET_OS_ARCH_solaris_x8634# include "copy_solaris_x86.inline.hpp"35#endif36#ifdef TARGET_OS_ARCH_windows_x8637# include "copy_windows_x86.inline.hpp"38#endif39#ifdef TARGET_OS_ARCH_bsd_x8640# include "copy_bsd_x86.inline.hpp"41#endif424344static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) {45#ifdef AMD6446julong* to = (julong*) tohw;47julong v = ((julong) value << 32) | value;48while (count-- > 0) {49*to++ = v;50}51#else52juint* to = (juint*)tohw;53count *= HeapWordSize / BytesPerInt;54while (count-- > 0) {55*to++ = value;56}57#endif // AMD6458}5960static void pd_fill_to_aligned_words(HeapWord* tohw, size_t count, juint value) {61pd_fill_to_words(tohw, count, value);62}6364static void pd_fill_to_bytes(void* to, size_t count, jubyte value) {65(void)memset(to, value, count);66}6768static void pd_zero_to_words(HeapWord* tohw, size_t count) {69pd_fill_to_words(tohw, count, 0);70}7172static void pd_zero_to_bytes(void* to, size_t count) {73(void)memset(to, 0, count);74}7576#endif // CPU_X86_VM_COPY_X86_HPP777879