/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_C1_C1_FRAMEMAP_HPP
#define SHARE_VM_C1_C1_FRAMEMAP_HPP
#include "asm/assembler.hpp"
#include "c1/c1_Defs.hpp"
#include "c1/c1_LIR.hpp"
#include "memory/allocation.hpp"
#include "runtime/synchronizer.hpp"
#include "utilities/globalDefinitions.hpp"
class ciMethod;
class CallingConvention;
class BasicTypeArray;
class BasicTypeList;
//--------------------------------------------------------
// FrameMap
//--------------------------------------------------------
// This class is responsible of mapping items (locals, monitors, spill
// slots and registers to their frame location
//
// The monitors are specified by a consecutive index, although each monitor entry
// occupies two words. The monitor_index is 0.._num_monitors
// The spill index is similar to local index; it is in range 0..(open)
//
// The CPU registers are mapped using a fixed table; register with number 0
// is the most used one.
// stack grow direction --> SP
// +----------+---+----------+-------+------------------------+-----+
// |arguments | x | monitors | spill | reserved argument area | ABI |
// +----------+---+----------+-------+------------------------+-----+
//
// x = ABI area (SPARC) or return adress and link (i486)
// ABI = ABI area (SPARC) or nothing (i486)
class LIR_OprDesc;
public:
enum {
};
#ifdef TARGET_ARCH_x86
# include "c1_FrameMap_x86.hpp"
#endif
#ifdef TARGET_ARCH_sparc
# include "c1_FrameMap_sparc.hpp"
#endif
#ifdef TARGET_ARCH_arm
# include "c1_FrameMap_arm.hpp"
#endif
#ifdef TARGET_ARCH_ppc
# include "c1_FrameMap_ppc.hpp"
#endif
friend class LIR_OprDesc;
private:
static bool _init_done;
int _framesize;
int _argcount;
int _num_monitors;
int _num_spills;
int _oop_map_arg_count;
return _cpu_rnr2reg[rnr];
}
}
}
}
protected:
#ifndef PRODUCT
static void cpu_range_check (int rnr) { assert(0 <= rnr && rnr < nof_cpu_regs, "cpu register number is too big"); }
static void fpu_range_check (int rnr) { assert(0 <= rnr && rnr < nof_fpu_regs, "fpu register number is too big"); }
#endif
// platform dependent hook used to check that frame is properly
// addressable on the platform. Used by sparc to verify that all
// stack addresses are expressable in a simm13.
bool validate_frame();
public:
// Opr representing the stack_pointer on this platform
static LIR_Opr stack_pointer();
// JSR 292
static LIR_Opr method_handle_invoke_SP_save_opr();
// for outgoing calls, these also update the reserved area to
// include space for arguments and any ABI area.
// deopt support
}
}
bool finalize_frame(int nof_slots);
// convenience routines
}
}
}
}
// Creates Location describing desired slot and returns it via pointer
// to Location object. Returns true if the stack frame offset was legal
// (as defined by Location::legal_offset_in_bytes()), false otherwise.
// Do not use the returned location if this returns false.
}
}
}
}
return _caller_save_cpu_regs[i];
}
return _caller_save_fpu_regs[i];
}
static void initialize();
};
// CallingConvention
//--------------------------------------------------------
private:
public:
// Indicates number of real frame slots used by arguments passed on stack.
#ifndef PRODUCT
void print () const {
for (int i = 0; i < length(); i++) {
}
}
#endif // PRODUCT
};
#endif // SHARE_VM_C1_C1_FRAMEMAP_HPP