registerMap_sparc.hpp revision 2539
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift/*
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift *
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift * This code is free software; you can redistribute it and/or modify it
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift * under the terms of the GNU General Public License version 2 only, as
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift * published by the Free Software Foundation.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift *
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * This code is distributed in the hope that it will be useful, but WITHOUT
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift * version 2 for more details (a copy is included in the LICENSE file that
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift * accompanied this code).
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift *
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * You should have received a copy of the GNU General Public License version
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * 2 along with this work; if not, write to the Free Software Foundation,
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac *
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift * or visit www.oracle.com if you need additional information or have any
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift * questions.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift *
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift */
65e99be301d5a19db33f25841f671756e8dbb9b5ludovicp
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift#ifndef CPU_SPARC_VM_REGISTERMAP_SPARC_HPP
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift#define CPU_SPARC_VM_REGISTERMAP_SPARC_HPP
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift// machine-dependent implemention for register maps
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift friend class frame;
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift friend class MethodHandles;
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift private:
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift intptr_t* _window; // register window save area (for L and I regs)
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift intptr_t* _younger_window; // previous save area (for O regs, if needed)
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift address pd_location(VMReg reg) const;
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift void pd_clear();
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift void pd_initialize_from(const RegisterMap* map) {
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift _window = map->_window;
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift _younger_window = map->_younger_window;
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift _location_valid[0] = 0; // avoid the shift_individual_registers game
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift }
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift void pd_initialize() {
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift _window = NULL;
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift _younger_window = NULL;
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift _location_valid[0] = 0; // avoid the shift_individual_registers game
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift }
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift void shift_window(intptr_t* sp, intptr_t* younger_sp) {
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift _window = sp;
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift _younger_window = younger_sp;
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift // Throw away locations for %i, %o, and %l registers:
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift // But do not throw away %g register locs.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift if (_location_valid[0] != 0) shift_individual_registers();
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift }
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift void shift_individual_registers();
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift // When popping out of compiled frames, we make all IRegs disappear.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift void make_integer_regs_unsaved() { _location_valid[0] = 0; }
#endif // CPU_SPARC_VM_REGISTERMAP_SPARC_HPP