2273N/A * Copyright (c) 1997, 2011, 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. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// Interface for updating the instruction cache. Whenever the VM modifies 0N/A// code, part of the processor instruction cache potentially has to be flushed. 0N/A// Default implementation is in icache.cpp, and can be hidden per-platform. 0N/A// Most platforms must provide only ICacheStubGenerator::generate_icache_flush(). 0N/A// Platforms that don't require icache flushing can just nullify the public 0N/A// members of AbstractICache in their ICache class. AbstractICache should never 0N/A// be referenced other than by deriving the ICache class from it. 0N/A// The code for the ICache class and for generate_icache_flush() must be in 0N/A// architecture-specific files, i.e., icache_<arch>.hpp/.cpp 0N/A // The flush stub signature 0N/A // The flush stub function address 0N/A // Call the flush stub 0N/A// Must be included before the definition of ICacheStubGenerator 0N/A// because ICacheStubGenerator uses ICache definitions. 0N/A // Generate the icache flush stub. 0N/A // Since we cannot flush the cache when this stub is generated, 0N/A // it must be generated first, and just to be sure, we do extra 0N/A // work to allow a check that these instructions got executed. 0N/A // The flush stub has three parameters (see flush_icache_stub_t). 0N/A // addr - Start address, must be aligned at log2_line_size 0N/A // lines - Number of line_size icache lines to flush 0N/A // magic - Magic number copied to result register to make sure 0N/A // the stub executed properly 0N/A // A template for generate_icache_flush is 0N/A // #define __ _masm-> 0N/A // void ICacheStubGenerator::generate_icache_flush( 0N/A // ICache::flush_icache_stub_t* flush_icache_stub 0N/A // StubCodeMark mark(this, "ICache", "flush_icache_stub"); 0N/A // address start = __ pc(); 0N/A // // emit flush stub asm code 0N/A // // Must be set here so StubCodeMark destructor can call the flush stub. 0N/A // *flush_icache_stub = (ICache::flush_icache_stub_t)start; 0N/A // The first use of flush_icache_stub must apply it to itself. The 0N/A // StubCodeMark destructor in generate_icache_flush will call Assembler::flush, 0N/A // in turn will call the flush stub *before* generate_icache_flush returns. 0N/A // The usual method of having generate_icache_flush return the address of the 0N/A // stub to its caller, which would then, e.g., store that address in 0N/A // flush_icache_stub, won't work. generate_icache_flush must itself set 0N/A // flush_icache_stub to the address of the stub it generates before 0N/A // the StubCodeMark destructor is invoked. 1879N/A#
endif // SHARE_VM_RUNTIME_ICACHE_HPP