Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/cpu/x86/vm/icache_x86.hpp
32285 views
/*1* Copyright (c) 1997, 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_ICACHE_X86_HPP25#define CPU_X86_VM_ICACHE_X86_HPP2627// Interface for updating the instruction cache. Whenever the VM modifies28// code, part of the processor instruction cache potentially has to be flushed.2930// On the x86, this is a no-op -- the I-cache is guaranteed to be consistent31// after the next jump, and the VM never modifies instructions directly ahead32// of the instruction fetch path.3334// [phh] It's not clear that the above comment is correct, because on an MP35// system where the dcaches are not snooped, only the thread doing the invalidate36// will see the update. Even in the snooped case, a memory fence would be37// necessary if stores weren't ordered. Fortunately, they are on all known38// x86 implementations.3940class ICache : public AbstractICache {41public:42#ifdef AMD6443enum {44stub_size = 64, // Size of the icache flush stub in bytes45line_size = 64, // Icache line size in bytes46log2_line_size = 6 // log2(line_size)47};4849// Use default implementation50#else51enum {52stub_size = 16, // Size of the icache flush stub in bytes53line_size = BytesPerWord, // conservative54log2_line_size = LogBytesPerWord // log2(line_size)55};56#endif // AMD6457};5859#endif // CPU_X86_VM_ICACHE_X86_HPP606162