stubRoutines.hpp revision 1174
1879N/A * Copyright 1997-2010 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1472N/A * CA 95054 USA or visit www.sun.com if you need additional information or 1879N/A// StubRoutines provides entry points to assembly routines used by 1879N/A// compiled code and the run-time system. Platform-specific entry 1879N/A// points are defined in the platform-specific inner class. 1879N/A// platform-independent platform-dependent 0N/A// implements implements 0N/A// stubRoutines_<os_family>.cpp stubGenerator_<arch>.cpp 0N/A// stubRoutines_<os_arch>.cpp 0N/A// Note 1: The important thing is a clean decoupling between stub 0N/A// entry points (interfacing to the whole vm; i.e., 1-to-n 0N/A// relationship) and stub generators (interfacing only to 0N/A// the entry points implementation; i.e., 1-to-1 relationship). 0N/A// This significantly simplifies changes in the generator 0N/A// structure since the rest of the vm is not affected. 0N/A// Note 2: stubGenerator_<arch>.cpp contains a minimal portion of 0N/A// machine-independent code; namely the generator calls of 1089N/A// the generator functions that are used platform-independently. 0N/A// However, it comes with the advantage of having a 1-file 0N/A// implementation of the generator. It should be fairly easy 0N/A// to change, should it become a problem later. 0N/A// Scheme for adding a new entry point: 0N/A// 1. determine if it's a platform-dependent or independent entry point 0N/A// a) if platform independent: make subsequent changes in the independent files 0N/A// b) if platform dependent: make subsequent changes in the dependent files 0N/A// 2. add a private instance variable holding the entry point address 0N/A// 3. add a public accessor function to the instance variable 0N/A// 4. implement the corresponding generator function in the platform-dependent 0N/A// stubGenerator_<arch>.cpp file and call the function in generate_all() of that file 0N/A // Leaf routines which implement arraycopy and their addresses 0N/A // arraycopy operands aligned on element type boundary 1089N/A // arraycopy operands aligned on zero'th element boundary 0N/A // These are identical to the ones aligned aligned on an 0N/A // element type boundary, except that they assume that both 0N/A // source and destination are HeapWord aligned. 0N/A // these are recommended but optional: 0N/A // These are versions of the java.lang.Math methods which perform 0N/A // the same operations as the intrinsic version. They are used for 0N/A // constant folding in the compiler to ensure equivalence. If the 0N/A // intrinsic version returns the same result as the strict version 0N/A // then they can be set to the appropriate function from 2453N/A // a subroutine for debugging the GC 1623N/A // Exceptions during unsafe access - should throw Java exception rather // Default versions of the above arraycopy functions for platforms which do // not have specialized versions