Wed, 14 Dec 2016 17:25:44 +0800
pd_fill_to_words fills 64 bits value each time.
aoqi@1 | 1 | /* |
aoqi@1 | 2 | * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. |
aoqi@1 | 3 | * Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. |
aoqi@1 | 4 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
aoqi@1 | 5 | * |
aoqi@1 | 6 | * This code is free software; you can redistribute it and/or modify it |
aoqi@1 | 7 | * under the terms of the GNU General Public License version 2 only, as |
aoqi@1 | 8 | * published by the Free Software Foundation. |
aoqi@1 | 9 | * |
aoqi@1 | 10 | * This code is distributed in the hope that it will be useful, but WITHOUT |
aoqi@1 | 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
aoqi@1 | 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
aoqi@1 | 13 | * version 2 for more details (a copy is included in the LICENSE file that |
aoqi@1 | 14 | * accompanied this code). |
aoqi@1 | 15 | * |
aoqi@1 | 16 | * You should have received a copy of the GNU General Public License version |
aoqi@1 | 17 | * 2 along with this work; if not, write to the Free Software Foundation, |
aoqi@1 | 18 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
aoqi@1 | 19 | * |
aoqi@1 | 20 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
aoqi@1 | 21 | * or visit www.oracle.com if you need additional information or have any |
aoqi@1 | 22 | * questions. |
aoqi@1 | 23 | * |
aoqi@1 | 24 | */ |
aoqi@1 | 25 | |
aoqi@1 | 26 | #ifndef CPU_MIPS_VM_COPY_MIPS_HPP |
aoqi@1 | 27 | #define CPU_MIPS_VM_COPY_MIPS_HPP |
aoqi@1 | 28 | |
aoqi@1 | 29 | // Inline functions for memory copy and fill. |
aoqi@1 | 30 | // |
aoqi@1 | 31 | // // Contains inline asm implementations |
aoqi@1 | 32 | #ifdef TARGET_OS_ARCH_linux_mips |
aoqi@1 | 33 | # include "copy_linux_mips.inline.hpp" |
aoqi@1 | 34 | #endif |
aoqi@1 | 35 | #ifdef TARGET_OS_ARCH_solaris_mips |
aoqi@1 | 36 | # include "copy_solaris_mips.inline.hpp" |
aoqi@1 | 37 | #endif |
aoqi@1 | 38 | #ifdef TARGET_OS_ARCH_windows_mips |
aoqi@1 | 39 | # include "copy_windows_mips.inline.hpp" |
aoqi@1 | 40 | #endif |
aoqi@1 | 41 | #ifdef TARGET_OS_ARCH_bsd_mips |
aoqi@1 | 42 | # include "copy_bsd_mips.inline.hpp" |
aoqi@1 | 43 | #endif |
aoqi@1 | 44 | // Inline functions for memory copy and fill. |
aoqi@1 | 45 | |
aoqi@1 | 46 | // Contains inline asm implementations |
aoqi@1 | 47 | |
aoqi@1 | 48 | static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) { |
aoqi@198 | 49 | julong* to = (julong*) tohw; |
aoqi@198 | 50 | julong v = ((julong) value << 32) | value; |
aoqi@1 | 51 | while (count-- > 0) { |
aoqi@198 | 52 | *to++ = v; |
aoqi@1 | 53 | } |
aoqi@1 | 54 | } |
aoqi@1 | 55 | |
aoqi@1 | 56 | static void pd_fill_to_aligned_words(HeapWord* tohw, size_t count, juint value) { |
aoqi@1 | 57 | pd_fill_to_words(tohw, count, value); |
aoqi@1 | 58 | } |
aoqi@1 | 59 | |
aoqi@1 | 60 | static void pd_fill_to_bytes(void* to, size_t count, jubyte value) { |
aoqi@1 | 61 | (void)memset(to, value, count); |
aoqi@1 | 62 | } |
aoqi@1 | 63 | |
aoqi@1 | 64 | static void pd_zero_to_words(HeapWord* tohw, size_t count) { |
aoqi@1 | 65 | pd_fill_to_words(tohw, count, 0); |
aoqi@1 | 66 | } |
aoqi@1 | 67 | |
aoqi@1 | 68 | static void pd_zero_to_bytes(void* to, size_t count) { |
aoqi@1 | 69 | (void)memset(to, 0, count); |
aoqi@1 | 70 | } |
aoqi@1 | 71 | |
aoqi@1 | 72 | #endif //CPU_MIPS_VM_COPY_MIPS_HPP |